open-grid 1.2.1 → 1.3.1
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 +388 -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/FilterSelect.d.ts +26 -5
- package/dist/types/core/FormulaEngine.d.ts +15 -4
- package/dist/types/core/GridRenderer.d.ts +143 -10
- package/dist/types/core/GridShuttle.d.ts +26 -10
- package/dist/types/core/GroupEngine.d.ts +68 -10
- package/dist/types/core/IconRegistry.d.ts +31 -13
- 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 +401 -122
- package/dist/types/core/OrgChart.d.ts +32 -11
- 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 +86 -19
- package/dist/types/core/TreeEngine.d.ts +60 -6
- package/dist/types/core/VirtualScroll.d.ts +64 -0
- package/dist/types/core/XmlConverter.d.ts +40 -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/chart/types.d.ts +102 -21
- 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/LocaleRegistry.d.ts +0 -0
- package/dist/types/core/i18n/types.d.ts +67 -11
- 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 +511 -226
- 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,21 @@
|
|
|
1
|
+
import { ExportResult, ExportRunCtx, IArtifactSource, IByteSink } from '../types.js';
|
|
2
|
+
/** XML 채널 옵션. / XML channel options. */
|
|
3
|
+
export interface XmlChannelOptions {
|
|
4
|
+
/** 루트 요소명(기본 rows). / Root element name. */
|
|
5
|
+
readonly rootTag?: string;
|
|
6
|
+
/** 행 요소명(기본 row). / Row element name. */
|
|
7
|
+
readonly rowTag?: string;
|
|
8
|
+
/** field 를 요소명으로(false면 <cell name="field">). / Use field as element name. */
|
|
9
|
+
readonly fieldAsTag?: boolean;
|
|
10
|
+
/** provenance 주석 포함. / Include provenance comment. */
|
|
11
|
+
readonly includeProvenance?: boolean;
|
|
12
|
+
readonly preserveRaw?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/** XML 직렬화 전략. / XML serialization strategy. */
|
|
15
|
+
export declare class XmlChannel {
|
|
16
|
+
private readonly opts;
|
|
17
|
+
readonly id: "xml";
|
|
18
|
+
readonly capabilities: import('../types.js').ChannelCapabilities;
|
|
19
|
+
constructor(opts?: XmlChannelOptions);
|
|
20
|
+
write(source: IArtifactSource, sink: IByteSink, ctx?: ExportRunCtx): Promise<ExportResult>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ChannelCapabilities, ChannelId } from '../types.js';
|
|
2
|
+
/** CSV — 값 + provenance 주석행만. 색/병합/스타일 불가. / CSV: values + comment-row provenance only. */
|
|
3
|
+
export declare const CSV_CAPS: ChannelCapabilities;
|
|
4
|
+
/** JSON — 값 + provenance 사이드카. / JSON: values + provenance sidecar. */
|
|
5
|
+
export declare const JSON_CAPS: ChannelCapabilities;
|
|
6
|
+
/** XML — 값 + provenance 주석. / XML: values + comment provenance. */
|
|
7
|
+
export declare const XML_CAPS: ChannelCapabilities;
|
|
8
|
+
/** xlsx — 병합·컬럼폭·CF 색·스타일·provenance(시트메모). / xlsx: merges/widths/cf/styling/provenance. */
|
|
9
|
+
export declare const XLSX_CAPS: ChannelCapabilities;
|
|
10
|
+
/** print — 병합·CF(흑백 강등)·스타일·차트·provenance(페이지 푸터). / print: merges/cf/styling/charts/provenance. */
|
|
11
|
+
export declare const PRINT_CAPS: ChannelCapabilities;
|
|
12
|
+
/** 기본 능력 매트릭스(매니페스트 조립용). / Default capability matrix for the manifest. */
|
|
13
|
+
export declare const DEFAULT_CAPS: Readonly<Record<ChannelId, ChannelCapabilities>>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type { ChannelId, DataState, CellAlign, CellArtifact, RowArtifact, HeaderArtifact, RowRange, RowChunk, ProjectOptions, IArtifactSource, IByteSink, ChannelCapabilities, ActiveStateFlags, StateLoss, ChannelStateMatrix, ExportRunCtx, ExportResult, IExportChannel, TransformProvenance, ProvenanceBadge, ProvenanceBlock, IArtifactProvenance, } from './types.js';
|
|
2
|
+
export { ArtifactProvenance, buildProvenance } from './Provenance.js';
|
|
3
|
+
export type { ArtifactProvenanceOptions } from './Provenance.js';
|
|
4
|
+
export { ExportManifest } from './ExportManifest.js';
|
|
5
|
+
export { StreamPump, STREAM_DEFAULTS, shouldStream } from './StreamPump.js';
|
|
6
|
+
export { MemoryByteSink, DownloadByteSink } from './sinks.js';
|
|
7
|
+
export { GridArtifactSource } from './GridArtifactSource.js';
|
|
8
|
+
export type { GridArtifactSourceDeps, ArtifactColumn, PlacementFn, CfFn, } from './GridArtifactSource.js';
|
|
9
|
+
export { ChannelRegistry } from './ChannelRegistry.js';
|
|
10
|
+
export { CsvChannel } from './channels/CsvChannel.js';
|
|
11
|
+
export type { CsvChannelOptions } from './channels/CsvChannel.js';
|
|
12
|
+
export { JsonChannel } from './channels/JsonChannel.js';
|
|
13
|
+
export type { JsonChannelOptions } from './channels/JsonChannel.js';
|
|
14
|
+
export { XmlChannel } from './channels/XmlChannel.js';
|
|
15
|
+
export type { XmlChannelOptions } from './channels/XmlChannel.js';
|
|
16
|
+
export { XlsxChannel } from './channels/XlsxChannel.js';
|
|
17
|
+
export type { XlsxChannelOptions, SheetModel, SheetCell, MergeRegion, IWorkbookWriter, } from './channels/XlsxChannel.js';
|
|
18
|
+
export { CSV_CAPS, JSON_CAPS, XML_CAPS, XLSX_CAPS, PRINT_CAPS, DEFAULT_CAPS, } from './channels/capabilities.js';
|
|
19
|
+
export { ScreenAdapter, GrayscaleAdapter, createOutputAdapter, } from './print/OutputChannelAdapter.js';
|
|
20
|
+
export type { IOutputChannelAdapter, InkDecision, BorderSpec, } from './print/OutputChannelAdapter.js';
|
|
21
|
+
export { Paginator } from './print/Paginator.js';
|
|
22
|
+
export type { IPaginator, PrintPage, PaginatorOptions } from './print/Paginator.js';
|
|
23
|
+
export { PrintRenderTarget } from './print/PrintRenderTarget.js';
|
|
24
|
+
export type { PrintRenderDeps, PrintRenderOptions } from './print/PrintRenderTarget.js';
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { VisualSpec } from '../../cf/encoders.js';
|
|
2
|
+
import { CellArtifact } from '../types.js';
|
|
3
|
+
import { Sign } from '../../format/types.js';
|
|
4
|
+
/** 색+형태 이중부호화 결과 — 흑백에서도 의미 생존(§2.6). / Color+shape dual-encoding result. */
|
|
5
|
+
export interface InkDecision {
|
|
6
|
+
/** 흑백=명도 그레이 또는 해치 패턴 색. / Mono grey (or hatch fill). */
|
|
7
|
+
readonly fill: string;
|
|
8
|
+
/** 색 상실 시 형태로 부호. / Shape-encode when color is lost. */
|
|
9
|
+
readonly pattern?: 'solid' | 'hatch-up' | 'hatch-down' | 'dots';
|
|
10
|
+
/** ▲▼ 등 부호 픽토(색 단독 금지 가드). / Sign glyph guard. */
|
|
11
|
+
readonly glyph?: string;
|
|
12
|
+
/** AA 대비 보증 텍스트색. / AA-guaranteed text color. */
|
|
13
|
+
readonly textColor: string;
|
|
14
|
+
}
|
|
15
|
+
/** 테두리/구분선 지정. / Border spec. */
|
|
16
|
+
export interface BorderSpec {
|
|
17
|
+
readonly color: string;
|
|
18
|
+
readonly widthPx: number;
|
|
19
|
+
readonly style: 'solid';
|
|
20
|
+
}
|
|
21
|
+
/** 출력 채널 어댑터 계약(§2.6). / Output-channel adapter contract. */
|
|
22
|
+
export interface IOutputChannelAdapter {
|
|
23
|
+
readonly channel: 'screen' | 'print' | 'grayscale' | 'forced-colors';
|
|
24
|
+
/** CF 채움색 → 이 채널의 잉크. / CF fill color → this channel's ink. */
|
|
25
|
+
ink(cf: VisualSpec | undefined, text: {
|
|
26
|
+
sign?: Sign;
|
|
27
|
+
colorHint?: string;
|
|
28
|
+
}): InkDecision;
|
|
29
|
+
/** 말줄임 텍스트를 지면에서 전개(화면 생략 → 인쇄 전체값). / Expand truncated text for print. */
|
|
30
|
+
expandTruncation(cell: CellArtifact): string;
|
|
31
|
+
/** 테두리를 솔리드 강제(반투명·헤어라인 소실 방지). / Force solid borders. */
|
|
32
|
+
borderStyle(): BorderSpec;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* screen — 상류 확정 cf.inkColor 를 그대로 통과(재계산 금지). / Passes upstream cf.inkColor as-is.
|
|
36
|
+
*/
|
|
37
|
+
export declare class ScreenAdapter implements IOutputChannelAdapter {
|
|
38
|
+
readonly channel: "screen";
|
|
39
|
+
ink(cf: VisualSpec | undefined, text: {
|
|
40
|
+
sign?: Sign;
|
|
41
|
+
colorHint?: string;
|
|
42
|
+
}): InkDecision;
|
|
43
|
+
expandTruncation(cell: CellArtifact): string;
|
|
44
|
+
borderStyle(): BorderSpec;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* print/grayscale — 채움을 명도 그레이 + 해치 패턴으로 강등, 잉크는 palette 대비 커널로 산정.
|
|
48
|
+
* / Degrades fills to grey + hatch; ink computed via the palette contrast kernel.
|
|
49
|
+
*/
|
|
50
|
+
export declare class GrayscaleAdapter implements IOutputChannelAdapter {
|
|
51
|
+
readonly channel: 'print' | 'grayscale' | 'forced-colors';
|
|
52
|
+
constructor(channel?: 'print' | 'grayscale' | 'forced-colors');
|
|
53
|
+
ink(cf: VisualSpec | undefined, text: {
|
|
54
|
+
sign?: Sign;
|
|
55
|
+
colorHint?: string;
|
|
56
|
+
}): InkDecision;
|
|
57
|
+
expandTruncation(cell: CellArtifact): string;
|
|
58
|
+
borderStyle(): BorderSpec;
|
|
59
|
+
}
|
|
60
|
+
/** 채널명 → 기본 어댑터. / Channel name → default adapter. */
|
|
61
|
+
export declare function createOutputAdapter(channel: IOutputChannelAdapter['channel']): IOutputChannelAdapter;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { HeaderArtifact, RowArtifact } from '../types.js';
|
|
2
|
+
import { IOutputChannelAdapter } from './OutputChannelAdapter.js';
|
|
3
|
+
/** 인쇄 페이지 산출(어댑터 잉크 적용 완료). / A rendered print page. */
|
|
4
|
+
export interface PrintPage {
|
|
5
|
+
readonly pageNo: number;
|
|
6
|
+
readonly totalPagesHint?: number;
|
|
7
|
+
/** 이 페이지의 인쇄 HTML(문자열). / This page's print HTML. */
|
|
8
|
+
readonly html: string;
|
|
9
|
+
/** "3–58행 / 전체 12,300". / Row-range label. */
|
|
10
|
+
readonly rangeLabel: string;
|
|
11
|
+
}
|
|
12
|
+
/** 페이지 배분 계약(SPI). / Page distribution contract (SPI). */
|
|
13
|
+
export interface IPaginator {
|
|
14
|
+
paginate(rows: AsyncIterable<RowArtifact>, header: ReadonlyArray<ReadonlyArray<HeaderArtifact>>): AsyncIterable<PrintPage>;
|
|
15
|
+
}
|
|
16
|
+
/** Paginator 구성. / Paginator options. */
|
|
17
|
+
export interface PaginatorOptions {
|
|
18
|
+
/** 페이지 박스(px). / Page box in px. */
|
|
19
|
+
readonly pageBox: {
|
|
20
|
+
readonly w: number;
|
|
21
|
+
readonly h: number;
|
|
22
|
+
};
|
|
23
|
+
/** 행 높이(px). / Row height in px. */
|
|
24
|
+
readonly rowHeight: number;
|
|
25
|
+
/** 헤더 반복(기본 true). / Repeat header per page (default true). */
|
|
26
|
+
readonly repeatHeader?: boolean;
|
|
27
|
+
/** 헤더 높이(px, 페이지당 rows 산정에서 차감). / Header height (px). */
|
|
28
|
+
readonly headerHeight?: number;
|
|
29
|
+
/** 전체 행수(범위 라벨 분모, 없으면 누적치). / Total rows (denominator). */
|
|
30
|
+
readonly totalRows?: number;
|
|
31
|
+
/** 색→흑백 잉크 어댑터(선택; 미주입 시 원문 표시값). / Ink adapter (optional). */
|
|
32
|
+
readonly adapter?: IOutputChannelAdapter;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* 기본 페이지 분할 — 반복 헤더·행 경계 비분할·페이지 번호(§2.6).
|
|
36
|
+
* 페이지당 행수 = floor((pageH − headerH) / rowHeight), 최소 1(행 비분할 보장).
|
|
37
|
+
* / Default paginator; rows-per-page = floor((pageH − headerH)/rowHeight), min 1.
|
|
38
|
+
*/
|
|
39
|
+
export declare class Paginator implements IPaginator {
|
|
40
|
+
private readonly opts;
|
|
41
|
+
constructor(opts: PaginatorOptions);
|
|
42
|
+
/** 페이지당 데이터 행수(최소 1 — 한 행이 페이지보다 커도 절단 안 함). / Rows per page (min 1). */
|
|
43
|
+
rowsPerPage(): number;
|
|
44
|
+
paginate(rows: AsyncIterable<RowArtifact>, header: ReadonlyArray<ReadonlyArray<HeaderArtifact>>): AsyncIterable<PrintPage>;
|
|
45
|
+
private _emit;
|
|
46
|
+
private _headerHtml;
|
|
47
|
+
private _rowHtml;
|
|
48
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { IArtifactProvenance, IArtifactSource, RowRange } from '../types.js';
|
|
2
|
+
import { IOutputChannelAdapter } from './OutputChannelAdapter.js';
|
|
3
|
+
import { IPaginator, PrintPage } from './Paginator.js';
|
|
4
|
+
/** PrintRenderTarget 협력자. / Print render target collaborators. */
|
|
5
|
+
export interface PrintRenderDeps {
|
|
6
|
+
/** 전 모델행 투영(가시행 아님). / Full-row projection source. */
|
|
7
|
+
readonly source: IArtifactSource;
|
|
8
|
+
/** 흑백/이중부호 출력 어댑터. / Mono/dual-encoding output adapter. */
|
|
9
|
+
readonly adapter: IOutputChannelAdapter;
|
|
10
|
+
/** 페이지 배분 SPI(교체 가능). / Page distribution SPI (replaceable). */
|
|
11
|
+
readonly paginator: IPaginator;
|
|
12
|
+
/** 변환 provenance(페이지 푸터 동행). / Transform provenance (page footer). */
|
|
13
|
+
readonly provenance?: IArtifactProvenance;
|
|
14
|
+
}
|
|
15
|
+
/** render 옵션. / render options. */
|
|
16
|
+
export interface PrintRenderOptions {
|
|
17
|
+
/** 인쇄 범위(미지정 = 전체). / Print range (undefined = all). */
|
|
18
|
+
readonly range?: RowRange;
|
|
19
|
+
/** 문서 제목. / Document title. */
|
|
20
|
+
readonly title?: string;
|
|
21
|
+
/** 진행률(대용량). / Progress (large data). */
|
|
22
|
+
readonly onProgress?: (done: number, total: number) => void;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 전 논리행을 실체화해 페이지네이션된 인쇄 페이지를 스트림 생성(§2.6).
|
|
26
|
+
* / Materializes all logical rows into a stream of paginated print pages.
|
|
27
|
+
*/
|
|
28
|
+
export declare class PrintRenderTarget {
|
|
29
|
+
private readonly deps;
|
|
30
|
+
constructor(deps: PrintRenderDeps);
|
|
31
|
+
/** 인쇄 페이지 async 스트림. / Async stream of print pages. */
|
|
32
|
+
render(opts?: PrintRenderOptions): AsyncIterable<PrintPage>;
|
|
33
|
+
/** 전체 인쇄 문서 조립(모든 페이지 결합). shell 이 print window 에 write. / Assemble the full print doc. */
|
|
34
|
+
renderDocument(opts?: PrintRenderOptions): Promise<string>;
|
|
35
|
+
private _rowStream;
|
|
36
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { IByteSink } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* 메모리 버퍼 싱크(헤드리스 테스트). desiredSize 는 highWaterMark - 누적바이트.
|
|
4
|
+
* / In-memory buffer sink (headless tests); desiredSize = highWaterMark − buffered bytes.
|
|
5
|
+
*/
|
|
6
|
+
export declare class MemoryByteSink implements IByteSink {
|
|
7
|
+
private readonly _highWaterMark;
|
|
8
|
+
private readonly _chunks;
|
|
9
|
+
private _bytes;
|
|
10
|
+
private _closed;
|
|
11
|
+
private _aborted;
|
|
12
|
+
private _abortReason?;
|
|
13
|
+
constructor(_highWaterMark?: number);
|
|
14
|
+
write(chunk: Uint8Array | string): Promise<void>;
|
|
15
|
+
close(): Promise<void>;
|
|
16
|
+
abort(reason?: string): void;
|
|
17
|
+
get desiredSize(): number;
|
|
18
|
+
/** 누적 문자열(문자열 청크 결합). / Concatenated string of written chunks. */
|
|
19
|
+
toString(): string;
|
|
20
|
+
get bytesWritten(): number;
|
|
21
|
+
get closed(): boolean;
|
|
22
|
+
get aborted(): boolean;
|
|
23
|
+
get abortReason(): string | undefined;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 다운로드 유틸 싱크 어댑터(소규모/폴백 경로). 주입된 download 콜백으로 전량 위임.
|
|
27
|
+
* / Download-util sink adapter (small/fallback path); delegates the whole payload to a callback.
|
|
28
|
+
*/
|
|
29
|
+
export declare class DownloadByteSink implements IByteSink {
|
|
30
|
+
private readonly _download;
|
|
31
|
+
private readonly _highWaterMark;
|
|
32
|
+
private _buf;
|
|
33
|
+
private _bytes;
|
|
34
|
+
private _closed;
|
|
35
|
+
constructor(_download: (payload: string) => void, _highWaterMark?: number);
|
|
36
|
+
write(chunk: Uint8Array | string): Promise<void>;
|
|
37
|
+
close(): Promise<void>;
|
|
38
|
+
abort(): void;
|
|
39
|
+
get desiredSize(): number;
|
|
40
|
+
}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { Sign, StageId, DomainKind } from '../format/types.js';
|
|
2
|
+
import { VisualSpec } from '../cf/encoders.js';
|
|
3
|
+
import { LocaleMeta } from '../i18n/types.js';
|
|
4
|
+
/** 직렬화 채널 식별자. / Serialization channel id. */
|
|
5
|
+
export type ChannelId = 'csv' | 'xlsx' | 'json' | 'xml' | 'pdf' | 'html' | 'print';
|
|
6
|
+
/** 데이터 상태 — 빈/로딩/에러 시 출력 처우 판정(REQ-T9-846). / Data state for output disposition. */
|
|
7
|
+
export type DataState = 'ready' | 'loading' | 'error' | 'empty';
|
|
8
|
+
/** 셀 정렬. / Cell alignment. */
|
|
9
|
+
export type CellAlign = 'left' | 'right' | 'center';
|
|
10
|
+
/**
|
|
11
|
+
* 채널 중립 셀 아티팩트(§2.1). DD-04 FormatResult + DD-05 VisualSpec + DD-02 CellPlacement 합성 =
|
|
12
|
+
* 화면 렌더러(DD-03)가 소비하는 RenderModel 과 '동일 계보'. 불변. export/인쇄는 이 객체만 직렬화한다.
|
|
13
|
+
* / Channel-neutral cell artifact; the same lineage the on-screen renderer consumes. Immutable.
|
|
14
|
+
*/
|
|
15
|
+
export interface CellArtifact {
|
|
16
|
+
/** 화면 표시 문자열(마스킹·축약·부호 적용 후) = DisplayFormatter.format(...).text. / Display string. */
|
|
17
|
+
readonly text: string;
|
|
18
|
+
/** 축약/마스킹 원값(CSV '값 보존'·xlsx 원값 셀). / Preserved raw value under abbrev/mask. */
|
|
19
|
+
readonly rawText?: string;
|
|
20
|
+
/** 낭독 대체(인쇄 대체텍스트·PDF/UA 태깅). / Accessible alt text. */
|
|
21
|
+
readonly aria?: string;
|
|
22
|
+
/** 부호 클래스. / Sign class. */
|
|
23
|
+
readonly sign?: Sign;
|
|
24
|
+
/** DD-04 provenance(어느 단계가 걸렸나). / Applied pipeline stages. */
|
|
25
|
+
readonly applied: ReadonlyArray<StageId>;
|
|
26
|
+
/** DD-05 소유 VisualSpec(있을 때만). 재선언 금지 — import 소비만. / DD-05 VisualSpec (consume-only). */
|
|
27
|
+
readonly cf?: VisualSpec;
|
|
28
|
+
/** DD-04 색코드([Red] 등) — 형태/부호 병기로만 소비(색 단독 금지). / AST color hint (never color-alone). */
|
|
29
|
+
readonly colorHint?: string;
|
|
30
|
+
/** 병합 세로 스팬. / Merge row-span. */
|
|
31
|
+
readonly rowSpan: number;
|
|
32
|
+
/** 병합 가로 스팬. / Merge col-span. */
|
|
33
|
+
readonly colSpan: number;
|
|
34
|
+
/** 병합에 삼켜진 셀(직렬화 생략). / Swallowed by a merge (skip serialization). */
|
|
35
|
+
readonly hidden: boolean;
|
|
36
|
+
/** 정렬. / Alignment. */
|
|
37
|
+
readonly align: CellAlign;
|
|
38
|
+
/** 채널별 셀 타입 매핑용(xlsx number vs string). / Domain kind for per-channel typing. */
|
|
39
|
+
readonly type: DomainKind;
|
|
40
|
+
}
|
|
41
|
+
/** 한 논리 행의 아티팩트. 화면 밖 행도 동일 구조(전량 순회, REQ-T3-805). / One logical row's artifact. */
|
|
42
|
+
export interface RowArtifact {
|
|
43
|
+
/** 정렬/필터 후 논리 순서 index. / Logical index after sort/filter. */
|
|
44
|
+
readonly modelIndex: number;
|
|
45
|
+
/** visibleLeaves 순서, exceptFields 제외 반영. / Cells in visible-leaf order. */
|
|
46
|
+
readonly cells: ReadonlyArray<CellArtifact>;
|
|
47
|
+
/** 마스터/디테일·소계행 구분. / Master/detail / subtotal row kind. */
|
|
48
|
+
readonly rowState?: 'normal' | 'group' | 'summary' | 'detail';
|
|
49
|
+
/** 그룹 들여쓰기 깊이. / Group indent depth. */
|
|
50
|
+
readonly depth?: number;
|
|
51
|
+
}
|
|
52
|
+
/** 컬럼 헤더 아티팩트(다단 헤더·병합 반영). / Column header artifact. */
|
|
53
|
+
export interface HeaderArtifact {
|
|
54
|
+
readonly text: string;
|
|
55
|
+
readonly field: string;
|
|
56
|
+
readonly colSpan: number;
|
|
57
|
+
readonly rowSpan: number;
|
|
58
|
+
readonly widthPx: number;
|
|
59
|
+
readonly align: CellAlign;
|
|
60
|
+
}
|
|
61
|
+
/** 반열림 행 범위 [start,end). / Half-open row range. */
|
|
62
|
+
export interface RowRange {
|
|
63
|
+
readonly start: number;
|
|
64
|
+
readonly end: number;
|
|
65
|
+
}
|
|
66
|
+
/** 청크(청크 단위 async 스트림 단위). / Streaming chunk unit. */
|
|
67
|
+
export interface RowChunk {
|
|
68
|
+
readonly rows: ReadonlyArray<RowArtifact>;
|
|
69
|
+
readonly done: boolean;
|
|
70
|
+
}
|
|
71
|
+
/** 투영 옵션(§2.2). / Projection options. */
|
|
72
|
+
export interface ProjectOptions {
|
|
73
|
+
/** 미지정 = 전 모델행. / Undefined = all model rows. */
|
|
74
|
+
readonly range?: RowRange;
|
|
75
|
+
/** 제외 필드. / Excluded fields. */
|
|
76
|
+
readonly exceptFields?: ReadonlyArray<string>;
|
|
77
|
+
/** DD-04 마스킹 단계 포함 여부 지시(재구현 아님). / Whether the mask stage is applied upstream. */
|
|
78
|
+
readonly maskOnExport?: boolean;
|
|
79
|
+
/** cf 시각 계층 투영 여부(CSV=false, PDF=true 기본). / Whether to project the cf visual layer. */
|
|
80
|
+
readonly includeCF?: boolean;
|
|
81
|
+
/** 스트리밍 청크 행수. / Chunk row count for streaming. */
|
|
82
|
+
readonly chunkSize?: number;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* export/인쇄가 화면과 '같은 파이프라인'에서 파생됨을 강제하는 단일 포트(§2.2, REQ-T3-803).
|
|
86
|
+
* 채널이 raw 를 볼 방법 자체가 API 에 없다 = WYSIWYG 불변식의 강제 장치.
|
|
87
|
+
* / The single port forcing export/print to derive from the same pipeline as the screen.
|
|
88
|
+
*/
|
|
89
|
+
export interface IArtifactSource {
|
|
90
|
+
/** 헤더 투영(병합 반영). / Header projection (merges reflected). */
|
|
91
|
+
projectHeader(opts?: ProjectOptions): ReadonlyArray<ReadonlyArray<HeaderArtifact>>;
|
|
92
|
+
/** 전 모델행(또는 지정 범위)을 청크 단위 async 스트림으로 투영. / Project all model rows as an async stream. */
|
|
93
|
+
projectRows(opts?: ProjectOptions): AsyncIterable<RowChunk>;
|
|
94
|
+
/** 전체 행수(진행률 분모). / Total rows (progress denominator). */
|
|
95
|
+
totalRows(range?: RowRange): number;
|
|
96
|
+
/** 데이터 상태 — 빈/로딩/에러 처우(REQ-T9-846). / Data state for output disposition. */
|
|
97
|
+
dataState(): DataState;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* 바이트 소비처(백프레셔의 소비 측, §2.4). 반환 Promise 로 생산자를 눌러 OOM 방지(REQ-T9-810).
|
|
101
|
+
* / Byte sink (consumer side of backpressure); its Promise throttles the producer to avoid OOM.
|
|
102
|
+
*/
|
|
103
|
+
export interface IByteSink {
|
|
104
|
+
/** 청크 소비. 버퍼가 highWaterMark 초과면 drain 될 때까지 지연된 Promise. / Consume a chunk. */
|
|
105
|
+
write(chunk: Uint8Array | string): Promise<void>;
|
|
106
|
+
close(): Promise<void>;
|
|
107
|
+
abort(reason?: string): void;
|
|
108
|
+
/** 남은 버퍼 여유(음수면 생산 일시정지 신호). / Remaining buffer headroom (negative ⇒ pause). */
|
|
109
|
+
readonly desiredSize: number;
|
|
110
|
+
}
|
|
111
|
+
/** 채널 × 상태항목 포함/제외 선언 — 손실 고지의 SSOT(REQ-T3-804). / Channel capability matrix (loss SSOT). */
|
|
112
|
+
export interface ChannelCapabilities {
|
|
113
|
+
readonly merges: boolean;
|
|
114
|
+
readonly frozen: boolean;
|
|
115
|
+
readonly colWidths: boolean;
|
|
116
|
+
readonly cf: boolean;
|
|
117
|
+
readonly filters: boolean;
|
|
118
|
+
readonly sort: boolean;
|
|
119
|
+
readonly hiddenCols: boolean;
|
|
120
|
+
readonly groupCollapse: boolean;
|
|
121
|
+
readonly charts: boolean;
|
|
122
|
+
readonly styling: boolean;
|
|
123
|
+
readonly provenance: boolean;
|
|
124
|
+
}
|
|
125
|
+
/** 현 그리드에서 활성인 상태 플래그(손실 판정 입력). / Active state flags for loss computation. */
|
|
126
|
+
export interface ActiveStateFlags {
|
|
127
|
+
readonly merges?: boolean;
|
|
128
|
+
readonly frozen?: boolean;
|
|
129
|
+
readonly colWidths?: boolean;
|
|
130
|
+
readonly cf?: boolean;
|
|
131
|
+
readonly filters?: boolean;
|
|
132
|
+
readonly sort?: boolean;
|
|
133
|
+
readonly hiddenCols?: boolean;
|
|
134
|
+
readonly groupCollapse?: boolean;
|
|
135
|
+
readonly charts?: boolean;
|
|
136
|
+
readonly styling?: boolean;
|
|
137
|
+
}
|
|
138
|
+
/** 손실 항목 고지 레코드. / A single declared state loss. */
|
|
139
|
+
export interface StateLoss {
|
|
140
|
+
readonly item: string;
|
|
141
|
+
readonly reason: string;
|
|
142
|
+
}
|
|
143
|
+
/** 채널×상태항목 포함/제외 매트릭스(UI/문서용). / Channel×state inclusion matrix. */
|
|
144
|
+
export interface ChannelStateMatrix {
|
|
145
|
+
readonly channels: ReadonlyArray<ChannelId>;
|
|
146
|
+
readonly items: ReadonlyArray<string>;
|
|
147
|
+
readonly cells: Readonly<Record<string, Readonly<Record<string, boolean>>>>;
|
|
148
|
+
}
|
|
149
|
+
/** 실행 컨텍스트(§2.4). / Export run context. */
|
|
150
|
+
export interface ExportRunCtx {
|
|
151
|
+
/** 취소 신호. / Cancellation signal. */
|
|
152
|
+
readonly signal?: AbortSignal;
|
|
153
|
+
/** 진행률(청크마다). / Progress (per chunk). */
|
|
154
|
+
onProgress?: (done: number, total: number) => void;
|
|
155
|
+
/** 변환 provenance(산출물 동행). / Transform provenance (travels to the artifact). */
|
|
156
|
+
readonly provenance?: IArtifactProvenance;
|
|
157
|
+
/** 인쇄 lang·날짜·Excel 폰트 — DD-12 소유 LocaleMeta import(재선언 금지). / Locale meta (DD-12). */
|
|
158
|
+
readonly locale?: LocaleMeta;
|
|
159
|
+
/** 이 실행의 손실 항목 스냅샷. / This run's declared losses. */
|
|
160
|
+
readonly losses?: ReadonlyArray<StateLoss>;
|
|
161
|
+
}
|
|
162
|
+
/** 채널 실행 결과. / Channel run result. */
|
|
163
|
+
export interface ExportResult {
|
|
164
|
+
readonly bytesWritten: number;
|
|
165
|
+
readonly rowsWritten: number;
|
|
166
|
+
readonly aborted: boolean;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* 채널 직렬화 전략(Strategy, §2.4). 모든 포맷이 동일 계약 — 소스·싱크는 주입, 채널은 매핑만.
|
|
170
|
+
* / Channel serialization strategy; source/sink injected, the channel only maps.
|
|
171
|
+
*/
|
|
172
|
+
export interface IExportChannel {
|
|
173
|
+
readonly id: ChannelId;
|
|
174
|
+
/** 이 채널이 표현 가능한 상태항목(매니페스트 SSOT). / Representable state items (manifest SSOT). */
|
|
175
|
+
readonly capabilities: ChannelCapabilities;
|
|
176
|
+
/** 아티팩트 스트림 → 바이트. 청크마다 sink.write 를 await(백프레셔). / Artifact stream → bytes. */
|
|
177
|
+
write(source: IArtifactSource, sink: IByteSink, ctx?: ExportRunCtx): Promise<ExportResult>;
|
|
178
|
+
}
|
|
179
|
+
/** 파이프라인 변환 고지 레코드(REQ-T6-811). / Pipeline transform disclosure record. */
|
|
180
|
+
export interface TransformProvenance {
|
|
181
|
+
readonly source: 'format' | 'cf' | 'chart';
|
|
182
|
+
readonly kind: 'downsample' | 'aggregate' | 'normalize' | 'log' | 'truncatedAxis' | 'mask' | 'abbreviate' | 'clamp';
|
|
183
|
+
readonly detail: string;
|
|
184
|
+
readonly affected?: {
|
|
185
|
+
rows?: number;
|
|
186
|
+
cols?: ReadonlyArray<string>;
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
/** 무결성 배지(흑백 생존 픽토 병기). / Integrity badge (monochrome-surviving glyph). */
|
|
190
|
+
export interface ProvenanceBadge {
|
|
191
|
+
readonly code: string;
|
|
192
|
+
readonly label: string;
|
|
193
|
+
readonly monochromeGlyph: string;
|
|
194
|
+
}
|
|
195
|
+
/** 채널별 provenance 렌더 산출(꼬리말/시트메모/주석행/푸터). / Channel-rendered provenance block. */
|
|
196
|
+
export interface ProvenanceBlock {
|
|
197
|
+
readonly channel: ChannelId;
|
|
198
|
+
/** 채널 표현 문자열(CSV 주석행·PDF 꼬리말·print 푸터 등). / Channel representation string. */
|
|
199
|
+
readonly text: string;
|
|
200
|
+
/** 배지(흑백 픽토 포함). / Badges. */
|
|
201
|
+
readonly badges: ReadonlyArray<ProvenanceBadge>;
|
|
202
|
+
}
|
|
203
|
+
/** 산출물 단위 provenance 집계 포트(§2.3). / Per-artifact provenance aggregate port. */
|
|
204
|
+
export interface IArtifactProvenance {
|
|
205
|
+
readonly transforms: ReadonlyArray<TransformProvenance>;
|
|
206
|
+
readonly badges: ReadonlyArray<ProvenanceBadge>;
|
|
207
|
+
readonly generatedAt: number;
|
|
208
|
+
readonly rangeNote: string;
|
|
209
|
+
/** 배지/캡션을 채널 표현으로 렌더. / Render badges/caption for a channel. */
|
|
210
|
+
render(channel: ChannelId): ProvenanceBlock;
|
|
211
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { DeprecationInfo } from './Registry.js';
|
|
2
|
+
/** 매니페스트 1건 — 폐기 정보 + 식별자. / One manifest record — deprecation info + id. */
|
|
3
|
+
export interface DeprecationRecord extends DeprecationInfo {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* 폐기 경고 dedup + 매니페스트 + removeIn 게이트.
|
|
8
|
+
* / Deprecation warning dedup + manifest + removeIn gate.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* const dm = new DeprecationManager();
|
|
12
|
+
* dm.warn('defineSkin', { since: '2.1', removeIn: '3.0', replacement: 'registerSkin' });
|
|
13
|
+
* dm.warn('defineSkin', { since: '2.1', removeIn: '3.0' }); // dedup — no second warning
|
|
14
|
+
* dm.gateRemoval('defineSkin', '2.9'); // 'blocked' (removeIn 3.0 이전)
|
|
15
|
+
*/
|
|
16
|
+
export declare class DeprecationManager {
|
|
17
|
+
private _warned;
|
|
18
|
+
private _records;
|
|
19
|
+
private readonly _sink;
|
|
20
|
+
constructor(sink?: (msg: string) => void);
|
|
21
|
+
/**
|
|
22
|
+
* 폐기 경고 방출 — 동일 id 반복 시 1회만(dedup). 매니페스트에 기록.
|
|
23
|
+
* / Emit a deprecation warning — once per id (dedup). Also records for the manifest.
|
|
24
|
+
*
|
|
25
|
+
* @param id - 폐기 대상 식별자(API/키 이름) / Deprecated identifier (API/key name)
|
|
26
|
+
* @param info - 폐기 정보(since/removeIn/replacement) / Deprecation info
|
|
27
|
+
*/
|
|
28
|
+
warn(id: string, info: DeprecationInfo): void;
|
|
29
|
+
/** 경고 없이 매니페스트에만 기록(빌드타임 등록). / Record for the manifest without emitting a warning. */
|
|
30
|
+
private _record;
|
|
31
|
+
/** 빌드가 JSON 으로 산출하는 기계판독 매니페스트. / Machine-readable manifest the build emits as JSON. */
|
|
32
|
+
manifest(): DeprecationRecord[];
|
|
33
|
+
/**
|
|
34
|
+
* removeIn 이전 제거 차단(CI 게이트, UC-7). currentVersion < removeIn → 'blocked'.
|
|
35
|
+
* / Block removal before removeIn (CI gate). currentVersion < removeIn → 'blocked'.
|
|
36
|
+
*
|
|
37
|
+
* @param id - 폐기 대상 식별자 / Deprecated identifier
|
|
38
|
+
* @param currentVersion - 제거를 시도하는 현재 버전 / Current version attempting removal
|
|
39
|
+
* @returns 미등록/유예창 경과 시 'ok', 유예창 내 제거는 'blocked' / 'ok' if allowed, 'blocked' if premature
|
|
40
|
+
*/
|
|
41
|
+
gateRemoval(id: string, currentVersion: string): 'ok' | 'blocked';
|
|
42
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 모든 확장 구현이 상속하는 최소 계약(생명주기·격리·직렬화 정합의 근원). DD-10 정본.
|
|
3
|
+
* / The minimal contract inherited by every extension implementation. DD-10 canonical.
|
|
4
|
+
*
|
|
5
|
+
* 소유 DD 는 자기 정본 인터페이스가 `extends IExtension` 하도록 보강한다(재선언 아님, §2.5).
|
|
6
|
+
*/
|
|
7
|
+
export interface IExtension {
|
|
8
|
+
/** SPI 식별·버전 태그. 예: 'ICellRenderer@2'. / SPI identity/version tag, e.g. 'ICellRenderer@2'. */
|
|
9
|
+
readonly spi: string;
|
|
10
|
+
/** 코어 자원 획득(옵션). 실패 격리 대상. / Acquire core resources (optional). Isolated on failure. */
|
|
11
|
+
activate?(ctx?: unknown): void;
|
|
12
|
+
/** register 로 획득한 자원의 대칭 해제. / Symmetric release of resources acquired at register. */
|
|
13
|
+
dispose?(): void;
|
|
14
|
+
}
|
|
15
|
+
/** 검증 결과. / Validation result. */
|
|
16
|
+
export interface ValResult {
|
|
17
|
+
readonly ok: boolean;
|
|
18
|
+
/** 실패 사유(있으면). / Failure message (if any). */
|
|
19
|
+
readonly message?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* IValidator — 타 DD 미소유. DD-10 이 내용까지 소유하는 유일한 SPI(§2.5).
|
|
23
|
+
* 수식 기반 검증은 DD-08 CalcService 재사용(중복 평가엔진 금지, §1.2).
|
|
24
|
+
* / IValidator — not owned by any other DD; the sole SPI DD-10 owns in full.
|
|
25
|
+
*/
|
|
26
|
+
export interface IValidator extends IExtension {
|
|
27
|
+
validate(value: unknown, ctx?: unknown): ValResult | Promise<ValResult>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* 런타임 능력 질의(§2.8). 확장이 "이 빌드가 이걸 지원하나" 코드로 질의.
|
|
31
|
+
* / Runtime capability queries. Extensions ask, in code, whether a build supports something.
|
|
32
|
+
*/
|
|
33
|
+
export interface CoreCapabilities {
|
|
34
|
+
/** capability 토큰 보유 여부. / Whether a capability token is present. */
|
|
35
|
+
has(token: string): boolean;
|
|
36
|
+
/** SPI 이름 → 현재 버전(미제공 시 undefined). / SPI name → current version (undefined if absent). */
|
|
37
|
+
spiVersion(spi: string): string | undefined;
|
|
38
|
+
/** 코어 버전이 minCore 하한을 만족하는가. / Whether the core version satisfies a minCore floor. */
|
|
39
|
+
satisfies(minCore: string): boolean;
|
|
40
|
+
}
|
|
41
|
+
/** 확장이 선언하는 peer 계약 — 로드 시 코어가 검증(부적합 안전 거부, §2.5). / Peer contract an extension declares. */
|
|
42
|
+
export interface ExtensionPeer {
|
|
43
|
+
/** semver 하한. / semver floor. */
|
|
44
|
+
readonly minCore: string;
|
|
45
|
+
/** 대상 SPI@major. 예: 'IChartRenderer@3'. / Target SPI@major, e.g. 'IChartRenderer@3'. */
|
|
46
|
+
readonly spi: string;
|
|
47
|
+
/** 요구 capability 토큰. / Required capability tokens. */
|
|
48
|
+
readonly requires?: string[];
|
|
49
|
+
}
|
|
50
|
+
/** peer 검증 판정. / Peer verification verdict. */
|
|
51
|
+
export interface PeerVerdict {
|
|
52
|
+
readonly ok: boolean;
|
|
53
|
+
/** 거부 사유(고지). / Rejection reason (disclosed). */
|
|
54
|
+
readonly reason?: string;
|
|
55
|
+
}
|
|
56
|
+
/** 두 semver 문자열 비교: a<b→-1, a==b→0, a>b→1(수치 세그먼트). / Compare two semver strings by numeric segments. */
|
|
57
|
+
export declare function compareSemver(a: string, b: string): number;
|
|
58
|
+
/**
|
|
59
|
+
* 확장 로드 시 peer 검증(안전 거부, UC-6). minCore 미달·SPI major 불일치·capability 미보유는
|
|
60
|
+
* 모두 사유 고지 후 거부하며, 동일 SPI major 내 minor 차이는 통과.
|
|
61
|
+
* / Verify an extension's peer contract at load time (safe reject, UC-6).
|
|
62
|
+
*
|
|
63
|
+
* @param peer - 확장이 선언한 peer 계약 / The peer contract the extension declares
|
|
64
|
+
* @param core - 코어 능력 질의 인터페이스 / Core capability query interface
|
|
65
|
+
* @returns ok | reject(사유 고지) / ok, or reject with a disclosed reason
|
|
66
|
+
*/
|
|
67
|
+
export declare function verifyPeer(peer: ExtensionPeer, core: CoreCapabilities): PeerVerdict;
|
|
68
|
+
/** CoreCapabilities 구성 스펙. / Spec to build CoreCapabilities. */
|
|
69
|
+
export interface CapabilitiesSpec {
|
|
70
|
+
readonly core: string;
|
|
71
|
+
readonly spi?: Readonly<Record<string, string>>;
|
|
72
|
+
readonly tokens?: readonly string[];
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* CoreCapabilities 의 구체 구현(생성 매니페스트 소비, §2.8 CapabilityService).
|
|
76
|
+
* / Concrete CoreCapabilities implementation (consumes a generated manifest).
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* const caps = new Capabilities({ core: '2.4.0', spi: { IChartRenderer: '2' }, tokens: ['canvas2d'] });
|
|
80
|
+
* verifyPeer({ minCore: '2.0.0', spi: 'IChartRenderer@3' }, caps).ok; // false
|
|
81
|
+
*/
|
|
82
|
+
export declare class Capabilities implements CoreCapabilities {
|
|
83
|
+
private readonly _core;
|
|
84
|
+
private readonly _spi;
|
|
85
|
+
private readonly _tokens;
|
|
86
|
+
constructor(spec: CapabilitiesSpec);
|
|
87
|
+
has(token: string): boolean;
|
|
88
|
+
spiVersion(spi: string): string | undefined;
|
|
89
|
+
satisfies(minCore: string): boolean;
|
|
90
|
+
}
|