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.
- package/CHANGELOG.md +376 -365
- package/dist/{OpenGrid-0r_543Kj.cjs → OpenGrid-B7m7ei7f.cjs} +1222 -1029
- package/dist/{OpenGrid-HmhGVC2V.js → OpenGrid-CeUdO_fM.js} +1613 -1418
- package/dist/index-CeJ-0-80.cjs +260 -0
- package/dist/index-DnarQ4eR.js +266 -0
- package/dist/index-DrCPRuYi.js +548 -0
- package/dist/index-JjfWY3Bt.cjs +520 -0
- package/dist/open-grid-base.css +12 -1
- package/dist/open-grid-react.cjs +1 -1
- package/dist/open-grid-react.js +1 -1
- package/dist/open-grid-vue.cjs +7 -7
- package/dist/open-grid-vue.js +2 -2
- package/dist/open-grid.cjs +1 -1
- package/dist/open-grid.js +2 -2
- package/dist/types/bench/perf.d.ts +14 -8
- package/dist/types/core/AppearanceResolver.d.ts +98 -11
- package/dist/types/core/CFRenderBridge.d.ts +13 -0
- package/dist/types/core/CellTypeRegistry.d.ts +24 -0
- package/dist/types/core/ColumnLayout.d.ts +100 -2
- package/dist/types/core/CrossGridMapper.d.ts +43 -5
- package/dist/types/core/DataLayer.d.ts +210 -15
- package/dist/types/core/DragVisuals.d.ts +33 -4
- package/dist/types/core/EventEmitter.d.ts +54 -0
- package/dist/types/core/FormulaEngine.d.ts +15 -4
- package/dist/types/core/GridRenderer.d.ts +143 -10
- package/dist/types/core/GroupEngine.d.ts +68 -10
- package/dist/types/core/MathUtils.d.ts +58 -5
- package/dist/types/core/MergeEngine.d.ts +45 -10
- package/dist/types/core/OGDecimal.d.ts +144 -13
- package/dist/types/core/OpenGrid.d.ts +99 -0
- package/dist/types/core/PivotEngine.d.ts +37 -0
- package/dist/types/core/RowDragDrop.d.ts +52 -6
- package/dist/types/core/SkinRegistry.d.ts +4 -0
- package/dist/types/core/TreeEngine.d.ts +60 -6
- package/dist/types/core/VirtualScroll.d.ts +64 -0
- package/dist/types/core/a11y/AccessibilityAdapter.d.ts +103 -0
- package/dist/types/core/a11y/AriaIntent.d.ts +34 -0
- package/dist/types/core/a11y/KeyboardInteractionModel.d.ts +64 -0
- package/dist/types/core/a11y/LiveRegionController.d.ts +89 -0
- package/dist/types/core/a11y/OverlayStack.d.ts +36 -0
- package/dist/types/core/a11y/VisualEquivRegistry.d.ts +37 -0
- package/dist/types/core/a11y/index.d.ts +13 -0
- package/dist/types/core/a11y/ports.d.ts +24 -0
- package/dist/types/core/appearance/Appearance.d.ts +68 -0
- package/dist/types/core/appearance/AppearanceAxis.d.ts +94 -0
- package/dist/types/core/appearance/AppearanceComposer.d.ts +45 -0
- package/dist/types/core/appearance/AppearanceProvider.d.ts +50 -0
- package/dist/types/core/appearance/AppearanceView.d.ts +51 -0
- package/dist/types/core/appearance/DensityRegistry.d.ts +36 -0
- package/dist/types/core/appearance/ResolvedAppearanceSnapshot.d.ts +84 -0
- package/dist/types/core/appearance/TextureRegistry.d.ts +32 -0
- package/dist/types/core/appearance/ThemeMetaRegistry.d.ts +67 -0
- package/dist/types/core/appearance/axisAdapters.d.ts +37 -0
- package/dist/types/core/appearance/defaults.d.ts +10 -0
- package/dist/types/core/appearance/index.d.ts +20 -0
- package/dist/types/core/appearance/tokenCatalog.d.ts +30 -0
- package/dist/types/core/cf/CFEngine.d.ts +56 -0
- package/dist/types/core/cf/CFEvaluator.d.ts +24 -0
- package/dist/types/core/cf/CFRule.d.ts +127 -0
- package/dist/types/core/cf/ColorScale.d.ts +49 -0
- package/dist/types/core/cf/InkResolver.d.ts +33 -0
- package/dist/types/core/cf/appearance.d.ts +20 -0
- package/dist/types/core/cf/encoders.d.ts +61 -0
- package/dist/types/core/cf/eval-types.d.ts +93 -0
- package/dist/types/core/cf/index.d.ts +21 -0
- package/dist/types/core/cf/lineage.d.ts +32 -0
- package/dist/types/core/cf/predicates.d.ts +27 -0
- package/dist/types/core/cf/serialize.d.ts +46 -0
- package/dist/types/core/chart/CanvasAdapter.d.ts +50 -1
- package/dist/types/core/chart/DataExtractor.d.ts +53 -12
- package/dist/types/core/chart/a11y.d.ts +22 -0
- package/dist/types/core/chart/chart-type-registry.d.ts +53 -0
- package/dist/types/core/chart/downsample-report.d.ts +36 -0
- package/dist/types/core/chart/downsample.d.ts +26 -1
- package/dist/types/core/chart/engine/ChartEngineRegistry.d.ts +52 -0
- package/dist/types/core/chart/geometry.d.ts +96 -0
- package/dist/types/core/chart/hittest.d.ts +21 -3
- package/dist/types/core/chart/palette.d.ts +96 -12
- package/dist/types/core/chart/parity.d.ts +12 -0
- package/dist/types/core/chart/provenance.d.ts +47 -0
- package/dist/types/core/chart/scales.d.ts +28 -1
- package/dist/types/core/chart/scene.d.ts +102 -0
- package/dist/types/core/chart/server.d.ts +36 -0
- package/dist/types/core/chart/surfaces/CanvasSurface.d.ts +48 -0
- package/dist/types/core/chart/surfaces/ServerRasterSurface.d.ts +26 -0
- package/dist/types/core/chart/surfaces/SvgSurface.d.ts +24 -0
- package/dist/types/core/chart/surfaces/pattern-overlay.d.ts +24 -0
- package/dist/types/core/command/CommandBus.d.ts +51 -0
- package/dist/types/core/command/CommandRegistry.d.ts +43 -0
- package/dist/types/core/command/CommandStack.d.ts +38 -0
- package/dist/types/core/command/ICommand.d.ts +110 -0
- package/dist/types/core/command/commands/CellWriteCommand.d.ts +32 -0
- package/dist/types/core/command/commands/CompositeCommand.d.ts +17 -0
- package/dist/types/core/command/commands/RowCommands.d.ts +39 -0
- package/dist/types/core/command/index.d.ts +9 -0
- package/dist/types/core/command/support.d.ts +51 -0
- package/dist/types/core/coordinate/ColumnMetrics.d.ts +30 -0
- package/dist/types/core/coordinate/CoordinateKernel.d.ts +88 -0
- package/dist/types/core/coordinate/FrozenPanes.d.ts +29 -0
- package/dist/types/core/coordinate/MergeSourceAdapter.d.ts +18 -0
- package/dist/types/core/coordinate/NodeBudget.d.ts +33 -0
- package/dist/types/core/coordinate/ResizeGovernor.d.ts +50 -0
- package/dist/types/core/coordinate/RowMetrics.d.ts +37 -0
- package/dist/types/core/coordinate/ViewPermutation.d.ts +23 -0
- package/dist/types/core/coordinate/index.d.ts +10 -0
- package/dist/types/core/coordinate/ports.d.ts +45 -0
- package/dist/types/core/coordinate/types.d.ts +76 -0
- package/dist/types/core/detail/DetailGlyph.d.ts +42 -7
- package/dist/types/core/detail/DetailSplice.d.ts +42 -11
- package/dist/types/core/detail/DetailState.d.ts +80 -11
- package/dist/types/core/detail/SubgridCache.d.ts +72 -10
- package/dist/types/core/detail/index.d.ts +8 -0
- package/dist/types/core/domain/AggregateResult.d.ts +54 -0
- package/dist/types/core/domain/CellAddress.d.ts +61 -0
- package/dist/types/core/domain/CellValueAccess.d.ts +29 -0
- package/dist/types/core/domain/Delta.d.ts +37 -0
- package/dist/types/core/domain/DomainValue.d.ts +80 -0
- package/dist/types/core/domain/Missing.d.ts +65 -0
- package/dist/types/core/domain/Money.d.ts +42 -0
- package/dist/types/core/domain/NormalizationBasis.d.ts +47 -0
- package/dist/types/core/domain/Plain.d.ts +45 -0
- package/dist/types/core/domain/Quantity.d.ts +32 -0
- package/dist/types/core/domain/Ratios.d.ts +100 -0
- package/dist/types/core/domain/ThresholdSet.d.ts +46 -0
- package/dist/types/core/domain/ValueType.d.ts +71 -0
- package/dist/types/core/domain/rounding.d.ts +25 -0
- package/dist/types/core/domain/strategies.d.ts +38 -0
- package/dist/types/core/editors/DateEditor.d.ts +18 -0
- package/dist/types/core/editors/SelectEditor.d.ts +29 -0
- package/dist/types/core/export/ChannelRegistry.d.ts +18 -0
- package/dist/types/core/export/ExportManifest.d.ts +13 -0
- package/dist/types/core/export/GridArtifactSource.d.ts +62 -0
- package/dist/types/core/export/Provenance.d.ts +34 -0
- package/dist/types/core/export/StreamPump.d.ts +28 -0
- package/dist/types/core/export/channels/CsvChannel.d.ts +20 -0
- package/dist/types/core/export/channels/JsonChannel.d.ts +18 -0
- package/dist/types/core/export/channels/XlsxChannel.d.ts +53 -0
- package/dist/types/core/export/channels/XmlChannel.d.ts +21 -0
- package/dist/types/core/export/channels/capabilities.d.ts +13 -0
- package/dist/types/core/export/index.d.ts +24 -0
- package/dist/types/core/export/print/OutputChannelAdapter.d.ts +61 -0
- package/dist/types/core/export/print/Paginator.d.ts +48 -0
- package/dist/types/core/export/print/PrintRenderTarget.d.ts +36 -0
- package/dist/types/core/export/sinks.d.ts +40 -0
- package/dist/types/core/export/types.d.ts +211 -0
- package/dist/types/core/extension/DeprecationManager.d.ts +42 -0
- package/dist/types/core/extension/IExtension.d.ts +90 -0
- package/dist/types/core/extension/Registry.d.ts +142 -0
- package/dist/types/core/extension/SlotRegistry.d.ts +46 -0
- package/dist/types/core/extension/adapters.d.ts +44 -0
- package/dist/types/core/extension/conformance.d.ts +47 -0
- package/dist/types/core/extension/index.d.ts +16 -0
- package/dist/types/core/extension/registries.d.ts +31 -0
- package/dist/types/core/extension/reserved.d.ts +10 -0
- package/dist/types/core/format/DisplayFormatter.d.ts +47 -0
- package/dist/types/core/format/FormatCache.d.ts +20 -0
- package/dist/types/core/format/FormatterRegistry.d.ts +22 -0
- package/dist/types/core/format/grammar/AstRenderer.d.ts +10 -0
- package/dist/types/core/format/grammar/FormatCompiler.d.ts +16 -0
- package/dist/types/core/format/index.d.ts +55 -0
- package/dist/types/core/format/pipeline/DomainTypeResolver.d.ts +8 -0
- package/dist/types/core/format/pipeline/LocaleFormat.d.ts +11 -0
- package/dist/types/core/format/pipeline/ValueInterpreter.d.ts +8 -0
- package/dist/types/core/format/policy/MaskPolicy.d.ts +8 -0
- package/dist/types/core/format/policy/NegativePolicy.d.ts +12 -0
- package/dist/types/core/format/policy/NullPolicy.d.ts +10 -0
- package/dist/types/core/format/policy/TruncatePolicy.d.ts +11 -0
- package/dist/types/core/format/types.d.ts +292 -0
- package/dist/types/core/formula/CalcCacheStore.d.ts +89 -0
- package/dist/types/core/formula/CalcProvenance.d.ts +44 -0
- package/dist/types/core/formula/CalcService.d.ts +137 -0
- package/dist/types/core/formula/CyclePathReporter.d.ts +28 -0
- package/dist/types/core/formula/FormulaEvaluator.d.ts +35 -1
- package/dist/types/core/formula/FormulaGraph.d.ts +84 -7
- package/dist/types/core/formula/FormulaParser.d.ts +9 -0
- package/dist/types/core/formula/FormulaStore.d.ts +63 -1
- package/dist/types/core/formula/FunctionRegistry.d.ts +138 -0
- package/dist/types/core/formula/Generation.d.ts +86 -0
- package/dist/types/core/formula/RecalcCoordinator.d.ts +151 -9
- package/dist/types/core/formula/ReferenceRewriter.d.ts +81 -0
- package/dist/types/core/formula/functions/essential.d.ts +3 -0
- package/dist/types/core/formula/functions/extended/index.d.ts +10 -0
- package/dist/types/core/formula/normalizeRefs.d.ts +34 -3
- package/dist/types/core/formula/numericLiteral.d.ts +11 -1
- package/dist/types/core/formula/serializeFormula.d.ts +10 -1
- package/dist/types/core/host/CapabilityRegistry.d.ts +61 -0
- package/dist/types/core/host/GridHostDriver.d.ts +27 -0
- package/dist/types/core/host/GridHostPort.d.ts +37 -0
- package/dist/types/core/host/SliceOwnershipGuard.d.ts +27 -0
- package/dist/types/core/host/archCheck.d.ts +26 -0
- package/dist/types/core/host/index.d.ts +6 -0
- package/dist/types/core/host/reconcile.d.ts +22 -0
- package/dist/types/core/i18n/LocaleContext.d.ts +40 -0
- package/dist/types/core/i18n/types.d.ts +26 -1
- package/dist/types/core/icons/bootstrap-icons.d.ts +4 -2
- package/dist/types/core/quality/ContrastAuditor.d.ts +64 -0
- package/dist/types/core/quality/DeterminismKernel.d.ts +68 -0
- package/dist/types/core/quality/PerfBaseline.d.ts +23 -0
- package/dist/types/core/quality/PerfSpec.d.ts +95 -0
- package/dist/types/core/quality/RealBrowserGate.d.ts +69 -0
- package/dist/types/core/quality/RegressionJudge.d.ts +35 -0
- package/dist/types/core/quality/ReleaseGate.d.ts +94 -0
- package/dist/types/core/quality/VisualRegression.d.ts +74 -0
- package/dist/types/core/quality/hooks.d.ts +53 -0
- package/dist/types/core/quality/index.d.ts +20 -0
- package/dist/types/core/quality/pixelMetrics.d.ts +24 -0
- package/dist/types/core/range/ClipboardCodec.d.ts +46 -4
- package/dist/types/core/range/FillEngine.d.ts +69 -9
- package/dist/types/core/range/RangeModel.d.ts +100 -13
- package/dist/types/core/range/types.d.ts +27 -11
- package/dist/types/core/realtime/BackpressureScheduler.d.ts +0 -0
- package/dist/types/core/realtime/FreshnessClock.d.ts +34 -0
- package/dist/types/core/realtime/IRealtimeSource.d.ts +82 -0
- package/dist/types/core/realtime/LiveStateGuard.d.ts +23 -0
- package/dist/types/core/realtime/PollingSource.d.ts +42 -0
- package/dist/types/core/realtime/RealtimeController.d.ts +54 -0
- package/dist/types/core/realtime/RtAnnouncePolicy.d.ts +53 -0
- package/dist/types/core/realtime/RtApplyCommand.d.ts +29 -0
- package/dist/types/core/realtime/RtChartTargetTrigger.d.ts +26 -0
- package/dist/types/core/realtime/StreamingSource.d.ts +47 -0
- package/dist/types/core/realtime/backoff.d.ts +12 -0
- package/dist/types/core/realtime/index.d.ts +13 -0
- package/dist/types/core/realtime/ports.d.ts +80 -0
- package/dist/types/core/render/CellApplier.d.ts +18 -0
- package/dist/types/core/render/CellErrorBoundary.d.ts +65 -0
- package/dist/types/core/render/CellPipeline.d.ts +39 -0
- package/dist/types/core/render/CellRenderRequest.d.ts +209 -0
- package/dist/types/core/render/CellStageRegistry.d.ts +53 -0
- package/dist/types/core/render/OverlayCompositor.d.ts +38 -0
- package/dist/types/core/render/RenderBudget.d.ts +67 -0
- package/dist/types/core/render/contrast.d.ts +33 -0
- package/dist/types/core/render/index.d.ts +35 -0
- package/dist/types/core/render/stages/BackgroundStage.d.ts +14 -0
- package/dist/types/core/render/stages/DecoratorStage.d.ts +12 -0
- package/dist/types/core/render/stages/OverlayStage.d.ts +12 -0
- package/dist/types/core/render/stages/ValueRendererStage.d.ts +15 -0
- package/dist/types/core/render/stages/index.d.ts +14 -0
- package/dist/types/core/state/AutosaveController.d.ts +63 -0
- package/dist/types/core/state/IStatePersistence.d.ts +59 -0
- package/dist/types/core/state/MultiTabGuard.d.ts +33 -0
- package/dist/types/core/state/SchemaMigrator.d.ts +33 -0
- package/dist/types/core/state/SemVerPolicy.d.ts +39 -0
- package/dist/types/core/state/StateCodec.d.ts +75 -0
- package/dist/types/core/state/index.d.ts +6 -0
- package/dist/types/core/types.d.ts +17 -0
- package/dist/types/react/OpenGrid.d.ts +54 -0
- package/dist/types/react/index.d.ts +5 -0
- package/dist/types/realtime/index.d.ts +1 -0
- package/dist/types/vue/index.d.ts +5 -0
- package/dist/types/vue/types.d.ts +35 -0
- package/package.json +112 -111
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { IExtension } from './IExtension.js';
|
|
2
|
+
import { IRegistry } from './Registry.js';
|
|
3
|
+
/** 계약 검사 1건: (구현 팩토리) → 위반 목록. 빈 배열=통과. / One contract check: (factory) → violations; empty=pass. */
|
|
4
|
+
export interface ConformanceCheck<V> {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
/** 위반 문자열 목록(빈 배열=통과). / List of violation strings (empty=pass). */
|
|
7
|
+
run(make: () => V): string[];
|
|
8
|
+
}
|
|
9
|
+
/** 확장 SPI 하나에 대한 적합성 계약(파라미터화 스위트). / A conformance kit for one extension SPI. */
|
|
10
|
+
export interface ConformanceKit<V> {
|
|
11
|
+
readonly spi: string;
|
|
12
|
+
readonly checks: ReadonlyArray<ConformanceCheck<V>>;
|
|
13
|
+
}
|
|
14
|
+
/** 계약 검사 결과 1건. / One conformance result. */
|
|
15
|
+
export interface ConformanceResult {
|
|
16
|
+
readonly id: string;
|
|
17
|
+
readonly violations: string[];
|
|
18
|
+
}
|
|
19
|
+
/** 전 SPI 공통 계약 설명자(문서·수용기준 표기용). 실행 검사는 baseExtensionChecks 가 제공. / Descriptors of the shared contract. */
|
|
20
|
+
export declare const BASE_REGISTRY_CHECK_IDS: readonly ["shape:구현이 SPI 필수 멤버를 모두 노출", "lifecycle:activate 후 dispose 가 획득 자원을 대칭 해제(누수 0)", "isolation:입력 스냅샷 변형 시도가 코어 모델을 오염시키지 않음", "error-isolation:구현이 throw 해도 코어·타 확장 영향 0(격리 경계)", "serialize:직렬화→역직렬화 왕복 동일성(해당 SPI 만)", "virtualization:가상화 스크롤에서 가시행 한정 호출·오프스크린 미호출", "fallback:미등록/미지원 경로가 never-throw 폴백으로 귀결"];
|
|
21
|
+
/**
|
|
22
|
+
* 모든 IExtension 구현이 통과해야 하는 공통 실행 검사(shape·lifecycle·error-isolation).
|
|
23
|
+
* SPI별 kit 이 이 배열을 스프레드해 고유 검사를 덧붙인다.
|
|
24
|
+
* / Shared runnable checks every IExtension must pass; SPI kits spread these and add their own.
|
|
25
|
+
*/
|
|
26
|
+
export declare function baseExtensionChecks<V extends IExtension>(): ReadonlyArray<ConformanceCheck<V>>;
|
|
27
|
+
/**
|
|
28
|
+
* 파라미터화 러너: kit 의 각 검사를 구현 팩토리에 돌려 위반 목록을 표로 반환(수용기준).
|
|
29
|
+
* / Parameterized runner: runs each check against the factory, returns a table of violations.
|
|
30
|
+
*
|
|
31
|
+
* @param kit - 적합성 키트 / The conformance kit
|
|
32
|
+
* @param make - 검사 대상 구현 팩토리(검사마다 새 인스턴스) / Factory for the implementation under test
|
|
33
|
+
* @returns 검사별 위반 목록(전 항목 빈 배열=완전 통과) / Per-check violations (all empty = full pass)
|
|
34
|
+
*/
|
|
35
|
+
export declare function runConformance<V>(kit: ConformanceKit<V>, make: () => V): ConformanceResult[];
|
|
36
|
+
/** 적합성 결과가 전부 통과인지. / Whether all conformance results pass. */
|
|
37
|
+
export declare function conformancePassed(results: ConformanceResult[]): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* IRegistry 자체에 대한 재사용 계약 키트(§2.6). 빌트인·서드파티 레지스트리 팩토리를 이 키트로
|
|
40
|
+
* 돌려 never-throw 폴백·dispose 대칭·예약 가드·중복 결정론을 자가검증한다.
|
|
41
|
+
* / Reusable conformance kit for IRegistry itself: never-throw fallback, dispose symmetry,
|
|
42
|
+
* reserved guard, and duplicate determinism.
|
|
43
|
+
*
|
|
44
|
+
* @param placeholder - require 폴백에 쓸 플레이스홀더 값 / Placeholder value for the require fallback
|
|
45
|
+
* @returns 레지스트리 팩토리용 적합성 키트 / A conformance kit for a registry factory
|
|
46
|
+
*/
|
|
47
|
+
export declare function registryConformanceKit<V>(placeholder: V): ConformanceKit<IRegistry<V>>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { TypedRegistry, orderedApply, detectAmbiguousOrder, spiCompatible, } from './Registry.js';
|
|
2
|
+
export type { IRegistry, RegisterOptions, RegisterResult, RegisterAction, RegisterReason, RegistryEntry, EntryOrigin, DuplicatePolicy, DeprecationInfo, TypedRegistryConfig, } from './Registry.js';
|
|
3
|
+
export { RESERVED_PREFIXES, isReserved } from './reserved.js';
|
|
4
|
+
export { verifyPeer, compareSemver, Capabilities } from './IExtension.js';
|
|
5
|
+
export type { IExtension, IValidator, ValResult, CoreCapabilities, CapabilitiesSpec, ExtensionPeer, PeerVerdict, } from './IExtension.js';
|
|
6
|
+
export { createSlotRegistry, safeMount } from './SlotRegistry.js';
|
|
7
|
+
export type { ISlotProvider, SlotRegistry, SlotName, SlotHost, SlotHandle } from './SlotRegistry.js';
|
|
8
|
+
export { baseExtensionChecks, runConformance, conformancePassed, registryConformanceKit, BASE_REGISTRY_CHECK_IDS, } from './conformance.js';
|
|
9
|
+
export type { ConformanceKit, ConformanceCheck, ConformanceResult } from './conformance.js';
|
|
10
|
+
export { DeprecationManager } from './DeprecationManager.js';
|
|
11
|
+
export type { DeprecationRecord } from './DeprecationManager.js';
|
|
12
|
+
export { createCellTypeRegistry, createFormatterRegistry, createValidatorRegistry, createExtensionRegistry, } from './registries.js';
|
|
13
|
+
export { adaptRegistry, adaptFormatterRegistry, adaptSkinRegistry } from './adapters.js';
|
|
14
|
+
export type { RegistryBridge } from './adapters.js';
|
|
15
|
+
export type { ICellRenderer } from '../render/CellRenderRequest.js';
|
|
16
|
+
export type { IFormatter } from '../format/types.js';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { TypedRegistry } from './Registry.js';
|
|
2
|
+
import { IValidator } from './IExtension.js';
|
|
3
|
+
import { ICellRenderer } from '../render/CellRenderRequest.js';
|
|
4
|
+
import { IFormatter } from '../format/types.js';
|
|
5
|
+
/**
|
|
6
|
+
* 셀타입 레지스트리(ICellRenderer, DD-03 정본). 미등록 셀타입은 dev 물음표 플레이스홀더로
|
|
7
|
+
* require 폴백(never-throw). / Cell-type registry (ICellRenderer; DD-03 canonical).
|
|
8
|
+
*
|
|
9
|
+
* @param placeholder - 미등록 셀타입 dev 플레이스홀더(선택) / Dev placeholder for unregistered cell types (optional)
|
|
10
|
+
*/
|
|
11
|
+
export declare function createCellTypeRegistry<T = any>(placeholder?: (key: string) => ICellRenderer<T>): TypedRegistry<ICellRenderer<T>>;
|
|
12
|
+
/**
|
|
13
|
+
* 확장 포맷터 레지스트리(IFormatter, DD-04 정본). 기존 format/FormatterRegistry 와 별개의
|
|
14
|
+
* IRegistry 동형 인스턴스(어댑트는 adapters.ts). / Formatter extension registry (IFormatter; DD-04 canonical).
|
|
15
|
+
*/
|
|
16
|
+
export declare function createFormatterRegistry(): TypedRegistry<IFormatter>;
|
|
17
|
+
/**
|
|
18
|
+
* 검증기 레지스트리(IValidator, DD-10 소유). 다중 적용 가능 = orderedApply 로 순서 결정.
|
|
19
|
+
* / Validator registry (IValidator; DD-10-owned). Multi-apply via orderedApply.
|
|
20
|
+
*/
|
|
21
|
+
export declare function createValidatorRegistry(): TypedRegistry<IValidator>;
|
|
22
|
+
/**
|
|
23
|
+
* SPI 정본 미착지 확장점(차트타입·수식함수·커맨드·CF규칙·데이터소스·export채널)용 제네릭 팩토리.
|
|
24
|
+
* 값 타입 V 를 호출측이 지정한다(소유 DD 착지 시 그 타입으로 교체). / Generic factory for
|
|
25
|
+
* extension points whose canonical SPI has not yet landed.
|
|
26
|
+
*
|
|
27
|
+
* @param spiName - SPI 이름(peer 버저닝) / SPI name (peer versioning)
|
|
28
|
+
* @param version - SPI 현재 major / Current SPI major
|
|
29
|
+
* @param duplicatePolicy - 중복 정책(기본 protect-builtin) / Duplicate policy (default protect-builtin)
|
|
30
|
+
*/
|
|
31
|
+
export declare function createExtensionRegistry<V>(spiName: string, version?: string, duplicatePolicy?: 'last-wins' | 'explicit-override' | 'protect-builtin'): TypedRegistry<V>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** 코어가 예약하는 접두사 — 이 대역은 origin:'builtin' 만 점유할 수 있다.
|
|
2
|
+
* / Prefixes reserved by the core — only origin:'builtin' may occupy this band. */
|
|
3
|
+
export declare const RESERVED_PREFIXES: readonly ["og:", "og-"];
|
|
4
|
+
/**
|
|
5
|
+
* 키가 코어 예약 네임스페이스에 속하는지 판정. / Whether a key falls in the core-reserved namespace.
|
|
6
|
+
*
|
|
7
|
+
* @param key - 검사할 등록 키 / Registration key to inspect
|
|
8
|
+
* @returns 예약 접두사로 시작하면 true / true if it starts with a reserved prefix
|
|
9
|
+
*/
|
|
10
|
+
export declare function isReserved(key: string): boolean;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ColumnFormatSpec, FormatContext, FormatInput, FormatResult, IDisplayFormatPort, IDomainTypeResolver, ILocaleFormat, IMaskPolicy, INegativePolicy, INullPolicy, ITruncatePolicy, IUserFormatSpec, IValueInterpreter } from './types.js';
|
|
2
|
+
import { FormatterRegistry } from './FormatterRegistry.js';
|
|
3
|
+
import { FormatCache } from './FormatCache.js';
|
|
4
|
+
/** DisplayFormatter 협력자 묶음(생성자 주입). / Collaborators injected into the facade. */
|
|
5
|
+
export interface DisplayFormatterDeps {
|
|
6
|
+
interpreter: IValueInterpreter;
|
|
7
|
+
domain: IDomainTypeResolver;
|
|
8
|
+
locale: ILocaleFormat;
|
|
9
|
+
user: IUserFormatSpec;
|
|
10
|
+
nullP: INullPolicy;
|
|
11
|
+
truncate: ITruncatePolicy;
|
|
12
|
+
negative: INegativePolicy;
|
|
13
|
+
mask: IMaskPolicy;
|
|
14
|
+
registry: FormatterRegistry;
|
|
15
|
+
cache: FormatCache;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* 표시값 산출의 단일 정본 파사드. 모든 소비자(셀/차트/집계/export/aria/클립보드/인쇄)가 통과.
|
|
19
|
+
* / The single-source display formatter facade; every consumer passes through it.
|
|
20
|
+
*/
|
|
21
|
+
export declare class DisplayFormatter implements IDisplayFormatPort {
|
|
22
|
+
private readonly d;
|
|
23
|
+
constructor(d: DisplayFormatterDeps);
|
|
24
|
+
/** 핵심: raw → 표시. 캐시 히트 시 단계 미실행. / Core: raw → display; skips stages on cache hit. */
|
|
25
|
+
format(input: FormatInput, spec: ColumnFormatSpec, ctx: FormatContext): FormatResult;
|
|
26
|
+
/** 편의(문자열만) — 대다수 소비자 핫패스. / Convenience: text only (hot path). */
|
|
27
|
+
text(input: FormatInput, spec: ColumnFormatSpec, ctx: FormatContext): string;
|
|
28
|
+
/**
|
|
29
|
+
* 차트/집계용 포트 — 이미 집계·다운샘플된 수치에 라벨 서식만 적용(REQ-T6-802).
|
|
30
|
+
* interpret 생략(이미 수치) → domainType→truncate→locale→userFormat→negative. 셀과 동일 서식.
|
|
31
|
+
* / Chart/aggregate port; applies label formatting to an already-aggregated number.
|
|
32
|
+
*/
|
|
33
|
+
formatScalar(n: number, spec: ColumnFormatSpec, ctx: FormatContext): string;
|
|
34
|
+
/** 로케일 변경 훅 — 캐시 정확 무효화. / Locale-change hook — precise cache invalidation. */
|
|
35
|
+
onLocaleChange(): void;
|
|
36
|
+
/** 테마 변경 훅 — 색코드 축 무효화. / Theme-change hook — color-axis invalidation. */
|
|
37
|
+
onThemeChange(): void;
|
|
38
|
+
private _run;
|
|
39
|
+
/** 수치 파이프: truncate→locale/userFormat→negative. 우선순위 합성. / Numeric pipe with priority composition. */
|
|
40
|
+
private _numeric;
|
|
41
|
+
/** 도메인별 로케일 본문 산출(number/currency/percent). / Locale numeric body per domain. */
|
|
42
|
+
private _localeBody;
|
|
43
|
+
/** 결측 aria — 사유가 있으면 결측 낭독, 없으면 null 표시값. / Missing aria; spells the reason if present. */
|
|
44
|
+
private _missingAria;
|
|
45
|
+
/** ⑦ customHook 단계 — displayFormatter 슬롯/등록 포맷터를 마지막에 적용(null=파이프 산출 폴백). */
|
|
46
|
+
private _hook;
|
|
47
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FormatCacheKey, FormatResult } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* LRU 메모이즈 캐시(per-instance). get 시 최근성 갱신(move-to-end).
|
|
4
|
+
* / LRU memoize cache (per-instance); get() refreshes recency (move-to-end).
|
|
5
|
+
*/
|
|
6
|
+
export declare class FormatCache {
|
|
7
|
+
private readonly max;
|
|
8
|
+
private _map;
|
|
9
|
+
constructor(max?: number);
|
|
10
|
+
get(key: FormatCacheKey): FormatResult | undefined;
|
|
11
|
+
set(key: FormatCacheKey, r: FormatResult): void;
|
|
12
|
+
/** 로케일 축 무효화 — 전체 클리어(모든 숫자/날짜 표기 변경). / Locale-axis invalidation — full clear. */
|
|
13
|
+
invalidateLocale(): void;
|
|
14
|
+
/** 테마 축 무효화 — 색코드 보유 엔트리만 제거(R3 부분 무효화). / Theme-axis invalidation — color entries only. */
|
|
15
|
+
invalidateTheme(): void;
|
|
16
|
+
/** 현재 엔트리 수(테스트·계측). / Current entry count (tests/metrics). */
|
|
17
|
+
get size(): number;
|
|
18
|
+
/** 전체 비우기. / Clear all. */
|
|
19
|
+
clear(): void;
|
|
20
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IFormatter } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* 커스텀 포맷터 등록소. register/resolve/child 는 DD-10 TypedRegistry<IFormatter> 매핑.
|
|
4
|
+
* / Custom formatter registry (isomorphic to DD-10 TypedRegistry<IFormatter>).
|
|
5
|
+
*/
|
|
6
|
+
export declare class FormatterRegistry {
|
|
7
|
+
private _map;
|
|
8
|
+
private _parent;
|
|
9
|
+
constructor(parent?: FormatterRegistry);
|
|
10
|
+
/** 포맷터 등록(additive, 동일 이름 last-wins). / Register a formatter (last-wins on same name). */
|
|
11
|
+
register(f: IFormatter): this;
|
|
12
|
+
/** 이름으로 해석(미해석 → undefined, 파이프 기본 폴백). parent-chain 탐색. / Resolve by name; unknown → undefined. */
|
|
13
|
+
resolve(name: string): IFormatter | undefined;
|
|
14
|
+
/** 등록 여부(parent-chain 합집합). / Whether a formatter name is registered. */
|
|
15
|
+
has(name: string): boolean;
|
|
16
|
+
/** 이 레지스트리를 부모로 하는 자식(per-instance 격리, 멀티그리드 오염 0). / A child registry (per-instance isolation). */
|
|
17
|
+
child(): FormatterRegistry;
|
|
18
|
+
/** 등록된 포맷터 이름 목록(능력 매니페스트, parent-chain 합집합). / Registered formatter names (capability manifest). */
|
|
19
|
+
list(): string[];
|
|
20
|
+
}
|
|
21
|
+
/** 프로세스 전역 기본 포맷터 레지스트리. / Process-global default formatter registry. */
|
|
22
|
+
export declare const formatterRegistry: FormatterRegistry;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AstRender, FormatAst, FormatContext, ILocaleFormat, InterpretedValue, IUserFormatSpec } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* 기본 AST 렌더러. 로케일 서식기를 주입받아 숫자 본문을 로케일 위임으로 산출한다.
|
|
4
|
+
* / Default AST renderer; delegates numeric body to the injected locale formatter.
|
|
5
|
+
*/
|
|
6
|
+
export declare class AstRenderer implements IUserFormatSpec {
|
|
7
|
+
private readonly locale;
|
|
8
|
+
constructor(locale: ILocaleFormat);
|
|
9
|
+
apply(ast: FormatAst, v: InterpretedValue, ctx: FormatContext): AstRender;
|
|
10
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FormatAst, FormatDiagnostic, IUserFormatCompiler } from '../types.js';
|
|
2
|
+
/** 현 문법 버전(additive 진화). / Current grammar version. */
|
|
3
|
+
export declare const FORMAT_GRAMMAR_VERSION = 1;
|
|
4
|
+
/**
|
|
5
|
+
* 기본 포맷 컴파일러. 세미콜론 다중섹션(pos;neg;zero;text), 색코드, 숫자토큰 파싱.
|
|
6
|
+
* / Default compiler: semicolon multi-section, color codes, numeric token parsing.
|
|
7
|
+
*/
|
|
8
|
+
export declare class FormatCompiler implements IUserFormatCompiler {
|
|
9
|
+
readonly grammarVersion = 1;
|
|
10
|
+
compile(format: string): {
|
|
11
|
+
ast: FormatAst;
|
|
12
|
+
diagnostics: FormatDiagnostic[];
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
/** 공유 컴파일러 싱글턴(순수·상태 없음). / Shared stateless compiler singleton. */
|
|
16
|
+
export declare const defaultFormatCompiler: FormatCompiler;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { DisplayFormatter, DisplayFormatterDeps } from './DisplayFormatter.js';
|
|
2
|
+
import { FormatterRegistry } from './FormatterRegistry.js';
|
|
3
|
+
import { ColumnFormatSpec, DomainKind, MaskDef, MaskType, NegativePolicy as NegPolicy, NullPolicy as NullPol, AbbrevPolicy } from './types.js';
|
|
4
|
+
import { DisplayFormatterFn } from '../types.js';
|
|
5
|
+
export * from './types.js';
|
|
6
|
+
export { DisplayFormatter } from './DisplayFormatter.js';
|
|
7
|
+
export type { DisplayFormatterDeps } from './DisplayFormatter.js';
|
|
8
|
+
export { FormatterRegistry, formatterRegistry } from './FormatterRegistry.js';
|
|
9
|
+
export { FormatCache } from './FormatCache.js';
|
|
10
|
+
export { ValueInterpreter } from './pipeline/ValueInterpreter.js';
|
|
11
|
+
export { DomainTypeResolver } from './pipeline/DomainTypeResolver.js';
|
|
12
|
+
export { LocaleFormat } from './pipeline/LocaleFormat.js';
|
|
13
|
+
export { FormatCompiler, defaultFormatCompiler, FORMAT_GRAMMAR_VERSION } from './grammar/FormatCompiler.js';
|
|
14
|
+
export { AstRenderer } from './grammar/AstRenderer.js';
|
|
15
|
+
export { NullPolicy } from './policy/NullPolicy.js';
|
|
16
|
+
export { TruncatePolicy } from './policy/TruncatePolicy.js';
|
|
17
|
+
export { NegativePolicy } from './policy/NegativePolicy.js';
|
|
18
|
+
export { MaskPolicy } from './policy/MaskPolicy.js';
|
|
19
|
+
/** 기본 조립 옵션(협력자 오버라이드·격리). / Default assembly options. */
|
|
20
|
+
export interface CreateDisplayFormatterOptions {
|
|
21
|
+
/** 부모 포맷터 레지스트리(child 격리). 미지정 시 전역. / Parent registry (child isolation); global if unset. */
|
|
22
|
+
parentRegistry?: FormatterRegistry;
|
|
23
|
+
/** 협력자 부분 오버라이드(Strategy 교체·OCP). / Partial collaborator overrides (Strategy swap). */
|
|
24
|
+
overrides?: Partial<DisplayFormatterDeps>;
|
|
25
|
+
/** 캐시 최대 엔트리. / Cache max entries. */
|
|
26
|
+
cacheMax?: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* 기본 DisplayFormatter 조립(8단계 + child registry + per-instance cache).
|
|
30
|
+
* / Assemble a default DisplayFormatter (8 stages + child registry + per-instance cache).
|
|
31
|
+
*/
|
|
32
|
+
export declare function createDisplayFormatter(opts?: CreateDisplayFormatterOptions): DisplayFormatter;
|
|
33
|
+
/** compileFormatSpec 입력(컬럼 힌트, 헤드리스 — ColumnDef 미의존). / compileFormatSpec input (headless). */
|
|
34
|
+
export interface FormatSpecInput {
|
|
35
|
+
field?: string;
|
|
36
|
+
domain?: DomainKind;
|
|
37
|
+
/** 레거시 dataType/type('number'|'currency'|'date'|'mask'…). / Legacy dataType/type. */
|
|
38
|
+
type?: string;
|
|
39
|
+
/** Excel식 포맷 문자열('#,##0;[Red](#,##0)'). / Excel-style format string. */
|
|
40
|
+
format?: string;
|
|
41
|
+
currency?: string;
|
|
42
|
+
mask?: MaskType | MaskDef;
|
|
43
|
+
valueMap?: Readonly<Record<string, string>>;
|
|
44
|
+
abbreviate?: AbbrevPolicy;
|
|
45
|
+
negative?: NegPolicy;
|
|
46
|
+
nullPolicy?: NullPol;
|
|
47
|
+
customFormatter?: string | DisplayFormatterFn | null;
|
|
48
|
+
precision?: number;
|
|
49
|
+
datePattern?: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* 컬럼 힌트 → ColumnFormatSpec(specId·AST 컴파일 1회). 명세 불변 동안 재사용(메모이즈 안정).
|
|
53
|
+
* / Compile a column hint into a ColumnFormatSpec (specId + one-time AST compile).
|
|
54
|
+
*/
|
|
55
|
+
export declare function compileFormatSpec(input: FormatSpecInput): ColumnFormatSpec;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ColumnFormatSpec, DomainDirective, IDomainTypeResolver, InterpretedValue } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* 기본 도메인타입 해석기. valueMap 최우선, 그 다음 spec.domain, 폴백은 valueKind 추론.
|
|
4
|
+
* / Default resolver. valueMap wins; then spec.domain; falls back to inferring from valueKind.
|
|
5
|
+
*/
|
|
6
|
+
export declare class DomainTypeResolver implements IDomainTypeResolver {
|
|
7
|
+
resolve(v: InterpretedValue, spec: ColumnFormatSpec): DomainDirective;
|
|
8
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FormatContext, ILocaleFormat, NumberDirective } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Intl 기반 로케일 서식. 잘못된 로케일/통화는 throw 아닌 폴백(never-throw, 렌더 루프 소비자).
|
|
4
|
+
* / Intl-based locale formatting; invalid locale/currency falls back instead of throwing.
|
|
5
|
+
*/
|
|
6
|
+
export declare class LocaleFormat implements ILocaleFormat {
|
|
7
|
+
formatNumber(n: number, d: NumberDirective, ctx: FormatContext): string;
|
|
8
|
+
formatCurrency(n: number, currency: string, d: NumberDirective, ctx: FormatContext): string;
|
|
9
|
+
formatPercent(n: number, d: NumberDirective, ctx: FormatContext): string;
|
|
10
|
+
formatDate(d: Date, pattern: string | undefined, ctx: FormatContext): string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FormatInput, InterpretedValue, IValueInterpreter } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* 기본 값객체 해석기. DD-01 값객체는 읽기만, 원시값은 런타임 추론.
|
|
4
|
+
* / Default interpreter. DD-01 value objects are read-only; primitives are inferred at runtime.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ValueInterpreter implements IValueInterpreter {
|
|
7
|
+
interpret(input: FormatInput): InterpretedValue;
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IMaskPolicy, MaskDef, MaskType } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* 기본 마스킹 정책 — MaskingEngine.applyMask 래퍼(로직 재사용, 재구현 0).
|
|
4
|
+
* / Default mask policy — a thin wrapper over MaskingEngine.applyMask (no reimplementation).
|
|
5
|
+
*/
|
|
6
|
+
export declare class MaskPolicy implements IMaskPolicy {
|
|
7
|
+
mask(value: string, def: MaskType | MaskDef): string;
|
|
8
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { INegativePolicy, NegativePolicy as NegPolicy, Sign } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* 기본 음수 정책. 이미 로케일 서식된 문자열을 받아 부호화 형태로 변환.
|
|
4
|
+
* / Default negative policy; transforms an already locale-formatted string.
|
|
5
|
+
*/
|
|
6
|
+
export declare class NegativePolicy implements INegativePolicy {
|
|
7
|
+
encode(text: string, sign: Sign, p: NegPolicy): {
|
|
8
|
+
text: string;
|
|
9
|
+
aria?: string;
|
|
10
|
+
colorHint?: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FormatContext, FormatInput, INullPolicy } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* 기본 null 정책. raw 가 null/undefined/'' 이면 기본 표시값(default), 아니면 null(미참여).
|
|
4
|
+
* / Default null policy: raw null/empty → default display; otherwise null (not participating).
|
|
5
|
+
*/
|
|
6
|
+
export declare class NullPolicy implements INullPolicy {
|
|
7
|
+
private readonly defaultText;
|
|
8
|
+
constructor(defaultText?: string);
|
|
9
|
+
render(input: FormatInput, _ctx: FormatContext): string | null;
|
|
10
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AbbrevPolicy, FormatContext, ITruncatePolicy } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* 기본 축약 정책. threshold(기본 1000) 이상 절대값만 축약. 미만이면 null(미참여) 반환.
|
|
4
|
+
* / Default abbreviation policy; abbreviates only at/above threshold, else null.
|
|
5
|
+
*/
|
|
6
|
+
export declare class TruncatePolicy implements ITruncatePolicy {
|
|
7
|
+
abbreviate(n: number, p: AbbrevPolicy, _ctx: FormatContext): {
|
|
8
|
+
text: string;
|
|
9
|
+
rawText: string;
|
|
10
|
+
} | null;
|
|
11
|
+
}
|