open-grid 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (294) hide show
  1. package/CHANGELOG.md +376 -353
  2. package/README.md +1 -1
  3. package/dist/OpenGrid-B7m7ei7f.cjs +7385 -0
  4. package/dist/OpenGrid-CeUdO_fM.js +7398 -0
  5. package/dist/index-CeJ-0-80.cjs +260 -0
  6. package/dist/index-DnarQ4eR.js +266 -0
  7. package/dist/index-DrCPRuYi.js +548 -0
  8. package/dist/index-JjfWY3Bt.cjs +520 -0
  9. package/dist/open-grid-base.css +12 -1
  10. package/dist/open-grid-react.cjs +27 -1
  11. package/dist/open-grid-react.js +22 -82
  12. package/dist/open-grid-vue.cjs +31 -1
  13. package/dist/open-grid-vue.js +29 -79
  14. package/dist/open-grid.cjs +272 -6
  15. package/dist/open-grid.js +177 -266
  16. package/dist/types/bench/perf.d.ts +14 -8
  17. package/dist/types/core/AppearanceResolver.d.ts +98 -11
  18. package/dist/types/core/CFRenderBridge.d.ts +13 -0
  19. package/dist/types/core/CellEditManager.d.ts +73 -0
  20. package/dist/types/core/CellEventHandler.d.ts +99 -2
  21. package/dist/types/core/CellTypeRegistry.d.ts +24 -0
  22. package/dist/types/core/ChartManager.d.ts +51 -3
  23. package/dist/types/core/ColumnLayout.d.ts +100 -2
  24. package/dist/types/core/ContextMenu.d.ts +43 -2
  25. package/dist/types/core/CrossGridController.d.ts +86 -15
  26. package/dist/types/core/CrossGridMapper.d.ts +43 -5
  27. package/dist/types/core/CrossGridRegistry.d.ts +36 -2
  28. package/dist/types/core/DataLayer.d.ts +210 -15
  29. package/dist/types/core/DetailManager.d.ts +106 -15
  30. package/dist/types/core/DragVisuals.d.ts +33 -4
  31. package/dist/types/core/EventEmitter.d.ts +54 -0
  32. package/dist/types/core/ExportManager.d.ts +66 -1
  33. package/dist/types/core/ExtensionPointRegistry.d.ts +160 -14
  34. package/dist/types/core/FilterPanel.d.ts +17 -2
  35. package/dist/types/core/FilterSelect.d.ts +37 -13
  36. package/dist/types/core/FindBarManager.d.ts +26 -0
  37. package/dist/types/core/FlatRowModel.d.ts +54 -11
  38. package/dist/types/core/FooterManager.d.ts +53 -1
  39. package/dist/types/core/FormulaController.d.ts +139 -10
  40. package/dist/types/core/FormulaEngine.d.ts +15 -4
  41. package/dist/types/core/GridComposer.d.ts +54 -6
  42. package/dist/types/core/GridRenderer.d.ts +143 -10
  43. package/dist/types/core/GridShuttle.d.ts +44 -4
  44. package/dist/types/core/GroupEngine.d.ts +68 -10
  45. package/dist/types/core/GroupTreeManager.d.ts +86 -2
  46. package/dist/types/core/IconRegistry.d.ts +56 -9
  47. package/dist/types/core/KeyboardManager.d.ts +88 -4
  48. package/dist/types/core/MaskingEngine.d.ts +10 -9
  49. package/dist/types/core/MathUtils.d.ts +58 -5
  50. package/dist/types/core/MergeEngine.d.ts +45 -10
  51. package/dist/types/core/MutationService.d.ts +113 -10
  52. package/dist/types/core/OGDecimal.d.ts +144 -13
  53. package/dist/types/core/OpenGrid.d.ts +99 -0
  54. package/dist/types/core/OrgChart.d.ts +56 -1
  55. package/dist/types/core/OverrideKernel.d.ts +59 -15
  56. package/dist/types/core/Pagination.d.ts +38 -4
  57. package/dist/types/core/PivotEngine.d.ts +37 -0
  58. package/dist/types/core/RangeSelectionManager.d.ts +121 -7
  59. package/dist/types/core/RenderController.d.ts +56 -0
  60. package/dist/types/core/RowDragDrop.d.ts +52 -6
  61. package/dist/types/core/RowManager.d.ts +55 -0
  62. package/dist/types/core/SkinRegistry.d.ts +55 -15
  63. package/dist/types/core/SortFilterManager.d.ts +80 -1
  64. package/dist/types/core/TreeEngine.d.ts +60 -6
  65. package/dist/types/core/TriggerManager.d.ts +46 -0
  66. package/dist/types/core/VirtualScroll.d.ts +64 -0
  67. package/dist/types/core/WorksheetManager.d.ts +61 -2
  68. package/dist/types/core/XmlConverter.d.ts +56 -23
  69. package/dist/types/core/a11y/AccessibilityAdapter.d.ts +103 -0
  70. package/dist/types/core/a11y/AriaIntent.d.ts +34 -0
  71. package/dist/types/core/a11y/KeyboardInteractionModel.d.ts +64 -0
  72. package/dist/types/core/a11y/LiveRegionController.d.ts +89 -0
  73. package/dist/types/core/a11y/OverlayStack.d.ts +36 -0
  74. package/dist/types/core/a11y/VisualEquivRegistry.d.ts +37 -0
  75. package/dist/types/core/a11y/index.d.ts +13 -0
  76. package/dist/types/core/a11y/ports.d.ts +24 -0
  77. package/dist/types/core/appearance/Appearance.d.ts +68 -0
  78. package/dist/types/core/appearance/AppearanceAxis.d.ts +94 -0
  79. package/dist/types/core/appearance/AppearanceComposer.d.ts +45 -0
  80. package/dist/types/core/appearance/AppearanceProvider.d.ts +50 -0
  81. package/dist/types/core/appearance/AppearanceView.d.ts +51 -0
  82. package/dist/types/core/appearance/DensityRegistry.d.ts +36 -0
  83. package/dist/types/core/appearance/ResolvedAppearanceSnapshot.d.ts +84 -0
  84. package/dist/types/core/appearance/TextureRegistry.d.ts +32 -0
  85. package/dist/types/core/appearance/ThemeMetaRegistry.d.ts +67 -0
  86. package/dist/types/core/appearance/axisAdapters.d.ts +37 -0
  87. package/dist/types/core/appearance/defaults.d.ts +10 -0
  88. package/dist/types/core/appearance/index.d.ts +20 -0
  89. package/dist/types/core/appearance/tokenCatalog.d.ts +30 -0
  90. package/dist/types/core/cf/CFEngine.d.ts +56 -0
  91. package/dist/types/core/cf/CFEvaluator.d.ts +24 -0
  92. package/dist/types/core/cf/CFRule.d.ts +127 -0
  93. package/dist/types/core/cf/ColorScale.d.ts +49 -0
  94. package/dist/types/core/cf/InkResolver.d.ts +33 -0
  95. package/dist/types/core/cf/appearance.d.ts +20 -0
  96. package/dist/types/core/cf/encoders.d.ts +61 -0
  97. package/dist/types/core/cf/eval-types.d.ts +93 -0
  98. package/dist/types/core/cf/index.d.ts +21 -0
  99. package/dist/types/core/cf/lineage.d.ts +32 -0
  100. package/dist/types/core/cf/predicates.d.ts +27 -0
  101. package/dist/types/core/cf/serialize.d.ts +46 -0
  102. package/dist/types/core/chart/CanvasAdapter.d.ts +50 -1
  103. package/dist/types/core/chart/DataExtractor.d.ts +53 -12
  104. package/dist/types/core/chart/a11y.d.ts +22 -0
  105. package/dist/types/core/chart/chart-type-registry.d.ts +53 -0
  106. package/dist/types/core/chart/downsample-report.d.ts +36 -0
  107. package/dist/types/core/chart/downsample.d.ts +26 -1
  108. package/dist/types/core/chart/engine/ChartEngineRegistry.d.ts +52 -0
  109. package/dist/types/core/chart/geometry.d.ts +96 -0
  110. package/dist/types/core/chart/hittest.d.ts +21 -3
  111. package/dist/types/core/chart/palette.d.ts +96 -12
  112. package/dist/types/core/chart/parity.d.ts +12 -0
  113. package/dist/types/core/chart/provenance.d.ts +47 -0
  114. package/dist/types/core/chart/scales.d.ts +28 -1
  115. package/dist/types/core/chart/scene.d.ts +102 -0
  116. package/dist/types/core/chart/server.d.ts +36 -0
  117. package/dist/types/core/chart/surfaces/CanvasSurface.d.ts +48 -0
  118. package/dist/types/core/chart/surfaces/ServerRasterSurface.d.ts +26 -0
  119. package/dist/types/core/chart/surfaces/SvgSurface.d.ts +24 -0
  120. package/dist/types/core/chart/surfaces/pattern-overlay.d.ts +24 -0
  121. package/dist/types/core/chart/types.d.ts +107 -10
  122. package/dist/types/core/command/CommandBus.d.ts +51 -0
  123. package/dist/types/core/command/CommandRegistry.d.ts +43 -0
  124. package/dist/types/core/command/CommandStack.d.ts +38 -0
  125. package/dist/types/core/command/ICommand.d.ts +110 -0
  126. package/dist/types/core/command/commands/CellWriteCommand.d.ts +32 -0
  127. package/dist/types/core/command/commands/CompositeCommand.d.ts +17 -0
  128. package/dist/types/core/command/commands/RowCommands.d.ts +39 -0
  129. package/dist/types/core/command/index.d.ts +9 -0
  130. package/dist/types/core/command/support.d.ts +51 -0
  131. package/dist/types/core/coordinate/ColumnMetrics.d.ts +30 -0
  132. package/dist/types/core/coordinate/CoordinateKernel.d.ts +88 -0
  133. package/dist/types/core/coordinate/FrozenPanes.d.ts +29 -0
  134. package/dist/types/core/coordinate/MergeSourceAdapter.d.ts +18 -0
  135. package/dist/types/core/coordinate/NodeBudget.d.ts +33 -0
  136. package/dist/types/core/coordinate/ResizeGovernor.d.ts +50 -0
  137. package/dist/types/core/coordinate/RowMetrics.d.ts +37 -0
  138. package/dist/types/core/coordinate/ViewPermutation.d.ts +23 -0
  139. package/dist/types/core/coordinate/index.d.ts +10 -0
  140. package/dist/types/core/coordinate/ports.d.ts +45 -0
  141. package/dist/types/core/coordinate/types.d.ts +76 -0
  142. package/dist/types/core/detail/DetailGlyph.d.ts +42 -7
  143. package/dist/types/core/detail/DetailSplice.d.ts +42 -11
  144. package/dist/types/core/detail/DetailState.d.ts +80 -11
  145. package/dist/types/core/detail/SubgridCache.d.ts +72 -10
  146. package/dist/types/core/detail/index.d.ts +8 -0
  147. package/dist/types/core/domain/AggregateResult.d.ts +54 -0
  148. package/dist/types/core/domain/CellAddress.d.ts +61 -0
  149. package/dist/types/core/domain/CellValueAccess.d.ts +29 -0
  150. package/dist/types/core/domain/Delta.d.ts +37 -0
  151. package/dist/types/core/domain/DomainValue.d.ts +80 -0
  152. package/dist/types/core/domain/Missing.d.ts +65 -0
  153. package/dist/types/core/domain/Money.d.ts +42 -0
  154. package/dist/types/core/domain/NormalizationBasis.d.ts +47 -0
  155. package/dist/types/core/domain/Plain.d.ts +45 -0
  156. package/dist/types/core/domain/Quantity.d.ts +32 -0
  157. package/dist/types/core/domain/Ratios.d.ts +100 -0
  158. package/dist/types/core/domain/ThresholdSet.d.ts +46 -0
  159. package/dist/types/core/domain/ValueType.d.ts +71 -0
  160. package/dist/types/core/domain/rounding.d.ts +25 -0
  161. package/dist/types/core/domain/strategies.d.ts +38 -0
  162. package/dist/types/core/editors/CellEditor.d.ts +29 -2
  163. package/dist/types/core/editors/DateEditor.d.ts +18 -0
  164. package/dist/types/core/editors/SelectEditor.d.ts +29 -0
  165. package/dist/types/core/export/ChannelRegistry.d.ts +18 -0
  166. package/dist/types/core/export/ExportManifest.d.ts +13 -0
  167. package/dist/types/core/export/GridArtifactSource.d.ts +62 -0
  168. package/dist/types/core/export/Provenance.d.ts +34 -0
  169. package/dist/types/core/export/StreamPump.d.ts +28 -0
  170. package/dist/types/core/export/channels/CsvChannel.d.ts +20 -0
  171. package/dist/types/core/export/channels/JsonChannel.d.ts +18 -0
  172. package/dist/types/core/export/channels/XlsxChannel.d.ts +53 -0
  173. package/dist/types/core/export/channels/XmlChannel.d.ts +21 -0
  174. package/dist/types/core/export/channels/capabilities.d.ts +13 -0
  175. package/dist/types/core/export/index.d.ts +24 -0
  176. package/dist/types/core/export/print/OutputChannelAdapter.d.ts +61 -0
  177. package/dist/types/core/export/print/Paginator.d.ts +48 -0
  178. package/dist/types/core/export/print/PrintRenderTarget.d.ts +36 -0
  179. package/dist/types/core/export/sinks.d.ts +40 -0
  180. package/dist/types/core/export/types.d.ts +211 -0
  181. package/dist/types/core/extension/DeprecationManager.d.ts +42 -0
  182. package/dist/types/core/extension/IExtension.d.ts +90 -0
  183. package/dist/types/core/extension/Registry.d.ts +142 -0
  184. package/dist/types/core/extension/SlotRegistry.d.ts +46 -0
  185. package/dist/types/core/extension/adapters.d.ts +44 -0
  186. package/dist/types/core/extension/conformance.d.ts +47 -0
  187. package/dist/types/core/extension/index.d.ts +16 -0
  188. package/dist/types/core/extension/registries.d.ts +31 -0
  189. package/dist/types/core/extension/reserved.d.ts +10 -0
  190. package/dist/types/core/format/DisplayFormatter.d.ts +47 -0
  191. package/dist/types/core/format/FormatCache.d.ts +20 -0
  192. package/dist/types/core/format/FormatterRegistry.d.ts +22 -0
  193. package/dist/types/core/format/grammar/AstRenderer.d.ts +10 -0
  194. package/dist/types/core/format/grammar/FormatCompiler.d.ts +16 -0
  195. package/dist/types/core/format/index.d.ts +55 -0
  196. package/dist/types/core/format/pipeline/DomainTypeResolver.d.ts +8 -0
  197. package/dist/types/core/format/pipeline/LocaleFormat.d.ts +11 -0
  198. package/dist/types/core/format/pipeline/ValueInterpreter.d.ts +8 -0
  199. package/dist/types/core/format/policy/MaskPolicy.d.ts +8 -0
  200. package/dist/types/core/format/policy/NegativePolicy.d.ts +12 -0
  201. package/dist/types/core/format/policy/NullPolicy.d.ts +10 -0
  202. package/dist/types/core/format/policy/TruncatePolicy.d.ts +11 -0
  203. package/dist/types/core/format/types.d.ts +292 -0
  204. package/dist/types/core/formula/CalcCacheStore.d.ts +89 -0
  205. package/dist/types/core/formula/CalcProvenance.d.ts +44 -0
  206. package/dist/types/core/formula/CalcService.d.ts +137 -0
  207. package/dist/types/core/formula/CyclePathReporter.d.ts +28 -0
  208. package/dist/types/core/formula/FormulaEvaluator.d.ts +35 -1
  209. package/dist/types/core/formula/FormulaGraph.d.ts +84 -7
  210. package/dist/types/core/formula/FormulaParser.d.ts +9 -0
  211. package/dist/types/core/formula/FormulaStore.d.ts +63 -1
  212. package/dist/types/core/formula/FunctionRegistry.d.ts +138 -0
  213. package/dist/types/core/formula/Generation.d.ts +86 -0
  214. package/dist/types/core/formula/RecalcCoordinator.d.ts +151 -9
  215. package/dist/types/core/formula/ReferenceRewriter.d.ts +81 -0
  216. package/dist/types/core/formula/functions/essential.d.ts +3 -0
  217. package/dist/types/core/formula/functions/extended/index.d.ts +10 -0
  218. package/dist/types/core/formula/normalizeRefs.d.ts +34 -3
  219. package/dist/types/core/formula/numericLiteral.d.ts +11 -1
  220. package/dist/types/core/formula/serializeFormula.d.ts +10 -1
  221. package/dist/types/core/formula/types.d.ts +71 -8
  222. package/dist/types/core/host/CapabilityRegistry.d.ts +61 -0
  223. package/dist/types/core/host/GridHostDriver.d.ts +27 -0
  224. package/dist/types/core/host/GridHostPort.d.ts +37 -0
  225. package/dist/types/core/host/SliceOwnershipGuard.d.ts +27 -0
  226. package/dist/types/core/host/archCheck.d.ts +26 -0
  227. package/dist/types/core/host/index.d.ts +6 -0
  228. package/dist/types/core/host/reconcile.d.ts +22 -0
  229. package/dist/types/core/i18n/LocaleContext.d.ts +40 -0
  230. package/dist/types/core/i18n/types.d.ts +26 -1
  231. package/dist/types/core/icons/bootstrap-icons.d.ts +4 -2
  232. package/dist/types/core/quality/ContrastAuditor.d.ts +64 -0
  233. package/dist/types/core/quality/DeterminismKernel.d.ts +68 -0
  234. package/dist/types/core/quality/PerfBaseline.d.ts +23 -0
  235. package/dist/types/core/quality/PerfSpec.d.ts +95 -0
  236. package/dist/types/core/quality/RealBrowserGate.d.ts +69 -0
  237. package/dist/types/core/quality/RegressionJudge.d.ts +35 -0
  238. package/dist/types/core/quality/ReleaseGate.d.ts +94 -0
  239. package/dist/types/core/quality/VisualRegression.d.ts +74 -0
  240. package/dist/types/core/quality/hooks.d.ts +53 -0
  241. package/dist/types/core/quality/index.d.ts +20 -0
  242. package/dist/types/core/quality/pixelMetrics.d.ts +24 -0
  243. package/dist/types/core/range/ClipboardCodec.d.ts +46 -4
  244. package/dist/types/core/range/FillEngine.d.ts +69 -9
  245. package/dist/types/core/range/RangeModel.d.ts +100 -13
  246. package/dist/types/core/range/RangeQuery.d.ts +24 -2
  247. package/dist/types/core/range/types.d.ts +27 -11
  248. package/dist/types/core/realtime/BackpressureScheduler.d.ts +0 -0
  249. package/dist/types/core/realtime/FreshnessClock.d.ts +34 -0
  250. package/dist/types/core/realtime/IRealtimeSource.d.ts +82 -0
  251. package/dist/types/core/realtime/LiveStateGuard.d.ts +23 -0
  252. package/dist/types/core/realtime/PollingSource.d.ts +42 -0
  253. package/dist/types/core/realtime/RealtimeController.d.ts +54 -0
  254. package/dist/types/core/realtime/RtAnnouncePolicy.d.ts +53 -0
  255. package/dist/types/core/realtime/RtApplyCommand.d.ts +29 -0
  256. package/dist/types/core/realtime/RtChartTargetTrigger.d.ts +26 -0
  257. package/dist/types/core/realtime/StreamingSource.d.ts +47 -0
  258. package/dist/types/core/realtime/backoff.d.ts +12 -0
  259. package/dist/types/core/realtime/index.d.ts +13 -0
  260. package/dist/types/core/realtime/ports.d.ts +80 -0
  261. package/dist/types/core/render/CellApplier.d.ts +18 -0
  262. package/dist/types/core/render/CellErrorBoundary.d.ts +65 -0
  263. package/dist/types/core/render/CellPipeline.d.ts +39 -0
  264. package/dist/types/core/render/CellRenderRequest.d.ts +209 -0
  265. package/dist/types/core/render/CellStageRegistry.d.ts +53 -0
  266. package/dist/types/core/render/OverlayCompositor.d.ts +38 -0
  267. package/dist/types/core/render/RenderBudget.d.ts +67 -0
  268. package/dist/types/core/render/contrast.d.ts +33 -0
  269. package/dist/types/core/render/index.d.ts +35 -0
  270. package/dist/types/core/render/stages/BackgroundStage.d.ts +14 -0
  271. package/dist/types/core/render/stages/DecoratorStage.d.ts +12 -0
  272. package/dist/types/core/render/stages/OverlayStage.d.ts +12 -0
  273. package/dist/types/core/render/stages/ValueRendererStage.d.ts +15 -0
  274. package/dist/types/core/render/stages/index.d.ts +14 -0
  275. package/dist/types/core/renderers/CellRenderer.d.ts +100 -8
  276. package/dist/types/core/state/AutosaveController.d.ts +63 -0
  277. package/dist/types/core/state/IStatePersistence.d.ts +59 -0
  278. package/dist/types/core/state/MultiTabGuard.d.ts +33 -0
  279. package/dist/types/core/state/SchemaMigrator.d.ts +33 -0
  280. package/dist/types/core/state/SemVerPolicy.d.ts +39 -0
  281. package/dist/types/core/state/StateCodec.d.ts +75 -0
  282. package/dist/types/core/state/index.d.ts +6 -0
  283. package/dist/types/core/types.d.ts +17 -0
  284. package/dist/types/react/OpenGrid.d.ts +54 -0
  285. package/dist/types/react/index.d.ts +5 -0
  286. package/dist/types/realtime/index.d.ts +1 -0
  287. package/dist/types/vue/index.d.ts +5 -0
  288. package/dist/types/vue/types.d.ts +35 -0
  289. package/dist/xlsx.min-BQ1o3sB6.cjs +11793 -0
  290. package/dist/{xlsx.min-Wavxcamn.js → xlsx.min-Bbz2ZypC.js} +453 -566
  291. package/package.json +112 -110
  292. package/dist/OpenGrid-B0Spm0rU.js +0 -10404
  293. package/dist/OpenGrid-CuXj0isp.cjs +0 -97
  294. package/dist/xlsx.min-Bx-LxWOf.cjs +0 -138
