@endge/nova 0.13.6 → 0.13.14
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/dist/domain/constants/nova-phase.d.ts +16 -0
- package/dist/domain/types/base.types.d.ts +177 -0
- package/dist/domain/types/component.types.d.ts +156 -0
- package/dist/domain/types/context.types.d.ts +31 -0
- package/dist/domain/types/cursor.types.d.ts +89 -0
- package/dist/domain/types/diagnostics.types.d.ts +148 -0
- package/dist/domain/types/events.types.d.ts +85 -0
- package/dist/domain/types/export.types.d.ts +27 -0
- package/dist/domain/types/hit-test.types.d.ts +16 -0
- package/dist/domain/types/motion.types.d.ts +118 -0
- package/dist/domain/types/renderer.types.d.ts +607 -0
- package/dist/domain/types/rendering/index.d.ts +559 -0
- package/dist/domain/types/semantic.types.d.ts +69 -0
- package/dist/domain/types/sound.types.d.ts +84 -0
- package/dist/domain/types/theme.types.d.ts +53 -0
- package/dist/domain/utils/bounds.d.ts +34 -0
- package/dist/domain/utils/schemaBounds.d.ts +10 -0
- package/dist/index.d.ts +82 -8919
- package/dist/model/input/NovaCaretBlinkController.d.ts +35 -0
- package/dist/model/input/NovaClipboardService.d.ts +18 -0
- package/dist/model/input/NovaInputProxy_Adapter.d.ts +61 -0
- package/dist/model/input/NovaInputValidationController.d.ts +46 -0
- package/dist/model/input/NovaTextInputController.d.ts +126 -0
- package/dist/model/input/NovaTextLayoutEngine.d.ts +31 -0
- package/dist/model/input/index.d.ts +7 -0
- package/dist/model/input/nova-input.types.d.ts +137 -0
- package/dist/model/motion/NovaMotionEngine.d.ts +152 -0
- package/dist/model/motion/nova-motion-easing.d.ts +13 -0
- package/dist/model/motion/nova-motion-interpolation.d.ts +19 -0
- package/dist/model/motion/nova-motion-presets.d.ts +288 -0
- package/dist/model/motion/nova-motion-timeline.d.ts +5 -0
- package/dist/model/platform/NovaCanvas.d.ts +112 -0
- package/dist/model/platform/NovaGraphics.d.ts +32 -0
- package/dist/model/render/backends/canvas2d/NovaCanvas2DTargetManager.d.ts +29 -0
- package/dist/model/render/backends/canvas2d/NovaRenderer2D.d.ts +238 -0
- package/dist/model/render/backends/nova-render-backend-factory.d.ts +10 -0
- package/dist/model/render/backends/nova-render-backend.d.ts +16 -0
- package/dist/model/render/backends/webgl/NovaGpuBufferArena.d.ts +76 -0
- package/dist/model/render/backends/webgl/NovaRendererWebGL.d.ts +154 -0
- package/dist/model/render/backends/webgl/NovaWebGLBatcher.d.ts +17 -0
- package/dist/model/render/backends/webgl/NovaWebGLBuffer.d.ts +19 -0
- package/dist/model/render/backends/webgl/NovaWebGLDevice.d.ts +24 -0
- package/dist/model/render/backends/webgl/NovaWebGLDiagnostics.d.ts +29 -0
- package/dist/model/render/backends/webgl/NovaWebGLFrameRenderer.d.ts +1013 -0
- package/dist/model/render/backends/webgl/NovaWebGLProgram.d.ts +33 -0
- package/dist/model/render/backends/webgl/NovaWebGLTargetManager.d.ts +11 -0
- package/dist/model/render/backends/webgl/NovaWebGLTextRenderer.d.ts +17 -0
- package/dist/model/render/backends/webgl/NovaWebGLTextureManager.d.ts +16 -0
- package/dist/model/render/compiler/NovaRenderBuilder.d.ts +176 -0
- package/dist/model/render/compiler/NovaRenderCommandWriter.d.ts +166 -0
- package/dist/model/render/compiler/NovaRenderCompiler.d.ts +48 -0
- package/dist/model/render/compiler/NovaRenderFrameBuilder.d.ts +59 -0
- package/dist/model/render/graph/NovaRenderGraph.d.ts +96 -0
- package/dist/model/render/graph/NovaRenderHitIndex.d.ts +54 -0
- package/dist/model/render/graph/nova-render-culling.d.ts +26 -0
- package/dist/model/render/graph/nova-render-group.d.ts +18 -0
- package/dist/model/render/graph/nova-render-item.d.ts +35 -0
- package/dist/model/render/graph/nova-render-layer.d.ts +5 -0
- package/dist/model/render/graph/nova-render-stream.d.ts +117 -0
- package/dist/model/render/orchestration/NovaRenderOrchestrator.d.ts +73 -0
- package/dist/model/render/policy/nova-render-policy.d.ts +45 -0
- package/dist/model/render/resources/NovaGlyphAtlasManager.d.ts +45 -0
- package/dist/model/render/resources/NovaRenderResourceCache.d.ts +30 -0
- package/dist/model/render/resources/NovaRenderScheduler.d.ts +33 -0
- package/dist/model/render/resources/NovaTextAtlasManager.d.ts +44 -0
- package/dist/model/render/resources/NovaTextLayoutEngine.d.ts +23 -0
- package/dist/model/render/resources/NovaTextureAtlasManager.d.ts +95 -0
- package/dist/model/render/schema/NovaRenderContext.d.ts +74 -0
- package/dist/model/render/schema/nova-color-parser.d.ts +18 -0
- package/dist/model/render/schema/nova-style-compiler.d.ts +88 -0
- package/dist/model/render/targets/NovaRenderTargetManager.d.ts +51 -0
- package/dist/model/render/targets/nova-render-target-resource.d.ts +14 -0
- package/dist/model/render/utils/nova-icon-rendering.d.ts +9 -0
- package/dist/model/runtime/app/Nova.d.ts +167 -0
- package/dist/model/runtime/app/NovaApp.d.ts +305 -0
- package/dist/model/runtime/app/createNovaRaphRuntime.d.ts +17 -0
- package/dist/model/runtime/assets/NovaAssetRegistry.d.ts +511 -0
- package/dist/model/runtime/commands/NovaCommandBus.d.ts +48 -0
- package/dist/model/runtime/components/NovaComponentNode.d.ts +109 -0
- package/dist/model/runtime/components/NovaComponentRegistry.d.ts +35 -0
- package/dist/model/runtime/components/NovaSchemaRegistry.d.ts +71 -0
- package/dist/model/runtime/components/nova-component-metadata.d.ts +90 -0
- package/dist/model/runtime/components/nova-component.decorator.d.ts +38 -0
- package/dist/model/runtime/components/nova-defined-component.d.ts +58 -0
- package/dist/model/runtime/context/nova-context.d.ts +5 -0
- package/dist/model/runtime/cursor/NovaCursorManager.d.ts +148 -0
- package/dist/model/runtime/debug/NovaDebug.d.ts +105 -0
- package/dist/model/runtime/debug/NovaMetrics.d.ts +55 -0
- package/dist/model/runtime/diagnostics/NovaDiagnostics_Module.d.ts +143 -0
- package/dist/model/runtime/diagnostics/adapters/NovaDiagnosticsBrowser_Adapter.d.ts +32 -0
- package/dist/model/runtime/interaction/NovaEvents.d.ts +229 -0
- package/dist/model/runtime/interaction/NovaHitIndex.d.ts +57 -0
- package/dist/model/runtime/interaction/NovaSpatialIndex.d.ts +49 -0
- package/dist/model/runtime/reactivity/nova-reactivity.d.ts +24 -0
- package/dist/model/runtime/refs/nova-ref.d.ts +61 -0
- package/dist/model/runtime/scene/NovaScene.d.ts +80 -0
- package/dist/model/runtime/scene/nova-scene-components.d.ts +87 -0
- package/dist/model/runtime/state/NovaStore.d.ts +27 -0
- package/dist/model/runtime/state/nova-store-decorators.d.ts +40 -0
- package/dist/model/runtime/state/nova-store-runtime.d.ts +23 -0
- package/dist/model/runtime/state/nova-store-tracking.d.ts +17 -0
- package/dist/model/runtime/sync/NovaSyncScope.d.ts +93 -0
- package/dist/model/runtime/sync/nova-sync-context.d.ts +2 -0
- package/dist/model/runtime/sync/nova-sync-ports.d.ts +5 -0
- package/dist/model/runtime/sync/nova-sync.types.d.ts +48 -0
- package/dist/model/runtime/template/NovaTemplateRuntime.d.ts +79 -0
- package/dist/model/runtime/tree/NovaContainer.d.ts +78 -0
- package/dist/model/runtime/tree/NovaNode.d.ts +626 -0
- package/dist/model/runtime/tree/NovaSurface.d.ts +95 -0
- package/dist/model/semantic/NovaSemanticService.d.ts +30 -0
- package/dist/model/sound/NovaSoundEngine.d.ts +134 -0
- package/dist/model/telemetry.d.ts +108 -0
- package/dist/model/text-selection/NovaTextSelectionService.d.ts +85 -0
- package/dist/model/text-selection/index.d.ts +2 -0
- package/dist/model/text-selection/nova-text-selection.types.d.ts +54 -0
- package/dist/model/theme/NovaGlobalThemeRegistry.d.ts +57 -0
- package/dist/model/theme/NovaThemeService.d.ts +83 -0
- package/dist/nova.js +14616 -14189
- package/package.json +29 -23
|
@@ -0,0 +1,511 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Описывает kind Nova asset.
|
|
3
|
+
*/
|
|
4
|
+
export type NovaAssetKind = 'icon' | 'image' | 'fill' | 'font';
|
|
5
|
+
/**
|
|
6
|
+
* Описывает режим заполнения drawable asset внутри rect.
|
|
7
|
+
*/
|
|
8
|
+
export type NovaAssetFillMode = 'stretch' | 'repeat' | 'repeat-x' | 'repeat-y' | 'no-repeat';
|
|
9
|
+
/**
|
|
10
|
+
* Описывает сторону nine-slice bitmap.
|
|
11
|
+
*/
|
|
12
|
+
export interface NovaNineSliceInsets {
|
|
13
|
+
readonly top: number;
|
|
14
|
+
readonly right: number;
|
|
15
|
+
readonly bottom: number;
|
|
16
|
+
readonly left: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Описывает ref на asset без раскрытия atlas/texture деталей.
|
|
20
|
+
*/
|
|
21
|
+
export interface NovaAssetRef<K extends NovaAssetKind = NovaAssetKind> {
|
|
22
|
+
readonly __novaAssetRef: true;
|
|
23
|
+
readonly namespace: string;
|
|
24
|
+
readonly kind: K;
|
|
25
|
+
readonly name: string;
|
|
26
|
+
readonly id: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Описывает SVG asset descriptor.
|
|
30
|
+
*/
|
|
31
|
+
export interface NovaSvgAssetDescriptor {
|
|
32
|
+
readonly type: 'svg';
|
|
33
|
+
readonly source: string;
|
|
34
|
+
readonly width: number;
|
|
35
|
+
readonly height: number;
|
|
36
|
+
readonly color?: string;
|
|
37
|
+
readonly pixelRatio?: NovaSvgAssetPixelRatio;
|
|
38
|
+
}
|
|
39
|
+
export type NovaSvgAssetPixelRatio = number | 'auto';
|
|
40
|
+
/**
|
|
41
|
+
* Описывает image asset descriptor.
|
|
42
|
+
*/
|
|
43
|
+
export interface NovaImageAssetDescriptor {
|
|
44
|
+
readonly type: 'image';
|
|
45
|
+
readonly source: CanvasImageSource | string;
|
|
46
|
+
readonly width?: number;
|
|
47
|
+
readonly height?: number;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Описывает canvas asset descriptor.
|
|
51
|
+
*/
|
|
52
|
+
export interface NovaCanvasAssetDescriptor {
|
|
53
|
+
readonly type: 'canvas';
|
|
54
|
+
readonly source: HTMLCanvasElement | OffscreenCanvas;
|
|
55
|
+
readonly width?: number;
|
|
56
|
+
readonly height?: number;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Описывает pattern fill descriptor.
|
|
60
|
+
*/
|
|
61
|
+
export interface NovaPatternAssetDescriptor {
|
|
62
|
+
readonly type: 'pattern';
|
|
63
|
+
readonly source: CanvasImageSource | string;
|
|
64
|
+
readonly repeat: Exclude<NovaAssetFillMode, 'stretch'>;
|
|
65
|
+
readonly width?: number;
|
|
66
|
+
readonly height?: number;
|
|
67
|
+
readonly scale?: number;
|
|
68
|
+
readonly offsetX?: number;
|
|
69
|
+
readonly offsetY?: number;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Описывает stripe fill descriptor.
|
|
73
|
+
*/
|
|
74
|
+
export interface NovaStripeAssetDescriptor {
|
|
75
|
+
readonly type: 'stripe';
|
|
76
|
+
readonly bgColor: string;
|
|
77
|
+
readonly stripeColor: string;
|
|
78
|
+
readonly stripeWidth: number;
|
|
79
|
+
readonly angle: number;
|
|
80
|
+
readonly sizeK: number;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Описывает stop gradient fill descriptor.
|
|
84
|
+
*/
|
|
85
|
+
export interface NovaGradientStop {
|
|
86
|
+
readonly offset: number;
|
|
87
|
+
readonly color: string;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Описывает stop linear-gradient fill descriptor.
|
|
91
|
+
*/
|
|
92
|
+
export type NovaLinearGradientStop = NovaGradientStop;
|
|
93
|
+
/**
|
|
94
|
+
* Описывает linear-gradient fill descriptor.
|
|
95
|
+
*/
|
|
96
|
+
export interface NovaLinearGradientAssetDescriptor {
|
|
97
|
+
readonly type: 'linear-gradient';
|
|
98
|
+
readonly from: string;
|
|
99
|
+
readonly to: string;
|
|
100
|
+
readonly angle: number;
|
|
101
|
+
readonly stops?: ReadonlyArray<NovaLinearGradientStop>;
|
|
102
|
+
readonly size?: number;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Описывает radial-gradient fill descriptor.
|
|
106
|
+
*/
|
|
107
|
+
export interface NovaRadialGradientAssetDescriptor {
|
|
108
|
+
readonly type: 'radial-gradient';
|
|
109
|
+
readonly inner: string;
|
|
110
|
+
readonly outer: string;
|
|
111
|
+
readonly centerX: number;
|
|
112
|
+
readonly centerY: number;
|
|
113
|
+
readonly radiusX: number;
|
|
114
|
+
readonly radiusY: number;
|
|
115
|
+
readonly stops?: ReadonlyArray<NovaGradientStop>;
|
|
116
|
+
readonly size?: number;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Описывает conic-gradient fill descriptor.
|
|
120
|
+
*/
|
|
121
|
+
export interface NovaConicGradientAssetDescriptor {
|
|
122
|
+
readonly type: 'conic-gradient';
|
|
123
|
+
readonly from: string;
|
|
124
|
+
readonly to: string;
|
|
125
|
+
readonly centerX: number;
|
|
126
|
+
readonly centerY: number;
|
|
127
|
+
readonly startAngle: number;
|
|
128
|
+
readonly stops?: ReadonlyArray<NovaGradientStop>;
|
|
129
|
+
readonly size?: number;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Описывает noise fill descriptor.
|
|
133
|
+
*/
|
|
134
|
+
export interface NovaNoiseAssetDescriptor {
|
|
135
|
+
readonly type: 'noise';
|
|
136
|
+
readonly baseColor: string;
|
|
137
|
+
readonly noiseColor: string;
|
|
138
|
+
readonly opacity: number;
|
|
139
|
+
readonly density: number;
|
|
140
|
+
readonly seed: number;
|
|
141
|
+
readonly size?: number;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Описывает точку mesh-gradient.
|
|
145
|
+
*/
|
|
146
|
+
export interface NovaMeshGradientPoint {
|
|
147
|
+
readonly x: number;
|
|
148
|
+
readonly y: number;
|
|
149
|
+
readonly color: string;
|
|
150
|
+
readonly radius?: number;
|
|
151
|
+
readonly opacity?: number;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Описывает mesh-gradient fill descriptor.
|
|
155
|
+
*/
|
|
156
|
+
export interface NovaMeshGradientAssetDescriptor {
|
|
157
|
+
readonly type: 'mesh-gradient';
|
|
158
|
+
readonly background: string;
|
|
159
|
+
readonly points: ReadonlyArray<NovaMeshGradientPoint>;
|
|
160
|
+
readonly size?: number;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Описывает nine-slice image descriptor.
|
|
164
|
+
*/
|
|
165
|
+
export interface NovaNineSliceImageAssetDescriptor {
|
|
166
|
+
readonly type: 'nine-slice-image';
|
|
167
|
+
readonly source: CanvasImageSource | string;
|
|
168
|
+
readonly slice: NovaNineSliceInsets;
|
|
169
|
+
readonly width?: number;
|
|
170
|
+
readonly height?: number;
|
|
171
|
+
readonly centerMode: 'stretch' | 'repeat';
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Описывает font descriptor.
|
|
175
|
+
*/
|
|
176
|
+
export interface NovaFontAssetDescriptor {
|
|
177
|
+
readonly type: 'font';
|
|
178
|
+
readonly family: string;
|
|
179
|
+
readonly src: string;
|
|
180
|
+
readonly weight?: string;
|
|
181
|
+
readonly style?: string;
|
|
182
|
+
readonly display?: 'auto' | 'block' | 'swap' | 'fallback' | 'optional';
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Описывает asset descriptor.
|
|
186
|
+
*/
|
|
187
|
+
export type NovaAssetDescriptor = NovaSvgAssetDescriptor | NovaImageAssetDescriptor | NovaCanvasAssetDescriptor | NovaPatternAssetDescriptor | NovaStripeAssetDescriptor | NovaLinearGradientAssetDescriptor | NovaRadialGradientAssetDescriptor | NovaConicGradientAssetDescriptor | NovaNoiseAssetDescriptor | NovaMeshGradientAssetDescriptor | NovaNineSliceImageAssetDescriptor | NovaFontAssetDescriptor;
|
|
188
|
+
/**
|
|
189
|
+
* Описывает input bundle assets.
|
|
190
|
+
*/
|
|
191
|
+
export interface NovaAssetBundleInput {
|
|
192
|
+
readonly icons?: Record<string, NovaAssetDescriptor>;
|
|
193
|
+
readonly images?: Record<string, NovaAssetDescriptor>;
|
|
194
|
+
readonly fills?: Record<string, NovaAssetDescriptor>;
|
|
195
|
+
readonly fonts?: Record<string, NovaAssetDescriptor>;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Описывает нормализованный asset record.
|
|
199
|
+
*/
|
|
200
|
+
export interface NovaAssetRecord<K extends NovaAssetKind = NovaAssetKind> {
|
|
201
|
+
readonly ref: NovaAssetRef<K>;
|
|
202
|
+
readonly descriptor: NovaAssetDescriptor;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Описывает bundle с typed refs.
|
|
206
|
+
*/
|
|
207
|
+
export interface NovaAssetBundle<I extends Record<string, NovaAssetDescriptor> = Record<string, NovaAssetDescriptor>, F extends Record<string, NovaAssetDescriptor> = Record<string, NovaAssetDescriptor>, M extends Record<string, NovaAssetDescriptor> = Record<string, NovaAssetDescriptor>, T extends Record<string, NovaAssetDescriptor> = Record<string, NovaAssetDescriptor>> {
|
|
208
|
+
readonly namespace: string;
|
|
209
|
+
readonly icons: {
|
|
210
|
+
readonly [K in keyof I]: NovaAssetRef<'icon'>;
|
|
211
|
+
};
|
|
212
|
+
readonly fills: {
|
|
213
|
+
readonly [K in keyof F]: NovaAssetRef<'fill'>;
|
|
214
|
+
};
|
|
215
|
+
readonly images: {
|
|
216
|
+
readonly [K in keyof M]: NovaAssetRef<'image'>;
|
|
217
|
+
};
|
|
218
|
+
readonly fonts: {
|
|
219
|
+
readonly [K in keyof T]: NovaAssetRef<'font'>;
|
|
220
|
+
};
|
|
221
|
+
readonly records: ReadonlyMap<string, NovaAssetRecord>;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Описывает resolved drawable asset.
|
|
225
|
+
*/
|
|
226
|
+
export interface NovaResolvedAsset<K extends NovaAssetKind = NovaAssetKind> {
|
|
227
|
+
readonly ref: NovaAssetRef<K>;
|
|
228
|
+
readonly descriptor: NovaAssetDescriptor;
|
|
229
|
+
readonly source?: CanvasImageSource;
|
|
230
|
+
readonly ready: boolean;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Описывает drawable asset input.
|
|
234
|
+
*/
|
|
235
|
+
export type NovaAssetDrawableInput = NovaAssetRef | CanvasImageSource | string | undefined | null;
|
|
236
|
+
/**
|
|
237
|
+
* Проверяет ref Nova asset.
|
|
238
|
+
*/
|
|
239
|
+
export declare function isNovaAssetRef(value: unknown): value is NovaAssetRef;
|
|
240
|
+
/**
|
|
241
|
+
* Управляет scoped/global Nova assets без exposing atlas internals.
|
|
242
|
+
*/
|
|
243
|
+
export declare class NovaAssetRegistry {
|
|
244
|
+
private readonly _parent?;
|
|
245
|
+
private readonly _onUpdate?;
|
|
246
|
+
private readonly _records;
|
|
247
|
+
private readonly _materialized;
|
|
248
|
+
private readonly _recordUseCounts;
|
|
249
|
+
private readonly _fontFaces;
|
|
250
|
+
/**
|
|
251
|
+
* Создает registry.
|
|
252
|
+
*/
|
|
253
|
+
constructor(_parent?: NovaAssetRegistry | undefined, _onUpdate?: (() => void) | undefined);
|
|
254
|
+
/**
|
|
255
|
+
* Подключает bundle в текущий scope.
|
|
256
|
+
*/
|
|
257
|
+
use(bundle: NovaAssetBundle): void;
|
|
258
|
+
/**
|
|
259
|
+
* Удаляет bundle из текущего scope.
|
|
260
|
+
*/
|
|
261
|
+
unuse(bundle: NovaAssetBundle): void;
|
|
262
|
+
/**
|
|
263
|
+
* Возвращает asset record по ref или id.
|
|
264
|
+
*/
|
|
265
|
+
resolveRecord(input: NovaAssetRef | string | undefined | null): NovaAssetRecord | undefined;
|
|
266
|
+
/**
|
|
267
|
+
* Возвращает resolved asset.
|
|
268
|
+
*/
|
|
269
|
+
resolve(input: NovaAssetRef | string | undefined | null): NovaResolvedAsset | undefined;
|
|
270
|
+
/**
|
|
271
|
+
* Возвращает drawable source для ref/source.
|
|
272
|
+
*/
|
|
273
|
+
resolveDrawable(input: NovaAssetDrawableInput): CanvasImageSource | undefined;
|
|
274
|
+
/**
|
|
275
|
+
* Возвращает fill mode для drawable asset.
|
|
276
|
+
*/
|
|
277
|
+
resolveDrawableFillMode(input: NovaAssetDrawableInput): NovaAssetFillMode;
|
|
278
|
+
/**
|
|
279
|
+
* Возвращает stable slice metadata для nine-slice image.
|
|
280
|
+
*/
|
|
281
|
+
resolveNineSlice(input: NovaAssetRef<'image'> | string | undefined | null): NovaNineSliceImageAssetDescriptor | undefined;
|
|
282
|
+
/**
|
|
283
|
+
* Возвращает стабильный drawable key.
|
|
284
|
+
*/
|
|
285
|
+
resolveDrawableKey(prefix: string, input: NovaAssetDrawableInput, fallback: (source: CanvasImageSource) => string): string;
|
|
286
|
+
/**
|
|
287
|
+
* Возвращает materialized asset.
|
|
288
|
+
*/
|
|
289
|
+
private _resolveMaterialization;
|
|
290
|
+
/**
|
|
291
|
+
* Возвращает версию materialized source для invalidation texture caches.
|
|
292
|
+
*/
|
|
293
|
+
private _resolveMaterializationVersion;
|
|
294
|
+
/**
|
|
295
|
+
* Создает canvas с stripe fill.
|
|
296
|
+
*/
|
|
297
|
+
private _createStripeCanvas;
|
|
298
|
+
/**
|
|
299
|
+
* Создает canvas с linear-gradient fill.
|
|
300
|
+
*/
|
|
301
|
+
private _createLinearGradientCanvas;
|
|
302
|
+
/**
|
|
303
|
+
* Создает canvas с radial-gradient fill.
|
|
304
|
+
*/
|
|
305
|
+
private _createRadialGradientCanvas;
|
|
306
|
+
/**
|
|
307
|
+
* Создает canvas с conic-gradient fill.
|
|
308
|
+
*/
|
|
309
|
+
private _createConicGradientCanvas;
|
|
310
|
+
/**
|
|
311
|
+
* Создает canvas с procedural noise fill.
|
|
312
|
+
*/
|
|
313
|
+
private _createNoiseCanvas;
|
|
314
|
+
/**
|
|
315
|
+
* Создает canvas с mesh-gradient fill.
|
|
316
|
+
*/
|
|
317
|
+
private _createMeshGradientCanvas;
|
|
318
|
+
/**
|
|
319
|
+
* Создает materialization для image asset.
|
|
320
|
+
*/
|
|
321
|
+
private _createImageMaterialization;
|
|
322
|
+
/**
|
|
323
|
+
* Создает materialization для pattern fill.
|
|
324
|
+
*/
|
|
325
|
+
private _createPatternMaterialization;
|
|
326
|
+
/**
|
|
327
|
+
* Создает materialization для nine-slice image.
|
|
328
|
+
*/
|
|
329
|
+
private _createNineSliceMaterialization;
|
|
330
|
+
/**
|
|
331
|
+
* Создает materialization для font asset.
|
|
332
|
+
*/
|
|
333
|
+
private _createFontMaterialization;
|
|
334
|
+
/**
|
|
335
|
+
* Создает materialization для SVG asset.
|
|
336
|
+
*/
|
|
337
|
+
private _createSvgMaterialization;
|
|
338
|
+
/**
|
|
339
|
+
* Создает browser-loadable SVG image source из raw svg или data URL.
|
|
340
|
+
*/
|
|
341
|
+
private _createSvgImageSource;
|
|
342
|
+
/**
|
|
343
|
+
* Нормализует raw svg/data URL и применяет currentColor override.
|
|
344
|
+
*/
|
|
345
|
+
private _resolveSvgSource;
|
|
346
|
+
/**
|
|
347
|
+
* Создает canvas pattern source с учетом размера и scale.
|
|
348
|
+
*/
|
|
349
|
+
private _createPatternCanvas;
|
|
350
|
+
/**
|
|
351
|
+
* Создает image-backed materialization для source или url.
|
|
352
|
+
*/
|
|
353
|
+
private _createImageBackedMaterialization;
|
|
354
|
+
/**
|
|
355
|
+
* Снимает зарегистрированный FontFace из document.fonts.
|
|
356
|
+
*/
|
|
357
|
+
private _unuseFontFace;
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Создает asset bundle.
|
|
361
|
+
*/
|
|
362
|
+
export declare function defineNovaAssets<I extends Record<string, NovaAssetDescriptor> = Record<string, NovaAssetDescriptor>, F extends Record<string, NovaAssetDescriptor> = Record<string, NovaAssetDescriptor>, M extends Record<string, NovaAssetDescriptor> = Record<string, NovaAssetDescriptor>, T extends Record<string, NovaAssetDescriptor> = Record<string, NovaAssetDescriptor>>(namespace: string, input: {
|
|
363
|
+
readonly icons?: I;
|
|
364
|
+
readonly fills?: F;
|
|
365
|
+
readonly images?: M;
|
|
366
|
+
readonly fonts?: T;
|
|
367
|
+
}): NovaAssetBundle<I, F, M, T>;
|
|
368
|
+
/**
|
|
369
|
+
* Создает SVG descriptor.
|
|
370
|
+
*/
|
|
371
|
+
export declare function createNovaSvgAsset(source: string, options: {
|
|
372
|
+
width: number;
|
|
373
|
+
height: number;
|
|
374
|
+
color?: string;
|
|
375
|
+
pixelRatio?: NovaSvgAssetPixelRatio;
|
|
376
|
+
}): NovaSvgAssetDescriptor;
|
|
377
|
+
/**
|
|
378
|
+
* Создает image descriptor.
|
|
379
|
+
*/
|
|
380
|
+
export declare function createNovaImageAsset(source: CanvasImageSource | string, options?: {
|
|
381
|
+
width?: number;
|
|
382
|
+
height?: number;
|
|
383
|
+
}): NovaImageAssetDescriptor;
|
|
384
|
+
/**
|
|
385
|
+
* Создает canvas descriptor.
|
|
386
|
+
*/
|
|
387
|
+
export declare function createNovaCanvasAsset(source: HTMLCanvasElement | OffscreenCanvas, options?: {
|
|
388
|
+
width?: number;
|
|
389
|
+
height?: number;
|
|
390
|
+
}): NovaCanvasAssetDescriptor;
|
|
391
|
+
/**
|
|
392
|
+
* Создает pattern descriptor.
|
|
393
|
+
*/
|
|
394
|
+
export declare function createNovaPatternAsset(source: CanvasImageSource | string, options?: {
|
|
395
|
+
repeat?: Exclude<NovaAssetFillMode, 'stretch'>;
|
|
396
|
+
width?: number;
|
|
397
|
+
height?: number;
|
|
398
|
+
scale?: number;
|
|
399
|
+
offsetX?: number;
|
|
400
|
+
offsetY?: number;
|
|
401
|
+
}): NovaPatternAssetDescriptor;
|
|
402
|
+
/**
|
|
403
|
+
* Создает stripe descriptor.
|
|
404
|
+
*/
|
|
405
|
+
export declare function createNovaStripeAsset(options: {
|
|
406
|
+
bgColor: string;
|
|
407
|
+
stripeColor: string;
|
|
408
|
+
stripeWidth: number;
|
|
409
|
+
angle?: number;
|
|
410
|
+
sizeK?: number;
|
|
411
|
+
}): NovaStripeAssetDescriptor;
|
|
412
|
+
/**
|
|
413
|
+
* Создает linear-gradient descriptor.
|
|
414
|
+
*/
|
|
415
|
+
export declare function createNovaLinearGradientAsset(options: {
|
|
416
|
+
from: string;
|
|
417
|
+
to: string;
|
|
418
|
+
angle?: number;
|
|
419
|
+
stops?: ReadonlyArray<NovaLinearGradientStop>;
|
|
420
|
+
size?: number;
|
|
421
|
+
}): NovaLinearGradientAssetDescriptor;
|
|
422
|
+
/**
|
|
423
|
+
* Создает radial-gradient descriptor.
|
|
424
|
+
*/
|
|
425
|
+
export declare function createNovaRadialGradientAsset(options: {
|
|
426
|
+
inner: string;
|
|
427
|
+
outer: string;
|
|
428
|
+
centerX?: number;
|
|
429
|
+
centerY?: number;
|
|
430
|
+
radiusX?: number;
|
|
431
|
+
radiusY?: number;
|
|
432
|
+
stops?: ReadonlyArray<NovaGradientStop>;
|
|
433
|
+
size?: number;
|
|
434
|
+
}): NovaRadialGradientAssetDescriptor;
|
|
435
|
+
/**
|
|
436
|
+
* Создает conic-gradient descriptor.
|
|
437
|
+
*/
|
|
438
|
+
export declare function createNovaConicGradientAsset(options: {
|
|
439
|
+
from: string;
|
|
440
|
+
to: string;
|
|
441
|
+
centerX?: number;
|
|
442
|
+
centerY?: number;
|
|
443
|
+
startAngle?: number;
|
|
444
|
+
stops?: ReadonlyArray<NovaGradientStop>;
|
|
445
|
+
size?: number;
|
|
446
|
+
}): NovaConicGradientAssetDescriptor;
|
|
447
|
+
/**
|
|
448
|
+
* Создает noise descriptor.
|
|
449
|
+
*/
|
|
450
|
+
export declare function createNovaNoiseAsset(options?: {
|
|
451
|
+
baseColor?: string;
|
|
452
|
+
noiseColor?: string;
|
|
453
|
+
opacity?: number;
|
|
454
|
+
density?: number;
|
|
455
|
+
seed?: number;
|
|
456
|
+
size?: number;
|
|
457
|
+
}): NovaNoiseAssetDescriptor;
|
|
458
|
+
/**
|
|
459
|
+
* Создает mesh-gradient descriptor.
|
|
460
|
+
*/
|
|
461
|
+
export declare function createNovaMeshGradientAsset(options: {
|
|
462
|
+
background?: string;
|
|
463
|
+
points: ReadonlyArray<NovaMeshGradientPoint>;
|
|
464
|
+
size?: number;
|
|
465
|
+
}): NovaMeshGradientAssetDescriptor;
|
|
466
|
+
/**
|
|
467
|
+
* Создает nine-slice image descriptor.
|
|
468
|
+
*/
|
|
469
|
+
export declare function createNovaNineSliceImageAsset(source: CanvasImageSource | string, options: {
|
|
470
|
+
slice: number | Partial<NovaNineSliceInsets>;
|
|
471
|
+
width?: number;
|
|
472
|
+
height?: number;
|
|
473
|
+
centerMode?: 'stretch' | 'repeat';
|
|
474
|
+
}): NovaNineSliceImageAssetDescriptor;
|
|
475
|
+
/**
|
|
476
|
+
* Создает font descriptor.
|
|
477
|
+
*/
|
|
478
|
+
export declare function createNovaFontAsset(options: {
|
|
479
|
+
family: string;
|
|
480
|
+
src: string;
|
|
481
|
+
weight?: string;
|
|
482
|
+
style?: string;
|
|
483
|
+
display?: NovaFontAssetDescriptor['display'];
|
|
484
|
+
}): NovaFontAssetDescriptor;
|
|
485
|
+
/**
|
|
486
|
+
* Возвращает fill mode по descriptor.
|
|
487
|
+
*/
|
|
488
|
+
export declare function resolveNovaAssetFillMode(descriptor: NovaAssetDescriptor): NovaAssetFillMode;
|
|
489
|
+
/**
|
|
490
|
+
* Описывает публичный Nova assets facade.
|
|
491
|
+
*/
|
|
492
|
+
export declare const NovaAssets: Readonly<{
|
|
493
|
+
global: NovaAssetRegistry;
|
|
494
|
+
define: typeof defineNovaAssets;
|
|
495
|
+
svg: typeof createNovaSvgAsset;
|
|
496
|
+
image: typeof createNovaImageAsset;
|
|
497
|
+
canvas: typeof createNovaCanvasAsset;
|
|
498
|
+
pattern: typeof createNovaPatternAsset;
|
|
499
|
+
stripe: typeof createNovaStripeAsset;
|
|
500
|
+
linearGradient: typeof createNovaLinearGradientAsset;
|
|
501
|
+
radialGradient: typeof createNovaRadialGradientAsset;
|
|
502
|
+
conicGradient: typeof createNovaConicGradientAsset;
|
|
503
|
+
noise: typeof createNovaNoiseAsset;
|
|
504
|
+
meshGradient: typeof createNovaMeshGradientAsset;
|
|
505
|
+
nineSliceImage: typeof createNovaNineSliceImageAsset;
|
|
506
|
+
font: typeof createNovaFontAsset;
|
|
507
|
+
/**
|
|
508
|
+
* Выполняет действие ref в рамках ответственности текущего класса.
|
|
509
|
+
*/
|
|
510
|
+
ref<K extends NovaAssetKind>(namespace: string, kind: K, name: string): NovaAssetRef<K>;
|
|
511
|
+
}>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { NovaNode } from '../tree/NovaNode';
|
|
2
|
+
/**
|
|
3
|
+
* Описывает обработчик Nova command.
|
|
4
|
+
*/
|
|
5
|
+
export type NovaCommandHandler<TPayload = unknown, TResult = unknown> = (payload: TPayload) => TResult;
|
|
6
|
+
/**
|
|
7
|
+
* Описывает target команды.
|
|
8
|
+
*/
|
|
9
|
+
export type NovaCommandTarget = NovaNode<any> | {
|
|
10
|
+
componentId?: string;
|
|
11
|
+
} | string;
|
|
12
|
+
/**
|
|
13
|
+
* Описывает параметры регистрации команды.
|
|
14
|
+
*/
|
|
15
|
+
export interface NovaCommandRegisterOptions {
|
|
16
|
+
owner?: NovaCommandTarget;
|
|
17
|
+
scope?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Описывает параметры запуска команды.
|
|
21
|
+
*/
|
|
22
|
+
export interface NovaCommandRunOptions {
|
|
23
|
+
target?: NovaCommandTarget;
|
|
24
|
+
scope?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Хранит Nova commands и разрешает scoped/targeted запуск.
|
|
28
|
+
*/
|
|
29
|
+
export declare class NovaCommandBus {
|
|
30
|
+
private readonly _entries;
|
|
31
|
+
private _order;
|
|
32
|
+
/**
|
|
33
|
+
* Регистрирует command handler.
|
|
34
|
+
*/
|
|
35
|
+
register<TPayload = unknown, TResult = unknown>(id: string, handler: NovaCommandHandler<TPayload, TResult>, options?: NovaCommandRegisterOptions): () => void;
|
|
36
|
+
/**
|
|
37
|
+
* Запускает command handler.
|
|
38
|
+
*/
|
|
39
|
+
run<TPayload = unknown, TResult = unknown>(id: string, payload?: TPayload, options?: NovaCommandRunOptions): TResult;
|
|
40
|
+
/**
|
|
41
|
+
* Возвращает количество handlers для команды.
|
|
42
|
+
*/
|
|
43
|
+
count(id?: string): number;
|
|
44
|
+
/**
|
|
45
|
+
* Выбирает единственный handler для запуска.
|
|
46
|
+
*/
|
|
47
|
+
private _resolveEntry;
|
|
48
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { EventList } from '@endge/utils';
|
|
2
|
+
import { NovaComponentDescriptor } from '../../../domain/types/component.types';
|
|
3
|
+
import { NovaMotionOptions, NovaMotionPlayback } from '../../../domain/types/motion.types';
|
|
4
|
+
import { NovaApp } from '../app/NovaApp';
|
|
5
|
+
import { NovaSyncPortMap } from '../sync/nova-sync.types';
|
|
6
|
+
import { NovaSurface } from '../tree/NovaSurface';
|
|
7
|
+
import { NovaNode } from '../tree/NovaNode';
|
|
8
|
+
/**
|
|
9
|
+
* Описывает runtime-сущность NovaComponentNode.
|
|
10
|
+
*/
|
|
11
|
+
export declare abstract class NovaComponentNode<TProps extends Record<string, any> = Record<string, any>, TApi = unknown, TEvents extends Record<string, unknown> = Record<string, unknown>, TSchema = TProps, E extends EventList = Record<string, any>> extends NovaNode<E> {
|
|
12
|
+
readonly descriptor: NovaComponentDescriptor<TProps, TApi, TEvents, TSchema>;
|
|
13
|
+
readonly componentId: string;
|
|
14
|
+
protected props: TProps;
|
|
15
|
+
private _unregisterSyncPorts?;
|
|
16
|
+
private _commandDisposers;
|
|
17
|
+
private _pendingWatcherChanges;
|
|
18
|
+
/**
|
|
19
|
+
* Создает instance и подготавливает внутреннее состояние.
|
|
20
|
+
*/
|
|
21
|
+
constructor(app: NovaApp<E>, surface: NovaSurface<E>, descriptor: NovaComponentDescriptor<TProps, TApi, TEvents, TSchema>, props: TProps, options?: {
|
|
22
|
+
componentId?: string;
|
|
23
|
+
});
|
|
24
|
+
/**
|
|
25
|
+
* Обновляет props.
|
|
26
|
+
*/
|
|
27
|
+
setProps(patch: Partial<TProps>): this;
|
|
28
|
+
/**
|
|
29
|
+
* Возвращает props.
|
|
30
|
+
*/
|
|
31
|
+
getProps(): Readonly<TProps>;
|
|
32
|
+
/**
|
|
33
|
+
* Возвращает api.
|
|
34
|
+
*/
|
|
35
|
+
getApi(): TApi;
|
|
36
|
+
/**
|
|
37
|
+
* Выполняет внутреннюю операцию dispose.
|
|
38
|
+
*/
|
|
39
|
+
dispose(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Возвращает sync-порты runtime component. По умолчанию descriptor fields
|
|
42
|
+
* становятся безопасными prop-портами.
|
|
43
|
+
*/
|
|
44
|
+
getSyncPorts(): NovaSyncPortMap;
|
|
45
|
+
/**
|
|
46
|
+
* Регистрирует component ports в app-level sync scope после mount.
|
|
47
|
+
*/
|
|
48
|
+
protected onMount(): void;
|
|
49
|
+
/**
|
|
50
|
+
* Снимает component ports при unmount.
|
|
51
|
+
*/
|
|
52
|
+
protected onUnmount(): void;
|
|
53
|
+
/**
|
|
54
|
+
* Выполняет watchers update-фазы перед пользовательским update.
|
|
55
|
+
*/
|
|
56
|
+
update(): void;
|
|
57
|
+
/**
|
|
58
|
+
* Выполняет watchers render-фазы перед пользовательским render.
|
|
59
|
+
*/
|
|
60
|
+
render(): void;
|
|
61
|
+
/**
|
|
62
|
+
* Уведомляет sync scope об изменении конкретного порта.
|
|
63
|
+
*/
|
|
64
|
+
notifySyncPortChanged(name: string, value?: unknown): void;
|
|
65
|
+
/**
|
|
66
|
+
* Обрабатывает событие props changed.
|
|
67
|
+
*/
|
|
68
|
+
protected onPropsChanged(_changedKeys: Array<keyof TProps>): void;
|
|
69
|
+
/**
|
|
70
|
+
* Выполняет внутренний шаг notifySyncPortsChanged для NovaComponentNode.
|
|
71
|
+
*/
|
|
72
|
+
private _notifySyncPortsChanged;
|
|
73
|
+
/**
|
|
74
|
+
* Выполняет внутреннюю операцию transition to.
|
|
75
|
+
*/
|
|
76
|
+
protected transitionTo(patch: Partial<TProps>, options?: NovaMotionOptions): NovaMotionPlayback;
|
|
77
|
+
/**
|
|
78
|
+
* Вычисляет dirty.
|
|
79
|
+
*/
|
|
80
|
+
private _resolveDirty;
|
|
81
|
+
/**
|
|
82
|
+
* Читает watched paths перед изменением props.
|
|
83
|
+
*/
|
|
84
|
+
private _readWatcherValues;
|
|
85
|
+
/**
|
|
86
|
+
* Собирает changed watched paths после изменения props.
|
|
87
|
+
*/
|
|
88
|
+
private _collectWatcherChanges;
|
|
89
|
+
/**
|
|
90
|
+
* Выполняет immediate watchers.
|
|
91
|
+
*/
|
|
92
|
+
private _runImmediateWatchers;
|
|
93
|
+
/**
|
|
94
|
+
* Выполняет watchers указанной фазы.
|
|
95
|
+
*/
|
|
96
|
+
private _runWatchers;
|
|
97
|
+
/**
|
|
98
|
+
* Вызывает watcher method.
|
|
99
|
+
*/
|
|
100
|
+
private _callWatcher;
|
|
101
|
+
/**
|
|
102
|
+
* Регистрирует command handlers.
|
|
103
|
+
*/
|
|
104
|
+
private _registerCommands;
|
|
105
|
+
/**
|
|
106
|
+
* Снимает command handlers.
|
|
107
|
+
*/
|
|
108
|
+
private _disposeCommands;
|
|
109
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { NovaRuntimeComponentNode } from '../../../domain/types/component.types';
|
|
2
|
+
/**
|
|
3
|
+
* Хранит node components и schema components, доступные runtime Nova.
|
|
4
|
+
*/
|
|
5
|
+
export declare class NovaComponentRegistry {
|
|
6
|
+
private readonly _nodes;
|
|
7
|
+
/**
|
|
8
|
+
* Выполняет внутреннюю операцию register.
|
|
9
|
+
*/
|
|
10
|
+
register(node: NovaRuntimeComponentNode): void;
|
|
11
|
+
/**
|
|
12
|
+
* Выполняет внутреннюю операцию unregister.
|
|
13
|
+
*/
|
|
14
|
+
unregister(node: NovaRuntimeComponentNode): void;
|
|
15
|
+
/**
|
|
16
|
+
* Выполняет внутреннюю операцию get.
|
|
17
|
+
*/
|
|
18
|
+
get<TNode extends NovaRuntimeComponentNode = NovaRuntimeComponentNode>(id: string): TNode | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Выполняет внутреннюю операцию require.
|
|
21
|
+
*/
|
|
22
|
+
require<TNode extends NovaRuntimeComponentNode = NovaRuntimeComponentNode>(id: string): TNode;
|
|
23
|
+
/**
|
|
24
|
+
* Выполняет внутреннюю операцию api.
|
|
25
|
+
*/
|
|
26
|
+
api<TApi>(id: string): TApi | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Выполняет внутреннюю операцию require api.
|
|
29
|
+
*/
|
|
30
|
+
requireApi<TApi>(id: string): TApi;
|
|
31
|
+
/**
|
|
32
|
+
* Очищает внутреннее состояние.
|
|
33
|
+
*/
|
|
34
|
+
clear(): void;
|
|
35
|
+
}
|