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,40 @@
|
|
|
1
|
+
import { LocaleRegistry } from './LocaleRegistry.js';
|
|
2
|
+
import { LocaleMeta, LocaleMessageKey, MessageParams } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* `LocaleMeta` 조회 파사드 — 값객체/포맷터/정렬/검색이 주입받는 단일 컨텍스트 포트.
|
|
5
|
+
* `LocaleRegistry.meta()` 를 감싸 문화별 Intl 객체를 메모이즈 제공한다.
|
|
6
|
+
* / The single culture-context port injected into VOs/formatters/sort/search. Wraps
|
|
7
|
+
* `LocaleRegistry.meta()` and memoizes per-locale Intl objects.
|
|
8
|
+
*/
|
|
9
|
+
export declare class LocaleContextProvider {
|
|
10
|
+
private readonly _registry;
|
|
11
|
+
private readonly _subscribers;
|
|
12
|
+
private _collator;
|
|
13
|
+
private _numberFmt;
|
|
14
|
+
private _dateTimeFmt;
|
|
15
|
+
/** 메모 무효화 기준 — 활성 로케일. 변경 감지 시 캐시 clear. / Memo-invalidation basis: active locale. */
|
|
16
|
+
private _memoLocale;
|
|
17
|
+
constructor(registry: LocaleRegistry);
|
|
18
|
+
/** 활성 로케일 문화 컨텍스트(폴백 병합 후). / Active-locale culture context (after fallback merge). */
|
|
19
|
+
meta(): LocaleMeta;
|
|
20
|
+
/** 정렬/검색 tie-break 콜레이터(메모이즈). collation 규칙은 `LocaleMeta.collation` 에서 조회. / Collator (memoized). */
|
|
21
|
+
collator(): Intl.Collator;
|
|
22
|
+
/** 숫자 포맷(메모이즈). numbering/currency 기본값은 `LocaleMeta` 에서 보강. / NumberFormat (memoized). */
|
|
23
|
+
numberFormat(opts?: Intl.NumberFormatOptions): Intl.NumberFormat;
|
|
24
|
+
/** 날짜/시간 포맷(메모이즈). calendar/timeZone 기본값은 `LocaleMeta` 에서 보강. / DateTimeFormat (memoized). */
|
|
25
|
+
dateTimeFormat(opts?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat;
|
|
26
|
+
/** i18n 메시지 해석(어댑터·공지가 하드코딩 대신 이걸로). / Message resolution. */
|
|
27
|
+
t(key: LocaleMessageKey | string, params?: MessageParams): string;
|
|
28
|
+
/**
|
|
29
|
+
* 활성 로케일 전환의 정본 경로 — 레지스트리 전환 + 메모 무효화 + 구독자 통지(어댑터 onLocaleChange 배선).
|
|
30
|
+
* / The canonical active-locale switch: registry.setActive + memo invalidation + notify subscribers.
|
|
31
|
+
*/
|
|
32
|
+
setLocale(id: string): void;
|
|
33
|
+
/** 활성 로케일 변경 구독. 해제 함수 반환. / Subscribe to active-locale change; returns an unsubscribe fn. */
|
|
34
|
+
onChange(cb: () => void): () => void;
|
|
35
|
+
/** 외부에서 레지스트리를 직접 전환한 경우의 수동 메모 갱신·통지. / Manual refresh when the registry changed externally. */
|
|
36
|
+
refresh(): void;
|
|
37
|
+
private _syncMemo;
|
|
38
|
+
private _invalidate;
|
|
39
|
+
private _notify;
|
|
40
|
+
}
|
|
@@ -234,7 +234,14 @@ export type PartialLocaleMessages = {
|
|
|
234
234
|
export type LocaleMessageKey = {
|
|
235
235
|
[S in keyof LocaleMessages]: `${S & string}.${keyof LocaleMessages[S] & string}`;
|
|
236
236
|
}[keyof LocaleMessages];
|
|
237
|
-
/**
|
|
237
|
+
/**
|
|
238
|
+
* 문화 규칙 단일 컨텍스트(REQ-T9-816, DD-12 §2.4). 값객체·포맷터·정렬·검색이 문화를 **오직 여기서만**
|
|
239
|
+
* 조회한다(불변식 3). 아래 확장 필드는 전부 additive·옵셔널 — 기존 3필드·소비처 불변(semver 하위호환).
|
|
240
|
+
* ★대표 소유 = DD-12: DD-04 `FormatContext.locale`·DD-15 `ExportRunCtx.locale` 는 이 타입을 import(재선언 금지).
|
|
241
|
+
* / Single culture context (REQ-T9-816, DD-12 §2.4). The only lawful culture-lookup path (invariant 3).
|
|
242
|
+
* The extension fields below are all additive & optional — original 3 fields/consumers unchanged.
|
|
243
|
+
* ★Canonical owner = DD-12; DD-04/DD-15 import this type (no re-declaration).
|
|
244
|
+
*/
|
|
238
245
|
export interface LocaleMeta {
|
|
239
246
|
/** BCP-47 태그(toLocaleString/lang/인쇄 템플릿용). 예 'ko-KR'. / BCP-47 tag (for toLocaleString/lang/print template). e.g. 'ko-KR'. */
|
|
240
247
|
readonly intlLocale: string;
|
|
@@ -242,6 +249,24 @@ export interface LocaleMeta {
|
|
|
242
249
|
readonly dir?: 'ltr' | 'rtl';
|
|
243
250
|
/** Excel 내보내기 기본 폰트. / Default font for Excel export. */
|
|
244
251
|
readonly exportFont?: string;
|
|
252
|
+
/** 기본 통화코드(ISO 4217) — Money 미지정 시 폴백. / Default currency (ISO 4217). */
|
|
253
|
+
readonly currency?: string;
|
|
254
|
+
/** 달력 체계(gregory/japanese/…) — Intl.DateTimeFormat 위임. / Calendar system. */
|
|
255
|
+
readonly calendar?: string;
|
|
256
|
+
/** 콜레이션 규칙(정렬 tie-break·대소문자·발음구별) — Intl.Collator 옵션. / Collation for sort/search. */
|
|
257
|
+
readonly collation?: {
|
|
258
|
+
readonly sensitivity?: 'base' | 'accent' | 'case' | 'variant';
|
|
259
|
+
readonly numeric?: boolean;
|
|
260
|
+
readonly caseFirst?: 'upper' | 'lower' | 'false';
|
|
261
|
+
};
|
|
262
|
+
/** 숫자 체계(latn/arab/…). / Numbering system. */
|
|
263
|
+
readonly numbering?: string;
|
|
264
|
+
/** 시간대. / Time zone. */
|
|
265
|
+
readonly timeZone?: string;
|
|
266
|
+
/** 주 시작요일(0=일·1=월·6=토). / First day of week. */
|
|
267
|
+
readonly firstDayOfWeek?: 0 | 1 | 6;
|
|
268
|
+
/** 텍스트팽창 계수(레이아웃 예산 힌트·의사로케일). 예 de≈1.35, 의사로케일=1.4(REQ-T9-817). / Text-expansion factor. */
|
|
269
|
+
readonly textExpansion?: number;
|
|
245
270
|
}
|
|
246
271
|
/** register() 결과 — 누락 키 정직 신호(막지 않음). / register() result — honest missing-key signal (never blocks). */
|
|
247
272
|
export interface LocaleRegisterResult {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
/** 모든 큐레이션 글리프 공통 viewBox(Bootstrap Icons 16px 그리드). */
|
|
1
|
+
/** 모든 큐레이션 글리프 공통 viewBox(Bootstrap Icons 16px 그리드). / Common viewBox for all curated glyphs (Bootstrap Icons 16px grid). */
|
|
2
2
|
export declare const ICON_VIEWBOX = "0 0 16 16";
|
|
3
3
|
/**
|
|
4
4
|
* symbolId → SVG 내부 마크업(<path>/<g>). Bootstrap Icons v1.13.1(MIT)에서 큐레이션.
|
|
5
5
|
* `eye-reveal` 는 예외(기존 마스킹 셀 커스텀 글리프, 행동 보존용).
|
|
6
|
+
* / symbolId → inner SVG markup (<path>/<g>). Curated from Bootstrap Icons v1.13.1 (MIT).
|
|
7
|
+
* `eye-reveal` is the exception (existing masking-cell custom glyph, kept for behavior parity).
|
|
6
8
|
*/
|
|
7
9
|
export declare const BOOTSTRAP_ICONS: Readonly<Record<string, string>>;
|
|
8
|
-
/** 큐레이션에 포함된 symbol 개수(테스트/디버깅용). `eye-reveal`(커스텀 1) 포함. */
|
|
10
|
+
/** 큐레이션에 포함된 symbol 개수(테스트/디버깅용). `eye-reveal`(커스텀 1) 포함. / Count of curated symbols (for tests/debugging), including `eye-reveal` (1 custom). */
|
|
9
11
|
export declare const BOOTSTRAP_ICON_COUNT: number;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/** 대비 검사 쌍 — 전경/배경 + 요구 임계. / A contrast pair — fg/bg + required threshold. */
|
|
2
|
+
export interface ContrastPair {
|
|
3
|
+
readonly fg: string;
|
|
4
|
+
readonly bg: string;
|
|
5
|
+
readonly kind: 'bodyText' | 'largeText' | 'uiComponent' | 'graphic';
|
|
6
|
+
readonly context: {
|
|
7
|
+
theme: string;
|
|
8
|
+
skin: string;
|
|
9
|
+
state: string;
|
|
10
|
+
tokenId: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
/** WCAG 임계: bodyText ≥4.5, large/ui/graphic ≥3.0. 의도적 고정(표준 SSOT). / WCAG minimums. */
|
|
14
|
+
export declare const CONTRAST_MIN: Readonly<Record<ContrastPair['kind'], number>>;
|
|
15
|
+
/** 단일 쌍 판정. / A single pair verdict. */
|
|
16
|
+
export interface ContrastVerdict {
|
|
17
|
+
readonly pair: ContrastPair;
|
|
18
|
+
readonly ratio: number;
|
|
19
|
+
readonly required: number;
|
|
20
|
+
readonly status: 'pass' | 'fail';
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* 외관 토큰 스냅샷 입력(헤드리스 계약). DD-11 `ResolvedAppearanceSnapshot` 구현 시 대체 import.
|
|
24
|
+
* 감사기는 토큰 값을 만들지 않고, 스냅샷이 선언한 대비 관련 쌍을 순회·판정만 한다.
|
|
25
|
+
* / Appearance token snapshot input (headless contract). To be replaced by DD-11's
|
|
26
|
+
* `ResolvedAppearanceSnapshot` import once implemented.
|
|
27
|
+
*/
|
|
28
|
+
export interface AppearanceSnapshotLike {
|
|
29
|
+
readonly theme: string;
|
|
30
|
+
readonly skin: string;
|
|
31
|
+
readonly state: string;
|
|
32
|
+
/** 토큰 id → 결정된 색(hex/rgb). / token id → resolved color. */
|
|
33
|
+
readonly colors: Readonly<Record<string, string>>;
|
|
34
|
+
/** 감사 대상 대비 쌍(전경 토큰·배경 토큰·종류). / contrast pairs to audit. */
|
|
35
|
+
readonly pairs: ReadonlyArray<{
|
|
36
|
+
readonly fgToken: string;
|
|
37
|
+
readonly bgToken: string;
|
|
38
|
+
readonly kind: ContrastPair['kind'];
|
|
39
|
+
}>;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* 대비 감사기 — 순수 계산(DOM 무관, 헤드리스).
|
|
43
|
+
* CRC: 색쌍→대비비→판정 | 협력: DD-11(토큰 스냅샷 입력)·ReleaseGate(a11y 게이트)·palette.ts(산식).
|
|
44
|
+
* 불변식: 미달 1건이라도 있으면 실패. 산식 재구현 0 — palette.contrastRatio 위임.
|
|
45
|
+
* / Contrast auditor — pure computation (DOM-agnostic, headless).
|
|
46
|
+
*/
|
|
47
|
+
export declare class ContrastAuditor {
|
|
48
|
+
/**
|
|
49
|
+
* 테마×스킨×상태 스냅샷에서 색쌍 인벤토리 생성(누락 토큰=미커버). 결정론 순서.
|
|
50
|
+
* / Build a pair inventory from snapshots (missing token = uncovered). Deterministic order.
|
|
51
|
+
*/
|
|
52
|
+
enumeratePairs(snapshots: readonly AppearanceSnapshotLike[]): ContrastPair[];
|
|
53
|
+
/**
|
|
54
|
+
* 스냅샷의 대비 쌍 중 토큰 값이 누락된 항목 지목(미커버=완결성 위반, TX-830).
|
|
55
|
+
* / Report pairs whose token colors are missing (uncovered = completeness violation).
|
|
56
|
+
*/
|
|
57
|
+
coverageGaps(snapshots: readonly AppearanceSnapshotLike[]): string[];
|
|
58
|
+
/** WCAG 2.2 상대휘도 대비비 = palette.contrastRatio 위임(자체 산식 없음). / Delegated ratio. */
|
|
59
|
+
ratio(fg: string, bg: string): number;
|
|
60
|
+
/** 전수 판정. / Audit every pair. */
|
|
61
|
+
audit(pairs: readonly ContrastPair[]): ContrastVerdict[];
|
|
62
|
+
/** 미달 목록만 필터(리포트용). / Filter to failures only (for reporting). */
|
|
63
|
+
failures(verdicts: readonly ContrastVerdict[]): ContrastVerdict[];
|
|
64
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/** 주입 clock — 프로덕션=시스템시계, 테스트=고정/전진 가능한 가짜시계. / Injected clock. */
|
|
2
|
+
export interface IClock {
|
|
3
|
+
now(): number;
|
|
4
|
+
raf(cb: (t: number) => void): number;
|
|
5
|
+
cancelRaf(id: number): void;
|
|
6
|
+
}
|
|
7
|
+
/** 주입 RNG — 시드 기반 결정론 난수(테스트), 프로덕션=암묵 시드. / Injected RNG. */
|
|
8
|
+
export interface IRandom {
|
|
9
|
+
next(): number;
|
|
10
|
+
seed(s: number): void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* 결정론 커널 — 비결정성 소스의 단일 주입 지점.
|
|
14
|
+
* CRC: 시간/난수/idle-flush 통제 | 협력: 렌더 파이프라인·차트가 DI 로 소비.
|
|
15
|
+
* 불변식: 동일 seed·동일 clock 스텝 → 동일 출력. whenIdle 는 보류 flush 후 resolve.
|
|
16
|
+
* / Deterministic kernel — the single injection point for non-determinism.
|
|
17
|
+
*/
|
|
18
|
+
export declare class DeterminismKernel {
|
|
19
|
+
readonly clock: IClock;
|
|
20
|
+
readonly random: IRandom;
|
|
21
|
+
constructor(clock: IClock, random: IRandom);
|
|
22
|
+
/**
|
|
23
|
+
* 모든 보류 작업(raf 렌더·이미지 로드·캔버스 draw·레이아웃 반영) 완료 후 resolve.
|
|
24
|
+
* 시각회귀 스위트가 캡처 직전 호출 → 플래키(찍는 타이밍 경쟁) 제거의 핵심.
|
|
25
|
+
* / Resolve after all pending work completes; called right before a golden capture.
|
|
26
|
+
*/
|
|
27
|
+
whenIdle(): Promise<void>;
|
|
28
|
+
/** 보류 렌더를 강제 flush(동기 레이아웃 확정) — 골든 캡처용. / Force-flush pending renders. */
|
|
29
|
+
flushLayout(): void;
|
|
30
|
+
/**
|
|
31
|
+
* 결정론 직렬화: 키 순서·수치 포맷 고정(toJSON diff·회귀 비교 가능화).
|
|
32
|
+
* / Deterministic serialization: fixed key order + number format.
|
|
33
|
+
*/
|
|
34
|
+
stableStringify(value: unknown): string;
|
|
35
|
+
/**
|
|
36
|
+
* 포맷터 순수성 검증 헬퍼: 동일 입력 2회 실행 산출물 바이트 동일 assert.
|
|
37
|
+
* 위반 시 throw(계약 테스트에서 순수성 위반 탐지).
|
|
38
|
+
* / Purity check helper: run fn twice and assert byte-identical output; throws on violation.
|
|
39
|
+
*/
|
|
40
|
+
assertPure<T>(fn: () => T): void;
|
|
41
|
+
}
|
|
42
|
+
/** 프로덕션 clock — 시스템 시계/requestAnimationFrame 위임(헤드리스는 setTimeout 폴백). */
|
|
43
|
+
export declare class SystemClock implements IClock {
|
|
44
|
+
now(): number;
|
|
45
|
+
raf(cb: (t: number) => void): number;
|
|
46
|
+
cancelRaf(id: number): void;
|
|
47
|
+
}
|
|
48
|
+
/** 시드 기반 결정론 PRNG(mulberry32). / Seeded deterministic PRNG (mulberry32). */
|
|
49
|
+
export declare class SeededRandom implements IRandom {
|
|
50
|
+
private _state;
|
|
51
|
+
constructor(seed?: number);
|
|
52
|
+
next(): number;
|
|
53
|
+
seed(s: number): void;
|
|
54
|
+
}
|
|
55
|
+
/** 수동 전진 가짜 시계 — 예약된 raf 콜백을 결정론 실행. / Manually-advanced fake clock. */
|
|
56
|
+
export declare class FakeClock implements IClock {
|
|
57
|
+
private _now;
|
|
58
|
+
private _nextId;
|
|
59
|
+
private _pending;
|
|
60
|
+
constructor(start?: number);
|
|
61
|
+
now(): number;
|
|
62
|
+
raf(cb: (t: number) => void): number;
|
|
63
|
+
cancelRaf(id: number): void;
|
|
64
|
+
/** 시간 전진 + 예약된 raf 콜백 결정론 실행. / Advance time and run scheduled raf callbacks. */
|
|
65
|
+
advance(ms: number): void;
|
|
66
|
+
/** 보류 raf 콜백을 등록 순서대로 flush(현재 시각 전달). / Flush pending raf callbacks in registration order. */
|
|
67
|
+
flushRaf(): void;
|
|
68
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** 지표 단위. / Metric unit. */
|
|
2
|
+
export type MetricUnit = 'ms' | 'fps' | 'kb' | 'mb' | 'ratio' | 'nodes' | 'percent';
|
|
3
|
+
/** 단일 지표의 기준값 — 골든 파일(버전 관리)의 한 항목. / A single baseline entry (golden file). */
|
|
4
|
+
export interface BaselineEntry {
|
|
5
|
+
readonly metricId: string;
|
|
6
|
+
readonly value: number;
|
|
7
|
+
readonly unit: MetricUnit;
|
|
8
|
+
readonly capturedAt: string;
|
|
9
|
+
readonly commit: string;
|
|
10
|
+
}
|
|
11
|
+
/** 기준선 SSOT — 회귀 판정의 유일한 진실원. / Baseline SSOT — the single source of regression truth. */
|
|
12
|
+
export interface PerfBaseline {
|
|
13
|
+
readonly version: string;
|
|
14
|
+
readonly entries: Readonly<Record<string, BaselineEntry>>;
|
|
15
|
+
/** 지표별 허용 회귀율 오버라이드(기본 5%). fps는 하한이라 부호 반전. / per-metric tolerance overrides. */
|
|
16
|
+
readonly toleranceOverrides?: Readonly<Record<string, number>>;
|
|
17
|
+
}
|
|
18
|
+
/** 기본 허용 회귀율(%). / Default allowed regression (%). */
|
|
19
|
+
export declare const DEFAULT_REGRESSION_TOLERANCE_PCT = 5;
|
|
20
|
+
/** 빈 기준선(신규 지표 전부 status='new'). / An empty baseline (all metrics become 'new'). */
|
|
21
|
+
export declare const EMPTY_BASELINE: PerfBaseline;
|
|
22
|
+
/** 항목 배열로 기준선을 조립(편의). / Build a baseline from an entry array (convenience). */
|
|
23
|
+
export declare function makeBaseline(version: string, entries: readonly BaselineEntry[], toleranceOverrides?: Readonly<Record<string, number>>): PerfBaseline;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/** 규모 축 — 대표 워크로드. / Scale axis — representative workloads. */
|
|
2
|
+
export type Scale = '10k' | '100k' | '1m';
|
|
3
|
+
/** 조작 축 — 7대 핵심 조작(SPS 매트릭스 행). / Operation axis — the 7 core operations (SPS matrix rows). */
|
|
4
|
+
export type Operation = 'initialRender' | 'verticalScroll' | 'sort' | 'filter' | 'cellEditCommit' | 'cfRecalc' | 'themeSwitch';
|
|
5
|
+
/**
|
|
6
|
+
* 상호작용 지연 등급(TX-802) — 정성어를 수치로 못박는 SSOT. 모든 상호작용 예산은 이 등급 하나를 인용.
|
|
7
|
+
* / Interaction latency class (TX-802) — the SSOT that pins qualitative words to numbers.
|
|
8
|
+
*/
|
|
9
|
+
export declare enum LatencyClass {
|
|
10
|
+
Instant = "instant",// keypress→paint ≤16.7ms (1프레임)
|
|
11
|
+
Immediate = "immediate",// 지각적 즉시 ≤100ms
|
|
12
|
+
Responsive = "responsive",// INP p75 ≤200ms
|
|
13
|
+
Heavy = "heavy"
|
|
14
|
+
}
|
|
15
|
+
/** 지연 등급별 상한(ms) — 의도적 고정(표준·SSOT). / Per-class latency ceilings (ms) — intentionally fixed. */
|
|
16
|
+
export declare const LATENCY_MS: Readonly<Record<LatencyClass, number>>;
|
|
17
|
+
/**
|
|
18
|
+
* 단일 예산 셀 — SPS 매트릭스의 한 칸(조작×규모).
|
|
19
|
+
* 불변식: 모든 임계는 상한(≤)이거나 하한(≥, fps만). null=해당 규모에서 미측정 명시(누락과 구분).
|
|
20
|
+
* / A single budget cell — one square (operation×scale) of the SPS matrix.
|
|
21
|
+
*/
|
|
22
|
+
export interface PerfBudget {
|
|
23
|
+
readonly op: Operation;
|
|
24
|
+
readonly scale: Scale;
|
|
25
|
+
readonly p50Ms?: number;
|
|
26
|
+
readonly p95Ms: number;
|
|
27
|
+
readonly minFps?: number;
|
|
28
|
+
readonly maxDomNodes?: number;
|
|
29
|
+
readonly latencyClass: LatencyClass;
|
|
30
|
+
readonly reqIds: readonly string[];
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* per-feature 렌더 예산 — 가시행 기준 노드/프레임(TX-801 원장·TX-808 각론).
|
|
34
|
+
* "빈 그리드는 빨라도 CF 켜지면 무너진다" — 총론이 아닌 기능별 각론.
|
|
35
|
+
* / per-feature render budget — nodes/frame per visible row.
|
|
36
|
+
*/
|
|
37
|
+
export interface FeatureBudget {
|
|
38
|
+
readonly feature: 'cf' | 'sparkline' | 'databar' | 'heatmap' | 'widgetCell' | 'chart';
|
|
39
|
+
readonly scale: Scale;
|
|
40
|
+
readonly nodesPerVisibleRow: number;
|
|
41
|
+
readonly frameMs: number;
|
|
42
|
+
readonly reqIds: readonly string[];
|
|
43
|
+
}
|
|
44
|
+
/** TTFR·페인트·CLS 예산(TX-801). mount→첫 페인트. / TTFR·paint·CLS budget (TX-801). */
|
|
45
|
+
export interface PaintBudget {
|
|
46
|
+
readonly scale: Scale;
|
|
47
|
+
readonly ttfrMs: number;
|
|
48
|
+
readonly ttiMs: number;
|
|
49
|
+
readonly cls: number;
|
|
50
|
+
}
|
|
51
|
+
/** 상주 메모리 상한 곡선(TX-804). / Resident-memory ceiling curve (TX-804). */
|
|
52
|
+
export interface MemoryBudget {
|
|
53
|
+
readonly scale: Scale;
|
|
54
|
+
readonly maxResidentMb: number;
|
|
55
|
+
readonly maxDetachedNodes: number;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* 통합 성능 명세 — 단일 SSOT 애그리게이트.
|
|
59
|
+
* 이 객체 하나가 "성능이 무엇을 의미하는가"의 유일한 정본. CI·문서·대시보드가 모두 이걸 인용.
|
|
60
|
+
* / Aggregate performance spec — the single SSOT.
|
|
61
|
+
*/
|
|
62
|
+
export interface PerfSpec {
|
|
63
|
+
readonly version: string;
|
|
64
|
+
readonly operations: readonly PerfBudget[];
|
|
65
|
+
readonly features: readonly FeatureBudget[];
|
|
66
|
+
readonly paint: readonly PaintBudget[];
|
|
67
|
+
readonly memory: readonly MemoryBudget[];
|
|
68
|
+
/** 커버리지 계약: 신규 기능 키가 등장했는데 예산이 없으면 게이트 실패(머지 금지 강제). */
|
|
69
|
+
readonly coveredFeatures: readonly string[];
|
|
70
|
+
}
|
|
71
|
+
/** 기본 성능 명세 SSOT(v1). / Default performance spec SSOT (v1). */
|
|
72
|
+
export declare const DEFAULT_PERF_SPEC: PerfSpec;
|
|
73
|
+
/** 지표 id 규약: `${op}.${scale}.p95` 등 — 기준선/판정 키의 SSOT. / Metric id convention. */
|
|
74
|
+
export declare function metricId(op: Operation, scale: Scale, kind?: 'p50' | 'p95' | 'fps'): string;
|
|
75
|
+
/** op×scale 예산 셀 조회. 없으면 undefined. / Look up the op×scale budget cell. */
|
|
76
|
+
export declare function findBudget(spec: PerfSpec, op: Operation, scale: Scale): PerfBudget | undefined;
|
|
77
|
+
/** 단일 예산 assert 결과. / Single budget assertion result. */
|
|
78
|
+
export interface BudgetCheck {
|
|
79
|
+
readonly metricId: string;
|
|
80
|
+
readonly measured: number;
|
|
81
|
+
readonly budget: number;
|
|
82
|
+
/** fps/처리량 하한 지표면 true(작을수록 실패). / true for a floor metric (smaller = failing). */
|
|
83
|
+
readonly isFloor: boolean;
|
|
84
|
+
readonly withinBudget: boolean;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* 측정 p95(ms)를 op×scale 상한과 대조. 상한 초과 시 withinBudget=false.
|
|
88
|
+
* / Assert a measured p95 (ms) against the op×scale ceiling.
|
|
89
|
+
*/
|
|
90
|
+
export declare function assertP95(spec: PerfSpec, op: Operation, scale: Scale, measuredMs: number): BudgetCheck;
|
|
91
|
+
/**
|
|
92
|
+
* 측정 fps 를 op×scale 하한과 대조(스크롤류). 하한 미만이면 withinBudget=false.
|
|
93
|
+
* / Assert a measured fps against the op×scale floor (scroll-like).
|
|
94
|
+
*/
|
|
95
|
+
export declare function assertFps(spec: PerfSpec, op: Operation, scale: Scale, measuredFps: number): BudgetCheck;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/** 픽셀 어서션 — 특정 좌표의 RGBA 기대(허용오차). / Pixel assertion — expected RGBA at a coordinate. */
|
|
2
|
+
export interface PixelAssertion {
|
|
3
|
+
readonly kind: 'pixel';
|
|
4
|
+
readonly at: {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
};
|
|
8
|
+
readonly expect: {
|
|
9
|
+
rgba: [number, number, number, number];
|
|
10
|
+
tolerance: number;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
/** 노드수 어서션 — 셀렉터 라이브 노드 상한(TX-803). / Node-count assertion — live node cap. */
|
|
14
|
+
export interface NodeCountAssertion {
|
|
15
|
+
readonly kind: 'nodeCount';
|
|
16
|
+
readonly selector: string;
|
|
17
|
+
readonly max: number;
|
|
18
|
+
}
|
|
19
|
+
/** 렌더 의존 기능 1건. / One render-dependent feature case. */
|
|
20
|
+
export interface RenderGateCase {
|
|
21
|
+
readonly id: string;
|
|
22
|
+
readonly feature: 'chart' | 'microVisual' | 'virtualization' | 'pixelAlign' | 'merge' | 'frozen';
|
|
23
|
+
readonly fixtureId: string;
|
|
24
|
+
/** 최소 1개 이상의 픽셀/노드 어서션 필수(없으면 게이트가 이 케이스를 무효 처리). */
|
|
25
|
+
readonly assertions: ReadonlyArray<PixelAssertion | NodeCountAssertion>;
|
|
26
|
+
}
|
|
27
|
+
/** 단일 어서션 결과. / A single assertion result. */
|
|
28
|
+
export interface AssertionResult {
|
|
29
|
+
readonly assertion: PixelAssertion | NodeCountAssertion;
|
|
30
|
+
readonly measured: number | [number, number, number, number];
|
|
31
|
+
readonly status: 'pass' | 'fail';
|
|
32
|
+
}
|
|
33
|
+
/** 케이스 1건의 실행 결과. / One case's run result. */
|
|
34
|
+
export interface CaseResult {
|
|
35
|
+
readonly caseId: string;
|
|
36
|
+
readonly engine: string;
|
|
37
|
+
readonly status: 'pass' | 'fail' | 'invalid';
|
|
38
|
+
readonly assertions: readonly AssertionResult[];
|
|
39
|
+
}
|
|
40
|
+
/** 엔진별 개별 리포트(TX-828 크로스브라우저). / Per-engine report. */
|
|
41
|
+
export interface RenderGateReport {
|
|
42
|
+
readonly engine: string;
|
|
43
|
+
readonly cases: readonly CaseResult[];
|
|
44
|
+
readonly status: 'pass' | 'fail';
|
|
45
|
+
}
|
|
46
|
+
/** 실브라우저 케이스 구동 계약(Playwright 잡/스텁 주입). / Real-browser case runner contract. */
|
|
47
|
+
export interface ICaseRunner {
|
|
48
|
+
readonly engine: string;
|
|
49
|
+
run(c: RenderGateCase): Promise<readonly AssertionResult[]>;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* 실브라우저 게이트 — 렌더 의존 기능 전수가 실픽셀/노드 어서션을 통과해야 완료.
|
|
53
|
+
* CRC: 케이스 등록·구동·판정·커버리지 | 협력: ICaseRunner(엔진별)·ReleaseGate.
|
|
54
|
+
* 불변식: 케이스마다 assertion ≥1(허위완료 방지). assertion=0 → invalid.
|
|
55
|
+
* / Real-browser gate — every render-dependent feature must pass real pixel/node assertions.
|
|
56
|
+
*/
|
|
57
|
+
export declare class RealBrowserGate {
|
|
58
|
+
private readonly runner;
|
|
59
|
+
private readonly _cases;
|
|
60
|
+
constructor(runner: ICaseRunner);
|
|
61
|
+
/** 케이스 등록. / Register a case. */
|
|
62
|
+
registerCase(c: RenderGateCase): void;
|
|
63
|
+
/** 등록 케이스 수. / Registered case count. */
|
|
64
|
+
get caseCount(): number;
|
|
65
|
+
/** 실브라우저 구동 → 엔진 리포트. assertion=0 케이스는 invalid(허위완료 차단). / Run cases. */
|
|
66
|
+
run(): Promise<RenderGateReport>;
|
|
67
|
+
/** 커버리지: 렌더 의존 기능 목록 중 케이스 없는 항목 → 미커버 실패. / Coverage gaps. */
|
|
68
|
+
coverageGaps(featureInventory: readonly string[]): string[];
|
|
69
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { PerfSpec } from './PerfSpec.js';
|
|
2
|
+
import { PerfBaseline } from './PerfBaseline.js';
|
|
3
|
+
/** 한 지표의 판정 결과 — 게이트 산출의 최소 단위. / A single metric verdict — the atomic gate output. */
|
|
4
|
+
export interface MetricVerdict {
|
|
5
|
+
readonly metricId: string;
|
|
6
|
+
readonly measured: number;
|
|
7
|
+
readonly baseline: number | null;
|
|
8
|
+
readonly budget: number;
|
|
9
|
+
/** (measured-baseline)/baseline*100. baseline=null|0 이면 null(NaN 금지). / null when baseline is null/0. */
|
|
10
|
+
readonly regressionPct: number | null;
|
|
11
|
+
readonly status: 'pass' | 'fail-budget' | 'fail-regression' | 'new';
|
|
12
|
+
readonly reqIds: readonly string[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* 회귀 판정기 — SPS 예산 + 기준선을 함께 적용하는 2중 게이트.
|
|
16
|
+
* CRC: 예산 위반·기준선 회귀 판정 | 협력: PerfSpec(예산)·PerfBaseline(기준선 DI).
|
|
17
|
+
* / Regression judge — the SPS-budget + baseline double gate.
|
|
18
|
+
*/
|
|
19
|
+
export declare class RegressionJudge {
|
|
20
|
+
private readonly spec;
|
|
21
|
+
private readonly baseline;
|
|
22
|
+
constructor(spec: PerfSpec, baseline: PerfBaseline);
|
|
23
|
+
/** 지표별 허용 회귀율(%) — override 없으면 기본 5. / Per-metric tolerance (%). */
|
|
24
|
+
private tolerance;
|
|
25
|
+
/**
|
|
26
|
+
* 실측 지표맵을 받아 지표별 판정 배열 반환. 순수 함수(부작용 0).
|
|
27
|
+
* / Judge a measured metric map into per-metric verdicts. Pure.
|
|
28
|
+
*/
|
|
29
|
+
judge(measured: Readonly<Record<string, number>>): MetricVerdict[];
|
|
30
|
+
/**
|
|
31
|
+
* 커버리지 검사: SPS coveredFeatures 중 실측에 없는 기능 지표 → 미커버 지목(머지 금지 강제).
|
|
32
|
+
* / Coverage check: covered features with no measured metric → merge-blocking gaps.
|
|
33
|
+
*/
|
|
34
|
+
coverageGaps(measured: Readonly<Record<string, number>>): string[];
|
|
35
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { RegressionJudge } from './RegressionJudge.js';
|
|
2
|
+
import { ContrastAuditor, AppearanceSnapshotLike } from './ContrastAuditor.js';
|
|
3
|
+
/** 5대 하위 게이트. / The 5 sub-gates. */
|
|
4
|
+
export type SubGateId = 'perf' | 'memory' | 'bundle' | 'contrast' | 'a11y';
|
|
5
|
+
/** 하위 게이트 실패 항목. / A sub-gate failure item. */
|
|
6
|
+
export interface SubGateFailure {
|
|
7
|
+
readonly metricId: string;
|
|
8
|
+
readonly measured: number;
|
|
9
|
+
readonly budget: number;
|
|
10
|
+
readonly reqIds: readonly string[];
|
|
11
|
+
}
|
|
12
|
+
/** 하위 게이트 결과. / A sub-gate result. */
|
|
13
|
+
export interface SubGateResult {
|
|
14
|
+
readonly id: SubGateId;
|
|
15
|
+
readonly status: 'pass' | 'fail';
|
|
16
|
+
readonly failures: readonly SubGateFailure[];
|
|
17
|
+
}
|
|
18
|
+
/** 릴리스 종합 판정. / Aggregate release verdict. */
|
|
19
|
+
export interface ReleaseVerdict {
|
|
20
|
+
readonly status: 'pass' | 'blocked';
|
|
21
|
+
readonly subGates: readonly SubGateResult[];
|
|
22
|
+
/** 차단 시: 원인 하위게이트·지표·REQ 요약(리포트 SSOT). / Blocking reasons (report SSOT). */
|
|
23
|
+
readonly blockingReasons: ReadonlyArray<{
|
|
24
|
+
subGate: SubGateId;
|
|
25
|
+
metricId: string;
|
|
26
|
+
reqIds: readonly string[];
|
|
27
|
+
}>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* 게이트 컨텍스트 — 하위 게이트 입력 버킷. 각 게이트는 필요한 것만 읽는다.
|
|
31
|
+
* / Gate context — input buckets; each sub-gate reads only what it needs.
|
|
32
|
+
*/
|
|
33
|
+
export interface GateContext {
|
|
34
|
+
/** 실측 지표맵(perf/memory/bundle). / measured metric map. */
|
|
35
|
+
readonly metrics?: Readonly<Record<string, number>>;
|
|
36
|
+
/** 외관 토큰 스냅샷(contrast/a11y). / appearance token snapshots. */
|
|
37
|
+
readonly snapshots?: readonly AppearanceSnapshotLike[];
|
|
38
|
+
}
|
|
39
|
+
/** 하위 게이트 공통 계약 — OCP seam(신규 예산 축 additive 추가). / Sub-gate contract (OCP seam). */
|
|
40
|
+
export interface ISubGate {
|
|
41
|
+
readonly id: SubGateId;
|
|
42
|
+
run(ctx: GateContext): Promise<SubGateResult>;
|
|
43
|
+
}
|
|
44
|
+
/** 체크리스트 항목(자동/수동). / A checklist item. */
|
|
45
|
+
export interface ReleaseChecklistItem {
|
|
46
|
+
readonly id: string;
|
|
47
|
+
readonly label: string;
|
|
48
|
+
readonly automated: boolean;
|
|
49
|
+
readonly subGate?: SubGateId;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* 회귀 기반 하위게이트 — RegressionJudge 판정을 지표 prefix 로 선별해 perf/memory/bundle 축에 배정.
|
|
53
|
+
* / Regression-based sub-gate — selects RegressionJudge verdicts by metric-id prefix.
|
|
54
|
+
*/
|
|
55
|
+
export declare class RegressionSubGate implements ISubGate {
|
|
56
|
+
readonly id: SubGateId;
|
|
57
|
+
private readonly judge;
|
|
58
|
+
/** 이 게이트가 소유하는 지표인지 판별(prefix 등). / owns-this-metric predicate. */
|
|
59
|
+
private readonly owns;
|
|
60
|
+
constructor(id: SubGateId, judge: RegressionJudge,
|
|
61
|
+
/** 이 게이트가 소유하는 지표인지 판별(prefix 등). / owns-this-metric predicate. */
|
|
62
|
+
owns: (metricId: string) => boolean);
|
|
63
|
+
run(ctx: GateContext): Promise<SubGateResult>;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* 대비 기반 하위게이트 — ContrastAuditor 전수 판정을 contrast/a11y 축에 배정. 미달 1건이라도 실패.
|
|
67
|
+
* / Contrast-based sub-gate — maps ContrastAuditor verdicts to the contrast/a11y axis.
|
|
68
|
+
*/
|
|
69
|
+
export declare class ContrastSubGate implements ISubGate {
|
|
70
|
+
readonly id: SubGateId;
|
|
71
|
+
private readonly auditor;
|
|
72
|
+
constructor(id: SubGateId, auditor: ContrastAuditor);
|
|
73
|
+
run(ctx: GateContext): Promise<SubGateResult>;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* 릴리스 게이트 — 산재 게이트가 참조하는 단일 정본.
|
|
77
|
+
* CRC: 5개 하위 게이트 조립·단일 blocking 판정 | 협력: RegressionSubGate·ContrastSubGate·…
|
|
78
|
+
* 불변식: subGates 중 하나라도 fail → 전체 blocked(AND 게이트). 부분통과 개념 없음.
|
|
79
|
+
* / Release gate — the single canonical AND-gate.
|
|
80
|
+
*/
|
|
81
|
+
export declare class ReleaseGate {
|
|
82
|
+
private readonly subGates;
|
|
83
|
+
constructor(subGates: readonly ISubGate[]);
|
|
84
|
+
evaluate(ctx: GateContext): Promise<ReleaseVerdict>;
|
|
85
|
+
/**
|
|
86
|
+
* 커버리지: 5대 정본 축(perf·memory·bundle·contrast·a11y) 중 조립된 하위게이트가 없는 축 지목.
|
|
87
|
+
* evaluate() 는 등록된 게이트만 판정하므로, 미등록 축은 침묵 통과한다 — 이 메서드가 그 갭을 계량한다.
|
|
88
|
+
* / Coverage: canonical axes with no assembled sub-gate. evaluate() silently passes missing axes;
|
|
89
|
+
* this measures that gap (measurability guard, mirrors RegressionJudge/RealBrowserGate.coverageGaps).
|
|
90
|
+
*/
|
|
91
|
+
coverageGaps(): SubGateId[];
|
|
92
|
+
/** 체크리스트 정본 렌더(자동/수동 항목). / Render the canonical checklist. */
|
|
93
|
+
checklist(): ReleaseChecklistItem[];
|
|
94
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { DeterminismKernel } from './DeterminismKernel.js';
|
|
2
|
+
import { ImageLike } from './pixelMetrics.js';
|
|
3
|
+
/** 스냅샷 대상 좌표 — 매트릭스 한 점. / A snapshot target coordinate — one matrix point. */
|
|
4
|
+
export interface SnapshotSpec {
|
|
5
|
+
readonly component: 'header' | 'cell' | 'widgetCell' | 'contextMenu' | 'emptyState' | 'chart' | 'filterPanel' | 'editor';
|
|
6
|
+
readonly theme: string;
|
|
7
|
+
readonly skin: string;
|
|
8
|
+
readonly state?: 'default' | 'hover' | 'selected' | 'focus' | 'disabled' | 'zebra';
|
|
9
|
+
readonly fixtureId: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 비교 임계 — 판정 루브릭(육안 대체). 전부 주입값(생성자 DI) — 하드코딩 상수 아님(§4.1 오버라이딩).
|
|
13
|
+
* / Comparison thresholds — the verdict rubric replacing human eyeballing. All injectable.
|
|
14
|
+
*/
|
|
15
|
+
export interface DiffThreshold {
|
|
16
|
+
readonly maxChangedPixelRatio: number;
|
|
17
|
+
readonly minSsim: number;
|
|
18
|
+
readonly maxDeltaE: number;
|
|
19
|
+
readonly maxFlakyRate: number;
|
|
20
|
+
}
|
|
21
|
+
/** 기본 임계(§2.5 브리프 값). / Default thresholds (§2.5 brief values). */
|
|
22
|
+
export declare const DEFAULT_DIFF_THRESHOLD: DiffThreshold;
|
|
23
|
+
/** 단일 스냅샷 비교 결과. / A single snapshot comparison result. */
|
|
24
|
+
export interface DiffResult {
|
|
25
|
+
readonly spec: SnapshotSpec;
|
|
26
|
+
readonly changedPixelRatio: number;
|
|
27
|
+
readonly ssim: number;
|
|
28
|
+
readonly maxDeltaE: number;
|
|
29
|
+
readonly status: 'pass' | 'fail' | 'new-golden';
|
|
30
|
+
readonly diffImagePath?: string;
|
|
31
|
+
}
|
|
32
|
+
/** 실 픽셀 캡처 계약(실브라우저/스텁 주입). / Real-pixel capture contract (real browser / stub). */
|
|
33
|
+
export interface ICapturer {
|
|
34
|
+
capture(spec: SnapshotSpec): Promise<ImageLike>;
|
|
35
|
+
}
|
|
36
|
+
/** 골든 스냅샷 저장소 계약. / Golden snapshot store contract. */
|
|
37
|
+
export interface IGoldenStore {
|
|
38
|
+
get(spec: SnapshotSpec): ImageLike | null;
|
|
39
|
+
}
|
|
40
|
+
/** 매트릭스 전개 정의(컴포넌트×테마×스킨×상태). / Matrix definition for enumeration. */
|
|
41
|
+
export interface MatrixConfig {
|
|
42
|
+
readonly components: readonly SnapshotSpec['component'][];
|
|
43
|
+
readonly themes: readonly string[];
|
|
44
|
+
readonly skins: readonly string[];
|
|
45
|
+
readonly states: readonly NonNullable<SnapshotSpec['state']>[];
|
|
46
|
+
readonly fixtureId: string;
|
|
47
|
+
}
|
|
48
|
+
/** 스냅샷 spec 의 안정 키(골든 대조·flaky 추적). / Stable key for a snapshot spec. */
|
|
49
|
+
export declare function snapshotKey(s: SnapshotSpec): string;
|
|
50
|
+
/**
|
|
51
|
+
* 시각회귀 하니스 — 골든 캡처·비교·flaky 추적.
|
|
52
|
+
* CRC: 결정론 렌더→캡처→골든 대조 | 협력: DeterminismKernel(whenIdle)·ICapturer(실픽셀)·pixelMetrics.
|
|
53
|
+
* 불변식: 캡처 전 반드시 kernel.whenIdle() await(경쟁 제거).
|
|
54
|
+
* / Visual regression harness — golden capture, compare, flaky tracking.
|
|
55
|
+
*/
|
|
56
|
+
export declare class VisualRegressionHarness {
|
|
57
|
+
private readonly kernel;
|
|
58
|
+
private readonly threshold;
|
|
59
|
+
private readonly capturer;
|
|
60
|
+
private readonly goldens;
|
|
61
|
+
private readonly matrix;
|
|
62
|
+
constructor(kernel: DeterminismKernel, threshold: DiffThreshold, capturer: ICapturer, goldens: IGoldenStore, matrix: MatrixConfig);
|
|
63
|
+
/** 매트릭스 전개: 컴포넌트×테마×스킨×상태 조합 생성(누락 조합=미커버 리포트). */
|
|
64
|
+
enumerate(): SnapshotSpec[];
|
|
65
|
+
/** 단일 스냅샷 캡처(whenIdle 후 실픽셀). / Capture one snapshot (after whenIdle). */
|
|
66
|
+
capture(spec: SnapshotSpec): Promise<ImageLike>;
|
|
67
|
+
/** 골든 대조. SSIM+픽셀 diff+ΔE 동시 판정(§2.5 커널 재사용). / Compare against golden. */
|
|
68
|
+
compare(spec: SnapshotSpec, actual: ImageLike): DiffResult;
|
|
69
|
+
/**
|
|
70
|
+
* flaky 감지: 동일 spec N회 캡처→첫 캡처 대비 불일치율 반환. 임계 초과는 호출측이 판정.
|
|
71
|
+
* / Flaky detection: capture the same spec N times → mismatch ratio vs the first capture.
|
|
72
|
+
*/
|
|
73
|
+
measureFlaky(spec: SnapshotSpec, runs: number): Promise<number>;
|
|
74
|
+
}
|