@@ -2,13 +2,25 @@ import { ColumnDef, RendererDef } from '../types.js';
2
2
  /** i18n: 렌더 컨텍스트 로케일 해석기(주입 없으면 전역 t). 인스턴스 로케일이 전역보다 우선.
3
3
  * / i18n: render-context locale resolver (global t when not injected). Instance locale wins over global. */
4
4
  export declare function ctxT(ctx: RenderContext, key: string, params?: Record<string, string | number>): string;
5
+ /**
6
+ * 셀 렌더러/에디터에 전달되는 렌더 컨텍스트. / Render context passed to cell renderers/editors.
7
+ *
8
+ * @typeParam T - 행 데이터 타입 / Row data type
9
+ */
5
10
  export interface RenderContext<T = any> {
11
+ /** 셀 원시 값. / Raw cell value. */
6
12
  value: any;
13
+ /** 행 데이터. / Row data. */
7
14
  row: T;
15
+ /** flat 행 인덱스. / Flat row index. */
8
16
  rowIndex: number;
17
+ /** 컬럼 정의. / Column definition. */
9
18
  column: ColumnDef<T>;
19
+ /** 컬럼 인덱스. / Column index. */
10
20
  colIndex: number;
21
+ /** 선택 여부. / Whether selected. */
11
22
  isSelected: boolean;
23
+ /** 행 변경 상태. / Row mutation state. */
12
24
  rowState: 'none' | 'added' | 'edited' | 'removed';
13
25
  /** i18n: 인스턴스 로케일 해석기(GridRenderer/CellEditManager 가 주입, 미주입 시 전역 t 폴백). / i18n: instance locale resolver (injected; global-t fallback). */
14
26
  t?: (key: string, params?: Record<string, string | number>) => string;
@@ -21,7 +33,9 @@ export interface RenderContext<T = any> {
21
33
  /** C7(15_cross_contracts.md/F3-R14): 이 셀에 F3 셀 수식이 있으면 true — ColumnDef.formula 재평가를 skip. */
22
34
  hasCellFormula?: boolean;
23
35
  }
36
+ /** 셀 렌더러 인터페이스 — ctx 로 셀 엘리먼트를 만든다. / Cell renderer interface — builds a cell element from ctx. */
24
37
  export interface CellRenderer {
38
+ /** 셀 엘리먼트를 렌더한다. / Render the cell element. */
25
39
  render(ctx: RenderContext): HTMLElement;
26
40
  }
27
41
  /**
@@ -34,13 +48,25 @@ export interface CellRenderer {
34
48
  * formatNumber/formatDate 는 전역 상태 0 의 순수 포맷 함수로 환원했다(출력 동일, 회귀 0).
35
49
  */
36
50
  /**
37
- * 컬럼에 formula가 있으면 OGDecimal로 평가해 표시값(string)을 반환.
38
- * formula가 없으면 null 반환 → 기존 ctx.value 사용.
51
+ * 컬럼에 formula 가 있으면 OGDecimal 로 평가해 표시값(string)을 반환. 없으면 null(→ 기존 ctx.value 사용).
52
+ * / If the column has a formula, evaluate it via OGDecimal and return the display string; null otherwise (→ use ctx.value).
53
+ *
54
+ * @param ctx - 렌더 컨텍스트 / Render context
55
+ * @returns 표시 문자열, 또는 formula 없음/skip 시 null / Display string, or null when no formula / skipped
39
56
  */
40
57
  export declare function resolveFormula(ctx: RenderContext): string | null;
41
58
  /**
42
- * 숫자 포맷.
43
- * format 문자열:
59
+ * 숫자 포맷. / Format a number.
60
+ *
61
+ * @param value - 포맷할 값 / Value to format
62
+ * @param format - 포맷 문자열(아래 참조) / Format string (see below)
63
+ * @param precision - 소수 자리수(있으면 반올림) / Decimal precision (rounds if set)
64
+ * @param currency - ISO 통화코드 지정 시 Intl 로케일 통화 포맷 우선 / When an ISO currency code is set, Intl locale currency format takes priority
65
+ * @param field - 컬럼 field(선택) / Column field (optional)
66
+ * @param row - 행 데이터(선택) / Row data (optional)
67
+ * @returns 포맷된 문자열 / Formatted string
68
+ *
69
+ * format 문자열 / format string:
44
70
  * '#,##0' 천단위 콤마, 정수
45
71
  * '#,##0.00' 천단위 콤마, 소수 2자리
46
72
  * '₩#,##0' 통화 접두 (₩1,234)
@@ -50,10 +76,21 @@ export declare function resolveFormula(ctx: RenderContext): string | null;
50
76
  * currency: ISO 통화코드('KRW'|'USD'|'EUR'…) 지정 시 Intl.NumberFormat 로케일 통화 포맷 우선.
51
77
  */
52
78
  export declare function formatNumber(value: any, format?: string, precision?: number, currency?: string, field?: string, row?: any): string;
79
+ /**
80
+ * 날짜 포맷(yyyy/MM/dd 토큰 치환). / Format a date (replaces yyyy/MM/dd tokens).
81
+ *
82
+ * @param value - Date 또는 파싱 가능한 값 / A Date or a parseable value
83
+ * @param format - 포맷 문자열(기본 'yyyy-MM-dd') / Format string (default 'yyyy-MM-dd') @defaultValue 'yyyy-MM-dd'
84
+ * @param field - 컬럼 field(선택) / Column field (optional)
85
+ * @param row - 행 데이터(선택) / Row data (optional)
86
+ * @returns 포맷된 문자열 / Formatted string
87
+ */
53
88
  export declare function formatDate(value: any, format?: string, field?: string, row?: any): string;
89
+ /** 기본 텍스트 렌더러(formula/displayValue/valueMap/마스킹 처리 포함). / Default text renderer (handles formula/displayValue/valueMap/masking). */
54
90
  export declare class TextRenderer implements CellRenderer {
55
91
  render(ctx: RenderContext): HTMLElement;
56
92
  }
93
+ /** 셀렉트 값→라벨 매핑 렌더러(옵션 배열 또는 행별 옵션 함수). / Select value→label renderer (option array or per-row options function). */
57
94
  export declare class SelectRenderer implements CellRenderer {
58
95
  private _opts;
59
96
  private _fn;
@@ -68,106 +105,145 @@ export declare class SelectRenderer implements CellRenderer {
68
105
  }>);
69
106
  render(ctx: RenderContext): HTMLElement;
70
107
  }
