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,24 @@
1
+ import { CFRule, CFEncodeSpec } from './CFRule.js';
2
+ import { CellInput, ColumnStats, EvalCtx, CFCellVerdict, RuleDatum } from './eval-types.js';
3
+ import { CFRuleTypeRegistry } from './predicates.js';
4
+ /** 순수 평가 엔진 인터페이스 — 캔버스 없는 단위테스트의 표면(REQ-T5-808). / Pure evaluator SPI. */
5
+ export interface CFEvaluator {
6
+ evaluate(rules: readonly CFRule[], input: CellInput, stats: ColumnStats, ctx: EvalCtx): CFCellVerdict;
7
+ }
8
+ /** 규칙이 이 셀 입력에 스코프상 걸리는가. / Whether a rule's scope matches this cell input. */
9
+ export declare function scopeMatches(rule: CFRule, input: CellInput): boolean;
10
+ /**
11
+ * 발화 규칙의 도메인 결과 산출(순수) — 시각 원시값 아님. bar/scale 만 수치 datum, icon/sparkline 은
12
+ * 구간·부호만. 0기준·음수 양방향·클램프·발산 중립의 판정을 여기서 결정(정직성 색·px 는 인코더).
13
+ * / Compute a fired rule's domain datum (pure) — never a visual primitive.
14
+ */
15
+ export declare function computeDatum(encode: CFEncodeSpec, value: unknown, stats: ColumnStats): RuleDatum;
16
+ /**
17
+ * 우선순위·Stop-If-True 를 병합하는 순수 평가기. 술어 레지스트리를 주입받아 미지 type 은 skip(발화 안 함).
18
+ * / Pure evaluator merging priority + Stop-If-True. Unknown condition types skip (never fire).
19
+ */
20
+ export declare class DefaultCFEvaluator implements CFEvaluator {
21
+ private readonly ruleTypes;
22
+ constructor(ruleTypes: CFRuleTypeRegistry);
23
+ evaluate(rules: readonly CFRule[], input: CellInput, stats: ColumnStats, ctx: EvalCtx): CFCellVerdict;
24
+ }
@@ -0,0 +1,127 @@
1
+ /**
2
+ * 통계가 필요 없는 값 비교/텍스트/날짜 조건과, 열 전역 통계가 필요한 조건(topN·stdBand·duplicate)을
3
+ * 1급으로 담는 조건 카탈로그(REQ-T5-042). 각 조건은 순수 판정 술어로 해석된다.
4
+ * / First-class condition catalog (REQ-T5-042). Stat-free comparisons plus column-wide stat
5
+ * conditions (topN/stdBand/duplicate). Each is interpreted by a pure predicate.
6
+ */
7
+ export type CFCondition = {
8
+ readonly type: 'compare';
9
+ readonly op: '>' | '>=' | '<' | '<=' | '=' | '!=' | 'between';
10
+ readonly a: number;
11
+ readonly b?: number;
12
+ } | {
13
+ readonly type: 'textContains';
14
+ readonly text: string;
15
+ readonly ci?: boolean;
16
+ } | {
17
+ readonly type: 'dateOccurring';
18
+ readonly rel: 'today' | 'yesterday' | 'tomorrow' | 'thisWeek' | 'lastWeek' | 'thisMonth' | 'lastMonth' | 'next7d' | 'last7d';
19
+ } | {
20
+ readonly type: 'topN';
21
+ readonly n: number;
22
+ readonly bottom?: boolean;
23
+ } | {
24
+ readonly type: 'topNpct';
25
+ readonly pct: number;
26
+ readonly bottom?: boolean;
27
+ } | {
28
+ readonly type: 'aboveAvg';
29
+ readonly below?: boolean;
30
+ } | {
31
+ readonly type: 'stdBand';
32
+ readonly k: 1 | 2 | 3;
33
+ readonly outside?: boolean;
34
+ } | {
35
+ readonly type: 'duplicate';
36
+ readonly unique?: boolean;
37
+ } | {
38
+ readonly type: 'custom';
39
+ readonly predicateId: string;
40
+ readonly params?: Readonly<Record<string, unknown>>;
41
+ };
42
+ /**
43
+ * encode 슬롯 — 4종 시각 인코딩의 판별 유니온. 정직성 파라미터를 각자 소유(§2.1).
44
+ * bar: 0기준·음수 양방향·클램프·로그. scale: 이산 기본·연속 옵트인·발산 중립. icon: 이중부호화.
45
+ * / encode slot — discriminated union of the 4 visual encodings; each owns its honesty params.
46
+ */
47
+ export type CFEncodeSpec = {
48
+ readonly kind: 'bar';
49
+ readonly axis?: 'zero' | 'min';
50
+ readonly negative?: 'bidirectional' | 'none';
51
+ readonly clamp?: boolean;
52
+ readonly log?: boolean;
53
+ readonly fill?: 'solid' | 'gradient';
54
+ readonly seed?: 'primary' | 'graphite';
55
+ } | {
56
+ readonly kind: 'scale';
57
+ readonly mode?: 'discrete' | 'continuous';
58
+ readonly bands?: number;
59
+ readonly ramp?: string;
60
+ readonly diverging?: boolean;
61
+ readonly midpoint?: 'zero' | 'mean' | number;
62
+ readonly seed?: 'primary' | 'graphite';
63
+ } | {
64
+ readonly kind: 'icon';
65
+ readonly setId: string;
66
+ readonly steps?: 3 | 4 | 5;
67
+ readonly reverse?: boolean;
68
+ readonly iconOnly?: boolean;
69
+ } | {
70
+ readonly kind: 'sparkline';
71
+ readonly chart?: 'bar' | 'line' | 'area';
72
+ readonly normalize?: 'row' | 'column';
73
+ };
74
+ /** 적용 스코프 — 어느 셀 집합에 거는가. columnId 필수 + 선택적 행범위·행상태 술어. / Application scope. */
75
+ export interface CFScope {
76
+ readonly columnId: string;
77
+ /** 반열림 행 범위 [startRow, endRow). 미지정=열 전체. / Half-open row range; absent = whole column. */
78
+ readonly range?: {
79
+ readonly startRow: number;
80
+ readonly endRow: number;
81
+ };
82
+ /** 행상태 제한(예: 'added'|'edited'|'removed'). / Row-state gate. */
83
+ readonly rowState?: 'added' | 'edited' | 'removed';
84
+ }
85
+ /** 이름붙인 재사용 스타일 참조(색조정자 단일관리, MCD-DB014). / Named reusable style reference. */
86
+ export interface CFStyleRef {
87
+ readonly ref: string;
88
+ }
89
+ /** 인라인 스타일(공용 프리미티브). named style 이 없을 때의 직접 지정. / Inline style primitives. */
90
+ export interface CFInlineStyle {
91
+ readonly color?: string;
92
+ readonly background?: string;
93
+ readonly bold?: boolean;
94
+ readonly italic?: boolean;
95
+ readonly underline?: boolean;
96
+ }
97
+ /** style 슬롯이 참조형인지 판별(직렬화·해석 분기). / Discriminate a style ref from an inline style. */
98
+ export declare function isStyleRef(s: CFStyleRef | CFInlineStyle | undefined): s is CFStyleRef;
99
+ /**
100
+ * 조건부서식 규칙 — 직렬화 가능한 선언 값 객체(순수 데이터, DOM·함수 참조 없음). REQ-T5-001/808.
101
+ * / A conditional-formatting rule — a serializable declarative value object (pure data).
102
+ */
103
+ export interface CFRule {
104
+ /** 안정 식별자(직렬화·계보·우선순위 tie-break 결정론). / Stable id (serialization/lineage/tie-break). */
105
+ readonly id: string;
106
+ /** 발화 조건(1급 카탈로그 중 하나, REQ-T5-042). / Firing condition. */
107
+ readonly when: CFCondition;
108
+ /** 시각 인코딩 종류(4종 공유 스키마). / Visual encoding (4 kinds share one schema). */
109
+ readonly encode: CFEncodeSpec;
110
+ /** named style 참조 또는 인라인 스타일. / Named-style ref or inline style. */
111
+ readonly style?: CFStyleRef | CFInlineStyle;
112
+ /** 적용 스코프. / Application scope. */
113
+ readonly scope: CFScope;
114
+ /** 우선순위(작을수록 먼저 평가·낮은 층). 동값이면 id 로 결정론 tie-break. / Priority (smaller = earlier/lower). */
115
+ readonly priority: number;
116
+ /** 참이면 이 규칙 뒤 규칙 평가 중단(엑셀 Stop-If-True). 기본 false. / Stop-If-True (Excel). */
117
+ readonly stopIfTrue?: boolean;
118
+ /** 직렬화 스키마 버전(하위호환 진화). / Serialization schema version. */
119
+ readonly v?: number;
120
+ }
121
+ /** 현재 직렬화 스키마 버전. 로더가 미래(더 큰) 버전 규칙을 안전 skip 하는 기준. / Current schema version. */
122
+ export declare const CF_SCHEMA_VERSION = 1;
123
+ /**
124
+ * 규칙 값객체 동일성(직렬화 SSOT 비교) — 얕은 구조 비교. 계보·통계는 파생물이라 제외.
125
+ * / Rule value-object equality (serialization SSOT) — structural compare; derived data excluded.
126
+ */
127
+ export declare function cfRuleEquals(a: CFRule, b: CFRule): boolean;
@@ -0,0 +1,49 @@
1
+ /** 발산 스케일의 중립 중앙색(흰/회색, 고채도 금지). / Neutral diverging midpoint (white/gray). */
2
+ export declare const NEUTRAL_MIDPOINT = "#f4f5f6";
3
+ /**
4
+ * 순차 단색 명도 램프 색(연속) — ratio 0(밝음)→1(시드, 어두움). 명도 단조.
5
+ * / Sequential single-hue luminance color (continuous) — ratio 0 (light) → 1 (seed, dark).
6
+ *
7
+ * @param seed - AppearanceView.rampFrom 시드색 / The seed color from AppearanceView.rampFrom
8
+ * @param ratio - 정규화 위치 0..1 / Normalized position 0..1
9
+ * @returns hex 색 / A hex color
10
+ */
11
+ export declare function sequentialColor(seed: string, ratio: number): string;
12
+ /**
13
+ * 순차 단색 이산 램프(3~5단 기본, REQ-T5-012) — 각 밴드 대표색. 밴드 중앙 위치로 샘플.
14
+ * / Sequential discrete ramp (3–5 bands default). Samples the mid-position of each band.
15
+ *
16
+ * @param seed - 시드색 / Seed color
17
+ * @param bands - 밴드 수(2..5 클램프) / Band count (clamped 2..5)
18
+ * @returns 밴드별 hex 색 배열 / A per-band array of hex colors
19
+ */
20
+ export declare function sequentialBands(seed: string, bands: number): string[];
21
+ /**
22
+ * 발산 램프 색(연속) — lo(어두움)→중립(흰/회색)→hi(어두움). 중앙값 중립(REQ-T5-013).
23
+ * / Diverging color (continuous) — lo (dark) → neutral → hi (dark). Neutral midpoint.
24
+ *
25
+ * @param lo - 저(低)측 시드색 / Low-side seed color
26
+ * @param hi - 고(高)측 시드색 / High-side seed color
27
+ * @param ratio - 0..1(0.5=중립) / 0..1 (0.5 = neutral)
28
+ * @param neutral - 중앙 중립색(기본 NEUTRAL_MIDPOINT) / Center neutral color
29
+ * @returns hex 색 / A hex color
30
+ */
31
+ export declare function divergingColor(lo: string, hi: string, ratio: number, neutral?: string): string;
32
+ /**
33
+ * 발산 이산 램프(밴드 중앙 샘플). 중앙 밴드는 중립. / Diverging discrete ramp; center band neutral.
34
+ *
35
+ * @param lo - 저측 시드색 / Low-side seed
36
+ * @param hi - 고측 시드색 / High-side seed
37
+ * @param bands - 밴드 수(3..5 클램프) / Band count (clamped 3..5)
38
+ * @param neutral - 중앙 중립색 / Center neutral color
39
+ * @returns 밴드별 hex 색 배열 / A per-band array of hex colors
40
+ */
41
+ export declare function divergingBands(lo: string, hi: string, bands: number, neutral?: string): string[];
42
+ /** 스케일 도메인(컬러바 공유용, REQ-T5-015). CF 는 도메인만 제공·물질화는 DD-11/06. / Scale domain for shared colorbar. */
43
+ export interface ScaleDomain {
44
+ readonly min: number;
45
+ readonly mid?: number;
46
+ readonly max: number;
47
+ /** 이산 밴드 경계 틱(연속이면 [min,mid,max]). / Discrete band-boundary ticks. */
48
+ readonly ticks: readonly number[];
49
+ }
@@ -0,0 +1,33 @@
1
+ /** WCAG bodyText 임계(표준 SSOT). / WCAG body-text minimum. */
2
+ export declare const AA_BODY = 4.5;
3
+ /** 잉크(텍스트 색) 결정. outline=중간명도 폴백(1px halo). / Ink decision; outline = mid-luminance fallback. */
4
+ export interface InkDecision {
5
+ /** 선택된 텍스트 색(흑/백). / The chosen text color (black/white). */
6
+ readonly color: string;
7
+ /** 대비 미달 시 외곽선(halo) 폴백 지시. / Outline (halo) fallback when contrast is short. */
8
+ readonly outline?: boolean;
9
+ /** 폴백 외곽선 색(반대 잉크). / Fallback outline color (opposite ink). */
10
+ readonly outlineColor?: string;
11
+ /** 달성 대비비(진단·게이트). / Achieved contrast ratio (diagnostics/gate). */
12
+ readonly ratio: number;
13
+ }
14
+ /** 채움 위 텍스트 색 선택 계약(Strategy). / Fill-above ink selection contract (Strategy). */
15
+ export interface InkResolver {
16
+ pickInk(fillColor: string): InkDecision;
17
+ }
18
+ /**
19
+ * 기본 잉크 해석기 — 흑/백 중 대비 큰 쪽 선택, 둘 다 4.5:1 미달이면 외곽선 폴백.
20
+ * / Default ink resolver — pick the higher-contrast of black/white; outline fallback when both < 4.5:1.
21
+ */
22
+ export declare class DefaultInkResolver implements InkResolver {
23
+ pickInk(fillColor: string): InkDecision;
24
+ }
25
+ /**
26
+ * 커스텀 램프/스타일 등록 시 AA 게이트(§4.7 T5-807b) — 채움색이 흑·백 폴백 없이 AA 를 만족하는가.
27
+ * false 면 등록/사용 전에 폴백 필요. 우회 불가(정직성 하드룰).
28
+ * / AA gate for custom ramps/styles — whether a fill meets AA without fallback. Non-bypassable.
29
+ *
30
+ * @param fillColor - 검사할 채움색 / The fill color to test
31
+ * @returns AA 통과 여부 / Whether AA passes without fallback
32
+ */
33
+ export declare function passesInkGate(fillColor: string): boolean;
@@ -0,0 +1,20 @@
1
+ /** 시드 축 — 테마 primary(주색) 또는 graphite(무채색) 파생. / Seed axis — theme primary or graphite. */
2
+ export type CFRampSeed = 'primary' | 'graphite';
3
+ /**
4
+ * CF 가 소비하는 좁은 외관 읽기 포트. rampFrom 만이 시각 정직성의 색 원천이다(hex 하드코딩 금지).
5
+ * / The narrow appearance read port CF consumes. rampFrom is the sole color source (no hardcoded hex).
6
+ */
7
+ export interface AppearanceView {
8
+ /** 시드색(hex/rgb) — 데이터바/히트맵/아이콘 색 파생의 단일 시드. / Seed color for bar/heatmap/icon derivation. */
9
+ rampFrom(seed: CFRampSeed): string;
10
+ /** 반경 리터럴(선택, DD-11 위임). / Radius literal (optional, DD-11-delegated). */
11
+ radius?(px: number): string;
12
+ }
13
+ /**
14
+ * 테스트·기본용 정적 AppearanceView. graphite 무채색 시드가 기본(§9.3 "graphite ↔ 히트맵 한 몸").
15
+ * / A static AppearanceView for tests/defaults; graphite is the default achromatic seed.
16
+ *
17
+ * @param seeds - primary/graphite 시드색 override(선택) / Optional primary/graphite seed overrides
18
+ * @returns 정적 읽기 포트 / A static read port
19
+ */
20
+ export declare function staticAppearanceView(seeds?: Partial<Record<CFRampSeed, string>>): AppearanceView;
@@ -0,0 +1,61 @@
1
+ import { CellRect } from '../coordinate/index.js';
2
+ import { IRegistry } from '../extension/Registry.js';
3
+ import { CFEncodeSpec } from './CFRule.js';
4
+ import { RuleVerdict } from './eval-types.js';
5
+ import { AppearanceView } from './appearance.js';
6
+ /** 채움/글리프의 시각 스펙. ariaSummary 필수(텍스트 쌍둥이). / Visual spec; ariaSummary is mandatory. */
7
+ export interface VisualSpec {
8
+ readonly layer: 'background' | 'decorator';
9
+ /** 데이터바/히트맵 채움. / Data-bar/heatmap fill. */
10
+ readonly fill?: {
11
+ readonly color: string;
12
+ readonly from?: 'zero' | 'left' | 'right';
13
+ readonly ratio: number;
14
+ };
15
+ /** 아이콘 이중부호화(색+형태). / Icon dual encoding (color + shape). */
16
+ readonly glyph?: {
17
+ readonly role: string;
18
+ readonly tint: string;
19
+ readonly shape: 'circle' | 'triangleUp' | 'triangleDown';
20
+ };
21
+ /** 채움 위 텍스트 색(AA 보증 결과). / Fill-above text color (AA-guaranteed). */
22
+ readonly inkColor: string;
23
+ /** 중간명도 폴백 외곽선(halo) 지시. / Mid-luminance outline (halo) fallback. */
24
+ readonly inkOutline?: boolean;
25
+ /** 극단값 클램프 발동 표식(범위 초과 고지, T5-007). / Clamp-fired marker (out-of-range notice). */
26
+ readonly clamped?: boolean;
27
+ /** 텍스트 쌍둥이(원시 수치 요약, 필수). / Text twin (raw numeric summary, required). */
28
+ readonly ariaSummary: string;
29
+ }
30
+ /** 인코더 계약(Strategy) — 판정→VisualSpec(순수). / Encoder contract (Strategy). */
31
+ export interface CFEncoder {
32
+ readonly kind: CFEncodeSpec['kind'];
33
+ encode(verdict: RuleVerdict, appearance: AppearanceView, cellRect: CellRect): VisualSpec;
34
+ }
35
+ declare class BarEncoder implements CFEncoder {
36
+ readonly kind: "bar";
37
+ encode(verdict: RuleVerdict, appearance: AppearanceView, _rect: CellRect): VisualSpec;
38
+ }
39
+ declare class ScaleEncoder implements CFEncoder {
40
+ readonly kind: "scale";
41
+ encode(verdict: RuleVerdict, appearance: AppearanceView, _rect: CellRect): VisualSpec;
42
+ }
43
+ declare class IconEncoder implements CFEncoder {
44
+ readonly kind: "icon";
45
+ encode(verdict: RuleVerdict, appearance: AppearanceView, _rect: CellRect): VisualSpec;
46
+ }
47
+ declare class SparklineEncoder implements CFEncoder {
48
+ readonly kind: "sparkline";
49
+ encode(verdict: RuleVerdict, _appearance: AppearanceView, _rect: CellRect): VisualSpec;
50
+ }
51
+ /** CF 인코더 레지스트리(DD-10 IRegistry 동형). / CF encoder registry (IRegistry-homomorphic). */
52
+ export type CFEncoderRegistry = IRegistry<CFEncoder>;
53
+ /**
54
+ * 인코더 레지스트리 생성 — bar/scale/icon/sparkline 을 builtin 으로 등록(코어 보호). 동일 kind 재등록으로
55
+ * 기본 인코더 교체(예: gradient bar→커스텀 불릿), 신규 kind 로 확장(§4.7). 미지 kind = get→undefined skip.
56
+ * / Create the encoder registry with the 4 built-ins registered as protected; replace/extend via SPI.
57
+ *
58
+ * @returns 4종 내장 인코더가 채워진 IRegistry / An IRegistry pre-populated with the 4 built-in encoders
59
+ */
60
+ export declare function createEncoderRegistry(): CFEncoderRegistry;
61
+ export { BarEncoder, ScaleEncoder, IconEncoder, SparklineEncoder };
@@ -0,0 +1,93 @@
1
+ import { CFEncodeSpec, CFStyleRef, CFInlineStyle } from './CFRule.js';
2
+ import { RuleLineage } from './lineage.js';
3
+ /** 행 변경 상태(DD-03 rowState 정합). / Row mutation state. */
4
+ export type RowState = 'none' | 'added' | 'edited' | 'removed';
5
+ /** 조건이 요구하는 통계 종류. needs 선언 → 엔진이 컬럼 스캔 1회로 모은다(REQ-T5-803). / Stat kind. */
6
+ export type StatKind = 'min' | 'max' | 'avg' | 'stddev' | 'count' | 'distinct' | 'rank' | 'percentile' | 'cardinality';
7
+ /** 한 셀의 평가 입력 — 읽기 전용 투영. / One cell's evaluation input (read-only projection). */
8
+ export interface CellInput {
9
+ readonly value: unknown;
10
+ readonly rowIndex: number;
11
+ readonly columnId: string;
12
+ readonly rowState: RowState;
13
+ }
14
+ /**
15
+ * 컬럼 전역 통계 스냅샷(엔진이 needs 합집합으로 채움). 순위·분위·중복은 함수로 조회.
16
+ * / Column-wide stats snapshot (engine fills the needs union). Rank/percentile/dup are functional.
17
+ */
18
+ export interface ColumnStats {
19
+ readonly min?: number;
20
+ readonly max?: number;
21
+ readonly avg?: number;
22
+ readonly stddev?: number;
23
+ readonly count?: number;
24
+ readonly distinct?: number;
25
+ /** 1-based 내림차순 순위(1=최대). 동값은 최소(최상) 순위 공유. topN 용. / 1-based descending rank (1=max). */
26
+ readonly rankOf?: (v: number) => number;
27
+ /** 1-based 오름차순 순위(1=최소). bottomN 용. / 1-based ascending rank (1=min). */
28
+ readonly rankAscOf?: (v: number) => number;
29
+ /** 값 이하 비율 0..1(백분위). / Fraction of values ≤ v (percentile). */
30
+ readonly percentileOf?: (v: number) => number;
31
+ /** 값의 출현 횟수(중복/고유 판정). / Occurrence count of a value (dup/unique). */
32
+ readonly countOf?: (v: number) => number;
33
+ }
34
+ /** 평가 컨텍스트 — now 주입으로 상대날짜 결정론(Date.now 금지). / Evaluation context; now injected for determinism. */
35
+ export interface EvalCtx {
36
+ readonly now: number;
37
+ readonly locale?: string;
38
+ }
39
+ /**
40
+ * 규칙 발화 시 산출되는 도메인 결과(시각 원시값 아님). 인코더가 소비.
41
+ * / The domain result produced when a rule fires (never a visual primitive); consumed by encoders.
42
+ */
43
+ export interface RuleDatum {
44
+ /** 정규화 비율 0..1(bar/scale continuous). / Normalized ratio 0..1. */
45
+ readonly ratio?: number;
46
+ /** 부호(-1|0|1) — 0기준 데이터바 양방향. / Sign (-1|0|1) for zero-based bidirectional bars. */
47
+ readonly sign?: -1 | 0 | 1;
48
+ /** 이산 구간 인덱스(0..bandCount-1). / Discrete band index. */
49
+ readonly bandIndex?: number;
50
+ /** 이산 구간 총수. / Total discrete bands. */
51
+ readonly bandCount?: number;
52
+ /** 판정에 쓰인 수치 원값(있으면). / The numeric value used (if any). */
53
+ readonly value?: number;
54
+ /** 클램프 발동 여부(범위 초과 고지, T5-007). / Whether clamping fired (out-of-range notice). */
55
+ readonly clamped?: boolean;
56
+ }
57
+ /** 규칙 하나의 판정 — 도메인 값(시각 원시값 아님). / A single rule's verdict — domain values only. */
58
+ export interface RuleVerdict {
59
+ readonly ruleId: string;
60
+ readonly fired: boolean;
61
+ /** 인코더가 소비할 인코딩 스펙. / The encode spec the encoder consumes. */
62
+ readonly encode: CFEncodeSpec;
63
+ /** 도메인 결과(정규화비율·구간·부호). / Domain result (ratio/band/sign). */
64
+ readonly datum: RuleDatum;
65
+ /** 이 규칙이 참조하는 스타일. / The style this rule references. */
66
+ readonly styleRef?: CFStyleRef | CFInlineStyle;
67
+ /** 계보(REQ-T5-809). / Lineage. */
68
+ readonly lineage: RuleLineage;
69
+ }
70
+ /**
71
+ * 셀 최종 판정 — 우선순위·Stop-If-True 병합 결과(§2.3, DD-03 CellVerdicts 와 동명이물이라 CF 접두).
72
+ * / Cell final verdict — priority + Stop-If-True merge result (CF-prefixed to avoid DD-03 collision).
73
+ */
74
+ export interface CFCellVerdict {
75
+ /** 배경 층 승자(bar|scale 최상위 1). / Background winner (topmost bar|scale). */
76
+ readonly background?: RuleVerdict;
77
+ /** 데코 층(아이콘/스파크 다중). / Decorator layer (icon/sparkline; multiple). */
78
+ readonly decorators: readonly RuleVerdict[];
79
+ /** "왜 이 색인가" 대표 승자. / Representative winner ("why this color"). */
80
+ readonly winner?: RuleVerdict;
81
+ /** Stop-If-True 로 중단시킨 ruleId. / The ruleId that halted via Stop-If-True. */
82
+ readonly stoppedAt?: string;
83
+ }
84
+ /**
85
+ * 컬럼 값 배열에서 ColumnStats 를 계산한다(min/max/avg/stddev/count/distinct + 순위·분위·중복 함수).
86
+ * 실제 엔진은 DD-02/07 이 스캔·캐시하되, "무엇이 필요한가"는 CF 소유(REQ-T5-803). 이 헬퍼는 그 계약의
87
+ * 참조 구현이자 테스트 편의다. 순수 함수.
88
+ * / Compute ColumnStats from a column's values. Pure; a reference implementation of the stats contract.
89
+ *
90
+ * @param values - 컬럼 값(원시·문자열 포함) / Column values (primitives/strings)
91
+ * @returns 순위·분위·중복 조회를 포함한 통계 스냅샷 / A stats snapshot including rank/percentile/dup lookups
92
+ */
93
+ export declare function computeColumnStats(values: readonly unknown[]): ColumnStats;
@@ -0,0 +1,21 @@
1
+ export type { CFRule, CFCondition, CFEncodeSpec, CFScope, CFStyleRef, CFInlineStyle, } from './CFRule.js';
2
+ export { CF_SCHEMA_VERSION, isStyleRef, cfRuleEquals } from './CFRule.js';
3
+ export type { AppearanceView, CFRampSeed } from './appearance.js';
4
+ export { staticAppearanceView } from './appearance.js';
5
+ export type { RowState, StatKind, CellInput, ColumnStats, EvalCtx, RuleDatum, RuleVerdict, CFCellVerdict, } from './eval-types.js';
6
+ export { computeColumnStats } from './eval-types.js';
7
+ export type { RuleLineage, CFLineageQuery, StatsSnapshot } from './lineage.js';
8
+ export { snapshotStats } from './lineage.js';
9
+ export type { CFPredicate, CFRuleTypeRegistry } from './predicates.js';
10
+ export { BUILTIN_PREDICATES, createRuleTypeRegistry } from './predicates.js';
11
+ export type { CFEvaluator } from './CFEvaluator.js';
12
+ export { DefaultCFEvaluator, computeDatum, scopeMatches } from './CFEvaluator.js';
13
+ export type { ScaleDomain } from './ColorScale.js';
14
+ export { NEUTRAL_MIDPOINT, sequentialColor, sequentialBands, divergingColor, divergingBands, } from './ColorScale.js';
15
+ export type { InkResolver, InkDecision } from './InkResolver.js';
16
+ export { DefaultInkResolver, passesInkGate, AA_BODY } from './InkResolver.js';
17
+ export type { CFEncoder, VisualSpec, CFEncoderRegistry } from './encoders.js';
18
+ export { createEncoderRegistry, BarEncoder, ScaleEncoder, IconEncoder, SparklineEncoder, } from './encoders.js';
19
+ export type { CFRuleLoader, LoadResult, LoaderRegistries, SkipReport, SkipReason, CFNamedStyleRegistry, } from './serialize.js';
20
+ export { DefaultCFRuleLoader, serializeRules, createNamedStyleRegistry } from './serialize.js';
21
+ export { CFEngine, CFRuleStore } from './CFEngine.js';
@@ -0,0 +1,32 @@
1
+ import { CFCondition, CFRule } from './CFRule.js';
2
+ import { CellInput, ColumnStats, EvalCtx } from './eval-types.js';
3
+ /** 판정에 참조된 통계 스냅샷(계보 기록용, 함수 제외 스칼라만). / Scalar stats snapshot referenced by a verdict. */
4
+ export interface StatsSnapshot {
5
+ readonly min?: number;
6
+ readonly max?: number;
7
+ readonly avg?: number;
8
+ readonly stddev?: number;
9
+ readonly count?: number;
10
+ readonly distinct?: number;
11
+ }
12
+ /** 규칙 계보 — 어느 규칙이 왜 이겼나(REQ-T5-809). / Rule lineage — which rule won and why. */
13
+ export interface RuleLineage {
14
+ readonly ruleId: string;
15
+ readonly conditionType: CFCondition['type'];
16
+ /** 발화 임계(비교값·N·σk·백분위 등). / Firing threshold (compare value, N, σk, percentile…). */
17
+ readonly threshold: Readonly<Record<string, unknown>>;
18
+ /** 판정에 쓰인 원시값. / The raw value used for the verdict. */
19
+ readonly inputValue: unknown;
20
+ /** 이 판정이 참조한 통계 스냅샷. / The stats snapshot this verdict referenced. */
21
+ readonly statsUsed: StatsSnapshot;
22
+ readonly priority: number;
23
+ /** 이 규칙이 이긴(덮은) 하위 규칙 id. / Ids of lower rules this rule won over. */
24
+ readonly wonOver: readonly string[];
25
+ }
26
+ /** 계보 조회 API — 인스펙터·직렬화·디버그·회귀가 공유(REQ-T5-901). / Lineage query shared by inspector/tests. */
27
+ export interface CFLineageQuery {
28
+ /** 발화한 규칙들의 계보를 우선순위 순으로 반환. / Return fired rules' lineage in priority order. */
29
+ explain(input: CellInput, rules: readonly CFRule[], stats: ColumnStats, ctx: EvalCtx): RuleLineage[];
30
+ }
31
+ /** ColumnStats(함수 포함)에서 계보용 스칼라 스냅샷만 추출. / Extract the scalar-only lineage snapshot. */
32
+ export declare function snapshotStats(stats: ColumnStats): StatsSnapshot;
@@ -0,0 +1,27 @@
1
+ import { IRegistry } from '../extension/Registry.js';
2
+ import { CFCondition } from './CFRule.js';
3
+ import { CellInput, ColumnStats, EvalCtx, StatKind } from './eval-types.js';
4
+ /**
5
+ * 조건 판정 술어(Strategy) — 순수. needs 로 요구 통계를 미리 선언(엔진이 stats 로 준다).
6
+ * / A pure condition predicate (Strategy). Declares required stats via needs.
7
+ *
8
+ * @typeParam C - 이 술어가 해석하는 조건 형 / The condition kind this predicate interprets
9
+ */
10
+ export interface CFPredicate<C extends CFCondition = CFCondition> {
11
+ /** 이 조건이 요구하는 통계 명세. / The stats this condition requires. */
12
+ readonly needs: readonly StatKind[];
13
+ /** true=발화. DOM·Date.now·난수 금지 — now·stats 는 주입. / true = fires; determinism enforced. */
14
+ test(cond: C, input: CellInput, stats: ColumnStats, ctx: EvalCtx): boolean;
15
+ }
16
+ /** 코어 내장 술어 8종 + custom 폴백(등록 map). / The 8 built-in predicates + custom fallback. */
17
+ export declare const BUILTIN_PREDICATES: Readonly<Record<CFCondition['type'], CFPredicate>>;
18
+ /** CF 조건 술어 레지스트리(DD-10 IRegistry 동형). / CF rule-type registry (IRegistry-homomorphic). */
19
+ export type CFRuleTypeRegistry = IRegistry<CFPredicate>;
20
+ /**
21
+ * 조건 술어 레지스트리 생성 — 내장 8종+custom 폴백을 builtin 으로 등록(코어 보호), 신규/교체는 SPI.
22
+ * 동일 type 재등록 = last-wins(user origin), builtin 은 override:true 필요(§4.7 교체 시맨틱).
23
+ * / Create the rule-type registry with built-ins registered as protected; new/replacement via SPI.
24
+ *
25
+ * @returns 내장 술어가 채워진 IRegistry / An IRegistry pre-populated with built-in predicates
26
+ */
27
+ export declare function createRuleTypeRegistry(): CFRuleTypeRegistry;
@@ -0,0 +1,46 @@
1
+ import { CFRule, CFInlineStyle } from './CFRule.js';
2
+ import { CFRuleTypeRegistry } from './predicates.js';
3
+ import { CFEncoderRegistry } from './encoders.js';
4
+ import { IRegistry } from '../extension/Registry.js';
5
+ /** named style 레지스트리(DD-10 IRegistry 동형). / Named-style registry (IRegistry-homomorphic). */
6
+ export type CFNamedStyleRegistry = IRegistry<CFInlineStyle>;
7
+ /**
8
+ * named style 레지스트리 생성 — 재사용 셀 스타일 프리셋 등록점(색조정자 단일관리). 동일 name 재등록=교체.
9
+ * / Create the named-style registry — a registration point for reusable cell-style presets.
10
+ *
11
+ * @returns 빈 IRegistry(프리셋 번들이 채운다) / An empty IRegistry (populated by preset bundles)
12
+ */
13
+ export declare function createNamedStyleRegistry(): CFNamedStyleRegistry;
14
+ /** skip 사유. / Reason a rule/reference was skipped. */
15
+ export type SkipReason = 'unknown-condition' | 'unknown-encoder' | 'unknown-style' | 'future-version' | 'malformed';
16
+ /** skip 신고 1건. / A single skip report. */
17
+ export interface SkipReport {
18
+ readonly ruleId: string;
19
+ readonly reason: SkipReason;
20
+ readonly detail: string;
21
+ }
22
+ /** 로드 결과 — 유효 규칙 + skip 신고(경고는 값으로). / Load result — valid rules plus skip reports. */
23
+ export interface LoadResult {
24
+ readonly rules: CFRule[];
25
+ readonly skipped: SkipReport[];
26
+ }
27
+ /** 로더가 참조하는 레지스트리 3종. / The three registries the loader consults. */
28
+ export interface LoaderRegistries {
29
+ readonly types: CFRuleTypeRegistry;
30
+ readonly encoders: CFEncoderRegistry;
31
+ readonly styles: CFNamedStyleRegistry;
32
+ }
33
+ /** 로더 계약. / Loader contract. */
34
+ export interface CFRuleLoader {
35
+ load(json: unknown, reg: LoaderRegistries): LoadResult;
36
+ }
37
+ /**
38
+ * 규칙 배열(JSON)을 로드한다 — 미지 조건/인코더/스타일 참조·미래 버전·비정형은 skip + SkipReport,
39
+ * 나머지는 정상 규칙으로 반환한다(그리드가 죽지 않는다).
40
+ * / Load a JSON rule array; unknown/future/malformed entries skip with a report, the rest load.
41
+ */
42
+ export declare class DefaultCFRuleLoader implements CFRuleLoader {
43
+ load(json: unknown, reg: LoaderRegistries): LoadResult;
44
+ }
45
+ /** 규칙 배열을 직렬화(값객체라 순수 JSON). 계보·통계는 파생물이라 제외. / Serialize rules (pure JSON). */
46
+ export declare function serializeRules(rules: readonly CFRule[]): string;
@@ -1,6 +1,16 @@
1
1
  import { ChartAdapter, ChartDataModel, ChartPoint, ChartRenderSpec } from './types.js';
