open-grid 1.2.1 → 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 (251) hide show
  1. package/CHANGELOG.md +376 -365
  2. package/dist/{OpenGrid-0r_543Kj.cjs → OpenGrid-B7m7ei7f.cjs} +1222 -1029
  3. package/dist/{OpenGrid-HmhGVC2V.js → OpenGrid-CeUdO_fM.js} +1613 -1418
  4. package/dist/index-CeJ-0-80.cjs +260 -0
  5. package/dist/index-DnarQ4eR.js +266 -0
  6. package/dist/index-DrCPRuYi.js +548 -0
  7. package/dist/index-JjfWY3Bt.cjs +520 -0
  8. package/dist/open-grid-base.css +12 -1
  9. package/dist/open-grid-react.cjs +1 -1
  10. package/dist/open-grid-react.js +1 -1
  11. package/dist/open-grid-vue.cjs +7 -7
  12. package/dist/open-grid-vue.js +2 -2
  13. package/dist/open-grid.cjs +1 -1
  14. package/dist/open-grid.js +2 -2
  15. package/dist/types/bench/perf.d.ts +14 -8
  16. package/dist/types/core/AppearanceResolver.d.ts +98 -11
  17. package/dist/types/core/CFRenderBridge.d.ts +13 -0
  18. package/dist/types/core/CellTypeRegistry.d.ts +24 -0
  19. package/dist/types/core/ColumnLayout.d.ts +100 -2
  20. package/dist/types/core/CrossGridMapper.d.ts +43 -5
  21. package/dist/types/core/DataLayer.d.ts +210 -15
  22. package/dist/types/core/DragVisuals.d.ts +33 -4
  23. package/dist/types/core/EventEmitter.d.ts +54 -0
  24. package/dist/types/core/FormulaEngine.d.ts +15 -4
  25. package/dist/types/core/GridRenderer.d.ts +143 -10
  26. package/dist/types/core/GroupEngine.d.ts +68 -10
  27. package/dist/types/core/MathUtils.d.ts +58 -5
  28. package/dist/types/core/MergeEngine.d.ts +45 -10
  29. package/dist/types/core/OGDecimal.d.ts +144 -13
  30. package/dist/types/core/OpenGrid.d.ts +99 -0
  31. package/dist/types/core/PivotEngine.d.ts +37 -0
  32. package/dist/types/core/RowDragDrop.d.ts +52 -6
  33. package/dist/types/core/SkinRegistry.d.ts +4 -0
  34. package/dist/types/core/TreeEngine.d.ts +60 -6
  35. package/dist/types/core/VirtualScroll.d.ts +64 -0
  36. package/dist/types/core/a11y/AccessibilityAdapter.d.ts +103 -0
  37. package/dist/types/core/a11y/AriaIntent.d.ts +34 -0
  38. package/dist/types/core/a11y/KeyboardInteractionModel.d.ts +64 -0
  39. package/dist/types/core/a11y/LiveRegionController.d.ts +89 -0
  40. package/dist/types/core/a11y/OverlayStack.d.ts +36 -0
  41. package/dist/types/core/a11y/VisualEquivRegistry.d.ts +37 -0
  42. package/dist/types/core/a11y/index.d.ts +13 -0
  43. package/dist/types/core/a11y/ports.d.ts +24 -0
  44. package/dist/types/core/appearance/Appearance.d.ts +68 -0
  45. package/dist/types/core/appearance/AppearanceAxis.d.ts +94 -0
  46. package/dist/types/core/appearance/AppearanceComposer.d.ts +45 -0
  47. package/dist/types/core/appearance/AppearanceProvider.d.ts +50 -0
  48. package/dist/types/core/appearance/AppearanceView.d.ts +51 -0
  49. package/dist/types/core/appearance/DensityRegistry.d.ts +36 -0
  50. package/dist/types/core/appearance/ResolvedAppearanceSnapshot.d.ts +84 -0
  51. package/dist/types/core/appearance/TextureRegistry.d.ts +32 -0
  52. package/dist/types/core/appearance/ThemeMetaRegistry.d.ts +67 -0
  53. package/dist/types/core/appearance/axisAdapters.d.ts +37 -0
  54. package/dist/types/core/appearance/defaults.d.ts +10 -0
  55. package/dist/types/core/appearance/index.d.ts +20 -0
  56. package/dist/types/core/appearance/tokenCatalog.d.ts +30 -0
  57. package/dist/types/core/cf/CFEngine.d.ts +56 -0
  58. package/dist/types/core/cf/CFEvaluator.d.ts +24 -0
  59. package/dist/types/core/cf/CFRule.d.ts +127 -0
  60. package/dist/types/core/cf/ColorScale.d.ts +49 -0
  61. package/dist/types/core/cf/InkResolver.d.ts +33 -0
  62. package/dist/types/core/cf/appearance.d.ts +20 -0
  63. package/dist/types/core/cf/encoders.d.ts +61 -0
  64. package/dist/types/core/cf/eval-types.d.ts +93 -0
  65. package/dist/types/core/cf/index.d.ts +21 -0
  66. package/dist/types/core/cf/lineage.d.ts +32 -0
  67. package/dist/types/core/cf/predicates.d.ts +27 -0
  68. package/dist/types/core/cf/serialize.d.ts +46 -0
  69. package/dist/types/core/chart/CanvasAdapter.d.ts +50 -1
  70. package/dist/types/core/chart/DataExtractor.d.ts +53 -12
  71. package/dist/types/core/chart/a11y.d.ts +22 -0
  72. package/dist/types/core/chart/chart-type-registry.d.ts +53 -0
  73. package/dist/types/core/chart/downsample-report.d.ts +36 -0
  74. package/dist/types/core/chart/downsample.d.ts +26 -1
  75. package/dist/types/core/chart/engine/ChartEngineRegistry.d.ts +52 -0
  76. package/dist/types/core/chart/geometry.d.ts +96 -0
  77. package/dist/types/core/chart/hittest.d.ts +21 -3
  78. package/dist/types/core/chart/palette.d.ts +96 -12
  79. package/dist/types/core/chart/parity.d.ts +12 -0
  80. package/dist/types/core/chart/provenance.d.ts +47 -0
  81. package/dist/types/core/chart/scales.d.ts +28 -1
  82. package/dist/types/core/chart/scene.d.ts +102 -0
  83. package/dist/types/core/chart/server.d.ts +36 -0
  84. package/dist/types/core/chart/surfaces/CanvasSurface.d.ts +48 -0
  85. package/dist/types/core/chart/surfaces/ServerRasterSurface.d.ts +26 -0
  86. package/dist/types/core/chart/surfaces/SvgSurface.d.ts +24 -0
  87. package/dist/types/core/chart/surfaces/pattern-overlay.d.ts +24 -0
  88. package/dist/types/core/command/CommandBus.d.ts +51 -0
  89. package/dist/types/core/command/CommandRegistry.d.ts +43 -0
  90. package/dist/types/core/command/CommandStack.d.ts +38 -0
  91. package/dist/types/core/command/ICommand.d.ts +110 -0
  92. package/dist/types/core/command/commands/CellWriteCommand.d.ts +32 -0
  93. package/dist/types/core/command/commands/CompositeCommand.d.ts +17 -0
  94. package/dist/types/core/command/commands/RowCommands.d.ts +39 -0
  95. package/dist/types/core/command/index.d.ts +9 -0
  96. package/dist/types/core/command/support.d.ts +51 -0
  97. package/dist/types/core/coordinate/ColumnMetrics.d.ts +30 -0
  98. package/dist/types/core/coordinate/CoordinateKernel.d.ts +88 -0
  99. package/dist/types/core/coordinate/FrozenPanes.d.ts +29 -0
  100. package/dist/types/core/coordinate/MergeSourceAdapter.d.ts +18 -0
  101. package/dist/types/core/coordinate/NodeBudget.d.ts +33 -0
  102. package/dist/types/core/coordinate/ResizeGovernor.d.ts +50 -0
  103. package/dist/types/core/coordinate/RowMetrics.d.ts +37 -0
  104. package/dist/types/core/coordinate/ViewPermutation.d.ts +23 -0
  105. package/dist/types/core/coordinate/index.d.ts +10 -0
  106. package/dist/types/core/coordinate/ports.d.ts +45 -0
  107. package/dist/types/core/coordinate/types.d.ts +76 -0
  108. package/dist/types/core/detail/DetailGlyph.d.ts +42 -7
  109. package/dist/types/core/detail/DetailSplice.d.ts +42 -11
  110. package/dist/types/core/detail/DetailState.d.ts +80 -11
  111. package/dist/types/core/detail/SubgridCache.d.ts +72 -10
  112. package/dist/types/core/detail/index.d.ts +8 -0
  113. package/dist/types/core/domain/AggregateResult.d.ts +54 -0
  114. package/dist/types/core/domain/CellAddress.d.ts +61 -0
  115. package/dist/types/core/domain/CellValueAccess.d.ts +29 -0
  116. package/dist/types/core/domain/Delta.d.ts +37 -0
  117. package/dist/types/core/domain/DomainValue.d.ts +80 -0
  118. package/dist/types/core/domain/Missing.d.ts +65 -0
  119. package/dist/types/core/domain/Money.d.ts +42 -0
  120. package/dist/types/core/domain/NormalizationBasis.d.ts +47 -0
  121. package/dist/types/core/domain/Plain.d.ts +45 -0
  122. package/dist/types/core/domain/Quantity.d.ts +32 -0
  123. package/dist/types/core/domain/Ratios.d.ts +100 -0
  124. package/dist/types/core/domain/ThresholdSet.d.ts +46 -0
  125. package/dist/types/core/domain/ValueType.d.ts +71 -0
  126. package/dist/types/core/domain/rounding.d.ts +25 -0
  127. package/dist/types/core/domain/strategies.d.ts +38 -0
  128. package/dist/types/core/editors/DateEditor.d.ts +18 -0
  129. package/dist/types/core/editors/SelectEditor.d.ts +29 -0
  130. package/dist/types/core/export/ChannelRegistry.d.ts +18 -0
  131. package/dist/types/core/export/ExportManifest.d.ts +13 -0
  132. package/dist/types/core/export/GridArtifactSource.d.ts +62 -0
  133. package/dist/types/core/export/Provenance.d.ts +34 -0
  134. package/dist/types/core/export/StreamPump.d.ts +28 -0
  135. package/dist/types/core/export/channels/CsvChannel.d.ts +20 -0
  136. package/dist/types/core/export/channels/JsonChannel.d.ts +18 -0
  137. package/dist/types/core/export/channels/XlsxChannel.d.ts +53 -0
  138. package/dist/types/core/export/channels/XmlChannel.d.ts +21 -0
  139. package/dist/types/core/export/channels/capabilities.d.ts +13 -0
  140. package/dist/types/core/export/index.d.ts +24 -0
  141. package/dist/types/core/export/print/OutputChannelAdapter.d.ts +61 -0
  142. package/dist/types/core/export/print/Paginator.d.ts +48 -0
  143. package/dist/types/core/export/print/PrintRenderTarget.d.ts +36 -0
  144. package/dist/types/core/export/sinks.d.ts +40 -0
  145. package/dist/types/core/export/types.d.ts +211 -0
  146. package/dist/types/core/extension/DeprecationManager.d.ts +42 -0
  147. package/dist/types/core/extension/IExtension.d.ts +90 -0
  148. package/dist/types/core/extension/Registry.d.ts +142 -0
  149. package/dist/types/core/extension/SlotRegistry.d.ts +46 -0
  150. package/dist/types/core/extension/adapters.d.ts +44 -0
  151. package/dist/types/core/extension/conformance.d.ts +47 -0
  152. package/dist/types/core/extension/index.d.ts +16 -0
  153. package/dist/types/core/extension/registries.d.ts +31 -0
  154. package/dist/types/core/extension/reserved.d.ts +10 -0
  155. package/dist/types/core/format/DisplayFormatter.d.ts +47 -0
  156. package/dist/types/core/format/FormatCache.d.ts +20 -0
  157. package/dist/types/core/format/FormatterRegistry.d.ts +22 -0
  158. package/dist/types/core/format/grammar/AstRenderer.d.ts +10 -0
  159. package/dist/types/core/format/grammar/FormatCompiler.d.ts +16 -0
  160. package/dist/types/core/format/index.d.ts +55 -0
  161. package/dist/types/core/format/pipeline/DomainTypeResolver.d.ts +8 -0
  162. package/dist/types/core/format/pipeline/LocaleFormat.d.ts +11 -0
  163. package/dist/types/core/format/pipeline/ValueInterpreter.d.ts +8 -0
  164. package/dist/types/core/format/policy/MaskPolicy.d.ts +8 -0
  165. package/dist/types/core/format/policy/NegativePolicy.d.ts +12 -0
  166. package/dist/types/core/format/policy/NullPolicy.d.ts +10 -0
  167. package/dist/types/core/format/policy/TruncatePolicy.d.ts +11 -0
  168. package/dist/types/core/format/types.d.ts +292 -0
  169. package/dist/types/core/formula/CalcCacheStore.d.ts +89 -0
  170. package/dist/types/core/formula/CalcProvenance.d.ts +44 -0
  171. package/dist/types/core/formula/CalcService.d.ts +137 -0
  172. package/dist/types/core/formula/CyclePathReporter.d.ts +28 -0
  173. package/dist/types/core/formula/FormulaEvaluator.d.ts +35 -1
  174. package/dist/types/core/formula/FormulaGraph.d.ts +84 -7
  175. package/dist/types/core/formula/FormulaParser.d.ts +9 -0
  176. package/dist/types/core/formula/FormulaStore.d.ts +63 -1
  177. package/dist/types/core/formula/FunctionRegistry.d.ts +138 -0
  178. package/dist/types/core/formula/Generation.d.ts +86 -0
  179. package/dist/types/core/formula/RecalcCoordinator.d.ts +151 -9
  180. package/dist/types/core/formula/ReferenceRewriter.d.ts +81 -0
  181. package/dist/types/core/formula/functions/essential.d.ts +3 -0
  182. package/dist/types/core/formula/functions/extended/index.d.ts +10 -0
  183. package/dist/types/core/formula/normalizeRefs.d.ts +34 -3
  184. package/dist/types/core/formula/numericLiteral.d.ts +11 -1
  185. package/dist/types/core/formula/serializeFormula.d.ts +10 -1
  186. package/dist/types/core/host/CapabilityRegistry.d.ts +61 -0
  187. package/dist/types/core/host/GridHostDriver.d.ts +27 -0
  188. package/dist/types/core/host/GridHostPort.d.ts +37 -0
  189. package/dist/types/core/host/SliceOwnershipGuard.d.ts +27 -0
  190. package/dist/types/core/host/archCheck.d.ts +26 -0
  191. package/dist/types/core/host/index.d.ts +6 -0
  192. package/dist/types/core/host/reconcile.d.ts +22 -0
  193. package/dist/types/core/i18n/LocaleContext.d.ts +40 -0
  194. package/dist/types/core/i18n/types.d.ts +26 -1
  195. package/dist/types/core/icons/bootstrap-icons.d.ts +4 -2
  196. package/dist/types/core/quality/ContrastAuditor.d.ts +64 -0
  197. package/dist/types/core/quality/DeterminismKernel.d.ts +68 -0
  198. package/dist/types/core/quality/PerfBaseline.d.ts +23 -0
  199. package/dist/types/core/quality/PerfSpec.d.ts +95 -0
  200. package/dist/types/core/quality/RealBrowserGate.d.ts +69 -0
  201. package/dist/types/core/quality/RegressionJudge.d.ts +35 -0
  202. package/dist/types/core/quality/ReleaseGate.d.ts +94 -0
  203. package/dist/types/core/quality/VisualRegression.d.ts +74 -0
  204. package/dist/types/core/quality/hooks.d.ts +53 -0
  205. package/dist/types/core/quality/index.d.ts +20 -0
  206. package/dist/types/core/quality/pixelMetrics.d.ts +24 -0
  207. package/dist/types/core/range/ClipboardCodec.d.ts +46 -4
  208. package/dist/types/core/range/FillEngine.d.ts +69 -9
  209. package/dist/types/core/range/RangeModel.d.ts +100 -13
  210. package/dist/types/core/range/types.d.ts +27 -11
  211. package/dist/types/core/realtime/BackpressureScheduler.d.ts +0 -0
  212. package/dist/types/core/realtime/FreshnessClock.d.ts +34 -0
  213. package/dist/types/core/realtime/IRealtimeSource.d.ts +82 -0
  214. package/dist/types/core/realtime/LiveStateGuard.d.ts +23 -0
  215. package/dist/types/core/realtime/PollingSource.d.ts +42 -0
  216. package/dist/types/core/realtime/RealtimeController.d.ts +54 -0
  217. package/dist/types/core/realtime/RtAnnouncePolicy.d.ts +53 -0
  218. package/dist/types/core/realtime/RtApplyCommand.d.ts +29 -0
  219. package/dist/types/core/realtime/RtChartTargetTrigger.d.ts +26 -0
  220. package/dist/types/core/realtime/StreamingSource.d.ts +47 -0
  221. package/dist/types/core/realtime/backoff.d.ts +12 -0
  222. package/dist/types/core/realtime/index.d.ts +13 -0
  223. package/dist/types/core/realtime/ports.d.ts +80 -0
  224. package/dist/types/core/render/CellApplier.d.ts +18 -0
  225. package/dist/types/core/render/CellErrorBoundary.d.ts +65 -0
  226. package/dist/types/core/render/CellPipeline.d.ts +39 -0
  227. package/dist/types/core/render/CellRenderRequest.d.ts +209 -0
  228. package/dist/types/core/render/CellStageRegistry.d.ts +53 -0
  229. package/dist/types/core/render/OverlayCompositor.d.ts +38 -0
  230. package/dist/types/core/render/RenderBudget.d.ts +67 -0
  231. package/dist/types/core/render/contrast.d.ts +33 -0
  232. package/dist/types/core/render/index.d.ts +35 -0
  233. package/dist/types/core/render/stages/BackgroundStage.d.ts +14 -0
  234. package/dist/types/core/render/stages/DecoratorStage.d.ts +12 -0
  235. package/dist/types/core/render/stages/OverlayStage.d.ts +12 -0
  236. package/dist/types/core/render/stages/ValueRendererStage.d.ts +15 -0
  237. package/dist/types/core/render/stages/index.d.ts +14 -0
  238. package/dist/types/core/state/AutosaveController.d.ts +63 -0
  239. package/dist/types/core/state/IStatePersistence.d.ts +59 -0
  240. package/dist/types/core/state/MultiTabGuard.d.ts +33 -0
  241. package/dist/types/core/state/SchemaMigrator.d.ts +33 -0
  242. package/dist/types/core/state/SemVerPolicy.d.ts +39 -0
  243. package/dist/types/core/state/StateCodec.d.ts +75 -0
  244. package/dist/types/core/state/index.d.ts +6 -0
  245. package/dist/types/core/types.d.ts +17 -0
  246. package/dist/types/react/OpenGrid.d.ts +54 -0
  247. package/dist/types/react/index.d.ts +5 -0
  248. package/dist/types/realtime/index.d.ts +1 -0
  249. package/dist/types/vue/index.d.ts +5 -0
  250. package/dist/types/vue/types.d.ts +35 -0
  251. package/package.json +112 -111