108
+ /** 숫자 렌더러(formula/displayFormatter/통화·포맷 처리, 우측 정렬). / Number renderer (formula/displayFormatter/currency·format, right-aligned). */
71
109
  export declare class NumberRenderer implements CellRenderer {
72
110
  render(ctx: RenderContext): HTMLElement;
73
111
  }
112
+ /** 날짜 렌더러(displayFormatter 우선, 없으면 formatDate). / Date renderer (displayFormatter first, else formatDate). */
74
113
  export declare class DateRenderer implements CellRenderer {
75
114
  render(ctx: RenderContext): HTMLElement;
76
115
  }
116
+ /** 체크박스 렌더러(표시 전용, 클릭은 셀 이벤트가 처리). / Checkbox renderer (display-only; clicks handled by cell events). */
77
117
  export declare class CheckboxRenderer implements CellRenderer {
78
118
  render(ctx: RenderContext): HTMLElement;
79
119
  }
120
+ /** 버튼 렌더러 설정. / Button renderer definition. */
80
121
  export interface ButtonRendererDef {
81
122
  type: 'button';
123
+ /** 버튼 라벨(문자열 또는 (값,행)→문자열). / Button label (string or (value,row)→string). */
82
124
  label?: string | ((value: any, row: any) => string);
83
- /** R12c: 라벨과 함께 표시할 아이콘 role/key(renderIcon). 미지정 시 라벨만(기존과 동일). */
125
+ /** R12c: 라벨과 함께 표시할 아이콘 role/key(renderIcon). 미지정 시 라벨만. / Icon role/key shown with the label (renderIcon); label-only when unset. */
84
126
  icon?: string;
85
- /** 아이콘 위치(기본 'left'). */
127
+ /** 아이콘 위치. 기본 'left'. / Icon position. Default 'left'. @defaultValue 'left' */
86
128
  iconPos?: 'left' | 'right';
129
+ /** 버튼에 추가할 CSS 클래스. / Extra CSS class for the button. */
87
130
  buttonClass?: string;
131
+ /** 인라인 스타일. / Inline style. */
88
132
  style?: string;
89
133
  }
