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,61 @@
1
+ import { DomainValue, DomainValueDTO } from './DomainValue.js';
2
+ import { ValueType } from './ValueType.js';
3
+ /**
4
+ * 셀 주소 값 객체(REQ-T8-808). / Cell address value object.
5
+ */
6
+ export declare class CellAddress implements DomainValue {
7
+ readonly row: number;
8
+ readonly col: number;
9
+ readonly kind = "cellAddress";
10
+ private constructor();
11
+ /** 논리 주소 생성(음수 → 0 클램프). / Construct a logical address (negatives clamp to 0). */
12
+ static of(row: number, col: number): CellAddress;
13
+ /** "B3" → (row=2, col=1). / Parse an A1 reference. */
14
+ static parseA1(a1: string): CellAddress;
15
+ /** A1 표기(예: "B3"). / A1 notation. */
16
+ toA1(): string;
17
+ /** R1C1 표기(예: "R3C2"). / R1C1 notation. */
18
+ toR1C1(): string;
19
+ get type(): ValueType;
20
+ isMissing(): boolean;
21
+ isError(): boolean;
22
+ isBlank(): boolean;
23
+ equals(other: DomainValue): boolean;
24
+ hashKey(): string;
25
+ /** 행 우선, 그다음 열. / Row-major then column. */
26
+ compareTo(other: DomainValue): number;
27
+ textEquivalent(_locale?: string): string;
28
+ toJSON(): DomainValueDTO;
29
+ }
30
+ /**
31
+ * 셀 범위 값 객체(REQ-T8-808) — 정규화 불변식 보증(항상 start≤end).
32
+ * / Cell range value object; always normalized so start ≤ end.
33
+ */
34
+ export declare class CellRange implements DomainValue {
35
+ readonly start: CellAddress;
36
+ readonly end: CellAddress;
37
+ readonly kind = "cellRange";
38
+ private constructor();
39
+ /** 역방향 드래그를 (min→max)로 자동 정규화. / Normalize a reversed drag to (min→max). */
40
+ static of(a: CellAddress, b: CellAddress): CellRange;
41
+ get type(): ValueType;
42
+ isMissing(): boolean;
43
+ isError(): boolean;
44
+ isBlank(): boolean;
45
+ /** 주소 포함 여부. / Whether an address lies within the range. */
46
+ contains(addr: CellAddress): boolean;
47
+ /** 범위 교차 여부(병합 비중첩 검사용). / Whether two ranges intersect. */
48
+ intersects(other: CellRange): boolean;
49
+ /** 중첩/인접 범위 집합을 정규형(정렬된 비중첩 집합)으로 환원(REQ-T3-826). / Reduce to a sorted, non-overlapping set. */
50
+ static normalizeSet(ranges: CellRange[]): CellRange[];
51
+ private static _touching;
52
+ equals(other: DomainValue): boolean;
53
+ hashKey(): string;
54
+ compareTo(other: DomainValue): number;
55
+ textEquivalent(_locale?: string): string;
56
+ toJSON(): DomainValueDTO;
57
+ }
58
+ /** CellAddress 값 타입. / ValueType for cellAddress. */
59
+ export declare const cellAddressType: ValueType;
60
+ /** CellRange 값 타입. / ValueType for cellRange. */
61
+ export declare const cellRangeType: ValueType;
@@ -0,0 +1,29 @@
1
+ import { DomainValue } from './DomainValue.js';
2
+ /** 행 참조(안정 rowId 또는 flat 인덱스). / Row reference (stable rowId or flat index). */
3
+ export type RowRef = string | number;
4
+ /** 편집기 진입 시드(raw 로부터 파생). / Editor seed derived from raw. */
5
+ export interface EditorSeed {
6
+ /** 편집기 초기 문자열. / Initial editor string. */
7
+ readonly text: string;
8
+ /** 선택 힌트(select 등). / Optional choice hints. */
9
+ readonly choices?: readonly string[];
10
+ }
11
+ /**
12
+ * 셀 값 3계층 계약(REQ-T6-803). / Cell value 3-layer access contract.
13
+ *
14
+ * @invariant raw 는 항상 DomainValue. display/editor 는 raw 에서 단방향 파생(역참조 금지).
15
+ *
16
+ * ★역참조 금지 불변식:
17
+ * - getDisplay/getEditorSeed 의 반환(문자열/시드)을 다시 계산·집계로 흘리는 API 가 존재하지 않는다.
18
+ * - 계산/집계/차트/정렬/검증은 오직 getRawValue(값 객체)만 소비한다.
19
+ */
20
+ export interface CellValueAccess {
21
+ /** ── 정본(계산·차트·집계·정렬·검증이 소비) ── / Canonical raw value. */
22
+ getRawValue(row: RowRef, field: string): DomainValue;
23
+ /** ── 표시 파생(뷰 전용, DD-04 포맷터가 raw 로부터 산출) ── / Derived display string. */
24
+ getDisplay(row: RowRef, field: string): string;
25
+ /** ── 편집 시드(편집기 진입 값) ── / Editor seed. */
26
+ getEditorSeed(row: RowRef, field: string): EditorSeed;
27
+ /** 편집 커밋 — 원시 입력을 값 객체로 되돌리는 유일 경로(단방향 닫힘). / Commit an edit back into a value object. */
28
+ commitEdit(row: RowRef, field: string, rawInput: unknown): DomainValue;
29
+ }
@@ -0,0 +1,37 @@
1
+ import { OGDecimal, OGDecimalLike } from '../OGDecimal.js';
2
+ import { DomainValue, DomainValueDTO } from './DomainValue.js';
3
+ import { ValueType } from './ValueType.js';
4
+ import { GrowthRate, BaseValidity } from './Ratios.js';
5
+ /** 증감 방향. / Change direction. */
6
+ export type DeltaDirection = 'up' | 'down' | 'flat';
7
+ /**
8
+ * 증감 값 객체(REQ-T5-813). / Delta value object.
9
+ */
10
+ export declare class Delta implements DomainValue {
11
+ readonly current: OGDecimal;
12
+ readonly base: OGDecimal;
13
+ readonly direction: DeltaDirection;
14
+ readonly magnitude: OGDecimal;
15
+ readonly baseValidity: BaseValidity;
16
+ readonly kind = "delta";
17
+ private constructor();
18
+ /**
19
+ * 현재·기저·무변화 임계(eps)로 증감 생성. 방향/절대델타/기저적법을 한 곳에서 판정.
20
+ * / Build a delta; direction, magnitude and base validity are decided in one place.
21
+ */
22
+ static from(current: OGDecimalLike, base: OGDecimalLike, eps?: OGDecimalLike): Delta;
23
+ get type(): ValueType;
24
+ isMissing(): boolean;
25
+ isError(): boolean;
26
+ isBlank(): boolean;
27
+ /** 파생 증감률(같은 기저 규칙 재사용). / Derived growth rate (reuses the same base rules). */
28
+ growthRate(): GrowthRate;
29
+ equals(other: DomainValue): boolean;
30
+ hashKey(): string;
31
+ /** 절대델타(magnitude) 순. / Ordered by magnitude. */
32
+ compareTo(other: DomainValue): number;
33
+ textEquivalent(locale?: string): string;
34
+ toJSON(): DomainValueDTO;
35
+ }
36
+ /** Delta 값 타입(레지스트리 등록용). / ValueType for delta. */
37
+ export declare const deltaType: ValueType;
@@ -0,0 +1,80 @@
1
+ import { OGDecimal } from '../OGDecimal.js';
2
+ import { ValueType } from './ValueType.js';
3
+ /**
4
+ * 값 종류 판별자(개방형). 미지 kind 는 원시값 폴백(REQ-TX-831).
5
+ * / Open value-kind discriminant. Unknown kinds fall back to plain values.
6
+ */
7
+ export type ValueKind = 'number' | 'text' | 'money' | 'ratio' | 'percent' | 'percentagePoint' | 'growthRate' | 'delta' | 'quantity' | 'missing' | 'error' | 'normBasis' | 'thresholdSet' | 'aggregate' | 'cellAddress' | 'cellRange' | (string & {});
8
+ /**
9
+ * 값 객체 직렬화 슬라이스(개방형 태그드 유니온). / Serialization slice for a value object.
10
+ * 왕복 스키마·envelope 조립은 DD-09/TX-833 소유. 여기선 최소 형상만 정의.
11
+ */
12
+ export interface DomainValueDTO {
13
+ /** 역직렬화 시 registry.get(kind).parse 로 복원. / Kind used to restore via the registry. */
14
+ readonly kind: ValueKind;
15
+ /** 원시 원값(OGDecimal → 문자열로 정밀 보존). / Raw value (OGDecimal serialized as string). */
16
+ readonly v?: string | number | null;
17
+ /** 값종별 부속(currency·reason·code·unit 등). / Per-kind payload. */
18
+ readonly meta?: Readonly<Record<string, unknown>>;
19
+ }
20
+ /**
21
+ * 값 객체 루트. 불변·자기 도메인 인지·표현 무지(SRP).
22
+ * / Value-object root. Immutable, domain-aware, presentation-agnostic.
23
+ */
24
+ export interface DomainValue {
25
+ /** 개방형 종류 판별자. / Open discriminant. */
26
+ readonly kind: ValueKind;
27
+ /** 소속 ValueType(메타 보유). / The owning ValueType (carries domain meta). */
28
+ readonly type: ValueType;
29
+ /** Missing 인스턴스일 때 true. / true when this is a Missing value. */
30
+ isMissing(): boolean;
31
+ /** ErrorValue 인스턴스일 때 true. / true when this is an ErrorValue. */
32
+ isError(): boolean;
33
+ /** null/none 계열일 때 true(실제 0 은 false). / true for null/none (real 0 is false). */
34
+ isBlank(): boolean;
35
+ /**
36
+ * 구조적 동등성(REQ-T8-843) — 값 동등(참조 아님). / Structural (by-value) equality.
37
+ * a.equals(b) ⟺ a.hashKey()===b.hashKey().
38
+ */
39
+ equals(other: DomainValue): boolean;
40
+ /** 동등성/맵 키용 안정 해시 문자열. / Stable hash string for equality/map keys. */
41
+ hashKey(): string;
42
+ /**
43
+ * 도메인 비교 규칙(REQ-T3-802) — 항상 전순서. / Total-order domain comparison.
44
+ * 3단 층위: kindRank(정상<오류<결측) → kind 그룹키 → 동일 kind 도메인 순서.
45
+ * @returns 음수/0/양수 (this </=/> other).
46
+ */
47
+ compareTo(other: DomainValue): number;
48
+ /**
49
+ * 로케일 인지 텍스트 등가물(REQ-T5-817) — aria 접근성 쌍둥이의 데이터 원천.
50
+ * / Locale-aware text equivalent — data source for the accessible twin (aria).
51
+ */
52
+ textEquivalent(locale?: string): string;
53
+ /** 직렬화 슬라이스. / Serialization slice. */
54
+ toJSON(): DomainValueDTO;
55
+ }
56
+ /** 4-state 값 상태(REQ-TX-832) — 실제 0 을 blank 와 구분. / Four-state value state. */
57
+ export type ValueState = 'value' | 'zero' | 'blank' | 'error';
58
+ /**
59
+ * 값 상태 분류(REQ-TX-832) — 실제 0 을 blank(없음)와 명확히 구분.
60
+ * / Classify a value's state, distinguishing a real zero from a blank/missing value.
61
+ */
62
+ export declare function classifyState(v: DomainValue): ValueState;
63
+ /**
64
+ * 값 객체에서 정밀 수치 원값을 추출(없으면 null). / Extract the precise numeric backing value (or null).
65
+ * NormalizationBasis·ThresholdSet·classifyState 공유. 결측/오류/텍스트는 null.
66
+ */
67
+ export declare function numericOf(v: DomainValue): OGDecimal | null;
68
+ /**
69
+ * kindRank — 전순서 최상위 층(정상<오류<결측). / Top total-order layer: normal < error < missing.
70
+ */
71
+ export declare function kindRank(v: DomainValue): number;
72
+ /**
73
+ * 전순서 사전식 스캐폴드. kindRank → kind 그룹키까지 판정하고,
74
+ * 동일 kind(비교 적합)면 null 을 반환해 호출자가 도메인 순서를 적용한다.
75
+ * / Total-order scaffold. Resolves rank & cross-kind grouping; returns null when
76
+ * the two share a comparable kind so the caller applies the domain ordering.
77
+ */
78
+ export declare function compareByRankAndKind(a: DomainValue, b: DomainValue): number | null;
79
+ /** OGDecimal 3항 비교(-1/0/1). / OGDecimal three-way comparison. */
80
+ export declare function cmpDecimal(a: OGDecimal, b: OGDecimal): number;
@@ -0,0 +1,65 @@
1
+ import { DomainValue, DomainValueDTO } from './DomainValue.js';
2
+ import { ValueType } from './ValueType.js';
3
+ /** 결측 사유 5종(REQ-TX-832) — 실제 0 과 구분. / Five missing reasons, distinct from a real zero. */
4
+ export declare enum MissingReason {
5
+ NotApplicable = "na",// 미해당(구조적으로 값이 없음) / structurally not applicable
6
+ NoData = "no-data",// 미수집(있어야 하나 아직 없음) / expected but not yet collected
7
+ Suppressed = "suppressed",// 억제(권한·프라이버시로 가림) / suppressed for privacy/permission
8
+ Calculating = "pending",// 계산 중/미확정 / calculating / not finalized
9
+ Error = "error"
10
+ }
11
+ /** 표준 오류 토큰 셋 — 문자열 아닌 값 객체. / Standard error tokens as a value object, not a string. */
12
+ export declare enum ErrorCode {
13
+ DivZero = "#DIV/0!",
14
+ Ref = "#REF!",
15
+ Value = "#VALUE!",
16
+ Name = "#NAME?",
17
+ NA = "#N/A",
18
+ Num = "#NUM!",
19
+ Cycle = "#CYCLE!"
20
+ }
21
+ /**
22
+ * 결측 값 객체(REQ-TX-832). 사유별 캐시 싱글턴. / Missing value object; cached per reason.
23
+ */
24
+ export declare class Missing implements DomainValue {
25
+ readonly reason: MissingReason;
26
+ readonly kind = "missing";
27
+ private static _cache;
28
+ private constructor();
29
+ /** 사유별 캐시된 싱글턴. / Cached singleton per reason. */
30
+ static of(reason: MissingReason): Missing;
31
+ get type(): ValueType;
32
+ isMissing(): boolean;
33
+ isError(): boolean;
34
+ isBlank(): boolean;
35
+ equals(other: DomainValue): boolean;
36
+ hashKey(): string;
37
+ compareTo(other: DomainValue): number;
38
+ textEquivalent(locale?: string): string;
39
+ toJSON(): DomainValueDTO;
40
+ }
41
+ /**
42
+ * 오류 값 객체 — 표준 오류 토큰(결측·0 과 구분). / Error value object; distinct from missing/zero.
43
+ */
44
+ export declare class ErrorValue implements DomainValue {
45
+ readonly code: ErrorCode;
46
+ readonly detail?: string | undefined;
47
+ readonly kind = "error";
48
+ private constructor();
49
+ static of(code: ErrorCode, detail?: string): ErrorValue;
50
+ get type(): ValueType;
51
+ isMissing(): boolean;
52
+ isError(): boolean;
53
+ isBlank(): boolean;
54
+ /** 오류 전파(산술·집계에서 우선 전파). / Errors propagate through arithmetic/aggregation. */
55
+ propagate(): ErrorValue;
56
+ equals(other: DomainValue): boolean;
57
+ hashKey(): string;
58
+ compareTo(other: DomainValue): number;
59
+ textEquivalent(_locale?: string): string;
60
+ toJSON(): DomainValueDTO;
61
+ }
62
+ /** Missing 값 타입(레지스트리 등록용). / ValueType for missing. */
63
+ export declare const missingType: ValueType;
64
+ /** Error 값 타입(레지스트리 등록용). / ValueType for error. */
65
+ export declare const errorType: ValueType;
@@ -0,0 +1,42 @@
1
+ import { OGDecimal, OGDecimalLike } from '../OGDecimal.js';
2
+ import { DomainValue, DomainValueDTO } from './DomainValue.js';
3
+ import { ValueType } from './ValueType.js';
4
+ /** 통화 불일치 산술 오류. / Raised when arithmetic mixes different currencies. */
5
+ export declare class MoneyMismatchError extends Error {
6
+ constructor(a: string, b: string);
7
+ }
8
+ /** 통화별 최소단위 소수자리. / Minor-unit digits for a currency. */
9
+ export declare function minorUnitsOf(currency: string): number;
10
+ /**
11
+ * 통화 값 객체(REQ-T9-838). / Money value object.
12
+ */
13
+ export declare class Money implements DomainValue {
14
+ readonly amount: OGDecimal;
15
+ readonly currency: string;
16
+ readonly minorUnits: number;
17
+ readonly kind = "money";
18
+ private constructor();
19
+ /** 금액+통화로 생성. / Construct from amount and currency. */
20
+ static of(amount: OGDecimalLike, currency: string): Money;
21
+ get type(): ValueType;
22
+ isMissing(): boolean;
23
+ isError(): boolean;
24
+ isBlank(): boolean;
25
+ private _same;
26
+ /** 같은 통화 덧셈(불일치 시 throw). / Add same-currency money (throws on mismatch). */
27
+ add(other: Money): Money;
28
+ /** 같은 통화 뺄셈(불일치 시 throw). / Subtract same-currency money (throws on mismatch). */
29
+ sub(other: Money): Money;
30
+ /** 명시적 환산(레이트 주입) — 통화 교차 산술의 유일 경로. / Explicit conversion via injected rate. */
31
+ convertTo(currency: string, rate: OGDecimalLike): Money;
32
+ /** penny-rounding: 최소단위로 HALF_EVEN 반올림. / Round to the currency's minor unit (banker's). */
33
+ roundToMinorUnit(): Money;
34
+ equals(other: DomainValue): boolean;
35
+ hashKey(): string;
36
+ /** 동일 통화=amount, 다통화=currency 콜레이션 그룹분리 후 amount. / Same currency: by amount; else by currency code then amount. */
37
+ compareTo(other: DomainValue): number;
38
+ textEquivalent(_locale?: string): string;
39
+ toJSON(): DomainValueDTO;
40
+ }
41
+ /** Money 값 타입(레지스트리 등록용). / ValueType for money. */
42
+ export declare const moneyType: ValueType;
@@ -0,0 +1,47 @@
1
+ import { OGDecimal, OGDecimalLike } from '../OGDecimal.js';
2
+ import { DomainValue, DomainValueDTO } from './DomainValue.js';
3
+ import { ValueType } from './ValueType.js';
4
+ /** 정규화 스코프. / Normalization scope. */
5
+ export type NormScope = 'row' | 'column' | 'global' | 'selection';
6
+ /** 정규화 앵커. / Normalization anchor. */
7
+ export type NormAnchor = 'zero' | 'min';
8
+ /** 정규화 스케일. / Normalization scale. */
9
+ export type NormScale = 'linear' | 'log';
10
+ /**
11
+ * 정규화 기준 값 객체(REQ-TX-836). / Shared normalization basis for micro-visuals.
12
+ */
13
+ export declare class NormalizationBasis implements DomainValue {
14
+ readonly scope: NormScope;
15
+ readonly min: OGDecimal;
16
+ readonly max: OGDecimal;
17
+ readonly anchor: NormAnchor;
18
+ readonly clamp: boolean;
19
+ readonly scale: NormScale;
20
+ readonly kind = "normBasis";
21
+ private constructor();
22
+ static of(opts: {
23
+ scope: NormScope;
24
+ min: OGDecimalLike;
25
+ max: OGDecimalLike;
26
+ anchor?: NormAnchor;
27
+ clamp?: boolean;
28
+ scale?: NormScale;
29
+ }): NormalizationBasis;
30
+ get type(): ValueType;
31
+ isMissing(): boolean;
32
+ isError(): boolean;
33
+ isBlank(): boolean;
34
+ /**
35
+ * 값 → 0~1 사상(클램프/로그 규칙 내장). 결측/오류는 null(gap).
36
+ * / Project a value to [0,1]; missing/error → null (gap).
37
+ */
38
+ project(v: DomainValue): number | null;
39
+ private _clampT;
40
+ equals(other: DomainValue): boolean;
41
+ hashKey(): string;
42
+ compareTo(other: DomainValue): number;
43
+ textEquivalent(_locale?: string): string;
44
+ toJSON(): DomainValueDTO;
45
+ }
46
+ /** NormalizationBasis 값 타입. / ValueType for normBasis. */
47
+ export declare const normBasisType: ValueType;
@@ -0,0 +1,45 @@
1
+ import { OGDecimal, OGDecimalLike } from '../OGDecimal.js';
2
+ import { DomainValue, DomainValueDTO } from './DomainValue.js';
3
+ import { ValueType } from './ValueType.js';
4
+ /** 일반 숫자 값 객체. / Plain number value object. */
5
+ export declare class PlainNumber implements DomainValue {
6
+ readonly value: OGDecimal;
7
+ readonly kind = "number";
8
+ private constructor();
9
+ static of(value: OGDecimalLike): PlainNumber;
10
+ get type(): ValueType;
11
+ isMissing(): boolean;
12
+ isError(): boolean;
13
+ isBlank(): boolean;
14
+ equals(other: DomainValue): boolean;
15
+ hashKey(): string;
16
+ compareTo(other: DomainValue): number;
17
+ textEquivalent(_locale?: string): string;
18
+ toJSON(): DomainValueDTO;
19
+ }
20
+ /** 일반 텍스트 값 객체. / Plain text value object. */
21
+ export declare class PlainText implements DomainValue {
22
+ readonly value: string;
23
+ readonly kind = "text";
24
+ private constructor();
25
+ static of(value: string): PlainText;
26
+ get type(): ValueType;
27
+ isMissing(): boolean;
28
+ isError(): boolean;
29
+ isBlank(): boolean;
30
+ equals(other: DomainValue): boolean;
31
+ hashKey(): string;
32
+ compareTo(other: DomainValue): number;
33
+ textEquivalent(_locale?: string): string;
34
+ toJSON(): DomainValueDTO;
35
+ }
36
+ /** PlainNumber 값 타입. / ValueType for plain number. */
37
+ export declare const plainNumberType: ValueType;
38
+ /** PlainText 값 타입. / ValueType for plain text. */
39
+ export declare const plainTextType: ValueType;
40
+ /**
41
+ * PLAIN 폴백 값 타입(REQ-TX-831) — 미등록 kind 소비 시 반환.
42
+ * 수치면 PlainNumber, 아니면 PlainText 로 안전 처리.
43
+ * / PLAIN fallback type for unregistered kinds; numeric → PlainNumber, else PlainText.
44
+ */
45
+ export declare const plainType: ValueType;
@@ -0,0 +1,32 @@
1
+ import { OGDecimal, OGDecimalLike } from '../OGDecimal.js';
2
+ import { DomainValue, DomainValueDTO } from './DomainValue.js';
3
+ import { ValueType } from './ValueType.js';
4
+ /** 차원/단위 불일치 합산 오류. / Raised when quantities of different dimensions/units are combined. */
5
+ export declare class QuantityMismatchError extends Error {
6
+ constructor(a: string, b: string);
7
+ }
8
+ /**
9
+ * 수량 값 객체(REQ-T9-839 근접). / Quantity value object with a unit dimension.
10
+ */
11
+ export declare class Quantity implements DomainValue {
12
+ readonly value: OGDecimal;
13
+ readonly unit: string;
14
+ readonly dimension: string;
15
+ readonly kind = "quantity";
16
+ private constructor();
17
+ static of(value: OGDecimalLike, unit: string, dimension?: string): Quantity;
18
+ get type(): ValueType;
19
+ isMissing(): boolean;
20
+ isError(): boolean;
21
+ isBlank(): boolean;
22
+ /** 동일 차원·동일 단위만 합산(불일치 시 throw). / Add only same dimension & unit (throws otherwise). */
23
+ add(other: Quantity): Quantity;
24
+ equals(other: DomainValue): boolean;
25
+ hashKey(): string;
26
+ /** 동일 단위=value, 이종 단위=unit 콜레이션 그룹분리 후 value. / Same unit: by value; else group by unit code. */
27
+ compareTo(other: DomainValue): number;
28
+ textEquivalent(_locale?: string): string;
29
+ toJSON(): DomainValueDTO;
30
+ }
31
+ /** Quantity 값 타입(레지스트리 등록용). / ValueType for quantity. */
32
+ export declare const quantityType: ValueType;
@@ -0,0 +1,100 @@
1
+ import { OGDecimal, OGDecimalLike } from '../OGDecimal.js';
2
+ import { DomainValue, DomainValueDTO } from './DomainValue.js';
3
+ import { ValueType } from './ValueType.js';
4
+ /**
5
+ * 기저 적법성 판별자(REQ-T2-803) — GrowthRate·Delta 공유 정본 열거.
6
+ * / Base validity discriminant shared by GrowthRate and Delta.
7
+ */
8
+ export type BaseValidity = 'ok' | 'zeroBase' | 'negativeBase' | 'signChange';
9
+ /** 0~1 무차원 비율. / Dimensionless ratio in [0,1]. */
10
+ export declare class Ratio implements DomainValue {
11
+ readonly value: OGDecimal;
12
+ readonly kind = "ratio";
13
+ private constructor();
14
+ static of(value: OGDecimalLike): Ratio;
15
+ get type(): ValueType;
16
+ isMissing(): boolean;
17
+ isError(): boolean;
18
+ isBlank(): boolean;
19
+ /** ×100 명시 변환. / Explicit ×100 conversion. */
20
+ toPercent(): Percent;
21
+ /**
22
+ * 비율 집계 적법성(REQ-T2-805): 단순평균 금지 → 가중평균만(가중치=모수).
23
+ * / Weighted mean only (weights = population size); simple mean is disallowed.
24
+ */
25
+ static weightedMean(pairs: Array<[Ratio, OGDecimalLike]>): Ratio;
26
+ equals(other: DomainValue): boolean;
27
+ hashKey(): string;
28
+ compareTo(other: DomainValue): number;
29
+ textEquivalent(_locale?: string): string;
30
+ toJSON(): DomainValueDTO;
31
+ }
32
+ /** 백분율(예: 12.5%). / Percentage (e.g. 12.5%). */
33
+ export declare class Percent implements DomainValue {
34
+ readonly value: OGDecimal;
35
+ readonly kind = "percent";
36
+ private constructor();
37
+ static of(value: OGDecimalLike): Percent;
38
+ get type(): ValueType;
39
+ isMissing(): boolean;
40
+ isError(): boolean;
41
+ isBlank(): boolean;
42
+ /** ÷100 명시 변환. / Explicit ÷100 conversion. */
43
+ toRatio(): Ratio;
44
+ /** %p 는 오직 두 Percent 의 차로만 생성(의미 강제). / A %p is only produced by subtracting two Percents. */
45
+ minus(other: Percent): PercentagePoint;
46
+ equals(other: DomainValue): boolean;
47
+ hashKey(): string;
48
+ compareTo(other: DomainValue): number;
49
+ textEquivalent(locale?: string): string;
50
+ toJSON(): DomainValueDTO;
51
+ }
52
+ /** 퍼센트 포인트(%p) — 두 Percent 의 차. Percent 로 암시 변환 없음. / Percentage point; no implicit conversion to Percent. */
53
+ export declare class PercentagePoint implements DomainValue {
54
+ readonly value: OGDecimal;
55
+ readonly kind = "percentagePoint";
56
+ private constructor();
57
+ static of(value: OGDecimalLike): PercentagePoint;
58
+ get type(): ValueType;
59
+ isMissing(): boolean;
60
+ isError(): boolean;
61
+ isBlank(): boolean;
62
+ /** 가법(같은 %p 끼리만). / Addition (only with another %p). */
63
+ add(other: PercentagePoint): PercentagePoint;
64
+ equals(other: DomainValue): boolean;
65
+ hashKey(): string;
66
+ compareTo(other: DomainValue): number;
67
+ textEquivalent(locale?: string): string;
68
+ toJSON(): DomainValueDTO;
69
+ }
70
+ /**
71
+ * 증감률(REQ-T2-803) — 부호·기저 규칙을 값 객체에 못박음.
72
+ * / Growth rate; base/sign rules are encoded in the value object.
73
+ */
74
+ export declare class GrowthRate implements DomainValue {
75
+ readonly rate: OGDecimal | null;
76
+ readonly baseValidity: BaseValidity;
77
+ readonly kind = "growthRate";
78
+ private constructor();
79
+ /** (현재-기저)/|기저|. 기저 0 → rate=null·zeroBase(∞ 표기 금지). / Growth rate; zero base → null. */
80
+ static from(current: OGDecimalLike, base: OGDecimalLike): GrowthRate;
81
+ get type(): ValueType;
82
+ isMissing(): boolean;
83
+ isError(): boolean;
84
+ isBlank(): boolean;
85
+ /** 해석 가능(기저 적법 && 산출 가능). / Meaningful when base is ok and rate exists. */
86
+ isMeaningful(): boolean;
87
+ equals(other: DomainValue): boolean;
88
+ hashKey(): string;
89
+ compareTo(other: DomainValue): number;
90
+ textEquivalent(locale?: string): string;
91
+ toJSON(): DomainValueDTO;
92
+ }
93
+ /** Ratio 값 타입. / ValueType for ratio. */
94
+ export declare const ratioType: ValueType;
95
+ /** Percent 값 타입. / ValueType for percent. */
96
+ export declare const percentType: ValueType;
97
+ /** PercentagePoint 값 타입. / ValueType for percentage point. */
98
+ export declare const percentagePointType: ValueType;
99
+ /** GrowthRate 값 타입. / ValueType for growth rate. */
100
+ export declare const growthRateType: ValueType;
@@ -0,0 +1,46 @@
1
+ import { OGDecimal, OGDecimalLike } from '../OGDecimal.js';
2
+ import { DomainValue, DomainValueDTO } from './DomainValue.js';
3
+ import { ValueType } from './ValueType.js';
4
+ /** 임계 구간 정의. / A threshold band definition. */
5
+ export interface Band {
6
+ /** 구간 상한(null = 상방 무한). / Upper bound (null = unbounded above). */
7
+ readonly upper: OGDecimal | null;
8
+ /** 상한 포함 여부. / Whether the upper bound is inclusive. */
9
+ readonly inclusive: boolean;
10
+ /** 구간 라벨. / Band label. */
11
+ readonly label: string;
12
+ }
13
+ /** 임계 방향. / Threshold direction. */
14
+ export type ThresholdDirection = 'higherIsBetter' | 'lowerIsBetter';
15
+ /** 밴드 입력(OGDecimalLike 허용). / Band input accepting OGDecimalLike. */
16
+ export interface BandInput {
17
+ readonly upper: OGDecimalLike | null;
18
+ readonly inclusive: boolean;
19
+ readonly label: string;
20
+ }
21
+ /**
22
+ * 임계 집합 값 객체(REQ-T5-814). / ThresholdSet value object.
23
+ */
24
+ export declare class ThresholdSet implements DomainValue {
25
+ readonly bands: ReadonlyArray<Band>;
26
+ readonly direction: ThresholdDirection;
27
+ readonly kind = "thresholdSet";
28
+ private constructor();
29
+ static of(bands: ReadonlyArray<BandInput>, direction?: ThresholdDirection): ThresholdSet;
30
+ get type(): ValueType;
31
+ isMissing(): boolean;
32
+ isError(): boolean;
33
+ isBlank(): boolean;
34
+ /**
35
+ * 값이 속한 구간 인덱스(경계 규칙 일관 판정). 결측/오류/미소속 → -1.
36
+ * / Index of the band a value falls into; missing/error/unmatched → -1.
37
+ */
38
+ bandOf(v: DomainValue): number;
39
+ equals(other: DomainValue): boolean;
40
+ hashKey(): string;
41
+ compareTo(other: DomainValue): number;
42
+ textEquivalent(_locale?: string): string;
43
+ toJSON(): DomainValueDTO;
44
+ }
45
+ /** ThresholdSet 값 타입. / ValueType for thresholdSet. */
46
+ export declare const thresholdSetType: ValueType;
@@ -0,0 +1,71 @@
1
+ import { DomainValue, ValueKind } from './DomainValue.js';
2
+ import { RoundingRule } from './rounding.js';
3
+ import { SignRule, MissingPolicy, AggregationLegality } from './strategies.js';
4
+ export type { SignRule, MissingPolicy, AggregationLegality } from './strategies.js';
5
+ export type { RoundingRule } from './rounding.js';
6
+ /** 파싱 문맥(편집 커밋·임포트 시 값종별 부속 정보). / Parse context (per-kind hints on commit/import). */
7
+ export interface ParseContext {
8
+ readonly currency?: string;
9
+ readonly unit?: string;
10
+ readonly dimension?: string;
11
+ readonly locale?: string;
12
+ readonly precision?: number;
13
+ }
14
+ /**
15
+ * ValueType — 값 종류별 도메인 메타(REQ-TX-831). 순수 메타 객체.
16
+ * / Per-kind domain meta; a pure, tree-shakeable descriptor.
17
+ */
18
+ export interface ValueType {
19
+ readonly kind: ValueKind;
20
+ /** 단위 차원('money'|'none'|'length'…). 집계 호환성 판정용. / Unit dimension. */
21
+ readonly dimension: string;
22
+ /** 기본 반올림 규칙(값객체·포맷터·집계 공유). / Default rounding rule. */
23
+ readonly rounding: RoundingRule;
24
+ /** 부호·기저 규칙(의미). / Sign/base semantics rule. */
25
+ readonly sign: SignRule;
26
+ /** 결측 처우 기본. / Default missing-handling policy. */
27
+ readonly missing: MissingPolicy;
28
+ /** 집계 적법성(REQ-T2-805). / Aggregation legality. */
29
+ readonly aggregation: AggregationLegality;
30
+ /** 원시값 → 값 객체 파싱(편집 커밋·임포트 진입점). / Parse a raw value into a value object. */
31
+ parse(raw: unknown, ctx?: ParseContext): DomainValue;
32
+ }
33
+ /** 컬럼 값 메타(개방형 기술자) — 적합 타입 해석 입력. / Open column descriptor for type resolution. */
34
+ export interface ColumnValueMeta {
35
+ readonly kind?: ValueKind;
36
+ readonly dataType?: string;
37
+ readonly unit?: string;
38
+ readonly currencyCode?: string;
39
+ readonly intlLocale?: string;
40
+ readonly precision?: number;
41
+ readonly nullable?: boolean;
42
+ }
43
+ /**
44
+ * ValueTypeRegistry — 값 타입 카탈로그(REQ-TX-831). / ValueType catalog.
45
+ */
46
+ export interface ValueTypeRegistry {
47
+ /** 값 타입 등록(additive; 동일 kind 재등록=last-wins 승격). / Register a value type (last-wins). */
48
+ register(type: ValueType): void;
49
+ /** kind 로 조회(미등록 → PLAIN 폴백, throw 아님). / Resolve by kind; unknown → PLAIN fallback. */
50
+ get(kind: ValueKind): ValueType;
51
+ /** 등록 여부. / Whether a kind is registered. */
52
+ has(kind: ValueKind): boolean;
53
+ /** 컬럼 메타로 적합 타입 해석. / Resolve a suitable type from column meta. */
54
+ resolveForColumn(meta: ColumnValueMeta): ValueType;
55
+ }
56
+ /**
57
+ * 기본 ValueTypeRegistry 구현(REQ-TX-831). / Default registry implementation.
58
+ */
59
+ export declare class DefaultValueTypeRegistry implements ValueTypeRegistry {
60
+ private _map;
61
+ register(type: ValueType): void;
62
+ get(kind: ValueKind): ValueType;
63
+ has(kind: ValueKind): boolean;
64
+ resolveForColumn(meta: ColumnValueMeta): ValueType;
65
+ }
66
+ /** 기본 8+종 값 타입. / The built-in value types. */
67
+ export declare const DEFAULT_VALUE_TYPES: readonly ValueType[];
68
+ /**
69
+ * 기본 값 타입이 등록된 레지스트리 생성(REQ-TX-831). / Create a registry with the built-in types registered.
70
+ */
71
+ export declare function createDefaultRegistry(): DefaultValueTypeRegistry;