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
@@ -0,0 +1,51 @@
1
+ import { ICommand, ICommandCtx } from './ICommand.js';
2
+ import { CommandStack } from './CommandStack.js';
3
+ import { DirtyTracker, MutationGuard, AuditLog } from './support.js';
4
+ /** CommandBus 협력자(전부 옵션 — 기본 구현 주입). / CommandBus collaborators (all optional — defaults injected). */
5
+ export interface CommandBusDeps<T = any> {
6
+ readonly ctx: ICommandCtx<T>;
7
+ stack?: CommandStack<T>;
8
+ audit?: AuditLog;
9
+ dirty?: DirtyTracker;
10
+ guard?: MutationGuard;
11
+ /** 자동저장/협업/감사 구독 fan-out. / Fan-out for autosave/collaboration/audit subscribers. */
12
+ emit?: (event: 'command', cmd: ICommand<T>) => void;
13
+ }
14
+ /**
15
+ * 유일한 쓰기 진입점. 이벤트 오케스트레이션(DD-08/896)이 UI 이벤트를 커맨드로 번역해 여기로 보낸다.
16
+ * / The sole write entry point. Event orchestration (DD-08/896) translates UI events into commands here.
17
+ */
18
+ export declare class CommandBus<T = any> {
19
+ private readonly _ctx;
20
+ private readonly _stack;
21
+ private readonly _audit;
22
+ private readonly _dirty;
23
+ private readonly _guard;
24
+ private readonly _emit;
25
+ private _macro;
26
+ private _macroLabel;
27
+ constructor(deps: CommandBusDeps<T>);
28
+ get stack(): CommandStack<T>;
29
+ get audit(): AuditLog;
30
+ get dirty(): DirtyTracker;
31
+ get guard(): MutationGuard;
32
+ /**
33
+ * 커맨드 실행: do → 스택 push(coalesce 시도) → audit → dirty → emit. 매크로 녹화 중이면 스택 대신
34
+ * 프레임에 수집(그대로 실행됨). / Execute a command; while recording a macro, collect into the frame instead of the stack.
35
+ */
36
+ dispatch(cmd: ICommand<T>): void;
37
+ /** 되돌리기: 스택에서 꺼내 undo 재적용. / Undo: pop and apply undo. */
38
+ undo(): boolean;
39
+ /** 다시하기: 스택에서 꺼내 do 재적용. / Redo: pop and re-apply do. */
40
+ redo(): boolean;
41
+ canUndo(): boolean;
42
+ canRedo(): boolean;
43
+ /** 매크로 녹화 시작 — 이후 dispatch 는 프레임에 수집(실행은 됨). / Begin macro recording. */
44
+ beginMacro(label: string): void;
45
+ /** 매크로 중지 — 수집분을 CompositeCommand 로 접어 단일 undo 단위로 스택에 등록. / End macro; fold into one undo unit. */
46
+ endMacro(): void;
47
+ /** 트랜잭션 배치 — body 안의 dispatch 를 하나의 undo 단위로. 예외 시에도 endMacro 로 닫는다. / Transaction batch. */
48
+ transact(label: string, body: () => void): void;
49
+ /** 녹화 중 여부. / Whether a macro is being recorded. */
50
+ get recording(): boolean;
51
+ }
@@ -0,0 +1,43 @@
1
+ import { IRegistry, RegisterOptions } from '../extension/Registry.js';
2
+ import { ICommand, CommandDTO } from './ICommand.js';
3
+ import { CompositeCommand } from './commands/CompositeCommand.js';
4
+ import { CellWriteCommand } from './commands/CellWriteCommand.js';
5
+ import { RowInsertCommand, RowDeleteCommand } from './commands/RowCommands.js';
6
+ /** 커맨드 종류 등록 명세(payload 버저닝·복원). / Command-kind registration spec (payload versioning + restore). */
7
+ export interface CommandSpec<T = any> {
8
+ /** payload 최신 스키마 버전(커맨드 단위). 봉투 schemaVersion 과 독립 진화. / Latest payload schema version. */
9
+ readonly payloadVersion: number;
10
+ /** 구버전 payload → 최신 payload 마이그레이션(없으면 동일버전만 허용). / Old payload → latest migration. */
11
+ migratePayload?(payload: unknown, from: number): unknown;
12
+ /** payload → 살아있는 커맨드. / payload → live command. */
13
+ fromPayload(payload: unknown): ICommand<T>;
14
+ }
15
+ /** 미등록 kind / 미지 상위버전 재수화 실패(조용한 스킵 금지). / Rehydrate failure (never silent-skip). */
16
+ export declare class RehydrateError extends Error {
17
+ readonly kind: string;
18
+ constructor(kind: string, reason: string);
19
+ }
20
+ /** kind → (DTO 역직렬화기). 커스텀 커맨드도 이 포트로 등록돼 매크로/협업 재생에 참여. / kind → DTO deserializer. */
21
+ export interface CommandRegistry<T = any> {
22
+ register(kind: string, spec: CommandSpec<T>, opts?: RegisterOptions): void;
23
+ /** DTO → ICommand 복원. 미등록 kind = 정의된 오류(throw). / DTO → ICommand; unknown kind throws. */
24
+ rehydrate(dto: CommandDTO): ICommand<T>;
25
+ has(kind: string): boolean;
26
+ }
27
+ /**
28
+ * DD-10 IRegistry 동형 기본 구현(C1). 내장 커맨드(cell.write·row.insert·row.delete·composite)를
29
+ * 부트스트랩하고, 커스텀 kind 를 register 로 확장한다. composite 는 자식 DTO 를 재귀 재수화한다.
30
+ * / Default IRegistry-homomorphic implementation (C1). Bootstraps built-in commands and lets custom
31
+ * kinds extend via register; composite recursively rehydrates its children.
32
+ */
33
+ export declare class DefaultCommandRegistry<T = any> implements CommandRegistry<T> {
34
+ private readonly _reg;
35
+ constructor(reg?: IRegistry<CommandSpec<T>>);
36
+ private _registerBuiltins;
37
+ register(kind: string, spec: CommandSpec<T>, opts?: RegisterOptions): void;
38
+ has(kind: string): boolean;
39
+ rehydrate(dto: CommandDTO): ICommand<T>;
40
+ /** C1: 내부 IRegistry 노출(진단·override 표면 편입용). / C1: expose the inner IRegistry (diagnostics/override surface). */
41
+ get registry(): IRegistry<CommandSpec<T>>;
42
+ }
43
+ export { CellWriteCommand, RowInsertCommand, RowDeleteCommand, CompositeCommand };
@@ -0,0 +1,38 @@
1
+ import { ICommand, CommandDTO } from './ICommand.js';
2
+ /** CommandStack 구성. / CommandStack configuration. */
3
+ export interface CommandStackConfig {
4
+ /** undo 스택 최대 깊이. 기본 200. / Max undo depth. Default 200. */
5
+ capacity?: number;
6
+ /** 인접 coalesce 시간 창(ms). 기본 500. / Adjacency coalesce window (ms). Default 500. */
7
+ coalesceWindowMs?: number;
8
+ /** 시각 소스(테스트 주입). 기본 Date.now. / Time source (test-injectable). Default Date.now. */
9
+ now?: () => number;
10
+ }
11
+ /** undo/redo 이중 스택. / undo/redo double stack. */
12
+ export declare class CommandStack<T = any> {
13
+ private _undo;
14
+ private _redo;
15
+ private _lastPushAt;
16
+ private readonly _cap;
17
+ private readonly _win;
18
+ private readonly _now;
19
+ constructor(cfg?: CommandStackConfig);
20
+ /**
21
+ * 커맨드를 스택에 올린다. 최근 커맨드와 시간 창 내이고 coalesce 가 병합을 반환하면 접는다.
22
+ * 새 엔트리는 redo 스택을 비운다(분기 방지).
23
+ * / Push a command; fold into the top if within the window and its coalesce returns a merge.
24
+ * A new entry clears the redo stack (no branching).
25
+ */
26
+ push(cmd: ICommand<T>): void;
27
+ /** 최근 undo 엔트리를 꺼내 redo 로 옮긴다(호출자가 undo 실행). / Pop the latest undo entry onto redo. */
28
+ popUndo(): ICommand<T> | null;
29
+ /** 최근 redo 엔트리를 꺼내 undo 로 되돌린다(호출자가 do 재실행). / Pop the latest redo entry back onto undo. */
30
+ popRedo(): ICommand<T> | null;
31
+ canUndo(): boolean;
32
+ canRedo(): boolean;
33
+ clear(): void;
34
+ get undoDepth(): number;
35
+ get redoDepth(): number;
36
+ /** undo 이력 영속화용 직렬화(선택). / Serialize the undo history (optional persistence). */
37
+ serializeHistory(): CommandDTO[];
38
+ }
@@ -0,0 +1,110 @@
1
+ /**
2
+ * dirty·부분저장·협업 병합용 변경 지문. 커맨드가 만지는 범위를 데이터로 신고한다.
3
+ * / Change footprint for dirty tracking / partial save / collaboration merge.
4
+ */
5
+ export type CommandFootprint = {
6
+ readonly scope: 'cell';
7
+ readonly rowId: string;
8
+ readonly field: string;
9
+ } | {
10
+ readonly scope: 'row';
11
+ readonly rowIds: readonly string[];
12
+ } | {
13
+ readonly scope: 'range';
14
+ readonly rowIds: readonly string[];
15
+ readonly fields: readonly string[];
16
+ } | {
17
+ readonly scope: 'structure';
18
+ } | {
19
+ readonly scope: 'meta';
20
+ };
21
+ /**
22
+ * 직렬화 커맨드(매크로 스텝·협업 op·감사 레코드 공통). 값·좌표는 stable rowId 로 최소 재구성 정보만.
23
+ * / Serialized command (shared by macro step / collaboration op / audit record).
24
+ */
25
+ export interface CommandDTO {
26
+ readonly kind: string;
27
+ readonly payload: unknown;
28
+ /** 동결 시각(재생 결정론). / Frozen timestamp (replay determinism). */
29
+ readonly at: number;
30
+ /** 협업 actorId(옵션). / Collaboration actor id (optional). */
31
+ readonly actor?: string;
32
+ }
33
+ /**
34
+ * 커맨드가 모델을 만지는 유일한 표면 — 기존 MutationService(mutate→render→emit)를 1:1 위임(회귀 0).
35
+ * DD-09 는 이 파사드로만 위임하며 렌더/emit 내부를 모른다(§2.9).
36
+ * / The only surface a command uses to touch the model — delegates 1:1 to the existing
37
+ * MutationService (mutate→render→emit); DD-09 has no knowledge of render/emit internals.
38
+ */
39
+ export interface MutationServiceFacade<T = any> {
40
+ writeCell(rowIndex: number, field: string, value: unknown): void;
41
+ writeCells(patches: ReadonlyArray<{
42
+ rowIndex: number;
43
+ field: string;
44
+ value: unknown;
45
+ }>): number;
46
+ insertRow(item: Partial<T>, position?: number | 'first' | 'last' | 'before' | 'after'): void;
47
+ deleteRows(indices: readonly number[]): void;
48
+ beginBatch(): void;
49
+ endBatch(): void;
50
+ }
51
+ /**
52
+ * 도메인 좌표 해석(flat index ⇄ stable rowId) + 값/스냅샷 읽기. undo 안정성의 근간(§3.2):
53
+ * 커맨드는 좌표를 rowId 로만 앵커하고 실행 시점에 index 로 해소한다(구조 변경에 안전).
54
+ * / Domain coordinate resolution (flat index ⇄ stable rowId) plus value/snapshot reads.
55
+ */
56
+ export interface CoordResolver {
57
+ rowCount(): number;
58
+ rowIdAt(index: number): string | undefined;
59
+ /** 미존재 → -1. / Absent → -1. */
60
+ indexOf(rowId: string): number;
61
+ getCellValue(rowId: string, field: string): unknown;
62
+ getRowSnapshot(rowId: string): Record<string, unknown> | undefined;
63
+ }
64
+ /** 값 객체 동치성(DD-01 위임) — coalesce/oldValue 비교. / Value-object equality (delegated to DD-01). */
65
+ export interface ValueEquality {
66
+ equals(a: unknown, b: unknown): boolean;
67
+ }
68
+ /** 재생 결정론용 동결 시계(do 시 캡처, undo/replay 는 캡처값 사용). / Frozen clock for replay determinism. */
69
+ export interface FrozenClock {
70
+ now(): number;
71
+ }
72
+ /**
73
+ * 커맨드 실행 문맥 — do/undo 가 받는 협력자 묶음. / Command execution context passed to do/undo.
74
+ */
75
+ export interface ICommandCtx<T = any> {
76
+ readonly mutation: MutationServiceFacade<T>;
77
+ readonly coords: CoordResolver;
78
+ readonly values: ValueEquality;
79
+ readonly clock: FrozenClock;
80
+ }
81
+ /**
82
+ * 모든 모델 변이의 원자. do/undo/coalesce/serialize 4대 계약(§2.1).
83
+ * DD-10 `IExtension` 정합: `kind` 가 확장 식별자(=IExtension.id 역할), `spi` 표식이 확장 계약군 소속을 나타냄.
84
+ * / The atom of every model mutation (do/undo/coalesce/serialize). Aligns with DD-10 IExtension:
85
+ * `kind` acts as the extension id and `spi` marks membership in the extension-contract family.
86
+ */
87
+ export interface ICommand<T = any> {
88
+ /** DD-10 IExtension 정합 표식(SPI). / DD-10 IExtension alignment marker. */
89
+ readonly spi?: 'command';
90
+ /** 안정 커맨드 종류 id(레지스트리 키·직렬화 태그). 예: 'cell.write'. / Stable command-kind id. */
91
+ readonly kind: string;
92
+ /** 사람이 읽는 라벨(undo 메뉴/감사) — i18n 키. / Human-readable label (i18n key). */
93
+ readonly label: string;
94
+ /** 이 커맨드가 만지는 dirty 범위. / Dirty footprint this command touches. */
95
+ readonly footprint: CommandFootprint;
96
+ /** 정방향 적용. 되돌림에 필요한 역정보(inverse)를 do 시점에 포획(불변식 §2). / Apply forward; capture inverse at do-time. */
97
+ do(ctx: ICommandCtx<T>): void;
98
+ /** 역방향 적용. do 가 포획한 inverse 로 관측 상태를 do 직전으로 복원. / Apply inverse to restore pre-do state. */
99
+ undo(ctx: ICommandCtx<T>): void;
100
+ /** 인접 병합(선택). 하나의 undo 단위로 접을 수 있으면 병합 커맨드 반환, 아니면 null. / Optional adjacent coalesce. */
101
+ coalesce?(next: ICommand<T>): ICommand<T> | null;
102
+ /** 직렬화(매크로·감사·협업). schemaVersion 은 봉투의 몫 — 여기선 payload 만. / Serialize (payload only). */
103
+ serialize(): CommandDTO;
104
+ }
105
+ /**
106
+ * 기본 값 동치성 — 참조/Object.is + 값객체 `equals` 존재 시 위임(DD-01). / Default value equality.
107
+ */
108
+ export declare const defaultValueEquality: ValueEquality;
109
+ /** 실제 시스템 시계(비테스트 기본). / Real system clock (default outside tests). */
110
+ export declare const systemClock: FrozenClock;
@@ -0,0 +1,32 @@
1
+ import { ICommand, ICommandCtx, CommandDTO, CommandFootprint } from '../ICommand.js';
2
+ /**
3
+ * 셀 하나에 값을 쓰는 커맨드. `old` 를 주면 이미 포획된 것으로 간주(coalesce 병합 산출물).
4
+ * / Writes a value to a single cell. If `old` is supplied it is treated as already captured
5
+ * (produced by a coalesce merge).
6
+ */
7
+ export declare class CellWriteCommand<T = any> implements ICommand<T> {
8
+ readonly rowId: string;
9
+ readonly field: string;
10
+ readonly newValue: unknown;
11
+ readonly spi: "command";
12
+ readonly kind = "cell.write";
13
+ readonly label = "cmd.cellWrite";
14
+ private _old;
15
+ private _captured;
16
+ private _at;
17
+ constructor(rowId: string, field: string, newValue: unknown, old?: {
18
+ readonly value: unknown;
19
+ });
20
+ get footprint(): CommandFootprint;
21
+ do(ctx: ICommandCtx<T>): void;
22
+ undo(ctx: ICommandCtx<T>): void;
23
+ /**
24
+ * 같은 (rowId,field) CellWrite 면 병합: old 는 '나의 최초 old', new 는 'next 의 new'.
25
+ * undo 하면 최초 old 로 한 번에 복원(불변식 §2).
26
+ * / Merge with a next CellWrite on the same (rowId,field): keep my original old, take next's new.
27
+ */
28
+ coalesce(next: ICommand<T>): ICommand<T> | null;
29
+ serialize(): CommandDTO;
30
+ }
31
+ /** DTO payload → CellWriteCommand(직렬화 복원). / Rehydrate a CellWriteCommand from a DTO payload. */
32
+ export declare function cellWriteFromPayload<T = any>(payload: unknown): CellWriteCommand<T>;
@@ -0,0 +1,17 @@
1
+ import { ICommand, ICommandCtx, CommandDTO, CommandFootprint } from '../ICommand.js';
2
+ /** 여러 커맨드를 단일 undo 단위로 묶는 합성 커맨드. / Composite command folding many commands into one undo unit. */
3
+ export declare class CompositeCommand<T = any> implements ICommand<T> {
4
+ readonly label: string;
5
+ private readonly _children;
6
+ readonly spi: "command";
7
+ readonly kind = "composite";
8
+ private _at;
9
+ constructor(label: string, _children: ReadonlyArray<ICommand<T>>);
10
+ /** 매크로는 구조 변경을 포함할 수 있으므로 보수적으로 structure 로 신고(dirty 안전측). / Conservative structure footprint. */
11
+ get footprint(): CommandFootprint;
12
+ get size(): number;
13
+ get children(): ReadonlyArray<ICommand<T>>;
14
+ do(ctx: ICommandCtx<T>): void;
15
+ undo(ctx: ICommandCtx<T>): void;
16
+ serialize(): CommandDTO;
17
+ }
@@ -0,0 +1,39 @@
1
+ import { ICommand, ICommandCtx, CommandDTO, CommandFootprint } from '../ICommand.js';
2
+ /** 행 하나를 삽입하는 커맨드. undo 는 do 가 부여받은 rowId 로 그 행을 삭제. / Insert a single row. */
3
+ export declare class RowInsertCommand<T = any> implements ICommand<T> {
4
+ readonly item: Partial<T>;
5
+ readonly position: number | 'first' | 'last';
6
+ readonly spi: "command";
7
+ readonly kind = "row.insert";
8
+ readonly label = "cmd.rowInsert";
9
+ private _rowId;
10
+ private _at;
11
+ constructor(item: Partial<T>, position?: number | 'first' | 'last');
12
+ get footprint(): CommandFootprint;
13
+ do(ctx: ICommandCtx<T>): void;
14
+ undo(ctx: ICommandCtx<T>): void;
15
+ serialize(): CommandDTO;
16
+ }
17
+ /** DTO payload → RowInsertCommand. / Rehydrate a RowInsertCommand from a DTO payload. */
18
+ export declare function rowInsertFromPayload<T = any>(payload: unknown): RowInsertCommand<T>;
19
+ /**
20
+ * 하나 이상의 행을 제거하는 커맨드. do 는 삭제 전 rowId·index·스냅샷을 동결, undo 는 원래 index 오름차순으로
21
+ * 스냅샷을 재삽입(각 삽입이 뒤 index 를 밀어 위치 정합).
22
+ * / Deletes one or more rows. do freezes rowId/index/snapshot before removal; undo reinserts by
23
+ * ascending original index (each insert shifts later indices back into place).
24
+ */
25
+ export declare class RowDeleteCommand<T = any> implements ICommand<T> {
26
+ readonly indices: readonly number[];
27
+ readonly spi: "command";
28
+ readonly kind = "row.delete";
29
+ readonly label = "cmd.rowDelete";
30
+ private _removed;
31
+ private _at;
32
+ constructor(indices: readonly number[]);
33
+ get footprint(): CommandFootprint;
34
+ do(ctx: ICommandCtx<T>): void;
35
+ undo(ctx: ICommandCtx<T>): void;
36
+ serialize(): CommandDTO;
37
+ }
38
+ /** DTO payload → RowDeleteCommand(복원). 재삽입 스냅샷을 그대로 싣는다. / Rehydrate a RowDeleteCommand. */
39
+ export declare function rowDeleteFromPayload<T = any>(payload: unknown): RowDeleteCommand<T>;
@@ -0,0 +1,9 @@
1
+ export type { ICommand, ICommandCtx, CommandDTO, CommandFootprint, MutationServiceFacade, CoordResolver, ValueEquality, FrozenClock, } from './ICommand.js';
2
+ export { defaultValueEquality, systemClock } from './ICommand.js';
3
+ export { CommandStack, type CommandStackConfig } from './CommandStack.js';
4
+ export { CommandBus, type CommandBusDeps } from './CommandBus.js';
5
+ export { DefaultAuditLog, DirtyTracker, MutationGuard, type AuditLog, type MutationViolationSink, } from './support.js';
6
+ export { DefaultCommandRegistry, RehydrateError, type CommandRegistry, type CommandSpec, } from './CommandRegistry.js';
7
+ export { CellWriteCommand, cellWriteFromPayload } from './commands/CellWriteCommand.js';
8
+ export { RowInsertCommand, RowDeleteCommand, rowInsertFromPayload, rowDeleteFromPayload, } from './commands/RowCommands.js';
9
+ export { CompositeCommand } from './commands/CompositeCommand.js';
@@ -0,0 +1,51 @@
1
+ import { CommandDTO, CommandFootprint } from './ICommand.js';
2
+ /** 커맨드 스트림 → 감사 로그(협업/디버그/재생). 순수 append. / Command stream → audit log (append-only). */
3
+ export interface AuditLog {
4
+ record(dto: CommandDTO): void;
5
+ /** 리비전(로그 인덱스) 이후 레코드. / Records since a revision (log index). */
6
+ since(rev: number): CommandDTO[];
7
+ all(): CommandDTO[];
8
+ readonly length: number;
9
+ }
10
+ /** 기본 인메모리 감사 로그. / Default in-memory audit log. */
11
+ export declare class DefaultAuditLog implements AuditLog {
12
+ private _log;
13
+ record(dto: CommandDTO): void;
14
+ since(rev: number): CommandDTO[];
15
+ all(): CommandDTO[];
16
+ get length(): number;
17
+ }
18
+ /**
19
+ * 마지막 저장 이후 변경 footprint 집합. RPO/부분저장/저장버튼 활성화 근거.
20
+ * / Set of change footprints since the last save. Basis for RPO / partial save / save-button state.
21
+ */
22
+ export declare class DirtyTracker {
23
+ private _fps;
24
+ private _dirty;
25
+ mark(fp: CommandFootprint): void;
26
+ isDirty(): boolean;
27
+ /** 저장 완료 후 dirty 해제(rev 인자는 MVP 미사용 — 전량 클리어). / Clear dirty after save (rev unused in MVP). */
28
+ clearTo(_rev?: number): void;
29
+ snapshot(): CommandFootprint[];
30
+ }
31
+ /** dev 우회변이 감지 위반 싱크. / Dev bypass-mutation violation sink. */
32
+ export type MutationViolationSink = (op: string) => void;
33
+ /**
34
+ * dev 모드: dispatch 구간 밖에서 모델 변이가 일어나면 경고(불변식 §1 단일 쓰기 경로).
35
+ * enter/leave 로 dispatch 구간을 표시하고, assertInside 로 우회를 감지한다.
36
+ * / Dev mode: warns when a mutation happens outside a dispatch window (invariant §1, single write path).
37
+ */
38
+ export declare class MutationGuard {
39
+ private _depth;
40
+ private readonly _sink;
41
+ private readonly _dev;
42
+ constructor(opts?: {
43
+ onViolation?: MutationViolationSink;
44
+ dev?: boolean;
45
+ });
46
+ enter(): void;
47
+ leave(): void;
48
+ get inside(): boolean;
49
+ /** dispatch 구간 밖에서 호출되면 위반 신고. / Reports a violation if called outside a dispatch window. */
50
+ assertInside(op: string): void;
51
+ }
@@ -0,0 +1,30 @@
1
+ import { Px, LeafColIndex } from './types.js';
2
+ /**
3
+ * 가로 축(리프 컬럼) 메트릭. 부분합으로 O(logN) index↔pixel. 순수 불변.
4
+ * / Horizontal leaf-column metrics; prefix sums for O(logN) index↔pixel. Pure & immutable.
5
+ */
6
+ export declare class ColumnMetrics {
7
+ private readonly _widths;
8
+ private readonly _left;
9
+ private readonly _frozenLeft;
10
+ /**
11
+ * @param widths 표시 리프 순서의 너비(px) / per visible-leaf widths
12
+ * @param frozenLeft 좌측 고정 리프 수 / left-frozen leaf count
13
+ */
14
+ constructor(widths: readonly Px[], frozenLeft: number);
15
+ /** 리프 컬럼 총수. / Total leaf columns. */
16
+ get count(): number;
17
+ /** 전체 콘텐츠 폭. / Total content width. */
18
+ totalWidth(): Px;
19
+ /** 컬럼 좌측 x(부분합). / Column left x (prefix sum). */
20
+ leftOf(col: LeafColIndex): Px;
21
+ /** 컬럼 너비. / Column width. */
22
+ widthOf(col: LeafColIndex): Px;
23
+ /** x → col(이분탐색). / x → col (binary search). */
24
+ colAt(x: Px): LeafColIndex;
25
+ /** 좌측 고정 리프 수. / Left-frozen leaf count. */
26
+ get frozenLeft(): number;
27
+ /** 고정 팬 폭(첫 frozenLeft 합). / Frozen pane width (sum of first frozenLeft). */
28
+ frozenWidth(): Px;
29
+ private _clampCol;
30
+ }
@@ -0,0 +1,88 @@
1
+ import { Px, ViewIndex, LeafColIndex, ModelIndex, IndexRange, CellRect, CellPlacement, PaneId } from './types.js';
2
+ import { RowMetrics } from './RowMetrics.js';
3
+ import { ColumnMetrics } from './ColumnMetrics.js';
4
+ import { ViewPermutation } from './ViewPermutation.js';
5
+ import { FrozenPanes } from './FrozenPanes.js';
6
+ import { NodeBudget } from './NodeBudget.js';
7
+ import { IMergeSource, IWindowingPort } from './ports.js';
8
+ /** 한 프레임의 불변 좌표 스냅샷 — 소비처는 이것만 읽는다. / Immutable per-frame snapshot. */
9
+ export interface CoordinateSnapshot {
10
+ readonly range: IndexRange;
11
+ readonly colRange: {
12
+ start: LeafColIndex;
13
+ end: LeafColIndex;
14
+ };
15
+ readonly offsetY: Px;
16
+ readonly totalHeight: Px;
17
+ readonly totalWidth: Px;
18
+ readonly nodeBudget: {
19
+ estimatedNodes: number;
20
+ withinBudget: boolean;
21
+ };
22
+ readonly clamped: {
23
+ viewport: boolean;
24
+ nodes: boolean;
25
+ };
26
+ }
27
+ /** 커널 조립 의존성. / Kernel assembly dependencies. */
28
+ export interface CoordinateKernelDeps {
29
+ perm: ViewPermutation;
30
+ rows: RowMetrics;
31
+ cols: ColumnMetrics;
32
+ frozen: FrozenPanes;
33
+ merges: IMergeSource;
34
+ budget: NodeBudget;
35
+ /** 세로/가로 윈도 오버스캔(기본 = budget.overscan). / windowing overscan. */
36
+ overscan?: number;
37
+ }
38
+ /**
39
+ * 좌표 변환 전권 SSOT. 순수 함수 커널(전역 미접근).
40
+ * / The coordinate authority. Pure kernel with no global access.
41
+ */
42
+ export declare class CoordinateKernel implements IWindowingPort {
43
+ private readonly perm;
44
+ private readonly rows;
45
+ private readonly cols;
46
+ private readonly frozen;
47
+ private readonly merges;
48
+ private readonly budget;
49
+ private readonly overscan;
50
+ constructor(deps: CoordinateKernelDeps);
51
+ /** v → m. / view → model. */
52
+ toModel(v: ViewIndex): ModelIndex;
53
+ /** m → v(-1 = 소멸). / model → view (-1 if gone). */
54
+ toView(m: ModelIndex): ViewIndex | -1;
55
+ /** 셀 완전 배치 — 소비처 SSOT. / Full cell placement — consumer SSOT. */
56
+ placeCell(view: ViewIndex, col: LeafColIndex): CellPlacement;
57
+ /** 셀 범위 사각형(frozen 경계 넘어도 콘텐츠 좌표 통합 사각형). / Rect covering an inclusive cell range. */
58
+ rectOfRange(a: {
59
+ view: ViewIndex;
60
+ col: LeafColIndex;
61
+ }, b: {
62
+ view: ViewIndex;
63
+ col: LeafColIndex;
64
+ }): CellRect;
65
+ /** 픽셀 → (view,col,pane). 은폐 셀은 앵커로 흡수. / Pixel → cell; hidden cells resolve to anchor. */
66
+ hitTest(x: Px, y: Px): {
67
+ view: ViewIndex;
68
+ col: LeafColIndex;
69
+ pane: PaneId;
70
+ } | null;
71
+ /** 세로 가시 view 범위(overscan 포함, 반열림). / Vertical visible range (overscan, half-open). */
72
+ verticalWindow(scrollTop: Px, viewportH: Px): IndexRange;
73
+ /** 가로 가시 리프 컬럼 범위(overscan 포함, 반열림). / Horizontal visible range. */
74
+ horizontalWindow(scrollLeft: Px, viewportW: Px): {
75
+ start: LeafColIndex;
76
+ end: LeafColIndex;
77
+ };
78
+ /** 뷰포트/노드예산/클램프 일괄 산출. / Compute range + budget + clamp in one shot. */
79
+ snapshot(scroll: {
80
+ top: Px;
81
+ left: Px;
82
+ }, viewport: {
83
+ h: Px;
84
+ w: Px;
85
+ }): CoordinateSnapshot;
86
+ /** 지정 view 가 보이도록 하는 scrollTop(이미 보이면 cur 유지). / scrollTop to reveal a view. */
87
+ scrollTopFor(view: ViewIndex, viewportH: Px, cur: Px): Px;
88
+ }
@@ -0,0 +1,29 @@
1
+ import { Px, ViewIndex, LeafColIndex, PaneId } from './types.js';
2
+ import { RowMetrics } from './RowMetrics.js';
3
+ import { ColumnMetrics } from './ColumnMetrics.js';
4
+ /**
5
+ * 고정 행/열 분할 상태. 순수 불변.
6
+ * / Frozen row/column split. Pure & immutable.
7
+ */
8
+ export declare class FrozenPanes {
9
+ private readonly _rows;
10
+ private readonly _cols;
11
+ /**
12
+ * @param opts.rows 상단 고정 행 수 / top-frozen row count
13
+ * @param opts.cols 좌측 고정 컬럼 수 / left-frozen column count
14
+ */
15
+ constructor(opts: {
16
+ rows: number;
17
+ cols: number;
18
+ });
19
+ /** 상단 고정 행 수. / Top-frozen row count. */
20
+ get rows(): number;
21
+ /** 좌측 고정 컬럼 수. / Left-frozen column count. */
22
+ get cols(): number;
23
+ /** 어느 팬에 속하는가 — view/col 를 팬으로 분류. / Classify (view,col) into a pane. */
24
+ paneOf(view: ViewIndex, col: LeafColIndex): PaneId;
25
+ /** 본문 스크롤에서 제외되는 상단 고정 높이. / Top-frozen height excluded from body scroll. */
26
+ topOffset(rm: RowMetrics): Px;
27
+ /** 본문 스크롤에서 제외되는 좌측 고정 폭. / Left-frozen width excluded from body scroll. */
28
+ leftOffset(cm: ColumnMetrics): Px;
29
+ }
@@ -0,0 +1,18 @@
1
+ import { MergeEngine } from '../MergeEngine.js';
2
+ import { IMergeSource } from './ports.js';
3
+ import { ViewIndex, LeafColIndex } from './types.js';
4
+ /**
5
+ * MergeEngine → IMergeSource 어댑터(내부 무변경). / Adapter wrapping MergeEngine as IMergeSource.
6
+ */
7
+ export declare class MergeSourceAdapter implements IMergeSource {
8
+ private readonly _engine;
9
+ constructor(_engine: MergeEngine);
10
+ getInfo(view: ViewIndex, col: LeafColIndex): {
11
+ rowSpan: number;
12
+ colSpan: number;
13
+ hidden: boolean;
14
+ } | null;
15
+ get isEmpty(): boolean;
16
+ }
17
+ /** 병합이 전혀 없는 빈 소스(균일 fast-path). / Empty merge source (uniform fast-path). */
18
+ export declare const EMPTY_MERGE_SOURCE: IMergeSource;
@@ -0,0 +1,33 @@
1
+ /** 노드 예산 판정 결과. / Node budget evaluation result. */
2
+ export interface NodeBudgetResult {
3
+ readonly estimatedNodes: number;
4
+ readonly withinBudget: boolean;
5
+ /** 예산 초과 시에만 존재 — 세로 윈도 축소 목표 행수. / Present only when over budget. */
6
+ readonly clampedRows?: number;
7
+ }
8
+ /**
9
+ * DOM 라이브 노드 상한 예산 계산기. 순수.
10
+ * / DOM live-node budget calculator. Pure.
11
+ */
12
+ export declare class NodeBudget {
13
+ private readonly _maxNodes;
14
+ private readonly _overscan;
15
+ /**
16
+ * @param opts.maxNodes 라이브 노드 상한(기본 5000) / live-node cap (default 5000)
17
+ * @param opts.overscan 기본 오버스캔(기본 5) / default overscan (default 5)
18
+ */
19
+ constructor(opts?: {
20
+ maxNodes?: number;
21
+ overscan?: number;
22
+ });
23
+ /** 상한(기본 5000). / Node cap. */
24
+ get maxNodes(): number;
25
+ /** 기본 오버스캔. / Default overscan. */
26
+ get overscan(): number;
27
+ /** 가시행수×표시열수+버퍼 → 예산 판정. / Evaluate rows×cols+buffer against the cap. */
28
+ evaluate(input: {
29
+ visibleRows: number;
30
+ visibleCols: number;
31
+ overscanRows: number;
32
+ }): NodeBudgetResult;
33
+ }
@@ -0,0 +1,50 @@
1
+ import { Px } from './types.js';
2
+ /** admit 판정 결과. / Result of an admit decision. */
3
+ export type ResizeDecision = {
4
+ kind: 'apply';
5
+ height: Px;
6
+ width: Px;
7
+ clamped: boolean;
8
+ } | {
9
+ kind: 'ignore';
10
+ reason: 'below-threshold' | 'reentrant' | 'oscillation' | 'coalesced';
11
+ };
12
+ /** governor 통계(회귀 게이트가 pull). / Governor stats (pulled by regression gate). */
13
+ export interface ResizeStats {
14
+ readonly passesThisFrame: number;
15
+ readonly oscillationDetected: boolean;
16
+ readonly lastConvergedInPasses: number;
17
+ }
18
+ /**
19
+ * ResizeObserver 되먹임 차단 계약. 순수 판정(임계값·재진입·진동·클램프).
20
+ * / Guarded governor for resize feedback. Pure decisions (threshold, reentrancy, oscillation, clamp).
21
+ */
22
+ export declare class ResizeGovernor {
23
+ private readonly _minDeltaPx;
24
+ private readonly _maxPassesPerFrame;
25
+ private readonly _fallback;
26
+ private _last;
27
+ private _passesThisFrame;
28
+ private _oscillationDetected;
29
+ private _lastConvergedInPasses;
30
+ private readonly _ring;
31
+ /**
32
+ * @param opts.minDeltaPx 크기 변화 임계값(기본 1px) / size-change threshold
33
+ * @param opts.maxPassesPerFrame 프레임당 재계산 상한(기본 1) / recompute cap per frame
34
+ * @param opts.fallbackViewportHeight 언바운드/0 클램프 목표 / clamp target for unbounded/0
35
+ */
36
+ constructor(opts: {
37
+ minDeltaPx?: Px;
38
+ maxPassesPerFrame?: number;
39
+ fallbackViewportHeight: Px;
40
+ });
41
+ /** 관측 크기 유입 → 반영해도 되는지 판정(진동·재진입 차단). / Admit an observed box. */
42
+ admit(box: {
43
+ height: number;
44
+ width: number;
45
+ }): ResizeDecision;
46
+ /** 프레임 경계 — 재진입/패스 카운터·진동 플래그 리셋. shell 이 rAF 마다 호출. / Frame boundary reset. */
47
+ beginFrame(): void;
48
+ /** 진동 감지·수렴 통계(회귀 게이트가 pull). / Convergence/oscillation stats. */
49
+ stats(): ResizeStats;
50
+ }