134
+ /** 버튼 렌더러(라벨±아이콘). / Button renderer (label ± icon). */
90
135
  export declare class ButtonRenderer implements CellRenderer {
91
136
  private def?;
92
137
  constructor(def?: ButtonRendererDef | undefined);
93
138
  render(ctx: RenderContext): HTMLElement;
94
139
  }
140
+ /** 배지 렌더러(상태/태그 색상 표시). / Badge renderer (colored status/tag pill). */
95
141
  export declare class BadgeRenderer implements CellRenderer {
96
142
  private colorMap?;
97
143
  private labelMap?;
98
144
  constructor(colorMap?: Record<string, string> | undefined, labelMap?: Record<string, string> | undefined);
99
145
  render(ctx: RenderContext): HTMLElement;
100
146
  }
147
+ /** 링크(a) 렌더러(hrefFn·target 지원). / Link (a) renderer (supports hrefFn·target). */
101
148
  export declare class LinkRenderer implements CellRenderer {
102
149
  private hrefFn?;
103
150
  private target?;
104
151
  constructor(hrefFn?: ((value: any, row: any) => string) | undefined, target?: string | undefined);
105
152
  render(ctx: RenderContext): HTMLElement;
106
153
  }
154
+ /** 템플릿 렌더러(사용자 함수가 HTML 문자열 생성). / Template renderer (user function produces an HTML string). */
107
155
  export declare class TemplateRenderer implements CellRenderer {
108
156
  private templateFn;
109
157
  constructor(templateFn: (value: any, row: any, rowIndex: number) => string);
110
158
  render(ctx: RenderContext): HTMLElement;
111
159
  }
