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,53 @@
|
|
|
1
|
+
/** 렌더 1회의 실측 샘플 — 코어가 매 렌더 완료 시 발신. / One measured render sample. */
|
|
2
|
+
export interface RenderMetric {
|
|
3
|
+
readonly renderMs: number;
|
|
4
|
+
readonly visibleRows: number;
|
|
5
|
+
readonly nodeCount: number;
|
|
6
|
+
readonly timestamp: number;
|
|
7
|
+
readonly reason: 'mount' | 'scroll' | 'data' | 'theme' | 'resize';
|
|
8
|
+
}
|
|
9
|
+
/** 상호작용 지연 샘플 — 입력→다음 페인트. / Interaction latency sample — input→next paint. */
|
|
10
|
+
export interface InteractionSample {
|
|
11
|
+
readonly type: 'edit' | 'scroll' | 'filter' | 'sort';
|
|
12
|
+
readonly latencyMs: number;
|
|
13
|
+
readonly timestamp: number;
|
|
14
|
+
}
|
|
15
|
+
/** 백분위 요약 — 원시 샘플에서 계산. / Percentile summary derived from raw samples. */
|
|
16
|
+
export interface LatencyStats {
|
|
17
|
+
readonly type: InteractionSample['type'];
|
|
18
|
+
readonly count: number;
|
|
19
|
+
readonly p50: number;
|
|
20
|
+
readonly p75: number;
|
|
21
|
+
readonly p95: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* 계측 훅 옵션 — OpenGridOptions 에 additive 편입(semver 안전, opt-in).
|
|
25
|
+
* / Instrumentation hook options — additive to OpenGridOptions (semver-safe, opt-in).
|
|
26
|
+
*/
|
|
27
|
+
export interface PerfHooks {
|
|
28
|
+
/** 렌더마다 호출. dev 모드에서 예산 초과 시 [OpenGrid] 경고 동반. / Called per render. */
|
|
29
|
+
onRenderMetrics?(m: RenderMetric): void;
|
|
30
|
+
/** 상호작용 지연 수집기. 유형별 p75/p95 반환 API 제공. / Interaction latency sink. */
|
|
31
|
+
onInteractionLatency?(s: InteractionSample): void;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* 지연 수집기 — 훅 샘플을 순환 버퍼에 모아 백분위 노출.
|
|
35
|
+
* CRC: 샘플 축적·백분위 계산 | 협력: PerfHooks(입력)·ReleaseGate/대시보드(출력).
|
|
36
|
+
* 불변식: 메모리 상한(고정 버퍼 크기 N=1024, 오래된 샘플 드롭) — 계측이 누수 원인이 되면 안 됨.
|
|
37
|
+
* / Latency collector — accumulates hook samples in a ring buffer and exposes percentiles.
|
|
38
|
+
*/
|
|
39
|
+
export declare class LatencyCollector {
|
|
40
|
+
private readonly _capacity;
|
|
41
|
+
private readonly _buf;
|
|
42
|
+
private _head;
|
|
43
|
+
/** @param capacity 순환 버퍼 크기(기본 1024) / ring buffer size (default 1024) */
|
|
44
|
+
constructor(capacity?: number);
|
|
45
|
+
/** 샘플 기록(용량 초과 시 최오래된 것 덮어씀). / Record a sample (overwrites the oldest when full). */
|
|
46
|
+
record(s: InteractionSample): void;
|
|
47
|
+
/** 현재 축적 샘플 수(용량 상한). / Current sample count (capped by capacity). */
|
|
48
|
+
get size(): number;
|
|
49
|
+
/** 유형별 p50/p75/p95 통계. / Per-type p50/p75/p95 stats. */
|
|
50
|
+
stats(type: InteractionSample['type']): LatencyStats;
|
|
51
|
+
/** 전체 샘플 비움. / Clear all samples. */
|
|
52
|
+
reset(): void;
|
|
53
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type { Scale, Operation, PerfBudget, FeatureBudget, PaintBudget, MemoryBudget, PerfSpec, BudgetCheck, } from './PerfSpec.js';
|
|
2
|
+
export { LatencyClass, LATENCY_MS, DEFAULT_PERF_SPEC, metricId, findBudget, assertP95, assertFps, } from './PerfSpec.js';
|
|
3
|
+
export type { RenderMetric, InteractionSample, LatencyStats, PerfHooks } from './hooks.js';
|
|
4
|
+
export { LatencyCollector } from './hooks.js';
|
|
5
|
+
export type { MetricUnit, BaselineEntry, PerfBaseline } from './PerfBaseline.js';
|
|
6
|
+
export { DEFAULT_REGRESSION_TOLERANCE_PCT, EMPTY_BASELINE, makeBaseline } from './PerfBaseline.js';
|
|
7
|
+
export type { MetricVerdict } from './RegressionJudge.js';
|
|
8
|
+
export { RegressionJudge } from './RegressionJudge.js';
|
|
9
|
+
export type { IClock, IRandom } from './DeterminismKernel.js';
|
|
10
|
+
export { DeterminismKernel, SystemClock, SeededRandom, FakeClock } from './DeterminismKernel.js';
|
|
11
|
+
export type { ImageLike } from './pixelMetrics.js';
|
|
12
|
+
export { changedPixelRatio, ssim, maxDeltaE } from './pixelMetrics.js';
|
|
13
|
+
export type { SnapshotSpec, DiffThreshold, DiffResult, ICapturer, IGoldenStore, MatrixConfig, } from './VisualRegression.js';
|
|
14
|
+
export { DEFAULT_DIFF_THRESHOLD, VisualRegressionHarness, snapshotKey } from './VisualRegression.js';
|
|
15
|
+
export type { ContrastPair, ContrastVerdict, AppearanceSnapshotLike } from './ContrastAuditor.js';
|
|
16
|
+
export { CONTRAST_MIN, ContrastAuditor } from './ContrastAuditor.js';
|
|
17
|
+
export type { PixelAssertion, NodeCountAssertion, RenderGateCase, AssertionResult, CaseResult, RenderGateReport, ICaseRunner, } from './RealBrowserGate.js';
|
|
18
|
+
export { RealBrowserGate } from './RealBrowserGate.js';
|
|
19
|
+
export type { SubGateId, SubGateFailure, SubGateResult, ReleaseVerdict, GateContext, ISubGate, ReleaseChecklistItem, } from './ReleaseGate.js';
|
|
20
|
+
export { RegressionSubGate, ContrastSubGate, ReleaseGate } from './ReleaseGate.js';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 픽셀 버퍼(브라우저 ImageData 구조 호환, 헤드리스에서도 사용). RGBA row-major.
|
|
3
|
+
* / Pixel buffer (structurally compatible with browser ImageData; headless-usable). RGBA row-major.
|
|
4
|
+
*/
|
|
5
|
+
export interface ImageLike {
|
|
6
|
+
readonly width: number;
|
|
7
|
+
readonly height: number;
|
|
8
|
+
readonly data: ArrayLike<number>;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 변경 픽셀 비율([0,1]). 규격 불일치는 1(전부 변경). tolerance=채널 절대차 허용(기본 0).
|
|
12
|
+
* / Ratio of changed pixels ([0,1]). Dimension mismatch → 1. tolerance = per-channel abs diff allowance.
|
|
13
|
+
*/
|
|
14
|
+
export declare function changedPixelRatio(a: ImageLike, b: ImageLike, tolerance?: number): number;
|
|
15
|
+
/**
|
|
16
|
+
* 구조 유사도 SSIM([0,1]) — 휘도 채널 전역 단일 창 근사. 동일 이미지=1, 규격 불일치=0.
|
|
17
|
+
* / Structural similarity (global single-window approximation over luma). Identical=1, mismatch=0.
|
|
18
|
+
*/
|
|
19
|
+
export declare function ssim(a: ImageLike, b: ImageLike): number;
|
|
20
|
+
/**
|
|
21
|
+
* 최대 색차(ΔE 근사, RGB 유클리드). 규격 불일치는 최대치(441). 차트/그래픽 스냅샷 판정.
|
|
22
|
+
* / Max color difference (ΔE approximation, RGB Euclidean). Mismatch → max (441).
|
|
23
|
+
*/
|
|
24
|
+
export declare function maxDeltaE(a: ImageLike, b: ImageLike): number;
|
|
@@ -1,30 +1,72 @@
|
|
|
1
1
|
import { CellRange, FlatRowRefLike } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* 복사 시 셀 값/표시값 조회 계약(§5.1, UR-4). / Cell value/display-text query contract for copy (§5.1, UR-4).
|
|
4
|
+
*/
|
|
2
5
|
export interface ClipboardQueryContext {
|
|
6
|
+
/** 열 인덱스(ci) → field 명(없으면 undefined). / Column index (ci) → field name (undefined if none). */
|
|
3
7
|
fieldAt(ci: number): string | undefined;
|
|
8
|
+
/** (행 ri, field) → 원시 셀 값. / (row ri, field) → raw cell value. */
|
|
4
9
|
getCellValue(ri: number, field: string): any;
|
|
5
|
-
/** override 데모 정합: 있으면 표시값 우선(§5.1 주석) */
|
|
10
|
+
/** override 데모 정합: 있으면 표시값 우선(§5.1 주석). / Override-demo alignment: prefer display text when present (§5.1 note). */
|
|
6
11
|
getDisplayText?(ri: number, field: string): string;
|
|
7
12
|
}
|
|
8
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* R행×C열 범위 → TSV(행마다 \t조인, 행간 \n) — 엑셀 왕복 호환(UR-4 AC).
|
|
15
|
+
* / R-row × C-col range → TSV (tab-join per row, newline between rows) — Excel round-trip compatible (UR-4 AC).
|
|
16
|
+
*
|
|
17
|
+
* @param rect - 직렬화할 정규화 셀 범위 / Normalized cell range to serialize
|
|
18
|
+
* @param ctx - 셀 값/표시값 조회 컨텍스트 / Cell value/display-text query context
|
|
19
|
+
* @returns TSV 문자열 / TSV string
|
|
20
|
+
*/
|
|
9
21
|
export declare function rangeToTSV(rect: CellRange, ctx: ClipboardQueryContext): string;
|
|
10
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* TSV 문자열 → 2D 블록(행×열 문자열 배열). 빈 문자열은 1×1 빈 블록.
|
|
24
|
+
* / TSV string → 2D block (row×col string array). Empty string yields a 1×1 empty block.
|
|
25
|
+
*
|
|
26
|
+
* @param text - 붙여넣기 원본 TSV 문자열 / Source TSV string to paste
|
|
27
|
+
* @returns 행×열 2D 문자열 블록 / Row×col 2D string block
|
|
28
|
+
*/
|
|
11
29
|
export declare function parseTSV(text: string): string[][];
|
|
30
|
+
/**
|
|
31
|
+
* 붙여넣기 플랜 생성에 필요한 행 해소/편집 가능 조회 계약(§5.2).
|
|
32
|
+
* / Row-resolution / editability query contract needed to build a paste plan (§5.2).
|
|
33
|
+
*/
|
|
12
34
|
export interface PastePlanContext {
|
|
35
|
+
/** flat index → 행 참조(kind/rowId). / flat index → row reference (kind/rowId). */
|
|
13
36
|
resolveFlatRow(ri: number): FlatRowRefLike;
|
|
37
|
+
/** 열 인덱스(ci) → field 명(없으면 undefined). / Column index (ci) → field name (undefined if none). */
|
|
14
38
|
fieldAt(ci: number): string | undefined;
|
|
15
|
-
/** 기본 true(잠금 없음) */
|
|
39
|
+
/** 기본 true(잠금 없음). / Defaults to true (no lock). */
|
|
16
40
|
isEditable?(rowId: string, field: string): boolean;
|
|
17
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* 붙여넣기 플랜의 셀별 항목(값 기록 또는 skip). / Per-cell item of a paste plan (write value or skip).
|
|
44
|
+
*/
|
|
18
45
|
export interface PastePlanItem {
|
|
46
|
+
/** 대상 행의 flat index. / Flat index of the target row. */
|
|
19
47
|
rowIndex: number;
|
|
48
|
+
/** 대상 컬럼 field 명. / Target column field name. */
|
|
20
49
|
field: string;
|
|
50
|
+
/** 수행 동작: 값 기록 또는 건너뜀. / Action: write value or skip. */
|
|
21
51
|
action: 'value' | 'skip';
|
|
52
|
+
/** 기록할 값(action==='value'일 때). / Value to write (when action==='value'). */
|
|
22
53
|
value?: any;
|
|
54
|
+
/** skip 사유(예: 'non-data-row', 'not-editable'). / Skip reason (e.g. 'non-data-row', 'not-editable'). */
|
|
23
55
|
reason?: string;
|
|
24
56
|
}
|
|
25
57
|
/**
|
|
26
58
|
* 붙여넣기 소스 블록(2D) + 타깃 range → 플랜.
|
|
59
|
+
* / Paste source block (2D) + target range → plan.
|
|
60
|
+
*
|
|
27
61
|
* 소스가 타깃보다 작으면 타일 반복, 크면(또는 같으면) 블록 그대로 전개(타깃 크기 무시) — 엑셀 규칙(FR-4 AC).
|
|
28
62
|
* `r % blockRows`/`c % blockCols` 단일 공식으로 두 경우 모두 성립(작을 때=주기 반복, 클 때=outRows=blockRows라 항상 r 자신).
|
|
63
|
+
* / When the source is smaller than the target it tiles; when equal or larger it expands the block
|
|
64
|
+
* verbatim (ignoring target size) — Excel rule (FR-4 AC). The single `r % blockRows` / `c % blockCols`
|
|
65
|
+
* formula covers both cases (smaller = periodic tiling; larger = outRows equals blockRows so it is always r itself).
|
|
66
|
+
*
|
|
67
|
+
* @param block - 붙여넣기 소스 2D 블록 / 2D source block to paste
|
|
68
|
+
* @param target - 타깃 셀 범위 / Target cell range
|
|
69
|
+
* @param ctx - 행 해소/편집가능 조회 컨텍스트 / Row-resolution / editability query context
|
|
70
|
+
* @returns 셀별 붙여넣기 플랜 항목 배열 / Array of per-cell paste plan items
|
|
29
71
|
*/
|
|
30
72
|
export declare function buildPastePlan(block: string[][], target: CellRange, ctx: PastePlanContext): PastePlanItem[];
|
|
@@ -1,61 +1,121 @@
|
|
|
1
1
|
import { OGDecimal } from '../OGDecimal.js';
|
|
2
2
|
import { CellRange, FillAxis, FillMode, FlatRowRefLike } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* detectSeries 판정 결과. / Result of a detectSeries classification.
|
|
5
|
+
*/
|
|
3
6
|
export interface DetectSeriesResult {
|
|
7
|
+
/** 판정 종류: 복제/등차/텍스트+말미숫자. / Classification kind: copy / arithmetic / text-with-trailing-number. */
|
|
4
8
|
kind: 'copy' | 'arith' | 'text-suffix';
|
|
5
|
-
/** 자연순서(위→아래 / 왼→오) diff. arith/text-suffix에만
|
|
9
|
+
/** 자연순서(위→아래 / 왼→오) diff. arith/text-suffix에만 존재. / Natural-order (top→bottom / left→right) diff. Present only for arith/text-suffix. */
|
|
6
10
|
step?: OGDecimal;
|
|
7
|
-
/** 자연순서로 파싱된 수치값(arith) 또는 접미 숫자부(text-suffix) */
|
|
11
|
+
/** 자연순서로 파싱된 수치값(arith) 또는 접미 숫자부(text-suffix). / Numeric values parsed in natural order (arith) or trailing numeric parts (text-suffix). */
|
|
8
12
|
values?: OGDecimal[];
|
|
9
|
-
/** text-suffix의 공통
|
|
13
|
+
/** text-suffix의 공통 접두문자열. / Common prefix string for text-suffix. */
|
|
10
14
|
prefix?: string;
|
|
11
15
|
}
|
|
12
16
|
/**
|
|
13
17
|
* 소스 라인(주축과 직교하는 한 행 또는 한 열의 값 배열, 자연순서=위→아래/왼→오) → 감지 결과.
|
|
18
|
+
* / Source line (value array of one row or one column orthogonal to the fill axis, natural order = top→bottom/left→right)
|
|
19
|
+
* → detection result.
|
|
20
|
+
*
|
|
14
21
|
* 경계 AC(REQ-24): [1,2,4]→copy, [5]→copy, ["a","b"]→copy, ["Q1","Q2"]→arith 아님 text-suffix(step=1).
|
|
22
|
+
* / Boundary AC (REQ-24): [1,2,4]→copy, [5]→copy, ["a","b"]→copy, ["Q1","Q2"]→not arith but text-suffix (step=1).
|
|
23
|
+
*
|
|
24
|
+
* @param sourceLine - 자연순서 소스 값 배열 / Source values in natural order
|
|
25
|
+
* @returns copy/arith/text-suffix 판정 결과 / copy/arith/text-suffix classification result
|
|
15
26
|
*/
|
|
16
27
|
export declare function detectSeries(sourceLine: any[]): DetectSeriesResult;
|
|
17
28
|
/**
|
|
18
29
|
* 감지 결과 + 자연순서 소스라인으로 target 거리 d(1..N, 소스에 가장 가까운 셀=1)의 값을 외삽.
|
|
30
|
+
* / Extrapolate the value at target distance d (1..N, cell nearest the source = 1) from the detection result
|
|
31
|
+
* and the natural-order source line.
|
|
32
|
+
*
|
|
19
33
|
* 방향 부호(§3.4.1 "위/왼쪽 채우면 step 부호 반전")는 axis에 따라 base/부호를 선택해 처리한다.
|
|
34
|
+
* / The directional sign (§3.4.1 "filling up/left flips the step sign") is handled by choosing base/sign per axis.
|
|
35
|
+
*
|
|
36
|
+
* @param result - detectSeries 판정 결과 / detectSeries classification result
|
|
37
|
+
* @param sourceLine - 자연순서 소스 값 배열 / Source values in natural order
|
|
38
|
+
* @param axis - 채우기 방향(up/down/left/right) / Fill direction (up/down/left/right)
|
|
39
|
+
* @param d - 소스로부터의 거리(1..N) / Distance from the source (1..N)
|
|
40
|
+
* @returns 외삽된 셀 값 / Extrapolated cell value
|
|
20
41
|
*/
|
|
21
42
|
export declare function extrapolateValue(result: DetectSeriesResult, sourceLine: any[], axis: FillAxis, d: number): any;
|
|
43
|
+
/**
|
|
44
|
+
* 채우기 플랜의 셀별 항목(값/수식 기록 또는 skip). / Per-cell item of a fill plan (write value/formula or skip).
|
|
45
|
+
*/
|
|
22
46
|
export interface FillPlanItem {
|
|
47
|
+
/** 대상 행의 flat index. / Flat index of the target row. */
|
|
23
48
|
rowIndex: number;
|
|
49
|
+
/** 대상 컬럼 field 명. / Target column field name. */
|
|
24
50
|
field: string;
|
|
51
|
+
/** 수행 동작: 값 기록/수식 설정/건너뜀. / Action: write value / set formula / skip. */
|
|
25
52
|
action: 'value' | 'setFormula' | 'skip';
|
|
53
|
+
/** 기록할 값(action==='value'일 때). / Value to write (when action==='value'). */
|
|
26
54
|
value?: any;
|
|
55
|
+
/** 설정할 수식(action==='setFormula'일 때). / Formula to set (when action==='setFormula'). */
|
|
27
56
|
formula?: string;
|
|
57
|
+
/** skip 사유(예: 'non-data-row', 'formula-preserved'). / Skip reason (e.g. 'non-data-row', 'formula-preserved'). */
|
|
28
58
|
reason?: string;
|
|
29
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* buildFillPlan 결과 — 플랜 항목 + 보존된 수식 카운트. / buildFillPlan result — plan items + preserved-formula count.
|
|
62
|
+
*/
|
|
30
63
|
export interface FillPlanResult {
|
|
64
|
+
/** 셀별 플랜 항목 배열. / Array of per-cell plan items. */
|
|
31
65
|
items: FillPlanItem[];
|
|
32
|
-
/** C3.2 보존된 수식 셀 수(announce용) */
|
|
66
|
+
/** C3.2 보존된 수식 셀 수(announce용). / Count of preserved formula cells (C3.2, for announcement). */
|
|
33
67
|
skippedFormula: number;
|
|
34
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* 채우기 플랜 생성에 필요한 조회/정책 계약(§3.5/§3.6, C3). / Query/policy contract needed to build a fill plan (§3.5/§3.6, C3).
|
|
71
|
+
*/
|
|
35
72
|
export interface FillPlanContext {
|
|
73
|
+
/** flat index → 행 참조(kind/rowId). / flat index → row reference (kind/rowId). */
|
|
36
74
|
resolveFlatRow(ri: number): FlatRowRefLike;
|
|
75
|
+
/** 열 인덱스(ci) → field 명(없으면 undefined). / Column index (ci) → field name (undefined if none). */
|
|
37
76
|
fieldAt(ci: number): string | undefined;
|
|
77
|
+
/** (행 ri, field) → 원시 셀 값. / (row ri, field) → raw cell value. */
|
|
38
78
|
getCellValue(ri: number, field: string): any;
|
|
39
|
-
/** 기본 true(잠금 없음) */
|
|
79
|
+
/** 기본 true(잠금 없음). / Defaults to true (no lock). */
|
|
40
80
|
isEditable?(rowId: string, field: string): boolean;
|
|
41
|
-
/** 기본 false(수식 없음) */
|
|
81
|
+
/** 기본 false(수식 없음). / Defaults to false (no formula). */
|
|
42
82
|
hasCellFormula?(rowId: string, field: string): boolean;
|
|
43
|
-
/** C3.1: 상대 ref 오프셋 수식 생성(F3 제공) */
|
|
83
|
+
/** C3.1: 상대 ref 오프셋 수식 생성(F3 제공). / C3.1: build a relative-ref offset formula (provided by F3). */
|
|
44
84
|
offsetFormula?(rowId: string, field: string, dRow: number, dCol: number): string;
|
|
45
|
-
/** rangeSelection.fillOverwriteFormula(C3.2 opt-in) */
|
|
85
|
+
/** rangeSelection.fillOverwriteFormula(C3.2 opt-in). / rangeSelection.fillOverwriteFormula (C3.2 opt-in). */
|
|
46
86
|
overwriteFormula?: boolean;
|
|
47
|
-
/** Ctrl-강제-copy: 수식 원문 복제(오프셋 없음) */
|
|
87
|
+
/** Ctrl-강제-copy: 수식 원문 복제(오프셋 없음). / Ctrl-force-copy: replicate formula verbatim (no offset). */
|
|
48
88
|
forceCopyFormula?: boolean;
|
|
49
89
|
}
|
|
50
90
|
/**
|
|
51
91
|
* 소스 rect → 타깃 rect 채우기 플랜(§3.5). 주축과 직교하는 각 라인(행 또는 열) 별로 독립 처리(§3.4.1).
|
|
92
|
+
* / Fill plan for source rect → target rect (§3.5). Each line (row or column) orthogonal to the fill axis is
|
|
93
|
+
* processed independently (§3.4.1).
|
|
94
|
+
*
|
|
52
95
|
* non-data 행(kind!=='data')은 항상 skip(C0.3/CON-5). mode==='series'가 detectSeries로 'copy'에
|
|
53
96
|
* 귀결되면(경계 케이스) 그대로 copy 타일 반복으로 처리된다(설계가 의도한 동작).
|
|
97
|
+
* / Non-data rows (kind!=='data') are always skipped (C0.3/CON-5). If mode==='series' resolves to 'copy' via
|
|
98
|
+
* detectSeries (boundary case), it is handled as copy tiling as-is (intended design behavior).
|
|
99
|
+
*
|
|
100
|
+
* @param source - 소스 셀 범위 / Source cell range
|
|
101
|
+
* @param target - 타깃 셀 범위 / Target cell range
|
|
102
|
+
* @param axis - 채우기 방향(up/down/left/right) / Fill direction (up/down/left/right)
|
|
103
|
+
* @param mode - 'copy'(복제) 또는 'series'(시리즈 외삽) / 'copy' (replicate) or 'series' (series extrapolation)
|
|
104
|
+
* @param ctx - 조회/정책 컨텍스트 / Query/policy context
|
|
105
|
+
* @returns 플랜 항목 + 보존된 수식 카운트 / Plan items + preserved-formula count
|
|
54
106
|
*/
|
|
55
107
|
export declare function buildFillPlan(source: CellRange, target: CellRange, axis: FillAxis, mode: FillMode, ctx: FillPlanContext): FillPlanResult;
|
|
56
108
|
/**
|
|
57
109
|
* 현재 선택 rect에서 Ctrl+D(아래로)/Ctrl+R(오른쪽으로) 채우기의 source/target rect 산출(순수 함수).
|
|
110
|
+
* / Derive the source/target rects for Ctrl+D (downward) / Ctrl+R (rightward) fill from the current selection
|
|
111
|
+
* rect (pure function).
|
|
112
|
+
*
|
|
58
113
|
* 1행(D)/1열(R)뿐이면 채울 대상이 없어 null.
|
|
114
|
+
* / If the selection is a single row (D) / single column (R), there is nothing to fill, so returns null.
|
|
115
|
+
*
|
|
116
|
+
* @param rect - 현재 선택 셀 범위 / Current selection cell range
|
|
117
|
+
* @param axis - 'down'(Ctrl+D) 또는 'right'(Ctrl+R) / 'down' (Ctrl+D) or 'right' (Ctrl+R)
|
|
118
|
+
* @returns source/target rect 쌍, 채울 대상이 없으면 null / source/target rect pair, or null when nothing to fill
|
|
59
119
|
*/
|
|
60
120
|
export declare function ctrlFillSourceTarget(rect: CellRange, axis: 'down' | 'right'): {
|
|
61
121
|
source: CellRange;
|
|
@@ -1,6 +1,25 @@
|
|
|
1
1
|
import { CellCoord, CellRange, Direction, RangeIdentity, RangeModelHost } from './types.js';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* anchor/focus → 정규화된 CellRange(§2.3). 역방향 드래그(anchor>focus)도 min/max로 정규화.
|
|
4
|
+
* / anchor/focus → normalized CellRange (§2.3). Reverse drags (anchor>focus) are normalized via min/max as well.
|
|
5
|
+
*
|
|
6
|
+
* @param a - 앵커 좌표 / Anchor coordinate
|
|
7
|
+
* @param f - 포커스 좌표 / Focus coordinate
|
|
8
|
+
* @returns 정규화된 셀 범위 / Normalized cell range
|
|
9
|
+
*/
|
|
3
10
|
export declare function normalize(a: CellCoord, f: CellCoord): CellRange;
|
|
11
|
+
/**
|
|
12
|
+
* F1 범위 선택 상태 머신(순수 MODEL). anchor/focus/정체성/rects를 관리하고, 드래그·Shift 확장·
|
|
13
|
+
* 재투영을 헤드리스로 계산한다. / F1 range-selection state machine (pure MODEL). Manages anchor/focus/identity/rects
|
|
14
|
+
* and computes drag, Shift extension, and reprojection headlessly.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* const model = new RangeModel(host);
|
|
18
|
+
* model.beginDrag(2, 1);
|
|
19
|
+
* model.updateFocus(5, 3);
|
|
20
|
+
* model.endDrag();
|
|
21
|
+
* const rect = model.getActiveRange(); // { startRow: 2, endRow: 5, startCol: 1, endCol: 3 }
|
|
22
|
+
*/
|
|
4
23
|
export declare class RangeModel {
|
|
5
24
|
private _host;
|
|
6
25
|
private _anchor;
|
|
@@ -9,44 +28,112 @@ export declare class RangeModel {
|
|
|
9
28
|
private _rects;
|
|
10
29
|
private _hasSelection;
|
|
11
30
|
private _additive;
|
|
31
|
+
/**
|
|
32
|
+
* @param host - 좌표 해소/재투영을 제공하는 호스트(FlatRowModel 계약 모양, C0.3) / Host providing coordinate resolution/reprojection (FlatRowModel contract shape, C0.3)
|
|
33
|
+
*/
|
|
12
34
|
constructor(host: RangeModelHost);
|
|
35
|
+
/** 현재 선택이 존재하는지 여부. / Whether a selection currently exists. */
|
|
13
36
|
get hasSelection(): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* 현재 앵커 좌표의 복사본을 반환. / Return a copy of the current anchor coordinate.
|
|
39
|
+
* @returns 앵커 좌표 {ri, ci} / Anchor coordinate {ri, ci}
|
|
40
|
+
*/
|
|
14
41
|
getAnchor(): CellCoord;
|
|
42
|
+
/**
|
|
43
|
+
* 현재 포커스 좌표의 복사본을 반환. / Return a copy of the current focus coordinate.
|
|
44
|
+
* @returns 포커스 좌표 {ri, ci} / Focus coordinate {ri, ci}
|
|
45
|
+
*/
|
|
15
46
|
getFocus(): CellCoord;
|
|
47
|
+
/**
|
|
48
|
+
* 현재 범위 정체성(rowId/field 집합)의 복사본을 반환. / Return a copy of the current range identity (rowId/field sets).
|
|
49
|
+
* @returns 범위 정체성 스냅샷 / Range identity snapshot
|
|
50
|
+
*/
|
|
16
51
|
getIdentity(): RangeIdentity;
|
|
17
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* 공개 API 재료(C4): 정규화 rects (없으면 []). MVP는 길이 ≤1. / Public-API material (C4): normalized rects ([] if none). MVP length ≤1.
|
|
54
|
+
* @returns 정규화된 셀 범위 배열 / Array of normalized cell ranges
|
|
55
|
+
*/
|
|
18
56
|
getRangeSelection(): CellRange[];
|
|
19
|
-
/**
|
|
57
|
+
/**
|
|
58
|
+
* 공개 API 재료(C4): getRangeSelection()[0] ?? null. / Public-API material (C4): getRangeSelection()[0] ?? null.
|
|
59
|
+
* @returns 활성 셀 범위 또는 null / Active cell range or null
|
|
60
|
+
*/
|
|
20
61
|
getActiveRange(): CellRange | null;
|
|
21
|
-
/**
|
|
62
|
+
/**
|
|
63
|
+
* 복사/채우기 소스 결정용 별칭(§5.1 getPrimaryRect). / Alias for deciding the copy/fill source (§5.1 getPrimaryRect).
|
|
64
|
+
* @returns 기본(primary) 셀 범위 또는 null / Primary cell range or null
|
|
65
|
+
*/
|
|
22
66
|
getPrimaryRect(): CellRange | null;
|
|
23
|
-
/**
|
|
67
|
+
/**
|
|
68
|
+
* 정렬/필터 후에도 유지되는 실제 rowId 집합의 현재 flat 위치(오름차순, 화면밖=-1 제외).
|
|
69
|
+
* / Current flat positions of the retained rowId set after sort/filter (ascending, off-screen=-1 excluded).
|
|
70
|
+
* @returns 오름차순 flat 행 인덱스 배열 / Ascending array of flat row indexes
|
|
71
|
+
*/
|
|
24
72
|
getProjectedFlatRows(): number[];
|
|
25
|
-
/**
|
|
73
|
+
/**
|
|
74
|
+
* pointerdown. shift=true면 기존 anchor 유지(있을 때만), 아니면 새 1x1 anchor.
|
|
75
|
+
* / pointerdown. When shift=true keep the existing anchor (only if present); otherwise start a new 1×1 anchor.
|
|
76
|
+
*
|
|
77
|
+
* @param ri - 행 flat index / Row flat index
|
|
78
|
+
* @param ci - 열 인덱스 / Column index
|
|
79
|
+
* @param opts - additive(누적)/shift(기존 anchor 유지 확장) 플래그 / additive / shift (extend keeping anchor) flags
|
|
80
|
+
*/
|
|
26
81
|
beginDrag(ri: number, ci: number, opts?: {
|
|
27
82
|
additive?: boolean;
|
|
28
83
|
shift?: boolean;
|
|
29
84
|
}): void;
|
|
30
|
-
/**
|
|
85
|
+
/**
|
|
86
|
+
* pointermove — 포커스만 갱신하고 rect 재계산. / pointermove — update only the focus and recompute the rect.
|
|
87
|
+
* @param ri - 행 flat index / Row flat index
|
|
88
|
+
* @param ci - 열 인덱스 / Column index
|
|
89
|
+
*/
|
|
31
90
|
updateFocus(ri: number, ci: number): void;
|
|
32
|
-
/** pointerup — 확정 + 정체성 스냅샷(§2.5). */
|
|
91
|
+
/** pointerup — 확정 + 정체성 스냅샷(§2.5). / pointerup — commit + identity snapshot (§2.5). */
|
|
33
92
|
endDrag(): void;
|
|
93
|
+
/** 마지막 드래그가 누적(additive) 모드였는지 여부. / Whether the last drag was in additive mode. */
|
|
34
94
|
get additive(): boolean;
|
|
35
|
-
/**
|
|
95
|
+
/**
|
|
96
|
+
* 클릭(비-Shift): 새 1×1 anchor(FR-1). / Click (non-Shift): new 1×1 anchor (FR-1).
|
|
97
|
+
* @param ri - 행 flat index / Row flat index
|
|
98
|
+
* @param ci - 열 인덱스 / Column index
|
|
99
|
+
*/
|
|
36
100
|
click(ri: number, ci: number): void;
|
|
37
|
-
/**
|
|
101
|
+
/**
|
|
102
|
+
* Shift+클릭: anchor 유지, focus만 갱신. anchor 없으면 click으로 위임(UC-2 예외).
|
|
103
|
+
* / Shift+click: keep anchor, update only focus. If no anchor exists, delegate to click (UC-2 exception).
|
|
104
|
+
* @param ri - 행 flat index / Row flat index
|
|
105
|
+
* @param ci - 열 인덱스 / Column index
|
|
106
|
+
*/
|
|
38
107
|
shiftClickExtend(ri: number, ci: number): void;
|
|
39
|
-
/**
|
|
108
|
+
/**
|
|
109
|
+
* anchor 고정, focus만 1칸 이동(격자 경계 clamp). 편집 우선순위(C9)는 호출측(KeyboardManager)이 가드.
|
|
110
|
+
* / Keep anchor fixed, move only the focus by one cell (clamped to grid bounds). The edit-priority guard (C9)
|
|
111
|
+
* is enforced by the caller (KeyboardManager).
|
|
112
|
+
* @param dir - 이동 방향(up/down/left/right) / Move direction (up/down/left/right)
|
|
113
|
+
*/
|
|
40
114
|
extendFocus(dir: Direction): void;
|
|
115
|
+
/**
|
|
116
|
+
* 외부에서 직접 rect를 지정하고 정체성을 스냅샷(setRangeSelection API 재료, §6.2).
|
|
117
|
+
* / Directly assign a rect from outside and snapshot the identity (setRangeSelection API material, §6.2).
|
|
118
|
+
* @param rect - 지정할 셀 범위 / Cell range to assign
|
|
119
|
+
*/
|
|
41
120
|
setRect(rect: CellRange): void;
|
|
42
|
-
/** clearRangeSelection API
|
|
121
|
+
/** clearRangeSelection API 재료 — 선택/정체성/rects를 비운다. / clearRangeSelection API material — clears selection/identity/rects. */
|
|
43
122
|
clear(): void;
|
|
44
|
-
/**
|
|
123
|
+
/**
|
|
124
|
+
* 현재 rect를 rowId 집합 × field 집합으로 스냅샷(display-index는 렌더용 투영일 뿐).
|
|
125
|
+
* / Snapshot the current rect as a rowId set × field set (display-index is only a render-time projection).
|
|
126
|
+
*/
|
|
45
127
|
snapshotIdentity(): void;
|
|
46
128
|
/**
|
|
47
129
|
* 정렬/필터 후 호출(onModelReproject 구독 지점). rowId 집합 → 현재 flat 좌표로 재투영.
|
|
130
|
+
* / Called after sort/filter (onModelReproject subscription point). Reproject the rowId set → current flat coordinates.
|
|
131
|
+
*
|
|
48
132
|
* 사라진 행(flatIndexOfRowId === -1)은 정체성에는 남되 투영(rects)에서는 제외된다(불연속 허용).
|
|
49
133
|
* MVP는 단일 bounding rect로 투영(§2.2 rects 길이 1 방침) — 남아있는 행들의 min/max로 계산.
|
|
134
|
+
* / Vanished rows (flatIndexOfRowId === -1) remain in identity but are excluded from the projection (rects)
|
|
135
|
+
* (discontinuity allowed). MVP projects into a single bounding rect (§2.2 rects-length-1 policy) — computed from
|
|
136
|
+
* the min/max of surviving rows.
|
|
50
137
|
*/
|
|
51
138
|
reproject(): void;
|
|
52
139
|
private _recompute;
|
|
@@ -1,47 +1,63 @@
|
|
|
1
1
|
import { CellRange } from '../types.js';
|
|
2
2
|
export type { CellRange };
|
|
3
|
-
/** 방향성 원시 좌표. ri=flat/visual index(C0.2), ci=visibleLeaves index(C0.4). */
|
|
3
|
+
/** 방향성 원시 좌표. ri=flat/visual index(C0.2), ci=visibleLeaves index(C0.4). / Directional raw coordinate. ri=flat/visual index (C0.2), ci=visibleLeaves index (C0.4). */
|
|
4
4
|
export interface CellCoord {
|
|
5
|
+
/** 행 flat/visual 인덱스(C0.2). / Row flat/visual index (C0.2). */
|
|
5
6
|
ri: number;
|
|
7
|
+
/** 열 visibleLeaves 인덱스(C0.4). / Column visibleLeaves index (C0.4). */
|
|
6
8
|
ci: number;
|
|
7
9
|
}
|
|
10
|
+
/** 이동/채우기 방향. / Move/fill direction. */
|
|
8
11
|
export type Direction = 'up' | 'down' | 'left' | 'right';
|
|
12
|
+
/** 채우기 축(방향과 동형). / Fill axis (isomorphic to Direction). */
|
|
9
13
|
export type FillAxis = Direction;
|
|
14
|
+
/** 채우기 모드: 복제 또는 시리즈 외삽. / Fill mode: copy or series extrapolation. */
|
|
10
15
|
export type FillMode = 'copy' | 'series';
|
|
11
|
-
/** 범위 정체성(C0.5) — display-index가 아니라 stable 집합으로 저장. */
|
|
16
|
+
/** 범위 정체성(C0.5) — display-index가 아니라 stable 집합으로 저장. / Range identity (C0.5) — stored as stable sets, not display-indexes. */
|
|
12
17
|
export interface RangeIdentity {
|
|
13
|
-
/** 선택된 data 행의 stable _ogRowId 집합 (정렬/필터를 넘어 보존) */
|
|
18
|
+
/** 선택된 data 행의 stable _ogRowId 집합 (정렬/필터를 넘어 보존). / Stable _ogRowId set of selected data rows (preserved across sort/filter). */
|
|
14
19
|
rowIds: string[];
|
|
15
|
-
/** 선택된 열의 field 집합 (visibleLeaves.field) */
|
|
20
|
+
/** 선택된 열의 field 집합 (visibleLeaves.field). / Field set of selected columns (visibleLeaves.field). */
|
|
16
21
|
fields: string[];
|
|
17
22
|
}
|
|
18
|
-
/** FlatRowModel.resolveFlatRow가 반환하는 참조(C0.3). */
|
|
23
|
+
/** FlatRowModel.resolveFlatRow가 반환하는 참조(C0.3). / Reference returned by FlatRowModel.resolveFlatRow (C0.3). */
|
|
19
24
|
export interface FlatRowRefLike {
|
|
25
|
+
/** 행 종류. filler엔 writeCell 금지 판별 재료(C0.3). / Row kind. Basis for forbidding writeCell on fillers (C0.3). */
|
|
20
26
|
kind: 'data' | 'group' | 'tree' | 'detailHead' | 'detailFiller';
|
|
27
|
+
/** stable rowId(data/tree 등). / Stable rowId (data/tree, etc.). */
|
|
21
28
|
rowId?: string;
|
|
29
|
+
/** 원본 데이터 배열 인덱스. / Index into the source data array. */
|
|
22
30
|
dataIndex?: number;
|
|
31
|
+
/** 현재 표시(flat) 인덱스. / Current display (flat) index. */
|
|
23
32
|
displayIndex?: number;
|
|
24
33
|
}
|
|
25
34
|
/**
|
|
26
35
|
* F1이 좌표 해소·재투영을 위해 필요로 하는 최소 계약 모양(C0.3 FlatRowModel + visibleLeaves).
|
|
27
36
|
* 실제 구현(baseline FlatRowModel/ColumnLayout)은 이 형태를 만족하는 어댑터를 배선 단계에서 주입한다.
|
|
37
|
+
* / Minimal contract shape F1 needs for coordinate resolution/reprojection (C0.3 FlatRowModel + visibleLeaves).
|
|
38
|
+
* The real implementation (baseline FlatRowModel/ColumnLayout) injects an adapter satisfying this shape at the
|
|
39
|
+
* wiring stage.
|
|
28
40
|
*/
|
|
29
41
|
export interface RangeModelHost {
|
|
30
|
-
/** flat/visual 행
|
|
42
|
+
/** flat/visual 행 총수. / Total flat/visual row count. */
|
|
31
43
|
count(): number;
|
|
32
|
-
/** flat index → 참조(kind/rowId 등). 없으면 kind 판별 불가 상태를 반환해야 함(C0.3) */
|
|
44
|
+
/** flat index → 참조(kind/rowId 등). 없으면 kind 판별 불가 상태를 반환해야 함(C0.3). / flat index → reference (kind/rowId, etc.); must return a kind-undeterminable state when absent (C0.3). */
|
|
33
45
|
resolveFlatRow(flatIndex: number): FlatRowRefLike;
|
|
34
|
-
/** stable rowId → 현재 flat index. 없으면(접힘/필터아웃) -1 */
|
|
46
|
+
/** stable rowId → 현재 flat index. 없으면(접힘/필터아웃) -1. / stable rowId → current flat index; -1 when absent (collapsed/filtered out). */
|
|
35
47
|
flatIndexOfRowId(rowId: string): number;
|
|
36
|
-
/** flat index → stable rowId (data/tree만, 그 외 null) */
|
|
48
|
+
/** flat index → stable rowId (data/tree만, 그 외 null). / flat index → stable rowId (data/tree only, else null). */
|
|
37
49
|
rowIdOfFlat(flatIndex: number): string | null;
|
|
38
|
-
/** 현재 visibleLeaves의 field 목록(순서=ci) */
|
|
50
|
+
/** 현재 visibleLeaves의 field 목록(순서=ci). / Current visibleLeaves field list (order = ci). */
|
|
39
51
|
visibleFields(): string[];
|
|
40
52
|
}
|
|
41
|
-
/** 채우기 프리뷰(핸들 드래그 중) — 커밋 전 임시 상태 자료(§2.2 FillPreview). */
|
|
53
|
+
/** 채우기 프리뷰(핸들 드래그 중) — 커밋 전 임시 상태 자료(§2.2 FillPreview). / Fill preview (during handle drag) — transient pre-commit state (§2.2 FillPreview). */
|
|
42
54
|
export interface FillPreview {
|
|
55
|
+
/** 소스 셀 범위. / Source cell range. */
|
|
43
56
|
source: CellRange;
|
|
57
|
+
/** 타깃 셀 범위. / Target cell range. */
|
|
44
58
|
target: CellRange;
|
|
59
|
+
/** 채우기 축/방향. / Fill axis/direction. */
|
|
45
60
|
axis: FillAxis;
|
|
61
|
+
/** 채우기 모드. / Fill mode. */
|
|
46
62
|
mode: FillMode;
|
|
47
63
|
}
|
|
Binary file
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export type FreshnessState = 'fresh' | 'stale';
|
|
2
|
+
export interface FreshnessSnapshot {
|
|
3
|
+
readonly state: FreshnessState;
|
|
4
|
+
readonly ageMs: number;
|
|
5
|
+
readonly lastReceivedAt?: number;
|
|
6
|
+
}
|
|
7
|
+
export interface FreshnessConfig {
|
|
8
|
+
readonly staleAfterMs: number;
|
|
9
|
+
readonly now?: () => number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 신선도 시효 파생. markReceived 로 시계 리셋, compute 로 현재 파생값, onChange 로 전이 통지.
|
|
13
|
+
* / Freshness derivation: markReceived resets, compute derives, onChange notifies transitions.
|
|
14
|
+
*/
|
|
15
|
+
export declare class FreshnessClock {
|
|
16
|
+
private readonly _staleAfterMs;
|
|
17
|
+
private readonly _now;
|
|
18
|
+
private _lastReceivedAt;
|
|
19
|
+
private _lastState;
|
|
20
|
+
private readonly _listeners;
|
|
21
|
+
constructor(cfg: FreshnessConfig);
|
|
22
|
+
/** 성공 수신 기록 — 시계 리셋(fresh 로 전이 가능). / Record a successful receive. */
|
|
23
|
+
markReceived(at: number): void;
|
|
24
|
+
/** 현재 신선도 상태 파생값. / Current derived freshness. */
|
|
25
|
+
compute(): FreshnessSnapshot;
|
|
26
|
+
/**
|
|
27
|
+
* 신선도 전이 재평가 트리거(시간 경과는 외부 tick 이 호출 — RT 는 전역 타이머 미소유).
|
|
28
|
+
* 배지가 주기 폴하거나 연결/수신 이벤트 시 호출. 전이가 있으면 onChange 발화.
|
|
29
|
+
* / Re-evaluate freshness (driven by an external tick — RT owns no global timer).
|
|
30
|
+
*/
|
|
31
|
+
tick(): FreshnessSnapshot;
|
|
32
|
+
private _emitIfChanged;
|
|
33
|
+
onChange(l: (f: FreshnessSnapshot) => void): () => void;
|
|
34
|
+
}
|