@@ -0,0 +1,40 @@
1
+ import { IByteSink } from './types.js';
2
+ /**
3
+ * 메모리 버퍼 싱크(헤드리스 테스트). desiredSize 는 highWaterMark - 누적바이트.
4
+ * / In-memory buffer sink (headless tests); desiredSize = highWaterMark − buffered bytes.
5
+ */
6
+ export declare class MemoryByteSink implements IByteSink {
7
+ private readonly _highWaterMark;
8
+ private readonly _chunks;
9
+ private _bytes;
10
+ private _closed;
11
+ private _aborted;
12
+ private _abortReason?;
13
+ constructor(_highWaterMark?: number);
14
+ write(chunk: Uint8Array | string): Promise<void>;
15
+ close(): Promise<void>;
16
+ abort(reason?: string): void;
17
+ get desiredSize(): number;
18
+ /** 누적 문자열(문자열 청크 결합). / Concatenated string of written chunks. */
19
+ toString(): string;
20
+ get bytesWritten(): number;
21
+ get closed(): boolean;
22
+ get aborted(): boolean;
23
+ get abortReason(): string | undefined;
24
+ }
25
+ /**
26
+ * 다운로드 유틸 싱크 어댑터(소규모/폴백 경로). 주입된 download 콜백으로 전량 위임.
27
+ * / Download-util sink adapter (small/fallback path); delegates the whole payload to a callback.
28
+ */
29
+ export declare class DownloadByteSink implements IByteSink {
30
+ private readonly _download;
31
+ private readonly _highWaterMark;
32
+ private _buf;
33
+ private _bytes;
34
+ private _closed;
35
+ constructor(_download: (payload: string) => void, _highWaterMark?: number);
36
+ write(chunk: Uint8Array | string): Promise<void>;
37
+ close(): Promise<void>;
38
+ abort(): void;
39
+ get desiredSize(): number;
40
+ }
@@ -0,0 +1,211 @@
1
+ import { Sign, StageId, DomainKind } from '../format/types.js';
2
+ import { VisualSpec } from '../cf/encoders.js';
3
+ import { LocaleMeta } from '../i18n/types.js';
4
+ /** 직렬화 채널 식별자. / Serialization channel id. */
5
+ export type ChannelId = 'csv' | 'xlsx' | 'json' | 'xml' | 'pdf' | 'html' | 'print';
6
+ /** 데이터 상태 — 빈/로딩/에러 시 출력 처우 판정(REQ-T9-846). / Data state for output disposition. */
7
+ export type DataState = 'ready' | 'loading' | 'error' | 'empty';
8
+ /** 셀 정렬. / Cell alignment. */
9
+ export type CellAlign = 'left' | 'right' | 'center';
10
+ /**
11
+ * 채널 중립 셀 아티팩트(§2.1). DD-04 FormatResult + DD-05 VisualSpec + DD-02 CellPlacement 합성 =
12
+ * 화면 렌더러(DD-03)가 소비하는 RenderModel 과 '동일 계보'. 불변. export/인쇄는 이 객체만 직렬화한다.
13
+ * / Channel-neutral cell artifact; the same lineage the on-screen renderer consumes. Immutable.
14
+ */
15
+ export interface CellArtifact {
16
+ /** 화면 표시 문자열(마스킹·축약·부호 적용 후) = DisplayFormatter.format(...).text. / Display string. */
17
+ readonly text: string;
18
+ /** 축약/마스킹 원값(CSV '값 보존'·xlsx 원값 셀). / Preserved raw value under abbrev/mask. */
19
+ readonly rawText?: string;
20
+ /** 낭독 대체(인쇄 대체텍스트·PDF/UA 태깅). / Accessible alt text. */
21
+ readonly aria?: string;
22
+ /** 부호 클래스. / Sign class. */
23
+ readonly sign?: Sign;
24
+ /** DD-04 provenance(어느 단계가 걸렸나). / Applied pipeline stages. */
25
+ readonly applied: ReadonlyArray<StageId>;
26
+ /** DD-05 소유 VisualSpec(있을 때만). 재선언 금지 — import 소비만. / DD-05 VisualSpec (consume-only). */
27
+ readonly cf?: VisualSpec;
28
+ /** DD-04 색코드([Red] 등) — 형태/부호 병기로만 소비(색 단독 금지). / AST color hint (never color-alone). */
29
+ readonly colorHint?: string;
30
+ /** 병합 세로 스팬. / Merge row-span. */
31
+ readonly rowSpan: number;
32
+ /** 병합 가로 스팬. / Merge col-span. */
33
+ readonly colSpan: number;
34
+ /** 병합에 삼켜진 셀(직렬화 생략). / Swallowed by a merge (skip serialization). */
35
+ readonly hidden: boolean;
36
+ /** 정렬. / Alignment. */
37
+ readonly align: CellAlign;
38
+ /** 채널별 셀 타입 매핑용(xlsx number vs string). / Domain kind for per-channel typing. */
39
+ readonly type: DomainKind;
40
+ }
41
+ /** 한 논리 행의 아티팩트. 화면 밖 행도 동일 구조(전량 순회, REQ-T3-805). / One logical row's artifact. */
42
+ export interface RowArtifact {
43
+ /** 정렬/필터 후 논리 순서 index. / Logical index after sort/filter. */
44
+ readonly modelIndex: number;
45
+ /** visibleLeaves 순서, exceptFields 제외 반영. / Cells in visible-leaf order. */
46
+ readonly cells: ReadonlyArray<CellArtifact>;
47
+ /** 마스터/디테일·소계행 구분. / Master/detail / subtotal row kind. */
48
+ readonly rowState?: 'normal' | 'group' | 'summary' | 'detail';
49
+ /** 그룹 들여쓰기 깊이. / Group indent depth. */
50
+ readonly depth?: number;
51
+ }
52
+ /** 컬럼 헤더 아티팩트(다단 헤더·병합 반영). / Column header artifact. */
53
+ export interface HeaderArtifact {
54
+ readonly text: string;
55
+ readonly field: string;
56
+ readonly colSpan: number;
57
+ readonly rowSpan: number;
58
+ readonly widthPx: number;
59
+ readonly align: CellAlign;
60
+ }
61
+ /** 반열림 행 범위 [start,end). / Half-open row range. */
62
+ export interface RowRange {
63
+ readonly start: number;
64
+ readonly end: number;
65
+ }
66
+ /** 청크(청크 단위 async 스트림 단위). / Streaming chunk unit. */
67
+ export interface RowChunk {
68
+ readonly rows: ReadonlyArray<RowArtifact>;
69
+ readonly done: boolean;
70
+ }
71
+ /** 투영 옵션(§2.2). / Projection options. */
72
+ export interface ProjectOptions {
73
+ /** 미지정 = 전 모델행. / Undefined = all model rows. */
74
+ readonly range?: RowRange;
75
+ /** 제외 필드. / Excluded fields. */
76
+ readonly exceptFields?: ReadonlyArray<string>;
77
+ /** DD-04 마스킹 단계 포함 여부 지시(재구현 아님). / Whether the mask stage is applied upstream. */
78
+ readonly maskOnExport?: boolean;
79
+ /** cf 시각 계층 투영 여부(CSV=false, PDF=true 기본). / Whether to project the cf visual layer. */
80
+ readonly includeCF?: boolean;
81
+ /** 스트리밍 청크 행수. / Chunk row count for streaming. */
82
+ readonly chunkSize?: number;
83
+ }
84
+ /**
85
+ * export/인쇄가 화면과 '같은 파이프라인'에서 파생됨을 강제하는 단일 포트(§2.2, REQ-T3-803).
86
+ * 채널이 raw 를 볼 방법 자체가 API 에 없다 = WYSIWYG 불변식의 강제 장치.
87
+ * / The single port forcing export/print to derive from the same pipeline as the screen.
88
+ */
89
+ export interface IArtifactSource {
90
+ /** 헤더 투영(병합 반영). / Header projection (merges reflected). */
91
+ projectHeader(opts?: ProjectOptions): ReadonlyArray<ReadonlyArray<HeaderArtifact>>;
92
+ /** 전 모델행(또는 지정 범위)을 청크 단위 async 스트림으로 투영. / Project all model rows as an async stream. */
93
+ projectRows(opts?: ProjectOptions): AsyncIterable<RowChunk>;
94
+ /** 전체 행수(진행률 분모). / Total rows (progress denominator). */
95
+ totalRows(range?: RowRange): number;
96
+ /** 데이터 상태 — 빈/로딩/에러 처우(REQ-T9-846). / Data state for output disposition. */
97
+ dataState(): DataState;
98
+ }
99
+ /**
100
+ * 바이트 소비처(백프레셔의 소비 측, §2.4). 반환 Promise 로 생산자를 눌러 OOM 방지(REQ-T9-810).
101
+ * / Byte sink (consumer side of backpressure); its Promise throttles the producer to avoid OOM.
102
+ */
103
+ export interface IByteSink {
104
+ /** 청크 소비. 버퍼가 highWaterMark 초과면 drain 될 때까지 지연된 Promise. / Consume a chunk. */
105
+ write(chunk: Uint8Array | string): Promise<void>;
106
+ close(): Promise<void>;
107
+ abort(reason?: string): void;
108
+ /** 남은 버퍼 여유(음수면 생산 일시정지 신호). / Remaining buffer headroom (negative ⇒ pause). */
109
+ readonly desiredSize: number;
110
+ }
111
+ /** 채널 × 상태항목 포함/제외 선언 — 손실 고지의 SSOT(REQ-T3-804). / Channel capability matrix (loss SSOT). */
112
+ export interface ChannelCapabilities {
113
+ readonly merges: boolean;
114
+ readonly frozen: boolean;
115
+ readonly colWidths: boolean;
116
+ readonly cf: boolean;
117
+ readonly filters: boolean;
118
+ readonly sort: boolean;
119
+ readonly hiddenCols: boolean;
120
+ readonly groupCollapse: boolean;
121
+ readonly charts: boolean;
122
+ readonly styling: boolean;
123
+ readonly provenance: boolean;
124
+ }
125
+ /** 현 그리드에서 활성인 상태 플래그(손실 판정 입력). / Active state flags for loss computation. */
126
+ export interface ActiveStateFlags {
127
+ readonly merges?: boolean;
128
+ readonly frozen?: boolean;
129
+ readonly colWidths?: boolean;
130
+ readonly cf?: boolean;
131
+ readonly filters?: boolean;
132
+ readonly sort?: boolean;
133
+ readonly hiddenCols?: boolean;
134
+ readonly groupCollapse?: boolean;
135
+ readonly charts?: boolean;
136
+ readonly styling?: boolean;
137
+ }
138
+ /** 손실 항목 고지 레코드. / A single declared state loss. */
139
+ export interface StateLoss {
140
+ readonly item: string;
141
+ readonly reason: string;
142
+ }
143
+ /** 채널×상태항목 포함/제외 매트릭스(UI/문서용). / Channel×state inclusion matrix. */
144
+ export interface ChannelStateMatrix {
145
+ readonly channels: ReadonlyArray<ChannelId>;
146
+ readonly items: ReadonlyArray<string>;
147
+ readonly cells: Readonly<Record<string, Readonly<Record<string, boolean>>>>;
148
+ }
149
+ /** 실행 컨텍스트(§2.4). / Export run context. */
150
+ export interface ExportRunCtx {
151
+ /** 취소 신호. / Cancellation signal. */
152
+ readonly signal?: AbortSignal;
153
+ /** 진행률(청크마다). / Progress (per chunk). */
154
+ onProgress?: (done: number, total: number) => void;
155
+ /** 변환 provenance(산출물 동행). / Transform provenance (travels to the artifact). */
156
+ readonly provenance?: IArtifactProvenance;
157
+ /** 인쇄 lang·날짜·Excel 폰트 — DD-12 소유 LocaleMeta import(재선언 금지). / Locale meta (DD-12). */
158
+ readonly locale?: LocaleMeta;
159
+ /** 이 실행의 손실 항목 스냅샷. / This run's declared losses. */
160
+ readonly losses?: ReadonlyArray<StateLoss>;
161
+ }
162
+ /** 채널 실행 결과. / Channel run result. */
163
+ export interface ExportResult {
164
+ readonly bytesWritten: number;
165
+ readonly rowsWritten: number;
166
+ readonly aborted: boolean;
167
+ }
168
+ /**
169
+ * 채널 직렬화 전략(Strategy, §2.4). 모든 포맷이 동일 계약 — 소스·싱크는 주입, 채널은 매핑만.
170
+ * / Channel serialization strategy; source/sink injected, the channel only maps.
171
+ */
172
+ export interface IExportChannel {
173
+ readonly id: ChannelId;
174
+ /** 이 채널이 표현 가능한 상태항목(매니페스트 SSOT). / Representable state items (manifest SSOT). */
175
+ readonly capabilities: ChannelCapabilities;
176
+ /** 아티팩트 스트림 → 바이트. 청크마다 sink.write 를 await(백프레셔). / Artifact stream → bytes. */
177
+ write(source: IArtifactSource, sink: IByteSink, ctx?: ExportRunCtx): Promise<ExportResult>;
178
+ }
179
+ /** 파이프라인 변환 고지 레코드(REQ-T6-811). / Pipeline transform disclosure record. */
180
+ export interface TransformProvenance {
181
+ readonly source: 'format' | 'cf' | 'chart';
182
+ readonly kind: 'downsample' | 'aggregate' | 'normalize' | 'log' | 'truncatedAxis' | 'mask' | 'abbreviate' | 'clamp';
183
+ readonly detail: string;
184
+ readonly affected?: {
185
+ rows?: number;
186
+ cols?: ReadonlyArray<string>;
187
+ };
188
+ }
189
+ /** 무결성 배지(흑백 생존 픽토 병기). / Integrity badge (monochrome-surviving glyph). */
190
+ export interface ProvenanceBadge {
191
+ readonly code: string;
192
+ readonly label: string;
193
+ readonly monochromeGlyph: string;
194
+ }
195
+ /** 채널별 provenance 렌더 산출(꼬리말/시트메모/주석행/푸터). / Channel-rendered provenance block. */
196
+ export interface ProvenanceBlock {
197
+ readonly channel: ChannelId;
198
+ /** 채널 표현 문자열(CSV 주석행·PDF 꼬리말·print 푸터 등). / Channel representation string. */
199
+ readonly text: string;
200
+ /** 배지(흑백 픽토 포함). / Badges. */
201
+ readonly badges: ReadonlyArray<ProvenanceBadge>;
202
+ }
203
+ /** 산출물 단위 provenance 집계 포트(§2.3). / Per-artifact provenance aggregate port. */
204
+ export interface IArtifactProvenance {
205
+ readonly transforms: ReadonlyArray<TransformProvenance>;
206
+ readonly badges: ReadonlyArray<ProvenanceBadge>;
207
+ readonly generatedAt: number;
208
+ readonly rangeNote: string;
209
+ /** 배지/캡션을 채널 표현으로 렌더. / Render badges/caption for a channel. */
210
+ render(channel: ChannelId): ProvenanceBlock;
211
+ }
@@ -0,0 +1,42 @@
1
+ import { DeprecationInfo } from './Registry.js';
2
+ /** 매니페스트 1건 — 폐기 정보 + 식별자. / One manifest record — deprecation info + id. */
3
+ export interface DeprecationRecord extends DeprecationInfo {
4
+ readonly id: string;
5
+ }
6
+ /**
7
+ * 폐기 경고 dedup + 매니페스트 + removeIn 게이트.
8
+ * / Deprecation warning dedup + manifest + removeIn gate.
9
+ *
10
+ * @example
11
+ * const dm = new DeprecationManager();
12
+ * dm.warn('defineSkin', { since: '2.1', removeIn: '3.0', replacement: 'registerSkin' });
13
+ * dm.warn('defineSkin', { since: '2.1', removeIn: '3.0' }); // dedup — no second warning
14
+ * dm.gateRemoval('defineSkin', '2.9'); // 'blocked' (removeIn 3.0 이전)
15
+ */
16
+ export declare class DeprecationManager {
17
+ private _warned;
18
+ private _records;
19
+ private readonly _sink;
20
+ constructor(sink?: (msg: string) => void);
21
+ /**
22
+ * 폐기 경고 방출 — 동일 id 반복 시 1회만(dedup). 매니페스트에 기록.
23
+ * / Emit a deprecation warning — once per id (dedup). Also records for the manifest.
24
+ *
25
+ * @param id - 폐기 대상 식별자(API/키 이름) / Deprecated identifier (API/key name)
26
+ * @param info - 폐기 정보(since/removeIn/replacement) / Deprecation info
27
+ */
28
+ warn(id: string, info: DeprecationInfo): void;
29
+ /** 경고 없이 매니페스트에만 기록(빌드타임 등록). / Record for the manifest without emitting a warning. */
30
+ private _record;
31
+ /** 빌드가 JSON 으로 산출하는 기계판독 매니페스트. / Machine-readable manifest the build emits as JSON. */
32
+ manifest(): DeprecationRecord[];
33
+ /**
34
+ * removeIn 이전 제거 차단(CI 게이트, UC-7). currentVersion < removeIn → 'blocked'.
35
+ * / Block removal before removeIn (CI gate). currentVersion < removeIn → 'blocked'.
36
+ *
37
+ * @param id - 폐기 대상 식별자 / Deprecated identifier
38
+ * @param currentVersion - 제거를 시도하는 현재 버전 / Current version attempting removal
39
+ * @returns 미등록/유예창 경과 시 'ok', 유예창 내 제거는 'blocked' / 'ok' if allowed, 'blocked' if premature
40
+ */
41
+ gateRemoval(id: string, currentVersion: string): 'ok' | 'blocked';
42
+ }
@@ -0,0 +1,90 @@
1
+ /**
2
+ * 모든 확장 구현이 상속하는 최소 계약(생명주기·격리·직렬화 정합의 근원). DD-10 정본.
3
+ * / The minimal contract inherited by every extension implementation. DD-10 canonical.
4
+ *
5
+ * 소유 DD 는 자기 정본 인터페이스가 `extends IExtension` 하도록 보강한다(재선언 아님, §2.5).
6
+ */
7
+ export interface IExtension {
8
+ /** SPI 식별·버전 태그. 예: 'ICellRenderer@2'. / SPI identity/version tag, e.g. 'ICellRenderer@2'. */
9
+ readonly spi: string;
10
+ /** 코어 자원 획득(옵션). 실패 격리 대상. / Acquire core resources (optional). Isolated on failure. */
11
+ activate?(ctx?: unknown): void;
12
+ /** register 로 획득한 자원의 대칭 해제. / Symmetric release of resources acquired at register. */
13
+ dispose?(): void;
14
+ }
15
+ /** 검증 결과. / Validation result. */
16
+ export interface ValResult {
17
+ readonly ok: boolean;
18
+ /** 실패 사유(있으면). / Failure message (if any). */
19
+ readonly message?: string;
20
+ }
21
+ /**
22
+ * IValidator — 타 DD 미소유. DD-10 이 내용까지 소유하는 유일한 SPI(§2.5).
23
+ * 수식 기반 검증은 DD-08 CalcService 재사용(중복 평가엔진 금지, §1.2).
24
+ * / IValidator — not owned by any other DD; the sole SPI DD-10 owns in full.
25
+ */
26
+ export interface IValidator extends IExtension {
27
+ validate(value: unknown, ctx?: unknown): ValResult | Promise<ValResult>;
28
+ }
29
+ /**
30
+ * 런타임 능력 질의(§2.8). 확장이 "이 빌드가 이걸 지원하나" 코드로 질의.
31
+ * / Runtime capability queries. Extensions ask, in code, whether a build supports something.
32
+ */
33
+ export interface CoreCapabilities {
34
+ /** capability 토큰 보유 여부. / Whether a capability token is present. */
35
+ has(token: string): boolean;
36
+ /** SPI 이름 → 현재 버전(미제공 시 undefined). / SPI name → current version (undefined if absent). */
37
+ spiVersion(spi: string): string | undefined;
38
+ /** 코어 버전이 minCore 하한을 만족하는가. / Whether the core version satisfies a minCore floor. */
39
+ satisfies(minCore: string): boolean;
40
+ }
41
+ /** 확장이 선언하는 peer 계약 — 로드 시 코어가 검증(부적합 안전 거부, §2.5). / Peer contract an extension declares. */
42
+ export interface ExtensionPeer {
43
+ /** semver 하한. / semver floor. */
44
+ readonly minCore: string;
45
+ /** 대상 SPI@major. 예: 'IChartRenderer@3'. / Target SPI@major, e.g. 'IChartRenderer@3'. */
46
+ readonly spi: string;
47
+ /** 요구 capability 토큰. / Required capability tokens. */
48
+ readonly requires?: string[];
49
+ }
50
+ /** peer 검증 판정. / Peer verification verdict. */
51
+ export interface PeerVerdict {
52
+ readonly ok: boolean;
53
+ /** 거부 사유(고지). / Rejection reason (disclosed). */
54
+ readonly reason?: string;
55
+ }
56
+ /** 두 semver 문자열 비교: a<b→-1, a==b→0, a>b→1(수치 세그먼트). / Compare two semver strings by numeric segments. */
57
+ export declare function compareSemver(a: string, b: string): number;
58
+ /**
59
+ * 확장 로드 시 peer 검증(안전 거부, UC-6). minCore 미달·SPI major 불일치·capability 미보유는
60
+ * 모두 사유 고지 후 거부하며, 동일 SPI major 내 minor 차이는 통과.
61
+ * / Verify an extension's peer contract at load time (safe reject, UC-6).
62
+ *
63
+ * @param peer - 확장이 선언한 peer 계약 / The peer contract the extension declares
64
+ * @param core - 코어 능력 질의 인터페이스 / Core capability query interface
65
+ * @returns ok | reject(사유 고지) / ok, or reject with a disclosed reason
66
+ */
67
+ export declare function verifyPeer(peer: ExtensionPeer, core: CoreCapabilities): PeerVerdict;
68
+ /** CoreCapabilities 구성 스펙. / Spec to build CoreCapabilities. */
69
+ export interface CapabilitiesSpec {
70
+ readonly core: string;
71
+ readonly spi?: Readonly<Record<string, string>>;
72
+ readonly tokens?: readonly string[];
73
+ }
74
+ /**
75
+ * CoreCapabilities 의 구체 구현(생성 매니페스트 소비, §2.8 CapabilityService).
76
+ * / Concrete CoreCapabilities implementation (consumes a generated manifest).
77
+ *
78
+ * @example
79
+ * const caps = new Capabilities({ core: '2.4.0', spi: { IChartRenderer: '2' }, tokens: ['canvas2d'] });
80
+ * verifyPeer({ minCore: '2.0.0', spi: 'IChartRenderer@3' }, caps).ok; // false
81
+ */
82
+ export declare class Capabilities implements CoreCapabilities {
83
+ private readonly _core;
84
+ private readonly _spi;
85
+ private readonly _tokens;
86
+ constructor(spec: CapabilitiesSpec);
87
+ has(token: string): boolean;
88
+ spiVersion(spi: string): string | undefined;
89
+ satisfies(minCore: string): boolean;
90
+ }
@@ -0,0 +1,142 @@
1
+ /** 등록 출처 — 충돌 정책의 1차 판별자. og 코어 보호의 근거. / Entry origin — primary discriminator of conflict policy. */
2
+ export type EntryOrigin = 'builtin' | 'plugin' | 'user';
3
+ /** 폐기 정보 — 예고 없는 제거 금지의 데이터화(§2.8). / Deprecation info — data form of "no removal without notice". */
4
+ export interface DeprecationInfo {
5
+ /** 폐기 표시 버전. / Version where deprecation was marked. */
6
+ readonly since: string;
7
+ /** 제거 예정 버전(게이트가 이전 제거를 차단). / Planned removal version (gate blocks earlier removal). */
8
+ readonly removeIn: string;
9
+ /** 대체 API/키. / Replacement API/key. */
10
+ readonly replacement?: string;
11
+ /** 부가 설명. / Extra note. */
12
+ readonly note?: string;
13
+ }
14
+ /** 등록 시 선언하는 정책 메타(데이터로서의 정책). / Policy metadata declared at registration (policy as data). */
15
+ export interface RegisterOptions {
16
+ /** 기본 'user'. 'builtin' 은 코어 부트스트랩만. / Default 'user'; 'builtin' is core bootstrap only. */
17
+ origin?: EntryOrigin;
18
+ /** 보호 키를 이기려는 명시 의사. 기본 false. / Explicit intent to override a protected key. Default false. */
19
+ override?: boolean;
20
+ /** og:* 예약 검사·매니페스트 추적·일괄 dispose 키. / Reserved-check, manifest tracking, batch-dispose key. */
21
+ pluginId?: string;
22
+ /** 다중 적용 순서(작을수록 먼저). 기본 0. / Multi-apply order (smaller first). Default 0. */
23
+ priority?: number;
24
+ /** 이 값이 구현하는 SPI 버전(peer 검증용). / SPI version this value implements (for peer verification). */
25
+ spiVersion?: string;
26
+ /** 이 키가 폐기 예정이면 동반. / Present when this key is deprecated. */
27
+ deprecated?: DeprecationInfo;
28
+ }
29
+ /** 등록 1건의 정규화된 기록(불변). seq 는 로드순 tiebreak 의 안정 기준. / A normalized registration record (immutable). */
30
+ export interface RegistryEntry<V> {
31
+ readonly key: string;
32
+ readonly value: V;
33
+ readonly origin: EntryOrigin;
34
+ readonly priority: number;
35
+ /** 모노톤 등록 순번(레지스트리 로컬). / Monotonic registration sequence (registry-local). */
36
+ readonly seq: number;
37
+ readonly pluginId?: string;
38
+ readonly spiVersion?: string;
39
+ readonly deprecated?: DeprecationInfo;
40
+ }
41
+ /** 등록 결과의 행동 분류. / Action classification of a registration result. */
42
+ export type RegisterAction = 'added' | 'replaced' | 'kept' | 'rejected';
43
+ /** 거부/유지 사유. / Reason for rejection/keep. */
44
+ export type RegisterReason = 'reserved-namespace' | 'protected-builtin' | 'invalid-key' | 'spi-mismatch' | 'disposed' | 'adapter-error';
45
+ /** 등록 결과 — never-throw. 거부/경고를 값으로 반환(조용한 실패 금지). / Registration result — never-throw; rejections/warnings returned as values. */
46
+ export interface RegisterResult {
47
+ /** 제공한 값이 지금 등록되었는가(added/replaced=true). / Whether the provided value is now registered (added/replaced=true). */
48
+ readonly ok: boolean;
49
+ readonly action: RegisterAction;
50
+ readonly reason?: RegisterReason;
51
+ /** [OpenGrid] 프리픽스로 방출된 경고 원문. / Emitted warning text ([OpenGrid]-prefixed). */
52
+ readonly warning?: string;
53
+ }
54
+ /** 중복 키 재등록 정책. / Duplicate-key re-registration policy. */
55
+ export type DuplicatePolicy = 'last-wins' | 'explicit-override' | 'protect-builtin';
56
+ /**
57
+ * 전 확장점이 상속하는 단일 계약. K=키 타입(기본 string), V=등록 값 타입.
58
+ * / The single contract inherited by every extension point.
59
+ */
60
+ export interface IRegistry<V, K extends string = string> {
61
+ /** 등록(정책 적용, never-throw). / Register (policy-applied, never-throw). */
62
+ register(key: K, value: V, opts?: RegisterOptions): RegisterResult;
63
+ /** 미등록 → undefined (I1). / Unregistered → undefined (I1). */
64
+ get(key: K): V | undefined;
65
+ /** 미등록 → fallback/dev 플레이스홀더 (I1, REQ-T4-803). / Unregistered → fallback/dev placeholder (I1). */
66
+ require(key: K, fallback?: V): V;
67
+ has(key: K): boolean;
68
+ /** 등록된 키 목록. / Registered keys. */
69
+ list(): K[];
70
+ /** 정규화 기록(카탈로그·진단·다중적용 순서용). / Normalized records (catalog/diagnostics/ordered-apply). */
71
+ entries(): ReadonlyArray<RegistryEntry<V>>;
72
+ unregister(key: K): boolean;
73
+ /** 플러그인 단위 일괄 해제(대칭 teardown). 해제 수 반환. / Batch dispose by plugin (symmetric teardown). Returns count. */
74
+ disposePlugin(pluginId: string): number;
75
+ /** 전체 해제(자원 대칭). / Dispose everything (resource symmetry). */
76
+ dispose(): void;
77
+ }
78
+ /** 선언 SPI 버전이 코어 SPI major 와 호환되는가(major 일치). / Whether a declared SPI version is major-compatible with the core SPI. */
79
+ export declare function spiCompatible(coreVersion: string, declared: string): boolean;
80
+ /** TypedRegistry 구성. / TypedRegistry configuration. */
81
+ export interface TypedRegistryConfig<V, K extends string = string> {
82
+ /** 미등록 시 dev 플레이스홀더 값 생성자(레지스트리별 상이: 물음표·—포맷터…). / Dev placeholder factory for unregistered keys. */
83
+ placeholder?: (key: K) => V;
84
+ /** 중복 정책. 기본 'protect-builtin'. / Duplicate policy. Default 'protect-builtin'. */
85
+ duplicatePolicy?: DuplicatePolicy;
86
+ /** 이 레지스트리가 소유하는 SPI 이름·현재 버전(peer 검증용). / SPI name/version this registry owns (for peer checks). */
87
+ spi?: {
88
+ name: string;
89
+ version: string;
90
+ };
91
+ /** dev 경고 싱크(테스트 주입 가능, 기본 console.warn). / Dev warning sink (test-injectable; defaults to console.warn). */
92
+ onWarn?: (msg: string) => void;
93
+ }
94
+ /**
95
+ * 단일 값 슬롯형(포맷터·차트타입: 키당 1값)과 다중 적용형(CF규칙·데코: 한 대상 N값)을
96
+ * 하나의 저장·정책 엔진으로 처리하고, 조회 관점만 분리한다(§2.2).
97
+ * / One storage+policy engine for both single-slot and multi-apply extension points; only the
98
+ * read perspective differs (§2.2).
99
+ *
100
+ * @example
101
+ * const reg = new TypedRegistry<IFormatter>({ spi: { name: 'IFormatter', version: '1' } });
102
+ * reg.register('currency', myFmt, { origin: 'builtin' });
103
+ * reg.register('currency', mine); // kept — built-in protected
104
+ */
105
+ export declare class TypedRegistry<V, K extends string = string> implements IRegistry<V, K> {
106
+ private _map;
107
+ private _seq;
108
+ private _disposed;
109
+ private _warned;
110
+ private readonly _cfg;
111
+ constructor(cfg?: TypedRegistryConfig<V, K>);
112
+ private _warn;
113
+ register(key: K, value: V, opts?: RegisterOptions): RegisterResult;
114
+ /** 충돌 시 신규가 이기는가? — 정책 진리표(§4.2). true=교체 허용. / Does the newcomer win? (§4.2 truth table). */
115
+ private _resolveConflict;
116
+ get(key: K): V | undefined;
117
+ require(key: K, fallback?: V): V;
118
+ has(key: K): boolean;
119
+ list(): K[];
120
+ entries(): ReadonlyArray<RegistryEntry<V>>;
121
+ unregister(key: K): boolean;
122
+ disposePlugin(pluginId: string): number;
123
+ dispose(): void;
124
+ }
125
+ /**
126
+ * 결정론 정렬: priority 오름차순, 동률이면 등록 순번(seq) 오름차순(§2.3).
127
+ * 한 대상에 여러 확장이 겹칠 때의 적용 순서. 저장 구조는 재사용, 조회 관점만 정렬.
128
+ * / Deterministic ordering: ascending priority, ties broken by seq (§2.3).
129
+ *
130
+ * @param reg - 대상 레지스트리 / The registry
131
+ * @returns priority→seq 정렬된 기록(불변) / Records sorted by priority then seq (immutable)
132
+ */
133
+ export declare function orderedApply<V>(reg: IRegistry<V>): ReadonlyArray<RegistryEntry<V>>;
134
+ /**
135
+ * 순서 모호성 감지(§2.3 결정론 정직성): 동일 priority 를 가진 2건 이상의 겹침은 등록순(seq)에
136
+ * 의존한다 — 순서 민감 확장은 priority 를 명시해야 한다. 모호한 priority 그룹을 반환.
137
+ * / Detect order ambiguity: overlaps sharing the same priority depend on registration order (seq).
138
+ *
139
+ * @param entries - 검사할 기록(보통 한 대상에 적용될 부분집합) / Records to inspect
140
+ * @returns 2건 이상 공유하는 priority 목록(빈 배열=모호성 없음) / Priorities shared by 2+ entries
141
+ */
142
+ export declare function detectAmbiguousOrder<V>(entries: ReadonlyArray<RegistryEntry<V>>): number[];
@@ -0,0 +1,46 @@
1
+ import { TypedRegistry, IRegistry } from './Registry.js';
2
+ import { IExtension } from './IExtension.js';
3
+ /** 슬롯 이름(빌트인 + 임의 확장). / Slot name (built-ins + arbitrary extension). */
4
+ export type SlotName = 'header' | 'cell' | 'footer' | 'empty' | 'contextView' | 'masterDetail' | (string & {});
5
+ /** 슬롯 산출물이 마운트되는 호스트(host CSS isolation 경계 안). / Host where slot output mounts (inside host CSS isolation). */
6
+ export interface SlotHost {
7
+ [k: string]: unknown;
8
+ }
9
+ /** mount 가 반환하는 핸들 — update/unmount 의 대상. / Handle returned by mount — target of update/unmount. */
10
+ export interface SlotHandle {
11
+ [k: string]: unknown;
12
+ }
13
+ /**
14
+ * 슬롯 렌더 provider(§2.7). host CSS isolation 경계 안에서 동작(외부 스타일 침투 차단).
15
+ * / Slot render provider. Operates inside the host CSS isolation boundary.
16
+ */
17
+ export interface ISlotProvider<Ctx = unknown> extends IExtension {
18
+ /** 최초 부착 — DOM/문자열 산출물 마운트. 반환 핸들은 update/unmount 의 대상. / Initial attach; returns a handle. */
19
+ mount(host: SlotHost, ctx: Ctx): SlotHandle;
20
+ /** 데이터/상태 변화 시 갱신(가상화 재사용 — 새 mount 대신 update). / Update on data/state change (virtualization reuse). */
21
+ update?(handle: SlotHandle, ctx: Ctx): void;
22
+ /** 대칭 해제(mount 자원 회수). / Symmetric teardown (reclaim mount resources). */
23
+ unmount?(handle: SlotHandle): void;
24
+ /** 산출 실패/미구현 시 코어가 쓸 기본 슬롯(never-blank). / Default slot on failure/unimplemented (never-blank). */
25
+ fallback?: ISlotProvider<Ctx>;
26
+ }
27
+ /** 슬롯 레지스트리 — IRegistry 동형(슬롯당 1 provider). / Slot registry — isomorphic to IRegistry (1 provider per slot). */
28
+ export type SlotRegistry = IRegistry<ISlotProvider>;
29
+ /**
30
+ * 슬롯 레지스트리 생성(protect-builtin 정책 — 빌트인 슬롯 보호).
31
+ * / Create a slot registry (protect-builtin — built-in slots are protected).
32
+ *
33
+ * @returns 슬롯 provider 레지스트리 / A slot-provider registry
34
+ */
35
+ export declare function createSlotRegistry(): TypedRegistry<ISlotProvider>;
36
+ /**
37
+ * 슬롯 provider 를 fallback 사슬을 따라 안전 마운트(never-blank, UC-9). provider.mount 가 throw 하면
38
+ * fallback 으로 폴백하고, fallback 도 없으면 null 반환(코어는 계속 동작).
39
+ * / Safely mount a slot provider following its fallback chain (never-blank). Falls back on throw.
40
+ *
41
+ * @param provider - 마운트할 슬롯 provider / The slot provider to mount
42
+ * @param host - 마운트 호스트 / The mount host
43
+ * @param ctx - 슬롯 컨텍스트 / Slot context
44
+ * @returns 핸들, 전 사슬 실패 시 null / A handle, or null if the whole chain fails
45
+ */
46
+ export declare function safeMount<Ctx>(provider: ISlotProvider<Ctx> | undefined, host: SlotHost, ctx: Ctx): SlotHandle | null;
@@ -0,0 +1,44 @@
1
+ import { IRegistry } from './Registry.js';
2
+ import { FormatterRegistry } from '../format/FormatterRegistry.js';
3
+ import { IFormatter } from '../format/types.js';
4
+ import { SkinRegistry } from '../SkinRegistry.js';
5
+ import { SkinTokenDelta } from '../types.js';
6
+ /** 어댑터가 원본 저장소와 소통하는 최소 브리지(원본을 건드리지 않고 위임). / Minimal bridge to the underlying store. */
7
+ export interface RegistryBridge<V, K extends string = string> {
8
+ get(key: K): V | undefined;
9
+ has(key: K): boolean;
10
+ list(): K[];
11
+ /** 값 저장(원본 register/define 위임). throw 하면 어댑터가 격리해 rejected 로 값화. / Persist; throws are isolated into a rejected result. */
12
+ set(key: K, value: V): void;
13
+ /** 삭제(선택 — 미지원 원본은 생략). / Delete (optional). */
14
+ delete?(key: K): boolean;
15
+ }
16
+ /**
17
+ * 임의 브리지를 IRegistry<V> 계약으로 어댑트. 예약 가드·충돌 정책·never-throw·메타를 얹되
18
+ * 저장은 브리지에 위임(원본 무교란). / Adapt an arbitrary bridge to the IRegistry<V> contract.
19
+ *
20
+ * @param bridge - 원본 저장소 브리지 / The underlying-store bridge
21
+ * @param cfg - 정책(중복·경고 싱크) / Policy (duplicate, warning sink)
22
+ * @returns IRegistry<V> 어댑터 / An IRegistry<V> adapter
23
+ */
24
+ export declare function adaptRegistry<V, K extends string = string>(bridge: RegistryBridge<V, K>, cfg?: {
25
+ duplicatePolicy?: 'last-wins' | 'explicit-override' | 'protect-builtin';
26
+ onWarn?: (msg: string) => void;
27
+ }): IRegistry<V, K>;
28
+ /**
29
+ * 기존 format/FormatterRegistry(register(f)/resolve/has/list, 키=f.name)를 IRegistry<IFormatter>
30
+ * 로 어댑트. 원본 API 표면 불변(§5.2). / Adapt the existing FormatterRegistry to IRegistry<IFormatter>.
31
+ *
32
+ * @param reg - 기존 FormatterRegistry / The existing FormatterRegistry
33
+ * @returns IRegistry<IFormatter> 어댑터 / An IRegistry<IFormatter> adapter
34
+ */
35
+ export declare function adaptFormatterRegistry(reg: FormatterRegistry): IRegistry<IFormatter>;
36
+ /**
37
+ * 기존 SkinRegistry(define/has/get/list, FORM-only 검증·가드레일)를 IRegistry<SkinTokenDelta> 로
38
+ * 어댑트. define 의 색 리터럴 거부 throw 는 어댑터가 격리해 rejected('adapter-error')로 값화(never-throw).
39
+ * / Adapt the existing SkinRegistry to IRegistry<SkinTokenDelta>; define()'s throw is isolated.
40
+ *
41
+ * @param reg - 기존 SkinRegistry / The existing SkinRegistry
42
+ * @returns IRegistry<SkinTokenDelta> 어댑터 / An IRegistry<SkinTokenDelta> adapter
43
+ */
44
+ export declare function adaptSkinRegistry(reg: SkinRegistry): IRegistry<SkinTokenDelta>;