160
+ /** 이미지 렌더러 설정. / Image renderer definition. */
112
161
  export interface ImageRendererDef {
113
162
  type: 'image';
163
+ /** 너비(px). 기본 28. / Width in px. Default 28. @defaultValue 28 */
114
164
  width?: number;
165
+ /** 높이(px). 기본 28. / Height in px. Default 28. @defaultValue 28 */
115
166
  height?: number;
167
+ /** 모서리 반경(px). 기본 4. / Corner radius in px. Default 4. @defaultValue 4 */
116
168
  radius?: number;
169
+ /** 값→src URL 함수. / Value→src URL function. */
117
170
  srcFn?: (value: any, row: any) => string;
171
+ /** alt 텍스트 또는 함수. / alt text or function. */
118
172
  alt?: string | ((value: any, row: any) => string);
119
173
  }
174
+ /** 이미지(썸네일) 렌더러. / Image (thumbnail) renderer. */
120
175
  export declare class ImageRenderer implements CellRenderer {
121
176
  private def?;
122
177
  constructor(def?: ImageRendererDef | undefined);
123
178
  render(ctx: RenderContext): HTMLElement;
124
179
  }
180
+ /** 진행바 렌더러 설정. / Progress-bar renderer definition. */
125
181
  export interface ProgressRendererDef {
126
182
  type: 'progress';
183
+ /** 최댓값. 기본 100. / Max value. Default 100. @defaultValue 100 */
127
184
  max?: number;
185
+ /** 채움 색. / Fill color. */
128
186
  color?: string;
187
+ /** 퍼센트 라벨 표시(기본 true). / Show percent label (default true). @defaultValue true */
129
188
  showLabel?: boolean;
189
+ /** 값→색 함수(color 오버라이드). / Value→color function (overrides color). */
130
190
  colorFn?: (value: number) => string;
131
191
  }
192
+ /** 진행바 렌더러. / Progress-bar renderer. */
132
193
  export declare class ProgressRenderer implements CellRenderer {
133
194
  private def?;
134
195
  constructor(def?: ProgressRendererDef | undefined);
135
196
  render(ctx: RenderContext): HTMLElement;
136
197
  }
198
+ /** 스파크라인 렌더러 설정(값 배열 → 미니 차트). / Sparkline renderer definition (value array → mini chart). */
137
199
  export interface SparklineRendererDef {
138
200
  type: 'sparkline';
201
+ /** 캔버스 너비(px). 기본 80. / Canvas width in px. Default 80. @defaultValue 80 */
139
202
  width?: number;
203
+ /** 캔버스 높이(px). 기본 22. / Canvas height in px. Default 22. @defaultValue 22 */
140
204
  height?: number;
205
+ /** 선/바 색. / Line/bar color. */
141
206
  color?: string;
207
+ /** 미니 차트 종류(기본 'bar'). / Mini chart type (default 'bar'). @defaultValue 'bar' */
142
208
  chartType?: 'bar' | 'line' | 'area';
143
209
  }
210
+ /** 스파크라인(인라인 미니 차트) 렌더러. / Sparkline (inline mini chart) renderer. */
144
211
  export declare class SparklineRenderer implements CellRenderer {
145
212
  private def?;
146
213
  constructor(def?: SparklineRendererDef | undefined);
147
214
  render(ctx: RenderContext): HTMLElement;
148
215
  }
216
+ /** 토글 스위치 렌더러(표시 전용). / Toggle-switch renderer (display-only). */
149
217
  export declare class SwitchRenderer implements CellRenderer {
150
218
  render(ctx: RenderContext): HTMLElement;
151
219
  }
220
+ /** 별점 렌더러 설정. / Rating (stars) renderer definition. */
152
221
  export interface RatingRendererDef {
153
222
  type: 'rating';
223
+ /** 최대 별 수. 기본 5. / Max stars. Default 5. @defaultValue 5 */
154
224
  max?: number;
225
+ /** 채워진 별 색. / Filled-star color. */
155
226
  color?: string;
156
227
  }
228
+ /** 별점 렌더러. / Rating (stars) renderer. */
157
229
  export declare class RatingRenderer implements CellRenderer {
158
230
  private def?;
159
231
  constructor(def?: RatingRendererDef | undefined);
160
232
  render(ctx: RenderContext): HTMLElement;
161
233
  }
234
+ /** 라디오 렌더러(표시 전용, group 지원). / Radio renderer (display-only, supports group). */
162
235
  export declare class RadioRenderer implements CellRenderer {
163
236
  render(ctx: RenderContext): HTMLElement;
164
237
  }
238
+ /** 단순 이미지 렌더러(셀 값 = 이미지 URL). / Simple image renderer (cell value = image URL). */
165
239
  export declare class ImgRenderer implements CellRenderer {
166
240
  render(ctx: RenderContext): HTMLElement;
167
241
  }
242
+ /** HTML 렌더러(기본 sanitize; column.sanitize=false 로 해제 가능). / HTML renderer (sanitizes by default; disable via column.sanitize=false). */
168
243
  export declare class HtmlRenderer implements CellRenderer {
169
244
  render(ctx: RenderContext): HTMLElement;
170
245
  }
246
+ /** 바코드 렌더러(Code128B, SVG + 하단 텍스트). / Barcode renderer (Code128B, SVG plus caption text). */
171
247
  export declare class BarcodeRenderer implements CellRenderer {
172
248
  render(ctx: RenderContext): HTMLElement;
173
249
  }