2
2
  import { PointGeom } from './hittest.js';
3
+ /**
4
+ * 내장 canvas 차트 어댑터. host 요소에 canvas·시각숨김 a11y 테이블·실 button 범례·툴팁·aria-live
5
+ * 를 마운트하고, `ChartDataModel`을 bar/line/area 로 렌더한다(§3/§4/§B). 기하(hit-test 대상)와
6
+ * DOM 은 ctx 없이도 완성되고, 픽셀 그리기만 ctx 에 의존한다(jsdom 안전).
7
+ * / Built-in canvas chart adapter. Mounts a canvas, a visually-hidden a11y table, a real
8
+ * `<button>` legend, a tooltip, and an aria-live region into the host element, and renders a
9
+ * `ChartDataModel` as bar/line/area (§3/§4/§B). Geometry (the hit-test target) and DOM are
10
+ * complete even without a 2D context; only pixel drawing depends on ctx (jsdom-safe).
11
+ */
3
12
  export declare class CanvasAdapter implements ChartAdapter {
13
+ /** 어댑터 식별자(ChartAdapter 레지스트리 키). / Adapter identifier (ChartAdapter registry key). */
4
14
  readonly id = "builtin-canvas";
5
15
  private _host;
6
16
  private _canvas;
@@ -16,12 +26,51 @@ export declare class CanvasAdapter implements ChartAdapter {
16
26
  private _hidden;
17
27
  private _cursor;
18
28
  private _onPoint;
29
+ /**
30
+ * host 에 canvas·a11y 테이블·범례·툴팁·aria-live 를 마운트하고 포인터/키보드 리스너를 건다(§B).
31
+ * / Mount canvas, a11y table, legend, tooltip, and aria-live into the host, and attach the
32
+ * pointer/keyboard listeners (§B).
33
+ *
34
+ * @param host - 차트를 붙일 컨테이너 요소 / Container element the chart mounts into
35
+ * @param spec - 렌더 스펙(제목·팔레트·테마·포맷·a11y 옵션) / Render spec (title, palette, theme, format, a11y options)
36
+ */
19
37
  init(host: HTMLElement, spec: ChartRenderSpec): Promise<void>;
38
+ /**
39
+ * 데이터 모델을 렌더한다 — a11y 테이블·범례·기하 계산·픽셀 도색을 순서대로 수행하고, 라이브
40
+ * 갱신으로 categories/series 수가 줄면 커서를 즉시 클램프한다(§4/§B). 반복 호출 안전(라이브 재렌더).
41
+ * / Render the data model — refreshes the a11y table, legend, geometry, and pixel paint in
42
+ * order, and immediately clamps the cursor when a live update shrinks categories/series
43
+ * (§4/§B). Safe to call repeatedly (live re-render).
44
+ *
45
+ * @param model - 렌더할 차트 데이터 모델 / Chart data model to render
46
+ * @param spec - 렌더 스펙(테마·팔레트·툴팁/범례 토글 등) / Render spec (theme, palette, tooltip/legend toggles, …)
47
+ */
20
48
  render(model: ChartDataModel, spec: ChartRenderSpec): void;
49
+ /**
50
+ * 표시 크기를 바꾸고(하한 80×60 클램프) 마지막 모델로 재렌더한다.
51
+ * / Change the display size (clamped to a minimum of 80×60) and re-render the last model.
52
+ *
53
+ * @param width - 새 너비(px) / New width in px
54
+ * @param height - 새 높이(px) / New height in px
55
+ */
21
56
  resize(width: number, height: number): void;
57
+ /**
58
+ * 데이터포인트 클릭/활성화(Enter·Space) 콜백을 등록한다(단일 콜백, 재호출 시 교체).
59
+ * / Register the data-point click/activation (Enter·Space) callback (single callback, replaced on re-call).
60
+ *
61
+ * @param cb - 클릭된 포인트를 받는 콜백 / Callback receiving the clicked point
62
+ */
22
63
  onPointClick(cb: (p: ChartPoint) => void): void;
64
+ /**
65
+ * 리스너를 떼고 마운트한 모든 DOM(canvas·테이블·범례·툴팁·live)을 제거해 원상복구한다.
66
+ * / Detach listeners and remove all mounted DOM (canvas, table, legend, tooltip, live), restoring the host.
67
+ */
23
68
  destroy(): void;
24
- /** 렌더된 포인트 기하(hittest.spec/adapter.spec 검증용). */
69
+ /**
70
+ * 렌더된 포인트 기하(hit-test 검증용). / Rendered point geometry (for hit-test verification).
71
+ * @returns 마지막 렌더의 PointGeom 배열(읽기전용) / The last render's PointGeom array (read-only)
72
+ * @internal
73
+ */
25
74
  getGeometry(): readonly PointGeom[];
26
75
  private _renderA11yTable;
27
76
  /**