@@ -185,9 +261,25 @@ export declare class BarcodeRenderer implements CellRenderer {
185
261
  * - image/progress/sparkline/rating/template 은 def(설정 객체) 없이는 원래 TextRenderer 로 떨어졌으므로
186
262
  * def 유무로 게이트한다(문자열 렌더러명만 준 미완성 설정 = 기존과 동일 폴백).
187
263
  */
264
+ /** 셀 렌더러 팩토리 시그니처 `(col, def?) => CellRenderer`. / Cell-renderer factory signature `(col, def?) => CellRenderer`. */
188
265
  export type RendererFactory = (col: ColumnDef, def?: RendererDef) => CellRenderer;
189
- /** 커스텀 셀 렌더러 타입을 코어 편집 없이 등록(OCP). 프로세스 전역. */
266
+ /**
267
+ * 커스텀 셀 렌더러 타입을 코어 편집 없이 등록(OCP). 프로세스 전역.
268
+ * / Register a custom cell-renderer type without editing core (OCP). Process-global.
269
+ *
270
+ * @param typeName - 렌더러 타입 이름(예: 'sparkline') / Renderer type name (e.g. 'sparkline')
271
+ * @param factory - 렌더러 팩토리 / Renderer factory
272
+ * @example
273
+ * registerRenderer('stars', (col, def) => new RatingRenderer(def as any));
274
+ */
190
275
  export declare function registerRenderer(typeName: string, factory: RendererFactory): void;
191
- /** 등록 여부 조회(내부/테스트용). */
276
+ /** 렌더러 타입 등록 여부 조회(내부/테스트용). / Whether a renderer type is registered (internal/test use). */
192
277
  export declare function hasRenderer(typeName: string): boolean;
278
+ /**
279
+ * 컬럼 정의로부터 셀 렌더러를 생성한다(레지스트리 해석, 미등록 시 TextRenderer 폴백).
280
+ * / Create a cell renderer from a column definition (registry resolution; falls back to TextRenderer when unregistered).
281
+ *
282
+ * @param col - 컬럼 정의 / Column definition
283
+ * @returns 셀 렌더러 / A cell renderer
284
+ */
193
285
  export declare function createRenderer(col: ColumnDef): CellRenderer;
@@ -0,0 +1,63 @@
1
+ import { StateCodec } from './StateCodec.js';
2
+ import { IStatePersistence, PersistedRecord } from './IStatePersistence.js';
3
+ import { MultiTabGuard, TabConflictNotice } from './MultiTabGuard.js';
4
+ /** RPO 수치 계약. / RPO numeric contract. */
5
+ export interface AutosavePolicy {
6
+ /** ≤ 30_000 (수용기준). / Max interval between saves (acceptance: ≤ 30s). */
7
+ readonly maxIntervalMs: number;
8
+ /** N 조작마다 저장. / Save every N ops. */
9
+ readonly maxOpsBetweenSaves: number;
10
+ }
11
+ /** 초안↔현재 충돌 해소(조용히 덮지 않음 — 복원/버림/비교). / Draft-vs-current resolution (never silent overwrite). */
12
+ export interface DraftStatus {
13
+ readonly hasDraft: boolean;
14
+ readonly draftSavedAt?: number;
15
+ readonly loadedRevision?: number;
16
+ /** 초안 채택(setState). / Adopt the draft. */
17
+ restore(): void;
18
+ /** 초안 버림. / Discard the draft. */
19
+ discard(): void;
20
+ /** 비교(무엇이 다른지 — 섹션 키). / Diff (which sections differ). */
21
+ diff(): DraftDiff;
22
+ }
23
+ export interface DraftDiff {
24
+ readonly changedSections: string[];
25
+ }
26
+ export interface AutosaveControllerConfig {
27
+ readonly docId: string;
28
+ readonly codec: StateCodec;
29
+ readonly store: IStatePersistence;
30
+ readonly policy: AutosavePolicy;
31
+ readonly tabId?: string;
32
+ readonly guard?: MultiTabGuard;
33
+ readonly now?: () => number;
34
+ /** 저장 전 충돌 시 호출(조용한 클로버 대신 표면화). / Called on pre-save conflict (surface instead of clobber). */
35
+ readonly onConflict?: (notice: PersistedRecord) => void;
36
+ }
37
+ /** RPO 계약을 강제하는 자동저장 스케줄러. / Autosave scheduler enforcing the RPO contract. */
38
+ export declare class AutosaveController {
39
+ private readonly _cfg;
40
+ private readonly _now;
41
+ private readonly _tabId;
42
+ private _opsSinceSave;
43
+ private _lastSaveAt;
44
+ private _baseRevision;
45
+ private _saveCount;
46
+ constructor(cfg: AutosaveControllerConfig);
47
+ /** CommandBus 'command' 구독점: 임계 도달 시 저장. / Subscription point for CommandBus 'command'. */
48
+ onCommand(): void;
49
+ private _shouldSave;
50
+ /** 강제 저장(언로드 직전 beforeunload 등). 충돌 시 저장 생략 + onConflict. / Force a save; skip on conflict. */
51
+ flush(): Promise<boolean>;
52
+ /**
53
+ * 크래시 복구: 초안 존재 시 로드하지 않고 '초안 발견' 보고(자동 덮어쓰기 금지).
54
+ * restore()/discard()/diff() 로 호스트가 결정한다.
55
+ * / Crash recovery: reports a found draft without loading it (no auto-overwrite).
56
+ */
57
+ detectDraft(): Promise<DraftStatus>;
58
+ /** 다른 탭 저장 통지 처리(멀티탭 §2.7). / Handle another tab's save notice (multi-tab §2.7). */
59
+ onExternalSave(rec: PersistedRecord): TabConflictNotice | null;
60
+ get saveCount(): number;
61
+ get opsSinceSave(): number;
62
+ get baseRevision(): number;
63
+ }
@@ -0,0 +1,59 @@
1
+ import { StateEnvelope } from './StateCodec.js';
2
+ /** 저장 레코드 — 봉투 + 탭/리비전 메타. / Persisted record — envelope plus tab/revision metadata. */
3
+ export interface PersistedRecord {
4
+ readonly env: StateEnvelope;
5
+ readonly tabId: string;
6
+ readonly revision: number;
7
+ readonly savedAt: number;
8
+ }
9
+ /** 저장 매체 추상화 포트(구현은 호스트 주입). / Persistence port (host-injected implementation). */
10
+ export interface IStatePersistence {
11
+ load(docId: string): Promise<PersistedRecord | null>;
12
+ save(docId: string, rec: PersistedRecord): Promise<void>;
13
+ /** 멀티탭: 다른 탭의 저장 통지 구독. 해제 함수 반환. / Multi-tab: subscribe to other tabs' saves; returns an unsubscribe fn. */
14
+ subscribe(docId: string, cb: (rec: PersistedRecord) => void): () => void;
15
+ }
16
+ /** 인메모리 어댑터(테스트·헤드리스 기본). 같은 인스턴스 내 subscribe 는 즉시 동기 통지. / In-memory adapter (test/headless default). */
17
+ export declare class InMemoryStatePersistence implements IStatePersistence {
18
+ private readonly _store;
19
+ private readonly _subs;
20
+ load(docId: string): Promise<PersistedRecord | null>;
21
+ save(docId: string, rec: PersistedRecord): Promise<void>;
22
+ subscribe(docId: string, cb: (rec: PersistedRecord) => void): () => void;
23
+ /** 테스트 편의: 동기 조회. / Test convenience: synchronous peek. */
24
+ peek(docId: string): PersistedRecord | null;
25
+ }
26
+ interface StorageLike {
27
+ getItem(key: string): string | null;
28
+ setItem(key: string, value: string): void;
29
+ }
30
+ interface WindowLike {
31
+ addEventListener(type: 'storage', cb: (e: {
32
+ key: string | null;
33
+ newValue: string | null;
34
+ }) => void): void;
35
+ removeEventListener(type: 'storage', cb: (e: {
36
+ key: string | null;
37
+ newValue: string | null;
38
+ }) => void): void;
39
+ }
40
+ /**
41
+ * localStorage 어댑터 — 브라우저 전용. `storage` 이벤트로 다른 탭의 저장을 자연 통지받는다(멀티탭 §2.7).
42
+ * 헤드리스/서버에는 매체가 없으므로 load/save 는 무해히 no-op(주입 매체가 없으면).
43
+ * / localStorage adapter (browser-only). Receives other tabs' saves via the native `storage` event.
44
+ */
45
+ export declare class LocalStorageStatePersistence implements IStatePersistence {
46
+ private readonly _storage;
47
+ private readonly _win;
48
+ private readonly _prefix;
49
+ constructor(opts?: {
50
+ storage?: StorageLike;
51
+ win?: WindowLike;
52
+ prefix?: string;
53
+ });
54
+ private _key;
55
+ load(docId: string): Promise<PersistedRecord | null>;
56
+ save(docId: string, rec: PersistedRecord): Promise<void>;
57
+ subscribe(docId: string, cb: (rec: PersistedRecord) => void): () => void;
58
+ }
59
+ export {};
@@ -0,0 +1,33 @@
1
+ import { PersistedRecord } from './IStatePersistence.js';
2
+ /** 다른 탭 저장 통지. / Notice of another tab's save. */
3
+ export interface TabConflictNotice {
4
+ readonly otherTabId: string;
5
+ readonly otherRevision: number;
6
+ readonly savedAt: number;
7
+ }
8
+ /**
9
+ * revision 기반 낙관적 잠금. observe/onExternalSave 로 최신 매체 리비전을 추적하고, checkBeforeSave
10
+ * 로 저장 전 충돌을 감지한다. 내 탭(tabId) 저장은 충돌로 보지 않는다.
11
+ * / Revision-based optimistic lock. Tracks the latest media revision via observe/onExternalSave and
12
+ * detects conflicts before a save via checkBeforeSave. My own tab's saves are never conflicts.
13
+ */
14
+ export declare class MultiTabGuard {
15
+ private readonly _tabId;
16
+ private _latestRevision;
17
+ private _latestRec;
18
+ constructor(_tabId: string);
19
+ get tabId(): string;
20
+ /** 매체에서 관측한 최신 레코드 반영(subscribe 콜백/명시 폴링). / Record the latest observed media state. */
21
+ observe(rec: PersistedRecord): void;
22
+ /**
23
+ * 저장 전 충돌 검사: 관측한 최신 리비전이 baseRevision 보다 앞서고 그게 다른 탭 소행이면 충돌.
24
+ * / Pre-save conflict check: conflict if the observed latest revision leads baseRevision and it
25
+ * came from another tab.
26
+ */
27
+ checkBeforeSave(baseRevision: number): 'ok' | {
28
+ conflict: PersistedRecord;
29
+ };
30
+ /** 다른 탭 저장 통지 수신 → 관측 반영 + 경고(내 탭이면 null). / Receive another tab's save notice. */
31
+ onExternalSave(rec: PersistedRecord): TabConflictNotice | null;
32
+ get latestRevision(): number;
33
+ }
@@ -0,0 +1,33 @@
1
+ import { SemVerPolicy } from './SemVerPolicy.js';
2
+ import { StateEnvelope } from './StateCodec.js';
3
+ export interface MigrationNote {
4
+ readonly fromMajor: number;
5
+ readonly toMajor: number;
6
+ readonly note: string;
7
+ }
8
+ /** 한 major 단계 변환기(fromMajor → fromMajor+1). / A single major-step migrator. */
9
+ export interface MigrationStep {
10
+ readonly fromMajor: number;
11
+ migrate(env: StateEnvelope): StateEnvelope;
12
+ }
13
+ export type MigrateResult = {
14
+ readonly env: StateEnvelope;
15
+ readonly notes: MigrationNote[];
16
+ } | {
17
+ readonly rejected: true;
18
+ readonly reason: string;
19
+ };
20
+ /** 버전 간 변환 체인 계약. / Inter-version migration chain contract. */
21
+ export interface SchemaMigrator {
22
+ migrate(env: unknown): MigrateResult;
23
+ }
24
+ /** 등록된 major 단계들을 순차 적용하는 기본 마이그레이터. / Default migrator applying registered major steps in sequence. */
25
+ export declare class DefaultSchemaMigrator implements SchemaMigrator {
26
+ private readonly _steps;
27
+ private readonly _current;
28
+ private readonly _policy;
29
+ constructor(current: string, policy?: SemVerPolicy);
30
+ /** major 승격 단계 등록(Strategy 확장점). / Register a major-promotion step (Strategy extension point). */
31
+ register(step: MigrationStep): this;
32
+ migrate(env: unknown): MigrateResult;
33
+ }
@@ -0,0 +1,39 @@
1
+ /** 'MAJOR.MINOR.PATCH' 만 허용하는 브랜드 문자열(파싱 실패 = 거부 대상). / Branded 'MAJOR.MINOR.PATCH'. */
2
+ export type SemVer = string & {
3
+ readonly __brand: 'SemVer';
4
+ };
5
+ /** 검증 없이 브랜드 부여(호출자 책임). 실검증은 parse/classify 가 한다. / Brand without validation. */
6
+ export declare function asSemVer(s: string): SemVer;
7
+ export interface ParsedSemVer {
8
+ readonly major: number;
9
+ readonly minor: number;
10
+ readonly patch: number;
11
+ }
12
+ /** classify 결과 — 5분기. / classify result — 5 branches. */
13
+ export type Classification = {
14
+ readonly kind: 'load';
15
+ } | {
16
+ readonly kind: 'tolerant';
17
+ readonly unknownSections: string[];
18
+ } | {
19
+ readonly kind: 'migrate';
20
+ readonly fromMajor: number;
21
+ } | {
22
+ readonly kind: 'reject';
23
+ readonly reason: string;
24
+ };
25
+ /** classify 부가 입력(관용 로드 시 미지 섹션 산출). / Extra input for classify (unknown-section derivation). */
26
+ export interface ClassifyContext {
27
+ readonly loadedSections?: readonly string[];
28
+ readonly knownSections?: readonly string[];
29
+ }
30
+ /** semver 비교 커널(단일 소유 — 봉투/커맨드 payloadVersion 공용). / semver comparison kernel. */
31
+ export interface SemVerPolicy {
32
+ parse(s: string): ParsedSemVer | null;
33
+ classify(loaded: string, current: string, ctx?: ClassifyContext): Classification;
34
+ }
35
+ /** §2.5.1 표를 구현한 기본 정책. / Default policy implementing the §2.5.1 table. */
36
+ export declare class DefaultSemVerPolicy implements SemVerPolicy {
37
+ parse(s: string): ParsedSemVer | null;
38
+ classify(loaded: string, current: string, ctx?: ClassifyContext): Classification;
39
+ }
@@ -0,0 +1,75 @@
1
+ import { SemVerPolicy } from './SemVerPolicy.js';
2
+ import { SchemaMigrator } from './SchemaMigrator.js';
3
+ /** 저장 봉투 — 전 서브시스템 조각의 합성 + 단일 버전 권위. / Save envelope — composition of all sections + single version authority. */
4
+ export interface StateEnvelope {
5
+ readonly schemaVersion: string;
6
+ readonly savedAt: number;
7
+ /** 커맨드 리비전(멀티탭 충돌 감지 키). / Command revision (multi-tab conflict key). */
8
+ readonly revision: number;
9
+ readonly sections: Record<string, unknown>;
10
+ }
11
+ /** 조각 로드 결과 — 부분실패는 값으로 신고(조용한 실패 0). / Section load result — partial failure reported as a value. */
12
+ export interface SectionLoadResult {
13
+ readonly restored?: boolean;
14
+ readonly partial?: {
15
+ readonly reason: string;
16
+ };
17
+ }
18
+ /**
19
+ * 봉투에 담기는 한 조각의 소유 계약(해당 DD 소유). 봉투는 이 계약을 호출만 하고 내부 스키마를 모른다.
20
+ * / Ownership contract for one section (owned by its DD). The envelope only calls it, never knows its schema.
21
+ */
22
+ export interface ISectionCodec {
23
+ readonly key: string;
24
+ toState(): unknown;
25
+ fromState(raw: unknown): SectionLoadResult;
26
+ }
27
+ /** 로드 결과 — 무엇이 복원/일부실패/거부됐는지 표면화(조용한 실패 금지). / Load result — surfaces restored/partial/rejected. */
28
+ export interface LoadResult {
29
+ readonly ok: boolean;
30
+ readonly restored: string[];
31
+ readonly partial: {
32
+ section: string;
33
+ reason: string;
34
+ }[];
35
+ readonly rejected?: string;
36
+ }
37
+ export interface StateCodecConfig {
38
+ /** 런타임이 아는 현재 봉투 버전. / Current envelope version known to the runtime. */
39
+ readonly current: string;
40
+ readonly sections: ISectionCodec[];
41
+ readonly policy?: SemVerPolicy;
42
+ readonly migrator?: SchemaMigrator;
43
+ /** 봉투에 심을 리비전 소스(CommandBus dirty/audit 연동). / Revision source stamped into the envelope. */
44
+ readonly revision?: () => number;
45
+ readonly now?: () => number;
46
+ }
47
+ /** getState/setState 정본 + 버전 마이그레이션 파사드. / Canonical getState/setState + version migration facade. */
48
+ export declare class StateCodec {
49
+ private readonly _current;
50
+ private readonly _sections;
51
+ private readonly _policy;
52
+ private readonly _migrator;
53
+ private readonly _rev;
54
+ private readonly _now;
55
+ /** future-minor 로드 시 보존한 미지 섹션(round-trip 무손실 재방출). / Opaque unknown sections preserved for lossless round-trip. */
56
+ private _opaque;
57
+ constructor(cfg: StateCodecConfig);
58
+ /** 살아있는 그리드 → 봉투. 각 조각의 toState() 합성 + 보존된 opaque 섹션 병합(무손실). / Live grid → envelope. */
59
+ getState(): StateEnvelope;
60
+ /**
61
+ * 봉투 → 살아있는 그리드. schemaVersion 라우팅(§2.5.1) → 마이그레이션/관용/거부 → 조각 fromState.
62
+ * 로드는 CommandBus 를 거치지 않는 초기화 경로(undo 스택 clear 는 호출자 책임).
63
+ * / envelope → live grid; routes by schemaVersion, then applies section fromState.
64
+ */
65
+ setState(env: unknown): LoadResult;
66
+ /**
67
+ * 왕복 자기검사(골든 하니스용): 두 봉투의 섹션 동일성. 조각 소유 DD 값객체 equals 를 못 부르는
68
+ * DD-09 층에서는 구조(JSON) 동일성으로 판정하고, 손실경계는 diffs 로 표면화한다.
69
+ * / Round-trip self-check: section equality between two envelopes (structural JSON compare here).
70
+ */
71
+ roundTripEquals(a: StateEnvelope, b: StateEnvelope): {
72
+ equal: boolean;
73
+ diffs: string[];
74
+ };
75
+ }
@@ -0,0 +1,6 @@
1
+ export { DefaultSemVerPolicy, asSemVer, type SemVer, type ParsedSemVer, type Classification, type ClassifyContext, type SemVerPolicy, } from './SemVerPolicy.js';
2
+ export { StateCodec, type StateEnvelope, type ISectionCodec, type SectionLoadResult, type LoadResult, type StateCodecConfig, } from './StateCodec.js';
3
+ export { DefaultSchemaMigrator, type SchemaMigrator, type MigrationStep, type MigrationNote, type MigrateResult, } from './SchemaMigrator.js';
4
+ export { InMemoryStatePersistence, LocalStorageStatePersistence, type IStatePersistence, type PersistedRecord, } from './IStatePersistence.js';
5
+ export { MultiTabGuard, type TabConflictNotice } from './MultiTabGuard.js';
6
+ export { AutosaveController, type AutosavePolicy, type AutosaveControllerConfig, type DraftStatus, type DraftDiff, } from './AutosaveController.js';
@@ -618,6 +618,8 @@ export interface GridOptions<T = any> {
618
618
  masterDetail?: MasterDetailOptions<T>;
619
619
  /** F4: 그리드 데이터 통합 차트(C5.1 단일 중첩). 타입은 chart/types 순환-안전 type-only import. / F4: grid-data integrated chart (C5.1 single nesting). Type is a cycle-safe type-only import from chart/types. */
620
620
  chart?: import('./chart/types.js').ChartGlobalOptions;
621
+ /** DD-05: 조건부서식(CF) 규칙(opt-in, 기본 undefined=byte-identical). 지정 시 _mount 가 setConditionalFormat 로 배선(동적 import). 타입은 cf 순환-안전 type-only import. / DD-05: conditional-format rules (opt-in; default undefined = byte-identical). Type is a cycle-safe type-only import from cf. */
622
+ conditionalFormat?: import('./cf/CFRule.js').CFRule[];
621
623
  /** 전역 정렬 허용. / Global sort switch. */
622
624
  sortable?: boolean;
623
625
  /** Shift+클릭 멀티정렬 허용. / Allow Shift+click multi-sort. */
@@ -677,6 +679,10 @@ export interface GridOptions<T = any> {
677
679
  theme?: string;
678
680
  /** 스킨 (FORM 축, R12b) — data-og-skin. 미지정 시 'default'(오늘과 byte-identical). / Skin (FORM axis, R12b) — data-og-skin. Default 'default' (byte-identical to stock look). */
679
681
  skin?: string;
682
+ /** DD-11: 밀도 (DENSITY 축) — data-og-density. 미지정 시 미적용(byte-identical). / Density (DENSITY axis, DD-11) — data-og-density. Unset = not applied (byte-identical). */
683
+ density?: string;
684
+ /** DD-11: 질감 (TEXTURE 축) — data-og-texture. 미지정 시 미적용(byte-identical). / Texture (TEXTURE axis, DD-11) — data-og-texture. Unset = not applied (byte-identical). */
685
+ texture?: string;
680
686
  /** 컨테이너에 주입할 CSS 변수 맵. / CSS custom properties injected on the container. */
681
687
  cssVars?: Record<string, string>;
682
688
  /**
@@ -870,6 +876,13 @@ export interface OpenGridInstance<T = any> {
870
876
  pushData(data: T[]): void;
871
877
  prefixData(data: T[]): void;
872
878
  clearData(): void;
879
+ /**
880
+ * DD-05: 조건부서식(CF) 규칙 설정 — 데이터바·히트맵·아이콘셋을 렌더 경로에 배선(opt-in, 동적 import).
881
+ * 규칙이 걸린 컬럼 통계를 캐시 계산 후 재렌더한다. 빈 배열이면 CF 해제(잔재 제거).
882
+ * / DD-05: set conditional-format rules — wires data-bars/heatmaps/icon-sets into the render path
883
+ * (opt-in, dynamic import). Caches rule-bearing column stats, then re-renders. Empty array clears CF.
884
+ */
885
+ setConditionalFormat(rules: import('./cf/CFRule.js').CFRule[]): Promise<void>;
873
886
  insertRow(item: Partial<T>, position?: Position): void;
874
887
  pushRow(items: Partial<T> | Partial<T>[]): void;
875
888
  unshiftRow(items: Partial<T> | Partial<T>[]): void;
@@ -1046,6 +1059,10 @@ export interface OpenGridInstance<T = any> {
1046
1059
  getSkin(): string;
1047
1060
  /** R12b: FORM 축 단일 토큰 런타임 오버라이드(setThemeVar 의 형태-축 형제). 색 값은 거부. */
1048
1061
  setSkinVar(varName: string, value: string): void;
1062
+ /** DD-11: 밀도(DENSITY 축) 전환 — data-og-density + --og-density-* 토큰(+행높이 미러, relayout). 미등록 never-throw. 색⊥형태⊥밀도⊥질감 직교. / DD-11: switch the density axis — additive data-og-density + --og-density-* tokens (row-height mirror + relayout). Never throws. */
1063
+ setDensity(name: string): void;
1064
+ /** DD-11: 질감(TEXTURE 축) 전환 — data-og-texture + --og-texture-* 토큰(배경 페인트만, relayout 없음). 미등록 never-throw. / DD-11: switch the texture axis — additive data-og-texture + --og-texture-* tokens (paint only, no relayout). Never throws. */
1065
+ setTexture(name: string): void;
1049
1066
  /** UI 로케일 전환 — 크롬+가시창 재렌더 + emit('localeChange'). 미등록 로케일은 never-throw. */
1050
1067
  setLocale(locale: string): void;
1051
1068
  /** 현재 인스턴스 로케일 id. */