@clypra-studio/engine 1.0.7 → 1.2.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/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { S as SceneDocument, K as Keyframe, T as TextEffectConfig, a as StyleRecipe, P as Preset, E as EffectLayer, A as AnimTrack, b as TextEffectDefinition, G as GlowLayer, c as GradientStop, d as TextTemplate, e as TemplateLayer, f as TemplateCategory, g as AnimatableValue, h as TemplateEasingFunction, i as TemplateKeyframe } from './index-lNWEWqab.js';
2
- export { j as AnimationPreset, C as CUSTOM_ENGINE_IDS, k as CompositorFromScene, l as CompositorSettings, m as CustomEngineId, D as DEFAULT_CANVAS_HEIGHT, n as DEFAULT_CANVAS_WIDTH, o as DEFAULT_DURATION, p as DEFAULT_FONT_SIZE, q as DEFAULT_FPS, r as ENGINE_ID_TO_LEGACY, s as EffectBevel, t as EffectFill, u as EffectFullDefinition, v as EffectGlow, w as EffectIndexItem, x as EffectLayerType, y as EffectPanel, z as EffectShadow, B as EffectStack, F as EffectStroke, H as EvaluateOptions, I as EvaluatedTextLayer, J as FontDescriptor, L as FontLoadResult, M as FontLoader, N as FontVariant, O as LEGACY_RENDERER_MAP, Q as LayerAnimation, R as LayerTarget, U as SCENE_VERSION, V as SceneCanvas, W as SceneText, X as TemplateImageLayer, Y as TemplateShapeLayer, Z as TemplateTextLayer, _ as TextEffectRenderer, $ as Timeline, a0 as WebGLCompositor, a1 as _buildConfig, a2 as advanceSceneTime, a3 as builtInPresets, a4 as checkFontVariant, a5 as createEmptyScene, a6 as defaultConfig, a7 as disposeSharedCompositor, a8 as ensureFontsLoaded, a9 as evaluateConfig, aa as evaluateScene, ab as getFontLoader, ac as getSceneTime, ad as initializeFontSystem, ae as injectFontVariantRules, af as layerToTextEffectConfig, ag as mergeSceneIntoConfig, ah as newLayerId, ai as renderTextEffectCore, aj as resetFontLoader, ak as resetSceneTime, al as resolveCustomEngineId, am as resolveFontFamilyName, an as sceneToConfig, ao as setSceneTime, ap as syncCompositorFromScene, aq as textEffectConfigToScene } from './index-lNWEWqab.js';
1
+ import { S as SceneDocument, K as Keyframe, T as TextEffectConfig, a as StyleRecipe, P as Preset, E as EffectLayer, A as AnimTrack, b as TextEffectDefinition, G as GlowLayer, c as GradientStop, d as TextTemplate, e as TemplateLayer, f as TemplateCategory, g as AnimatableValue, h as TemplateEasingFunction, i as TemplateKeyframe } from './index-D6GAXDBy.js';
2
+ export { j as AnimationPreset, C as CUSTOM_ENGINE_IDS, k as CanvasBackgroundConfig, l as CompositorFromScene, m as CompositorSettings, n as CustomEngineId, D as DEFAULT_CANVAS_HEIGHT, o as DEFAULT_CANVAS_WIDTH, p as DEFAULT_DURATION, q as DEFAULT_FONT_SIZE, r as DEFAULT_FPS, s as ENGINE_ID_TO_LEGACY, t as EffectBevel, u as EffectFill, v as EffectFullDefinition, w as EffectGlow, x as EffectIndexItem, y as EffectLayerType, z as EffectPanel, B as EffectShadow, F as EffectStack, H as EffectStroke, I as EvaluateOptions, J as EvaluatedTextLayer, L as FontDescriptor, M as FontLoadResult, N as FontLoader, O as FontVariant, Q as LEGACY_RENDERER_MAP, R as LayerAnimation, U as LayerTarget, V as SCENE_VERSION, W as SceneCanvas, X as SceneText, Y as TemplateImageLayer, Z as TemplateShapeLayer, _ as TemplateTextLayer, $ as TextEffectRenderer, a0 as Timeline, a1 as WebGLCompositor, a2 as _buildConfig, a3 as advanceSceneTime, a4 as builtInPresets, a5 as checkFontVariant, a6 as createEmptyScene, a7 as defaultConfig, a8 as disposeSharedCompositor, a9 as ensureFontsLoaded, aa as evaluateConfig, ab as evaluateScene, ac as getFontLoader, ad as getSceneTime, ae as initializeFontSystem, af as injectFontVariantRules, ag as layerToTextEffectConfig, ah as mergeSceneIntoConfig, ai as newLayerId, aj as renderTextEffectCore, ak as resetFontLoader, al as resetSceneTime, am as resolveCustomEngineId, an as resolveFontFamilyName, ao as sceneToConfig, ap as setSceneTime, aq as syncCompositorFromScene, ar as textEffectConfigToScene } from './index-D6GAXDBy.js';
3
3
  import { z } from 'zod';
4
4
  import { PixiRenderer } from './videoEffects/index.js';
5
5
  export { AppliedEffect, AppliedOverlay, BlendMode, CameraEffects, EFFECTS_REGISTRY, EffectCategory, EffectEngine, EffectGraph, EffectMetadata, EffectParameters, EffectPreset, EffectRenderer, EffectRendererType, ExamplePixiEffects, FilterAsset, GraphDefinition, LightEffects, OverlayAsset, VideoEffectApiDefinition, VideoEffectCategory, VideoEffectItem, VideoEffectManifest, VideoEffectState, addNoise, blendColors, clearCanvas, effectMetadataToApi, generateEffectsManifest, getAllEffectsForApi, getEffectByIdForApi, getEffectCategoriesSummary, getEffectMetadata, getEffectPreviewUrl, getEffectRenderer, getEffectsByCategory, getEffectsByCategoryForApi, hexToRgba, rgbaToComponents, searchEffects, searchEffectsForApi, withContext } from './videoEffects/index.js';
@@ -11,7 +11,7 @@ export { NodeCapabilities as EffectCapabilities, NodeRequirements as EffectRequi
11
11
  import { R as RenderBackend, C as CommandBuffer, F as FrameGraph } from './index-Da47I6aX.js';
12
12
  export { a as Command, D as DependencyGraph, E as ExecutionPolicy, b as ExecutionQuality, P as PixiRenderBackend, c as PlaybackDirection, d as PlaybackMode, e as RenderPass, f as ResourceRequest } from './index-Da47I6aX.js';
13
13
  import * as pixi_js from 'pixi.js';
14
- import { Sprite, Texture, Filter } from 'pixi.js';
14
+ import { Sprite, Texture, Filter, Container } from 'pixi.js';
15
15
 
16
16
  /**
17
17
  * Runtime validation schemas for text effect definitions
@@ -24,8 +24,8 @@ declare const GradientStopSchema: z.ZodObject<{
24
24
  }, z.core.$strip>;
25
25
  declare const EffectFillSchema: z.ZodObject<{
26
26
  type: z.ZodEnum<{
27
- linear: "linear";
28
27
  solid: "solid";
28
+ linear: "linear";
29
29
  radial: "radial";
30
30
  pattern: "pattern";
31
31
  none: "none";
@@ -213,8 +213,8 @@ declare const EffectFullDefinitionSchema: z.ZodObject<{
213
213
  }, z.core.$strip>;
214
214
  fills: z.ZodArray<z.ZodObject<{
215
215
  type: z.ZodEnum<{
216
- linear: "linear";
217
216
  solid: "solid";
217
+ linear: "linear";
218
218
  radial: "radial";
219
219
  pattern: "pattern";
220
220
  none: "none";
@@ -389,8 +389,8 @@ declare const TextEffectDefinitionSchema: z.ZodObject<{
389
389
  }, z.core.$strip>;
390
390
  fills: z.ZodArray<z.ZodObject<{
391
391
  type: z.ZodEnum<{
392
- linear: "linear";
393
392
  solid: "solid";
393
+ linear: "linear";
394
394
  radial: "radial";
395
395
  pattern: "pattern";
396
396
  none: "none";
@@ -556,7 +556,7 @@ declare function validateEffectDefinition(data: unknown): z.ZodSafeParseResult<{
556
556
  lineHeight: number;
557
557
  };
558
558
  fills: {
559
- type: "linear" | "solid" | "radial" | "pattern" | "none";
559
+ type: "solid" | "linear" | "radial" | "pattern" | "none";
560
560
  color?: string;
561
561
  gradient?: {
562
562
  angle: number;
@@ -692,7 +692,7 @@ declare function validateEffectDefinitionStrict(data: unknown): {
692
692
  lineHeight: number;
693
693
  };
694
694
  fills: {
695
- type: "linear" | "solid" | "radial" | "pattern" | "none";
695
+ type: "solid" | "linear" | "radial" | "pattern" | "none";
696
696
  color?: string;
697
697
  gradient?: {
698
698
  angle: number;
@@ -827,7 +827,7 @@ declare function validateTextEffectDefinition(data: unknown): z.ZodSafeParseResu
827
827
  lineHeight: number;
828
828
  };
829
829
  fills: {
830
- type: "linear" | "solid" | "radial" | "pattern" | "none";
830
+ type: "solid" | "linear" | "radial" | "pattern" | "none";
831
831
  color?: string;
832
832
  gradient?: {
833
833
  angle: number;
@@ -964,7 +964,7 @@ declare function validateTextEffectDefinitionStrict(data: unknown): {
964
964
  lineHeight: number;
965
965
  };
966
966
  fills: {
967
- type: "linear" | "solid" | "radial" | "pattern" | "none";
967
+ type: "solid" | "linear" | "radial" | "pattern" | "none";
968
968
  color?: string;
969
969
  gradient?: {
970
970
  angle: number;
@@ -8354,10 +8354,10 @@ declare function removeTemplateKeyframe<T>(value: AnimatableValue<T>, time: numb
8354
8354
  *
8355
8355
  * Defines immutable project manifests, clips, tracks, and asset handles.
8356
8356
  */
8357
- type AssetKind = "video" | "audio" | "image" | "font" | "lut" | "model";
8357
+ type AssetKind$1 = "video" | "audio" | "image" | "font" | "lut" | "model";
8358
8358
  interface AssetHandle {
8359
8359
  readonly id: string;
8360
- readonly kind: AssetKind;
8360
+ readonly kind: AssetKind$1;
8361
8361
  readonly sourceUri: string;
8362
8362
  readonly hash: string;
8363
8363
  readonly durationMs: number;
@@ -8945,6 +8945,2424 @@ declare function applyBodyEffectMask(clipId: string, maskData: ImageData | HTMLC
8945
8945
  declare function clearBodyEffectMask(clipId: string): void;
8946
8946
  declare function clearAllBodyEffectMasks(): void;
8947
8947
 
8948
+ interface OverlayLayerConfig {
8949
+ layerId?: string;
8950
+ blendMode?: "normal" | "screen" | "multiply" | "overlay" | "add" | "soft-light" | "hard-light" | "color-dodge" | "color-burn" | "lighten" | "darken" | "difference";
8951
+ opacity?: number;
8952
+ brightness?: number;
8953
+ contrast?: number;
8954
+ saturation?: number;
8955
+ hueShift?: number;
8956
+ tint?: string;
8957
+ scale?: number;
8958
+ offsetX?: number;
8959
+ offsetY?: number;
8960
+ flipH?: boolean;
8961
+ flipV?: boolean;
8962
+ speed?: number;
8963
+ loop?: boolean;
8964
+ timingMode?: "continuous" | "timed";
8965
+ startTime?: number;
8966
+ endTime?: number;
8967
+ fadeIn?: number;
8968
+ fadeOut?: number;
8969
+ }
8970
+ interface OverlayDefinition {
8971
+ id: string;
8972
+ name: string;
8973
+ category: string;
8974
+ url: string;
8975
+ thumbnailUrl?: string;
8976
+ duration: number;
8977
+ width: number;
8978
+ height: number;
8979
+ format: string;
8980
+ blendMode?: OverlayLayerConfig["blendMode"];
8981
+ defaultOpacity?: number;
8982
+ tags?: string[];
8983
+ description?: string;
8984
+ loopable?: boolean;
8985
+ }
8986
+ /**
8987
+ * Render or update an Overlay layer inside a PixiJS Container.
8988
+ * Shared by Clypra Overlay Studio preview and Clypra NLE Editor timeline renderer.
8989
+ */
8990
+ declare function renderOverlayLayerBridged(layer: {
8991
+ layerId: string;
8992
+ x?: number;
8993
+ y?: number;
8994
+ width?: number;
8995
+ height?: number;
8996
+ rotation?: number;
8997
+ opacity?: number;
8998
+ blendMode?: OverlayLayerConfig["blendMode"];
8999
+ sourceTime?: number;
9000
+ overlayConfig?: OverlayLayerConfig;
9001
+ }, videoSource: HTMLVideoElement | HTMLCanvasElement | Texture, frameId: number, container: Container, viewport: {
9002
+ scale: number;
9003
+ offsetX: number;
9004
+ offsetY: number;
9005
+ pixelRatio: number;
9006
+ }, renderOrder?: number, overlayId?: string): Promise<Sprite | null>;
9007
+ /**
9008
+ * Remove an overlay layer bridge from the PixiJS container.
9009
+ */
9010
+ declare function unmountOverlayLayerBridge(layerId: string, container: Container): void;
9011
+ /**
9012
+ * Clean up unseen overlay bridges at end of frame cycle.
9013
+ */
9014
+ declare function endOverlayFrame(frameId: number, container: Container): void;
9015
+ /**
9016
+ * Clear all overlay bridges.
9017
+ */
9018
+ declare function clearAllOverlayBridges(container?: Container): void;
9019
+ /**
9020
+ * HTML5 Canvas 2D fallback compositing utility for external canvas pipelines.
9021
+ */
9022
+ declare function compositeOverlay2D(ctx: CanvasRenderingContext2D, videoElement: HTMLVideoElement | HTMLImageElement | HTMLCanvasElement, config: OverlayLayerConfig, targetWidth: number, targetHeight: number): void;
9023
+ /**
9024
+ * Generate CSS style object for overlay compositing in web apps.
9025
+ */
9026
+ declare function generateOverlayCssStyle(config: OverlayLayerConfig): Record<string, string>;
9027
+ /**
9028
+ * Generate WebGPU uniform layout object for shaders.
9029
+ */
9030
+ declare function generateOverlayWebGpuUniforms(config: OverlayLayerConfig): {
9031
+ uOpacity: number;
9032
+ uBlendMode: "normal" | "color-burn" | "color-dodge" | "darken" | "difference" | "hard-light" | "lighten" | "multiply" | "overlay" | "screen" | "soft-light" | "add";
9033
+ uContrast: number;
9034
+ uSaturation: number;
9035
+ uHueShift: number;
9036
+ uBrightness: number;
9037
+ uScale: number[];
9038
+ uOffset: number[];
9039
+ uFlip: number[];
9040
+ };
9041
+
9042
+ type SmartOverlayType = "list" | "stat" | "comparison" | "quote" | "timeline" | "code" | "social" | "lower-third";
9043
+ interface ListOverlayItem {
9044
+ id: string;
9045
+ text: string;
9046
+ startTime: number;
9047
+ endTime: number;
9048
+ icon?: string;
9049
+ active?: boolean;
9050
+ }
9051
+ interface ListOverlayContent {
9052
+ title: string;
9053
+ items: ListOverlayItem[];
9054
+ }
9055
+ interface StatOverlayContent {
9056
+ value: string;
9057
+ label: string;
9058
+ delta?: string;
9059
+ icon?: string;
9060
+ }
9061
+ interface ComparisonItem {
9062
+ title: string;
9063
+ subtitle?: string;
9064
+ points: string[];
9065
+ color?: string;
9066
+ }
9067
+ interface ComparisonOverlayContent {
9068
+ title: string;
9069
+ left: ComparisonItem;
9070
+ right: ComparisonItem;
9071
+ }
9072
+ interface QuoteOverlayContent {
9073
+ quote: string;
9074
+ author: string;
9075
+ title?: string;
9076
+ avatarUrl?: string;
9077
+ }
9078
+ interface TimelineOverlayNode {
9079
+ id: string;
9080
+ label: string;
9081
+ date?: string;
9082
+ time: number;
9083
+ description?: string;
9084
+ }
9085
+ interface TimelineOverlayContent {
9086
+ title: string;
9087
+ nodes: TimelineOverlayNode[];
9088
+ }
9089
+ interface CodeOverlayContent {
9090
+ title?: string;
9091
+ language: string;
9092
+ code: string;
9093
+ highlightLines?: number[];
9094
+ }
9095
+ interface SocialOverlayContent {
9096
+ platform: "x" | "youtube" | "github" | "instagram" | "tiktok";
9097
+ handle: string;
9098
+ name: string;
9099
+ verified?: boolean;
9100
+ avatarUrl?: string;
9101
+ message?: string;
9102
+ metrics?: string;
9103
+ }
9104
+ interface LowerThirdOverlayContent {
9105
+ name: string;
9106
+ title: string;
9107
+ company?: string;
9108
+ accentColor?: string;
9109
+ }
9110
+ type ListSmartOverlayContent = {
9111
+ type: "list";
9112
+ data: ListOverlayContent;
9113
+ };
9114
+ type StatSmartOverlayContent = {
9115
+ type: "stat";
9116
+ data: StatOverlayContent;
9117
+ };
9118
+ type ComparisonSmartOverlayContent = {
9119
+ type: "comparison";
9120
+ data: ComparisonOverlayContent;
9121
+ };
9122
+ type QuoteSmartOverlayContent = {
9123
+ type: "quote";
9124
+ data: QuoteOverlayContent;
9125
+ };
9126
+ type TimelineSmartOverlayContent = {
9127
+ type: "timeline";
9128
+ data: TimelineOverlayContent;
9129
+ };
9130
+ type CodeSmartOverlayContent = {
9131
+ type: "code";
9132
+ data: CodeOverlayContent;
9133
+ };
9134
+ type SocialSmartOverlayContent = {
9135
+ type: "social";
9136
+ data: SocialOverlayContent;
9137
+ };
9138
+ type LowerThirdSmartOverlayContent = {
9139
+ type: "lower-third";
9140
+ data: LowerThirdOverlayContent;
9141
+ };
9142
+ type SmartOverlayContentUnion = ListSmartOverlayContent | StatSmartOverlayContent | ComparisonSmartOverlayContent | QuoteSmartOverlayContent | TimelineSmartOverlayContent | CodeSmartOverlayContent | SocialSmartOverlayContent | LowerThirdSmartOverlayContent;
9143
+ type SmartOverlayLayout = "full-screen" | "side-panel" | "lower-third" | "top-banner" | "center-card";
9144
+ type SmartOverlayAnimation = "scale-pop" | "slide-stagger" | "typewriter" | "fade" | "glow-pulse";
9145
+ interface SmartOverlayStyle {
9146
+ presetId: string;
9147
+ layout: SmartOverlayLayout;
9148
+ fontFamily: string;
9149
+ fontSize: number;
9150
+ textColor: string;
9151
+ highlightColor: string;
9152
+ cardBackgroundColor: string;
9153
+ cardBorderColor?: string;
9154
+ cardOpacity: number;
9155
+ animationStyle: SmartOverlayAnimation;
9156
+ }
9157
+ interface SmartOverlayClip {
9158
+ id: string;
9159
+ kind: "smart-overlay";
9160
+ overlayType: SmartOverlayType;
9161
+ content: SmartOverlayContentUnion;
9162
+ style: SmartOverlayStyle;
9163
+ startTime: number;
9164
+ duration: number;
9165
+ }
9166
+ interface SmartOverlayPreset {
9167
+ id: string;
9168
+ name: string;
9169
+ category: SmartOverlayType;
9170
+ description: string;
9171
+ previewThumbnail: string;
9172
+ defaultContent: SmartOverlayContentUnion;
9173
+ style: SmartOverlayStyle;
9174
+ }
9175
+
9176
+ declare class SmartOverlayRenderer {
9177
+ private clip;
9178
+ constructor(clip: SmartOverlayClip);
9179
+ updateClip(clip: SmartOverlayClip): void;
9180
+ /**
9181
+ * Universal rendering entry point for drawing any Smart Overlay type on 2D canvas context.
9182
+ */
9183
+ draw(ctx: CanvasRenderingContext2D, relativeTime: number, canvasWidth: number, canvasHeight: number): void;
9184
+ private drawStatCard;
9185
+ private drawQuoteCard;
9186
+ private drawComparisonCard;
9187
+ private drawCodeCard;
9188
+ private drawListCard;
9189
+ private drawTimelineCard;
9190
+ private drawSocialCard;
9191
+ private drawLowerThirdCard;
9192
+ private drawRoundedRect;
9193
+ private wrapText;
9194
+ }
9195
+
9196
+ declare const SMART_OVERLAY_PRESETS: SmartOverlayPreset[];
9197
+
9198
+ interface ScratchElementBlock {
9199
+ id: string;
9200
+ type: "text" | "number" | "badge" | "code" | "avatar" | "bar" | "divider";
9201
+ label: string;
9202
+ slotBinding?: string;
9203
+ defaultValue: string;
9204
+ x: number;
9205
+ y: number;
9206
+ width: number;
9207
+ height: number;
9208
+ fontSize?: number;
9209
+ fontWeight?: "normal" | "bold" | "600" | "800";
9210
+ color?: string;
9211
+ backgroundColor?: string;
9212
+ borderColor?: string;
9213
+ borderRadius?: number;
9214
+ textAlign?: "left" | "center" | "right";
9215
+ }
9216
+ interface ScratchOverlayTemplate {
9217
+ id: string;
9218
+ name: string;
9219
+ category: SmartOverlayType;
9220
+ description: string;
9221
+ width: number;
9222
+ height: number;
9223
+ blocks: ScratchElementBlock[];
9224
+ style: SmartOverlayStyle;
9225
+ }
9226
+ declare function createDefaultScratchBlock(type: ScratchElementBlock["type"]): ScratchElementBlock;
9227
+ declare function createBlankScratchTemplate(category?: SmartOverlayType, empty?: boolean): ScratchOverlayTemplate;
9228
+ declare function convertScratchTemplateToClip(template: ScratchOverlayTemplate): SmartOverlayClip;
9229
+
9230
+ interface SmartOverlayRegistryItem {
9231
+ id: string;
9232
+ name: string;
9233
+ category: string;
9234
+ clipData: SmartOverlayClip;
9235
+ isCustom?: boolean;
9236
+ publishedAt?: string;
9237
+ }
9238
+ declare class SmartOverlayRegistryService {
9239
+ private static instance;
9240
+ private customItems;
9241
+ private constructor();
9242
+ static getInstance(): SmartOverlayRegistryService;
9243
+ private loadLocalCustomItems;
9244
+ private saveLocalCustomItems;
9245
+ getBuiltInPresets(): SmartOverlayPreset[];
9246
+ getCustomItems(): SmartOverlayRegistryItem[];
9247
+ getAllPresets(): SmartOverlayPreset[];
9248
+ saveCustomOverlay(name: string, clipData: SmartOverlayClip): SmartOverlayRegistryItem;
9249
+ deleteCustomOverlay(id: string): void;
9250
+ fetchRemoteCatalog(apiBaseUrl?: string): Promise<SmartOverlayPreset[]>;
9251
+ }
9252
+ declare const smartOverlayRegistry: SmartOverlayRegistryService;
9253
+
9254
+ /**
9255
+ * Declarative Overlay Document Schema
9256
+ * Single Canonical Source of Truth for Scene Graph, Components, Bindings, and Motion
9257
+ */
9258
+ type AssetKind = "image" | "video" | "icon" | "audio" | "font";
9259
+ type AssetSource = "local" | "remote" | "builtin";
9260
+ /**
9261
+ * A stable reference to an asset in the AssetRegistry.
9262
+ * OverlayDocument nodes hold an assetId, never binary data.
9263
+ */
9264
+ interface AssetRef {
9265
+ assetId: string;
9266
+ kind: AssetKind;
9267
+ source: AssetSource;
9268
+ /** Stable external URI — used for remote/cloud assets */
9269
+ uri?: string;
9270
+ metadata?: {
9271
+ width?: number;
9272
+ height?: number;
9273
+ duration?: number;
9274
+ mimeType?: string;
9275
+ originalFilename?: string;
9276
+ };
9277
+ }
9278
+ /**
9279
+ * A catalog-agnostic font reference.
9280
+ * The document doesn't care whether "Inter" came from system, Google Fonts,
9281
+ * an uploaded .woff2, or a future Clypra font service.
9282
+ */
9283
+ interface FontRef {
9284
+ family: string;
9285
+ source: "system" | "builtin" | "uploaded" | "remote";
9286
+ weight: number;
9287
+ style: "normal" | "italic";
9288
+ /** Links to AssetRegistry for uploaded/remote fonts */
9289
+ assetId?: string;
9290
+ /** Direct URL for remote fonts (e.g. Google Fonts CSS) */
9291
+ url?: string;
9292
+ }
9293
+ /**
9294
+ * Document-level declaration of all asset dependencies.
9295
+ * Used by RuntimeAssetResolver.warmDocument() to pre-warm the cache.
9296
+ */
9297
+ interface AssetManifest {
9298
+ assets: AssetRef[];
9299
+ }
9300
+ type SceneNodeType = "frame" | "text" | "shape" | "media" | "repeater" | "component" | "rich-text" | "gradient" | "icon" | "divider" | "metric" | "progress" | "chart" | "table" | "container" | "callout" | "avatar" | "annotation" | "connector" | "gauge" | "timeline";
9301
+ type LayoutMode = "none" | "flex-row" | "flex-column" | "grid" | "space-between";
9302
+ type AlignmentMode = "start" | "center" | "end" | "stretch";
9303
+ type DimensionMode = "fixed" | "hug" | "fill" | "relative";
9304
+ type AnchorXMode = "left" | "center" | "right";
9305
+ type AnchorYMode = "top" | "center" | "bottom";
9306
+ interface NodeConstraints {
9307
+ anchorX?: AnchorXMode;
9308
+ anchorY?: AnchorYMode;
9309
+ left?: number;
9310
+ top?: number;
9311
+ right?: number;
9312
+ bottom?: number;
9313
+ widthMode?: DimensionMode;
9314
+ heightMode?: DimensionMode;
9315
+ aspectRatio?: number;
9316
+ /** Clamp minimum resolved width (px) */
9317
+ minWidth?: number;
9318
+ /** Clamp maximum resolved width (px) */
9319
+ maxWidth?: number;
9320
+ /** Clamp minimum resolved height (px) */
9321
+ minHeight?: number;
9322
+ /** Clamp maximum resolved height (px) */
9323
+ maxHeight?: number;
9324
+ /** When true, height is derived from width × (1 / aspectRatio) after clamping */
9325
+ aspectRatioLock?: boolean;
9326
+ }
9327
+ interface NodeLayoutRules {
9328
+ mode?: LayoutMode;
9329
+ gap?: number;
9330
+ padding?: {
9331
+ top: number;
9332
+ right: number;
9333
+ bottom: number;
9334
+ left: number;
9335
+ };
9336
+ alignItems?: AlignmentMode;
9337
+ justifyContent?: AlignmentMode;
9338
+ constraints?: NodeConstraints;
9339
+ }
9340
+ /** @deprecated Use FontRef instead. Kept for migration compatibility. */
9341
+ interface FontSpec {
9342
+ family: string;
9343
+ weight?: number;
9344
+ source?: "system" | "web" | "asset";
9345
+ url?: string;
9346
+ }
9347
+ interface NodeStyleRules {
9348
+ fillColor?: string;
9349
+ fillGradient?: {
9350
+ type: "linear" | "radial";
9351
+ colors: string[];
9352
+ angle?: number;
9353
+ };
9354
+ fillOpacity?: number;
9355
+ strokeColor?: string;
9356
+ strokeWidth?: number;
9357
+ borderRadius?: number;
9358
+ opacity?: number;
9359
+ fontFamily?: string;
9360
+ /** @deprecated Use fontRef instead */
9361
+ fontSpec?: FontSpec;
9362
+ /** Catalog-agnostic font reference — resolved via FontRegistry at runtime */
9363
+ fontRef?: FontRef;
9364
+ fontSize?: number;
9365
+ fontWeight?: "normal" | "bold" | "600" | "800" | string;
9366
+ textColor?: string;
9367
+ textAlign?: "left" | "center" | "right";
9368
+ letterSpacing?: number;
9369
+ lineHeight?: number;
9370
+ textTransform?: "none" | "uppercase" | "lowercase";
9371
+ shadowColor?: string;
9372
+ shadowBlur?: number;
9373
+ shadow?: {
9374
+ x: number;
9375
+ y: number;
9376
+ blur: number;
9377
+ spread?: number;
9378
+ color: string;
9379
+ };
9380
+ blurRadius?: number;
9381
+ backdropBlur?: number;
9382
+ }
9383
+ interface MotionPreset {
9384
+ type: "fade" | "slide" | "scale" | "pop" | "bounce" | "typewriter" | "glow-pulse";
9385
+ direction?: "up" | "down" | "left" | "right";
9386
+ duration: number;
9387
+ delay?: number;
9388
+ easing?: "linear" | "ease-out" | "ease-in-out" | "elastic";
9389
+ }
9390
+ /** Generalized start specification supporting absolute seconds or marker offsets */
9391
+ type AnimationStartSpec = {
9392
+ type: "absolute";
9393
+ time: number;
9394
+ } | {
9395
+ type: "marker";
9396
+ markerId: string;
9397
+ offset?: number;
9398
+ };
9399
+ /** Strongly typed semantic animation configuration */
9400
+ type SemanticAnimationConfig = {
9401
+ type: "count-up";
9402
+ from: number;
9403
+ to: number | string;
9404
+ duration: number;
9405
+ format?: string;
9406
+ } | {
9407
+ type: "typewriter";
9408
+ charsPerSecond: number;
9409
+ } | {
9410
+ type: "repeater-stagger";
9411
+ delay: number;
9412
+ direction: "forward" | "reverse";
9413
+ };
9414
+ interface KeyframeTrack {
9415
+ property: string;
9416
+ keyframes: Array<{
9417
+ time: number;
9418
+ value: number | string;
9419
+ easing?: string;
9420
+ }>;
9421
+ }
9422
+ interface NodeAnimationRules {
9423
+ entrance?: MotionPreset;
9424
+ exit?: MotionPreset;
9425
+ start?: AnimationStartSpec;
9426
+ semanticAnimation?: SemanticAnimationConfig;
9427
+ keyframeTracks?: KeyframeTrack[];
9428
+ /** Controls animation inheritance scope for child nodes */
9429
+ animationScope?: "node" | "children" | "subtree";
9430
+ /** Stagger delay applied incrementally to children based on scene tree order */
9431
+ staggerChildren?: number;
9432
+ }
9433
+ interface DataBindingRule {
9434
+ targetProperty: string;
9435
+ expression: string;
9436
+ }
9437
+ /**
9438
+ * Sparse property patch stored per breakpoint on a node.
9439
+ * Only the properties that *change* at a given breakpoint are stored.
9440
+ * Identity fields (id, type, children) are never overridden.
9441
+ */
9442
+ interface ResponsiveNodeOverride {
9443
+ x?: number;
9444
+ y?: number;
9445
+ width?: number;
9446
+ height?: number;
9447
+ visible?: boolean;
9448
+ /** Partial deep-merge over base node.layout */
9449
+ layout?: Partial<NodeLayoutRules>;
9450
+ /** Partial deep-merge over base node.style */
9451
+ style?: Partial<NodeStyleRules>;
9452
+ /** Re-order this node within its parent at this breakpoint (0-based) */
9453
+ layoutOrder?: number;
9454
+ }
9455
+ interface SceneNodeBase {
9456
+ id: string;
9457
+ name: string;
9458
+ type: SceneNodeType;
9459
+ x: number;
9460
+ y: number;
9461
+ width: number;
9462
+ height: number;
9463
+ rotation?: number;
9464
+ visible?: boolean;
9465
+ locked?: boolean;
9466
+ layout?: NodeLayoutRules;
9467
+ style?: NodeStyleRules;
9468
+ animation?: NodeAnimationRules;
9469
+ bindings?: DataBindingRule[];
9470
+ visibilityExpression?: string;
9471
+ /**
9472
+ * Breakpoint-scoped property overrides.
9473
+ * Key = breakpoint id; value = sparse patch merged over base properties.
9474
+ * Only changed properties are stored — base properties are always inherited.
9475
+ */
9476
+ responsive?: Record<string, ResponsiveNodeOverride>;
9477
+ }
9478
+ interface FrameNode extends SceneNodeBase {
9479
+ type: "frame";
9480
+ children: SceneNode[];
9481
+ }
9482
+ interface PrimitiveTextNode extends SceneNodeBase {
9483
+ type: "text";
9484
+ text: string;
9485
+ }
9486
+ type ShapeKind = "rectangle" | "rounded-rectangle" | "circle" | "ellipse" | "triangle" | "polygon" | "star" | "arrow" | "chevron" | "hexagon" | "diamond" | "line" | "divider" | "custom-path";
9487
+ interface PrimitiveShapeNode extends SceneNodeBase {
9488
+ type: "shape";
9489
+ shapeType: ShapeKind;
9490
+ svgPath?: string;
9491
+ points?: number[];
9492
+ cornerRadius?: number;
9493
+ }
9494
+ interface PrimitiveMediaNode extends SceneNodeBase {
9495
+ type: "media";
9496
+ mediaType: "image" | "icon" | "svg" | "avatar";
9497
+ /** @deprecated Prefer assetId. Kept as legacy fallback for migration. */
9498
+ src?: string;
9499
+ /** Stable reference to AssetRegistry — document never contains binary data */
9500
+ assetId?: string;
9501
+ }
9502
+ interface RepeaterNode extends SceneNodeBase {
9503
+ type: "repeater";
9504
+ datasetBinding: string;
9505
+ staggerDelay?: number;
9506
+ itemTemplate: SceneNode;
9507
+ direction?: "vertical" | "horizontal";
9508
+ previewItemCount?: number;
9509
+ }
9510
+ interface ComponentNode extends SceneNodeBase {
9511
+ type: "component";
9512
+ componentType: string;
9513
+ variant?: string;
9514
+ props: Record<string, any>;
9515
+ children?: SceneNode[];
9516
+ }
9517
+ interface RichTextSpan {
9518
+ text: string;
9519
+ style?: Partial<NodeStyleRules>;
9520
+ }
9521
+ interface RichTextNode extends SceneNodeBase {
9522
+ type: "rich-text";
9523
+ spans: RichTextSpan[];
9524
+ }
9525
+
9526
+ interface GradientNode extends SceneNodeBase {
9527
+ type: "gradient";
9528
+ gradientType: "linear" | "radial";
9529
+ angle?: number;
9530
+ stops: GradientStop[];
9531
+ }
9532
+ interface IconNode extends SceneNodeBase {
9533
+ type: "icon";
9534
+ iconName: string;
9535
+ assetId?: string;
9536
+ svgPath?: string;
9537
+ }
9538
+ interface DividerNode extends SceneNodeBase {
9539
+ type: "divider";
9540
+ orientation: "horizontal" | "vertical";
9541
+ lineStyle?: "solid" | "dashed" | "dotted" | "gradient";
9542
+ thickness?: number;
9543
+ }
9544
+ interface MetricNode extends SceneNodeBase {
9545
+ type: "metric";
9546
+ value: number | string;
9547
+ prefix?: string;
9548
+ suffix?: string;
9549
+ label?: string;
9550
+ decimals?: number;
9551
+ /** Number formatting style */
9552
+ format?: "number" | "currency" | "percent" | "compact";
9553
+ locale?: string;
9554
+ /** Manual trend percentage (overrides auto-calculated delta) */
9555
+ trend?: number;
9556
+ trendDirection?: "up" | "down" | "neutral";
9557
+ /** Previous period value — delta and percentage change are auto-calculated */
9558
+ previousValue?: number;
9559
+ /** Show the delta/percentage change label below the primary value */
9560
+ showDelta?: boolean;
9561
+ /** Show the trend direction arrow (▲/▼) */
9562
+ showTrend?: boolean;
9563
+ /** Animate value counting up from 0. Uses existing semanticAnimation hook. */
9564
+ countUp?: boolean;
9565
+ /** Count-up animation duration in seconds. Default: 1.2 */
9566
+ countUpDuration?: number;
9567
+ }
9568
+ interface ProgressNode extends SceneNodeBase {
9569
+ type: "progress";
9570
+ value: number;
9571
+ max?: number;
9572
+ trackColor?: string;
9573
+ fillColor?: string;
9574
+ showLabel?: boolean;
9575
+ styleType?: "bar" | "circle";
9576
+ }
9577
+ type ChartType = "line" | "bar" | "area" | "donut" | "pie" | "radar" | "scatter";
9578
+ interface AxisConfig {
9579
+ /** Fixed minimum value. Undefined = auto from data. */
9580
+ min?: number;
9581
+ /** Fixed maximum value. Undefined = auto from data. */
9582
+ max?: number;
9583
+ /** Number of tick marks / grid lines. Default: 5 */
9584
+ tickCount?: number;
9585
+ /** Show horizontal grid lines across plot area */
9586
+ showGrid?: boolean;
9587
+ /** Show axis tick labels */
9588
+ showLabels?: boolean;
9589
+ /** Label format template e.g. "{{value}}%" or "${{value}}" */
9590
+ labelFormat?: string;
9591
+ }
9592
+ interface ChartBarStyle {
9593
+ /** Border radius on bar corners (px). Default: 4 */
9594
+ rounded?: number;
9595
+ /** Enable glow (rendered as DropShadowFilter with zero offset) */
9596
+ glow?: boolean;
9597
+ /** Glow/shadow color (RGBA hex). Default: series color at 40% opacity */
9598
+ glowColor?: string;
9599
+ /** Enable vertical gradient fill on each bar */
9600
+ gradient?: boolean;
9601
+ /** Spacing between grouped series bars within a category (px) */
9602
+ groupGap?: number;
9603
+ }
9604
+ interface ChartAnimationConfig {
9605
+ /** Animation style for bar entrance */
9606
+ mode: "grow" | "fade" | "none";
9607
+ /** Total animation duration in seconds. Default: 1.2 */
9608
+ duration?: number;
9609
+ /** Per-bar stagger delay in seconds. Default: 0.08 */
9610
+ stagger?: number;
9611
+ /** CSS easing name used for bar grow curve. Default: "easeOutCubic" */
9612
+ easing?: "linear" | "easeInCubic" | "easeOutCubic" | "easeInOutCubic" | "easeOutQuart" | "easeOutElastic";
9613
+ /** Animate the numeric label above each bar as a count-up */
9614
+ countUpLabels?: boolean;
9615
+ }
9616
+ interface ChartSeries {
9617
+ /** Unique key used as yField when populating from dataSource objects */
9618
+ id: string;
9619
+ /** Display name shown in legend */
9620
+ name: string;
9621
+ /** Bar fill color (hex) */
9622
+ color: string;
9623
+ /** Raw data values, one per category */
9624
+ data?: number[];
9625
+ /** Stack group key — bars sharing the same stackGroup are stacked (requires stacked: true) */
9626
+ stackGroup?: string;
9627
+ }
9628
+ interface ChartNode extends SceneNodeBase {
9629
+ type: "chart";
9630
+ chartType: ChartType;
9631
+ /** Stack series within each category (grouped otherwise) */
9632
+ stacked?: boolean;
9633
+ /** Bar orientation. Default: "vertical" */
9634
+ orientation?: "vertical" | "horizontal";
9635
+ /** Explicit category labels (X-axis). Populated from xField when dataSource is bound. */
9636
+ xLabels?: string[];
9637
+ /** Key in dataSource objects used to extract category labels */
9638
+ xField?: string;
9639
+ /** Keys in dataSource objects used for each series (deprecated: prefer series[].id) */
9640
+ yFields?: string[];
9641
+ /** Series definitions — color, label, and data */
9642
+ series?: ChartSeries[];
9643
+ /** Y-axis configuration */
9644
+ axis?: AxisConfig;
9645
+ /** Bar visual styling */
9646
+ barStyle?: ChartBarStyle;
9647
+ /** Chart-level animation, independent of NodeAnimationConfig entrance */
9648
+ chartAnimation?: ChartAnimationConfig;
9649
+ /** Default color palette — auto-assigned to series without explicit color */
9650
+ colorPalette?: string[];
9651
+ /** Chart title displayed above plot area (distinct from node.name) */
9652
+ title?: string;
9653
+ /** Show grid lines (shorthand for axis.showGrid) */
9654
+ showGrid?: boolean;
9655
+ /** Show legend */
9656
+ showLegend?: boolean;
9657
+ /** Legend placement. Default: "bottom" */
9658
+ legendPosition?: "bottom" | "right" | "top";
9659
+ /** Bound data source expression */
9660
+ dataSource?: string;
9661
+ /** Donut inner radius as fraction of outer radius. Default: 0.55 */
9662
+ donutHoleRatio?: number;
9663
+ /** Show percentage labels on pie/donut arcs */
9664
+ showPercentageLabels?: boolean;
9665
+ /** Area chart: fill the area below the line */
9666
+ showAreaFill?: boolean;
9667
+ /** Area chart: fill opacity 0–1. Default: 0.25 */
9668
+ areaFillOpacity?: number;
9669
+ /** Line chart: radius of data point dots (px). Default: 4 */
9670
+ pointRadius?: number;
9671
+ /** Line chart: animate as progressive path draw (left-to-right reveal) */
9672
+ drawProgress?: boolean;
9673
+ /** Phase 4R — Region highlights spotlighting specific category ranges */
9674
+ highlights?: Array<{
9675
+ seriesId?: string;
9676
+ dataIndexRange?: [number, number];
9677
+ color?: string;
9678
+ opacity?: number;
9679
+ label?: string;
9680
+ }>;
9681
+ }
9682
+ interface AnnotationNode extends SceneNodeBase {
9683
+ type: "annotation";
9684
+ text: string;
9685
+ anchor?: {
9686
+ nodeId: string;
9687
+ seriesId?: string;
9688
+ dataIndex?: number;
9689
+ element?: "bar-top" | "bar-center" | "point" | "arc-mid" | "absolute";
9690
+ };
9691
+ offsetX?: number;
9692
+ offsetY?: number;
9693
+ showLeader?: boolean;
9694
+ leaderColor?: string;
9695
+ pointerStyle?: "dot" | "arrow" | "none";
9696
+ }
9697
+ interface ConnectorNode extends SceneNodeBase {
9698
+ type: "connector";
9699
+ fromNodeId: string;
9700
+ toNodeId: string;
9701
+ fromElement?: "bar-top" | "point" | "arc-mid" | "center";
9702
+ toElement?: "bar-top" | "point" | "arc-mid" | "center";
9703
+ lineStyle?: "straight" | "curved" | "elbow";
9704
+ arrowHead?: "none" | "start" | "end" | "both";
9705
+ strokeColor?: string;
9706
+ strokeWidth?: number;
9707
+ dashPattern?: number[];
9708
+ }
9709
+ interface GaugeThreshold {
9710
+ value: number;
9711
+ color: string;
9712
+ }
9713
+ interface GaugeNode extends SceneNodeBase {
9714
+ type: "gauge";
9715
+ value: number;
9716
+ min?: number;
9717
+ max?: number;
9718
+ gaugeStyle?: "semicircle" | "full" | "arc";
9719
+ sweepAngle?: number;
9720
+ trackColor?: string;
9721
+ fillColor?: string;
9722
+ showValue?: boolean;
9723
+ showLabel?: boolean;
9724
+ label?: string;
9725
+ thresholds?: GaugeThreshold[];
9726
+ chartAnimation?: ChartAnimationConfig;
9727
+ }
9728
+ interface TimelineEvent {
9729
+ id: string;
9730
+ label: string;
9731
+ time: number;
9732
+ description?: string;
9733
+ color?: string;
9734
+ icon?: string;
9735
+ }
9736
+ interface TimelineNode extends SceneNodeBase {
9737
+ type: "timeline";
9738
+ events: TimelineEvent[];
9739
+ orientation?: "horizontal" | "vertical";
9740
+ trackColor?: string;
9741
+ eventColor?: string;
9742
+ showLabels?: boolean;
9743
+ animationMode?: "sequential" | "simultaneous";
9744
+ chartAnimation?: Pick<ChartAnimationConfig, "mode" | "stagger" | "easing">;
9745
+ }
9746
+ interface TableColumn {
9747
+ key: string;
9748
+ label: string;
9749
+ width?: number;
9750
+ format?: string;
9751
+ }
9752
+ interface TableNode extends SceneNodeBase {
9753
+ type: "table";
9754
+ columns: TableColumn[];
9755
+ dataSource?: string;
9756
+ rows?: Array<Record<string, any>>;
9757
+ }
9758
+ interface ContainerNode extends SceneNodeBase {
9759
+ type: "container";
9760
+ children: SceneNode[];
9761
+ clipContent?: boolean;
9762
+ }
9763
+ interface CalloutNode extends SceneNodeBase {
9764
+ type: "callout";
9765
+ title: string;
9766
+ body: string;
9767
+ iconName?: string;
9768
+ calloutType?: "info" | "warning" | "success" | "danger";
9769
+ }
9770
+ interface AvatarNode extends SceneNodeBase {
9771
+ type: "avatar";
9772
+ src?: string;
9773
+ initials?: string;
9774
+ assetId?: string;
9775
+ shape?: "circle" | "rounded" | "square";
9776
+ badgeStatus?: "online" | "offline" | "busy";
9777
+ }
9778
+ type SceneNode = FrameNode | PrimitiveTextNode | PrimitiveShapeNode | PrimitiveMediaNode | RepeaterNode | ComponentNode | RichTextNode | GradientNode | IconNode | DividerNode | MetricNode | ProgressNode | ChartNode | TableNode | ContainerNode | CalloutNode | AvatarNode | AnnotationNode | ConnectorNode | GaugeNode | TimelineNode;
9779
+ interface DocumentVariable {
9780
+ key: string;
9781
+ type: "string" | "number" | "boolean" | "color" | "array";
9782
+ defaultValue: any;
9783
+ label?: string;
9784
+ }
9785
+ interface DataPreviewSet {
9786
+ id: string;
9787
+ label: string;
9788
+ values: Record<string, any>;
9789
+ }
9790
+ /** Timeline Marker for snapping, keyframing, and video synchronization */
9791
+ interface TimelineMarker {
9792
+ id: string;
9793
+ time: number;
9794
+ label: string;
9795
+ type: "transcript" | "keyword" | "chapter" | "beat";
9796
+ color?: string;
9797
+ }
9798
+ /**
9799
+ * A named viewport context that overrides the canvas dimensions and
9800
+ * allows nodes to carry responsive overrides for that viewport.
9801
+ */
9802
+ interface Breakpoint {
9803
+ id: string;
9804
+ label: string;
9805
+ canvas: {
9806
+ width: number;
9807
+ height: number;
9808
+ };
9809
+ description?: string;
9810
+ }
9811
+ /**
9812
+ * Document-level breakpoint registry.
9813
+ * `activeId === null` means the canonical / base layout is active.
9814
+ */
9815
+ interface BreakpointSet {
9816
+ /** null = base / canonical layout */
9817
+ activeId: string | null;
9818
+ breakpoints: Breakpoint[];
9819
+ }
9820
+ interface OverlayDocument {
9821
+ id: string;
9822
+ version: "2.0";
9823
+ title: string;
9824
+ description?: string;
9825
+ category: string;
9826
+ canvas: {
9827
+ width: number;
9828
+ height: number;
9829
+ backgroundColor?: string;
9830
+ };
9831
+ variables: DocumentVariable[];
9832
+ nodes: SceneNode[];
9833
+ duration: number;
9834
+ createdAt: string;
9835
+ updatedAt: string;
9836
+ dataPreviewSets?: DataPreviewSet[];
9837
+ /** Named timeline markers across the document duration */
9838
+ markers?: TimelineMarker[];
9839
+ /** Declares all asset dependencies for this document — used to pre-warm the resolver */
9840
+ assetManifest?: AssetManifest;
9841
+ /** Responsive breakpoint definitions and active selection */
9842
+ breakpoints?: BreakpointSet;
9843
+ }
9844
+
9845
+ /**
9846
+ * Self-describing property that participates in the inspector, animation,
9847
+ * data binding, and validation simultaneously. Replaces PropertySchemaField.
9848
+ * Fully backwards-compatible — all old fields are preserved.
9849
+ */
9850
+ interface PropertyDefinition {
9851
+ key: string;
9852
+ label: string;
9853
+ type: "text" | "number" | "color" | "boolean" | "select" | "asset" | "json";
9854
+ defaultValue: any;
9855
+ editable?: boolean;
9856
+ animatable?: boolean;
9857
+ bindable?: boolean;
9858
+ exportable?: boolean;
9859
+ options?: Array<{
9860
+ label: string;
9861
+ value: any;
9862
+ }>;
9863
+ min?: number;
9864
+ max?: number;
9865
+ step?: number;
9866
+ group?: "Content" | "Layout" | "Style" | "Animation";
9867
+ required?: boolean;
9868
+ animationPropertyType?: "number" | "color" | "angle" | "discrete";
9869
+ }
9870
+ /** @deprecated Use PropertyDefinition instead */
9871
+ type PropertySchemaField = PropertyDefinition;
9872
+ type ComponentCategory = "metrics" | "comparison" | "typography" | "process" | "code" | "social" | "people" | "media" | "layout" | "primitives";
9873
+ interface ComponentDefinition {
9874
+ type: string;
9875
+ name: string;
9876
+ category: ComponentCategory;
9877
+ description: string;
9878
+ defaultProps: Record<string, any>;
9879
+ variants?: string[];
9880
+ /** Human-readable labels for each variant key */
9881
+ variantLabels?: Record<string, string>;
9882
+ semanticAnimations?: string[];
9883
+ schema: PropertyDefinition[];
9884
+ /** Returns the canonical inner scene tree (FrameNode with children).
9885
+ * Used when entering template editing mode. */
9886
+ structure?: () => FrameNode;
9887
+ createDefaultNode: () => ComponentNode | SceneNode;
9888
+ }
9889
+ declare class ComponentRegistry {
9890
+ private registry;
9891
+ register(def: ComponentDefinition): void;
9892
+ get(type: string): ComponentDefinition | undefined;
9893
+ getAll(): ComponentDefinition[];
9894
+ getTypes(): string[];
9895
+ }
9896
+ declare const componentRegistry: ComponentRegistry;
9897
+
9898
+ /**
9899
+ * Phase 4O — Single Source Primitive Registry & Default Node Factories
9900
+ *
9901
+ * Provides central registration, default node creation factories, and
9902
+ * metadata declarations for all 16 fundamental primitive node types.
9903
+ */
9904
+
9905
+ interface PrimitiveDefinition {
9906
+ type: SceneNodeType;
9907
+ label: string;
9908
+ category: "graphics" | "data" | "structure" | "media";
9909
+ createDefaultNode: (id?: string) => SceneNode;
9910
+ }
9911
+ declare class PrimitiveRegistry {
9912
+ private definitions;
9913
+ constructor();
9914
+ register(def: PrimitiveDefinition): void;
9915
+ get(type: SceneNodeType): PrimitiveDefinition | undefined;
9916
+ list(): PrimitiveDefinition[];
9917
+ createDefaultNode(type: SceneNodeType, customId?: string): SceneNode;
9918
+ private registerDefaults;
9919
+ }
9920
+ declare const primitiveRegistry: PrimitiveRegistry;
9921
+
9922
+ declare class DataBindingEngine {
9923
+ /**
9924
+ * Evaluate a variable template string like "{{revenue}}" or "Growth: {{growth}}%"
9925
+ * Returns the interpolated string with all {{key}} tokens replaced.
9926
+ */
9927
+ evaluateString(expr: string, context: Record<string, any>): string;
9928
+ /**
9929
+ * Evaluate a typed expression against context and return the computed value.
9930
+ * Unlike evaluateString (which always returns a string), this returns the
9931
+ * actual JS value: number, boolean, string, etc.
9932
+ *
9933
+ * Examples:
9934
+ * evaluateExpression("revenue / 1000000", { revenue: 1240000 }) => 1.24
9935
+ * evaluateExpression("growth > 0", { growth: -5 }) => false
9936
+ * evaluateExpression("firstName + ' ' + lastName", { firstName: "Alice", lastName: "Smith" }) => "Alice Smith"
9937
+ *
9938
+ * NOTE: Uses new Function() — acceptable for local authoring.
9939
+ * MUST be sandboxed (e.g. QuickJS / isolated-vm) before any server-side render path.
9940
+ */
9941
+ evaluateExpression(expr: string, context: Record<string, any>): any;
9942
+ /**
9943
+ * Evaluate boolean condition expressions like "growth > 0" or "type == 'guest'"
9944
+ */
9945
+ evaluateCondition(conditionExpr: string, context: Record<string, any>): boolean;
9946
+ /**
9947
+ * Expand a RepeaterNode for an array dataset context into instantiated nodes.
9948
+ * The key may be a raw variable name or a {{binding}} expression.
9949
+ */
9950
+ expandRepeater(repeater: RepeaterNode, context: Record<string, any>): SceneNode[];
9951
+ /**
9952
+ * Recursively evaluate data bindings across a node tree.
9953
+ * Evaluates node.bindings rules, text content, and component props.
9954
+ */
9955
+ evaluateNodeBindings(node: SceneNode, context: Record<string, any>): void;
9956
+ private resolvePath;
9957
+ private setPath;
9958
+ }
9959
+ declare const dataBindingEngine: DataBindingEngine;
9960
+
9961
+ interface EvaluatedNodeState {
9962
+ x: number;
9963
+ y: number;
9964
+ width: number;
9965
+ height: number;
9966
+ opacity: number;
9967
+ visible: boolean;
9968
+ translateX: number;
9969
+ translateY: number;
9970
+ scaleX: number;
9971
+ scaleY: number;
9972
+ rotation: number;
9973
+ blur: number;
9974
+ fillColor?: string;
9975
+ typewriterProgress: number;
9976
+ numericValueOverride?: number;
9977
+ }
9978
+ interface AnimationEvaluationOptions {
9979
+ doc?: OverlayDocument;
9980
+ /** Ephemeral preview phase override for authoring view (never stored on doc) */
9981
+ previewState?: "rest" | "enter" | "hold" | "exit";
9982
+ /** Inherited delay accumulated from parent frames/groups */
9983
+ inheritedDelay?: number;
9984
+ /** Absolute playhead time — used by evaluateScene() */
9985
+ currentTime?: number;
9986
+ }
9987
+ /**
9988
+ * Canonical output contract of the animation runtime.
9989
+ * PixiSceneProjection must consume ONLY this — no preset/marker/keyframe logic.
9990
+ */
9991
+ interface EvaluatedSceneState {
9992
+ time: number;
9993
+ nodes: Record<string, EvaluatedNodeState>;
9994
+ }
9995
+ interface SnapResult {
9996
+ snappedTime: number;
9997
+ snappedMarker?: TimelineMarker;
9998
+ }
9999
+ declare class AnimationRuntime {
10000
+ /**
10001
+ * Evaluate motion state for a node at a given currentTime (seconds).
10002
+ * Fully deterministic and pure — does NOT mutate node or document.
10003
+ */
10004
+ evaluateNodeState(node: SceneNode, currentTime: number, clipDuration: number, options?: AnimationEvaluationOptions): EvaluatedNodeState;
10005
+ /**
10006
+ * Helper to compute child delays for parent-child animation inheritance.
10007
+ * Child order is deterministic based on scene tree array index.
10008
+ */
10009
+ computeChildInheritedDelay(parentAnimation: SceneNode["animation"], childIndex: number, parentInheritedDelay?: number): number;
10010
+ /**
10011
+ * Evaluate the full document scene graph at a given time, producing a flat
10012
+ * node map. PixiSceneProjection should consume this exclusively.
10013
+ */
10014
+ evaluateScene(doc: OverlayDocument, options?: AnimationEvaluationOptions): EvaluatedSceneState;
10015
+ private collectNodes;
10016
+ /**
10017
+ * Engine-level snap utility for magnetic snapping to timeline markers
10018
+ */
10019
+ snapTime(time: number, markers?: TimelineMarker[], threshold?: number): SnapResult;
10020
+ private resolveStartTime;
10021
+ private evaluateSemanticAnimation;
10022
+ private applyEntrancePreset;
10023
+ private applyEasing;
10024
+ private interpolateTrack;
10025
+ }
10026
+ declare const animationRuntime: AnimationRuntime;
10027
+
10028
+ /**
10029
+ * Phase 4R.2 — Platform-independent Visualization Definition & Registry
10030
+ *
10031
+ * Pure evaluation contract: (node, context) → evaluated geometry.
10032
+ * Completely decoupled from PixiJS or DOM renderer implementations.
10033
+ */
10034
+
10035
+ interface VisualizationEvaluationContext {
10036
+ width: number;
10037
+ height: number;
10038
+ t: number;
10039
+ doc?: OverlayDocument;
10040
+ }
10041
+ interface VisualizationCapabilities {
10042
+ dataBinding: boolean;
10043
+ animation: boolean;
10044
+ responsive: boolean;
10045
+ }
10046
+ interface VisualizationDefinition<TNode = any, TGeometry = any> {
10047
+ type: string;
10048
+ name: string;
10049
+ category: "chart" | "metric" | "gauge" | "timeline" | "comparison" | "annotation";
10050
+ schema: PropertyDefinition[];
10051
+ supports: VisualizationCapabilities;
10052
+ evaluate(node: TNode, context: VisualizationEvaluationContext): TGeometry;
10053
+ }
10054
+ declare class VisualizationRegistry {
10055
+ private definitions;
10056
+ register<TNode, TGeometry>(def: VisualizationDefinition<TNode, TGeometry>): void;
10057
+ get<TNode = any, TGeometry = any>(type: string): VisualizationDefinition<TNode, TGeometry> | undefined;
10058
+ getAll(): VisualizationDefinition[];
10059
+ has(type: string): boolean;
10060
+ }
10061
+ declare const visualizationRegistry: VisualizationRegistry;
10062
+
10063
+ /**
10064
+ * Phase 4R.5 / 4R.7 — Gauge Visualization Definition & Renderer
10065
+ *
10066
+ * Evaluates GaugeNode geometry (semicircle/arc/full) and registers renderer in VisualizationRendererRegistry.
10067
+ */
10068
+
10069
+ interface EvaluatedGaugeGeometry {
10070
+ cx: number;
10071
+ cy: number;
10072
+ radius: number;
10073
+ innerRadius: number;
10074
+ startAngle: number;
10075
+ fullSweep: number;
10076
+ animSweep: number;
10077
+ fillColor: string;
10078
+ trackColor: string;
10079
+ formattedValue: string;
10080
+ label?: string;
10081
+ showValue: boolean;
10082
+ showLabel: boolean;
10083
+ }
10084
+ declare class GaugeVisualizationDefinition implements VisualizationDefinition<GaugeNode, EvaluatedGaugeGeometry> {
10085
+ type: string;
10086
+ name: string;
10087
+ category: "gauge";
10088
+ schema: any[];
10089
+ supports: {
10090
+ dataBinding: boolean;
10091
+ animation: boolean;
10092
+ responsive: boolean;
10093
+ };
10094
+ evaluate(node: GaugeNode, context: {
10095
+ width: number;
10096
+ height: number;
10097
+ t: number;
10098
+ }): EvaluatedGaugeGeometry;
10099
+ }
10100
+ declare const gaugeVisualization: GaugeVisualizationDefinition;
10101
+
10102
+ /**
10103
+ * Phase 4R.6 / 4R.7 — Timeline Visualization Definition & Renderer
10104
+ *
10105
+ * Evaluates TimelineNode geometry (events along a temporal axis) and registers renderer in VisualizationRendererRegistry.
10106
+ */
10107
+
10108
+ interface EvaluatedTimelineEvent {
10109
+ id: string;
10110
+ label: string;
10111
+ x: number;
10112
+ y: number;
10113
+ color: string;
10114
+ description?: string;
10115
+ active: boolean;
10116
+ }
10117
+ interface EvaluatedTimelineGeometry {
10118
+ axisX1: number;
10119
+ axisY1: number;
10120
+ axisX2: number;
10121
+ axisY2: number;
10122
+ trackColor: string;
10123
+ events: EvaluatedTimelineEvent[];
10124
+ }
10125
+ declare class TimelineVisualizationDefinition implements VisualizationDefinition<TimelineNode, EvaluatedTimelineGeometry> {
10126
+ type: string;
10127
+ name: string;
10128
+ category: "timeline";
10129
+ schema: any[];
10130
+ supports: {
10131
+ dataBinding: boolean;
10132
+ animation: boolean;
10133
+ responsive: boolean;
10134
+ };
10135
+ evaluate(node: TimelineNode, context: {
10136
+ width: number;
10137
+ height: number;
10138
+ t: number;
10139
+ }): EvaluatedTimelineGeometry;
10140
+ }
10141
+ declare const timelineVisualization: TimelineVisualizationDefinition;
10142
+
10143
+ /**
10144
+ * Phase 4R.4 / 4R.7 — Annotation & Connector Definitions & Renderers
10145
+ *
10146
+ * Resolves floating annotations and connectors against geometry anchors.
10147
+ */
10148
+
10149
+ interface EvaluatedAnnotationGeometry {
10150
+ text: string;
10151
+ x: number;
10152
+ y: number;
10153
+ anchorX?: number;
10154
+ anchorY?: number;
10155
+ showLeader: boolean;
10156
+ leaderColor: string;
10157
+ pointerStyle: "dot" | "arrow" | "none";
10158
+ }
10159
+ declare class AnnotationVisualizationDefinition implements VisualizationDefinition<AnnotationNode, EvaluatedAnnotationGeometry> {
10160
+ type: string;
10161
+ name: string;
10162
+ category: "annotation";
10163
+ schema: any[];
10164
+ supports: {
10165
+ dataBinding: boolean;
10166
+ animation: boolean;
10167
+ responsive: boolean;
10168
+ };
10169
+ evaluate(node: AnnotationNode, context: {
10170
+ width: number;
10171
+ height: number;
10172
+ t: number;
10173
+ }): EvaluatedAnnotationGeometry;
10174
+ }
10175
+ declare const annotationVisualization: AnnotationVisualizationDefinition;
10176
+ interface EvaluatedConnectorGeometry {
10177
+ fromX: number;
10178
+ fromY: number;
10179
+ toX: number;
10180
+ toY: number;
10181
+ strokeColor: string;
10182
+ strokeWidth: number;
10183
+ lineStyle: "straight" | "curved" | "elbow";
10184
+ arrowHead: "none" | "start" | "end" | "both";
10185
+ }
10186
+ declare class ConnectorVisualizationDefinition implements VisualizationDefinition<ConnectorNode, EvaluatedConnectorGeometry> {
10187
+ type: string;
10188
+ name: string;
10189
+ category: "annotation";
10190
+ schema: any[];
10191
+ supports: {
10192
+ dataBinding: boolean;
10193
+ animation: boolean;
10194
+ responsive: boolean;
10195
+ };
10196
+ evaluate(node: ConnectorNode, context: {
10197
+ width: number;
10198
+ height: number;
10199
+ t: number;
10200
+ }): EvaluatedConnectorGeometry;
10201
+ }
10202
+ declare const connectorVisualization: ConnectorVisualizationDefinition;
10203
+
10204
+ declare class PixiSceneProjection {
10205
+ rootContainer: Container;
10206
+ private nodeMap;
10207
+ constructor();
10208
+ /**
10209
+ * Sync and project an OverlayDocument onto PixiJS display tree at currentTime
10210
+ */
10211
+ project(doc: OverlayDocument, currentTime: number, contextData?: Record<string, any>,
10212
+ /** Optional ephemeral preview overrides — never persisted to the document */
10213
+ previewContext?: Record<string, any>): Container;
10214
+ private projectNode;
10215
+ private renderComponentNode;
10216
+ private renderTextNode;
10217
+ private renderMediaNode;
10218
+ private renderShapeNode;
10219
+ private applyShadow;
10220
+ private renderLabel;
10221
+ private renderRichTextNode;
10222
+ private renderGradientNode;
10223
+ private renderIconNode;
10224
+ private renderDividerNode;
10225
+ private renderMetricNode;
10226
+ private renderProgressNode;
10227
+ private renderChartNode;
10228
+ private renderTableNode;
10229
+ private renderContainerNode;
10230
+ private renderCalloutNode;
10231
+ private renderVisualizationNode;
10232
+ private renderAvatarNode;
10233
+ }
10234
+ declare const pixiSceneProjection: PixiSceneProjection;
10235
+
10236
+ declare class PixiSelectionOverlay {
10237
+ overlayContainer: Container;
10238
+ private selectionGraphics;
10239
+ constructor();
10240
+ /**
10241
+ * Render selection bounding box, 8 resize handles, and rotation knob for single or multi-selected nodes
10242
+ */
10243
+ renderSelection(selectedNode: SceneNode | null, doc: OverlayDocument, selectedNodes?: SceneNode[]): Container;
10244
+ /**
10245
+ * Clear the selection overlay
10246
+ */
10247
+ clearSelection(): void;
10248
+ }
10249
+ declare const pixiSelectionOverlay: PixiSelectionOverlay;
10250
+
10251
+ type CommandType = "SET_DOCUMENT" | "ADD_NODE" | "DELETE_NODE" | "UPDATE_NODE_PROPERTY" | "UPDATE_NODE_STYLE" | "REORDER_NODES" | "ADD_VARIABLE" | "REMOVE_VARIABLE" | "UPDATE_VARIABLE" | "ADD_DATA_PREVIEW_SET" | "UPDATE_DATA_PREVIEW_SET" | "REMOVE_DATA_PREVIEW_SET" | "ADD_TIMELINE_MARKER" | "UPDATE_TIMELINE_MARKER" | "REMOVE_TIMELINE_MARKER" | "UPDATE_KEYFRAME_TRACKS" | "UPDATE_ANIMATION" | "GROUP_NODES" | "UNGROUP_NODES" | "DETACH_COMPONENT" | "UPDATE_CANVAS_SIZE" | "SET_BINDING" | "REGISTER_ASSET" | "REMOVE_ASSET" | "SET_ASSET_REF" | "SET_FONT_REF" | "ADD_BREAKPOINT" | "REMOVE_BREAKPOINT" | "SET_ACTIVE_BREAKPOINT" | "SET_RESPONSIVE_OVERRIDE" | "BATCH_COMMANDS";
10252
+ interface BaseCommand {
10253
+ type: CommandType;
10254
+ timestamp?: number;
10255
+ }
10256
+ interface SetDocumentCommand extends BaseCommand {
10257
+ type: "SET_DOCUMENT";
10258
+ doc: OverlayDocument;
10259
+ }
10260
+ interface AddNodeCommand extends BaseCommand {
10261
+ type: "ADD_NODE";
10262
+ node: SceneNode;
10263
+ parentId?: string;
10264
+ index?: number;
10265
+ }
10266
+ interface DeleteNodeCommand extends BaseCommand {
10267
+ type: "DELETE_NODE";
10268
+ nodeId: string;
10269
+ }
10270
+ interface UpdateNodePropertyCommand extends BaseCommand {
10271
+ type: "UPDATE_NODE_PROPERTY";
10272
+ nodeId: string;
10273
+ path: string;
10274
+ value: any;
10275
+ previousValue?: any;
10276
+ }
10277
+ interface UpdateNodeStyleCommand extends BaseCommand {
10278
+ type: "UPDATE_NODE_STYLE";
10279
+ nodeId: string;
10280
+ stylePath: string;
10281
+ value: any;
10282
+ previousValue?: any;
10283
+ }
10284
+ interface ReorderNodesCommand extends BaseCommand {
10285
+ type: "REORDER_NODES";
10286
+ sourceIndex: number;
10287
+ destinationIndex: number;
10288
+ }
10289
+ interface AddVariableCommand extends BaseCommand {
10290
+ type: "ADD_VARIABLE";
10291
+ key: string;
10292
+ dataType: DocumentVariable["type"];
10293
+ defaultValue: any;
10294
+ label?: string;
10295
+ }
10296
+ interface RemoveVariableCommand extends BaseCommand {
10297
+ type: "REMOVE_VARIABLE";
10298
+ key: string;
10299
+ previousVariable?: DocumentVariable;
10300
+ }
10301
+ interface UpdateVariableCommand extends BaseCommand {
10302
+ type: "UPDATE_VARIABLE";
10303
+ key: string;
10304
+ patch: Partial<Omit<DocumentVariable, "key">>;
10305
+ previousPatch?: Partial<Omit<DocumentVariable, "key">>;
10306
+ }
10307
+ interface AddDataPreviewSetCommand extends BaseCommand {
10308
+ type: "ADD_DATA_PREVIEW_SET";
10309
+ set: DataPreviewSet;
10310
+ }
10311
+ interface UpdateDataPreviewSetCommand extends BaseCommand {
10312
+ type: "UPDATE_DATA_PREVIEW_SET";
10313
+ id: string;
10314
+ patch: Partial<Omit<DataPreviewSet, "id">>;
10315
+ previousPatch?: Partial<Omit<DataPreviewSet, "id">>;
10316
+ }
10317
+ interface RemoveDataPreviewSetCommand extends BaseCommand {
10318
+ type: "REMOVE_DATA_PREVIEW_SET";
10319
+ id: string;
10320
+ previousSet?: DataPreviewSet;
10321
+ }
10322
+ interface AddTimelineMarkerCommand extends BaseCommand {
10323
+ type: "ADD_TIMELINE_MARKER";
10324
+ marker: TimelineMarker;
10325
+ }
10326
+ interface UpdateTimelineMarkerCommand extends BaseCommand {
10327
+ type: "UPDATE_TIMELINE_MARKER";
10328
+ markerId: string;
10329
+ patch: Partial<Omit<TimelineMarker, "id">>;
10330
+ previousPatch?: Partial<Omit<TimelineMarker, "id">>;
10331
+ }
10332
+ interface RemoveTimelineMarkerCommand extends BaseCommand {
10333
+ type: "REMOVE_TIMELINE_MARKER";
10334
+ markerId: string;
10335
+ previousMarker?: TimelineMarker;
10336
+ }
10337
+ interface UpdateKeyframeTracksCommand extends BaseCommand {
10338
+ type: "UPDATE_KEYFRAME_TRACKS";
10339
+ nodeId: string;
10340
+ tracks: KeyframeTrack[];
10341
+ previousTracks?: KeyframeTrack[];
10342
+ }
10343
+ interface UpdateAnimationCommand extends BaseCommand {
10344
+ type: "UPDATE_ANIMATION";
10345
+ nodeId: string;
10346
+ animation: any;
10347
+ previousAnimation?: any;
10348
+ }
10349
+ interface GroupNodesCommand extends BaseCommand {
10350
+ type: "GROUP_NODES";
10351
+ nodeIds: string[];
10352
+ frameName?: string;
10353
+ }
10354
+ interface UngroupNodesCommand extends BaseCommand {
10355
+ type: "UNGROUP_NODES";
10356
+ frameId: string;
10357
+ }
10358
+ interface BatchCommandsCommand extends BaseCommand {
10359
+ type: "BATCH_COMMANDS";
10360
+ commands: DocumentCommand[];
10361
+ }
10362
+ interface AddBreakpointCommand extends BaseCommand {
10363
+ type: "ADD_BREAKPOINT";
10364
+ breakpoint: Breakpoint;
10365
+ }
10366
+ interface RemoveBreakpointCommand extends BaseCommand {
10367
+ type: "REMOVE_BREAKPOINT";
10368
+ breakpointId: string;
10369
+ /** Stored for undo */
10370
+ previousBreakpoint?: Breakpoint;
10371
+ }
10372
+ interface SetActiveBreakpointCommand extends BaseCommand {
10373
+ type: "SET_ACTIVE_BREAKPOINT";
10374
+ breakpointId: string | null;
10375
+ previousBreakpointId?: string | null;
10376
+ }
10377
+ interface SetResponsiveOverrideCommand extends BaseCommand {
10378
+ type: "SET_RESPONSIVE_OVERRIDE";
10379
+ nodeId: string;
10380
+ breakpointId: string;
10381
+ /**
10382
+ * Sparse patch to merge into node.responsive[breakpointId].
10383
+ * null = clear the entire override for this breakpoint on this node.
10384
+ */
10385
+ patch: Partial<ResponsiveNodeOverride> | null;
10386
+ /** Previous override value for undo */
10387
+ previousPatch?: Partial<ResponsiveNodeOverride> | null;
10388
+ }
10389
+ interface DetachComponentCommand extends BaseCommand {
10390
+ type: "DETACH_COMPONENT";
10391
+ /** ID of the ComponentNode to convert into a FrameNode with children */
10392
+ nodeId: string;
10393
+ }
10394
+ interface UpdateCanvasSizeCommand extends BaseCommand {
10395
+ type: "UPDATE_CANVAS_SIZE";
10396
+ width: number;
10397
+ height: number;
10398
+ previousWidth?: number;
10399
+ previousHeight?: number;
10400
+ }
10401
+ interface SetBindingCommand extends BaseCommand {
10402
+ type: "SET_BINDING";
10403
+ nodeId: string;
10404
+ /** Property path on the node (e.g. 'props.accentColor' or 'text') */
10405
+ targetProperty: string;
10406
+ /** Binding expression e.g. '{{revenue}}', or null/empty to clear */
10407
+ expression: string;
10408
+ previousExpression?: string;
10409
+ }
10410
+ interface RegisterAssetCommand extends BaseCommand {
10411
+ type: "REGISTER_ASSET";
10412
+ /** AssetRef to add to doc.assetManifest.assets */
10413
+ asset: AssetRef;
10414
+ }
10415
+ interface RemoveAssetCommand extends BaseCommand {
10416
+ type: "REMOVE_ASSET";
10417
+ assetId: string;
10418
+ /** Stored for undo */
10419
+ previousAsset?: AssetRef;
10420
+ }
10421
+ interface SetAssetRefCommand extends BaseCommand {
10422
+ type: "SET_ASSET_REF";
10423
+ /** ID of the PrimitiveMediaNode to update */
10424
+ nodeId: string;
10425
+ assetId: string;
10426
+ previousAssetId?: string;
10427
+ }
10428
+ interface SetFontRefCommand extends BaseCommand {
10429
+ type: "SET_FONT_REF";
10430
+ nodeId: string;
10431
+ fontRef: FontRef;
10432
+ previousFontRef?: FontRef;
10433
+ }
10434
+ type DocumentCommand = SetDocumentCommand | AddNodeCommand | DeleteNodeCommand | UpdateNodePropertyCommand | UpdateNodeStyleCommand | ReorderNodesCommand | AddVariableCommand | RemoveVariableCommand | UpdateVariableCommand | AddDataPreviewSetCommand | UpdateDataPreviewSetCommand | RemoveDataPreviewSetCommand | AddTimelineMarkerCommand | UpdateTimelineMarkerCommand | RemoveTimelineMarkerCommand | UpdateKeyframeTracksCommand | UpdateAnimationCommand | GroupNodesCommand | UngroupNodesCommand | DetachComponentCommand | UpdateCanvasSizeCommand | SetBindingCommand | RegisterAssetCommand | RemoveAssetCommand | SetAssetRefCommand | SetFontRefCommand | AddBreakpointCommand | RemoveBreakpointCommand | SetActiveBreakpointCommand | SetResponsiveOverrideCommand | BatchCommandsCommand;
10435
+
10436
+ interface CommandExecutionResult {
10437
+ nextDocument: OverlayDocument;
10438
+ inverseCommand: DocumentCommand;
10439
+ }
10440
+ declare class CommandExecutor {
10441
+ /**
10442
+ * Execute a command on an OverlayDocument and return the new document + inverse command for undo
10443
+ */
10444
+ execute(doc: OverlayDocument, command: DocumentCommand): CommandExecutionResult;
10445
+ private findNode;
10446
+ private removeNode;
10447
+ private getNestedProperty;
10448
+ private setNestedProperty;
10449
+ /**
10450
+ * Recursively remove node.responsive[breakpointId] from all nodes.
10451
+ * Called by REMOVE_BREAKPOINT to prevent orphan override data.
10452
+ */
10453
+ private purgeBreakpointOverrides;
10454
+ }
10455
+ declare const commandExecutor: CommandExecutor;
10456
+
10457
+ interface CommandHistoryOptions {
10458
+ maxSize?: number;
10459
+ }
10460
+ declare class CommandHistory {
10461
+ private past;
10462
+ private future;
10463
+ private maxSize;
10464
+ constructor(options?: CommandHistoryOptions);
10465
+ execute(doc: OverlayDocument, command: DocumentCommand): OverlayDocument;
10466
+ undo(doc: OverlayDocument): OverlayDocument;
10467
+ redo(doc: OverlayDocument): OverlayDocument;
10468
+ canUndo(): boolean;
10469
+ canRedo(): boolean;
10470
+ clear(): void;
10471
+ }
10472
+
10473
+ interface ViewportState {
10474
+ zoom: number;
10475
+ panX: number;
10476
+ panY: number;
10477
+ canvasWidth: number;
10478
+ canvasHeight: number;
10479
+ }
10480
+ interface ScreenPoint {
10481
+ x: number;
10482
+ y: number;
10483
+ }
10484
+ interface DocumentPoint {
10485
+ x: number;
10486
+ y: number;
10487
+ }
10488
+ declare class ViewportTransform {
10489
+ /**
10490
+ * Convert Document Point (1280x720) to Screen Canvas Point
10491
+ */
10492
+ documentToScreen(point: DocumentPoint, viewport: ViewportState): ScreenPoint;
10493
+ /**
10494
+ * Convert Screen Canvas Mouse Point to Document Point (1280x720)
10495
+ */
10496
+ screenToDocument(point: ScreenPoint, viewport: ViewportState): DocumentPoint;
10497
+ /**
10498
+ * Snap point to grid increment (e.g. 8px grid or 16px grid)
10499
+ */
10500
+ snapToGrid(val: number, gridSize?: number): number;
10501
+ }
10502
+ declare const viewportTransform: ViewportTransform;
10503
+
10504
+ interface ValidationDiagnostic {
10505
+ severity: "error" | "warning";
10506
+ code: string;
10507
+ message: string;
10508
+ nodeId?: string;
10509
+ }
10510
+ declare class DocumentValidator {
10511
+ validate(doc: OverlayDocument): ValidationDiagnostic[];
10512
+ private validateNode;
10513
+ }
10514
+ declare const documentValidator: DocumentValidator;
10515
+
10516
+ type AnimationDiagnosticSeverity = "error" | "warning" | "info";
10517
+ interface AnimationDiagnostic {
10518
+ nodeId: string;
10519
+ nodeName: string;
10520
+ severity: AnimationDiagnosticSeverity;
10521
+ code: string;
10522
+ message: string;
10523
+ }
10524
+ declare class AnimationValidator {
10525
+ validate(doc: OverlayDocument): AnimationDiagnostic[];
10526
+ private walkNodes;
10527
+ private validateNode;
10528
+ }
10529
+ declare const animationValidator: AnimationValidator;
10530
+
10531
+ declare class DocumentMigrator {
10532
+ /**
10533
+ * Migrate any raw document or legacy clip to latest OverlayDocument v2.0
10534
+ */
10535
+ migrate(rawInput: any): OverlayDocument;
10536
+ fromLegacyClip(clip: SmartOverlayClip): OverlayDocument;
10537
+ /**
10538
+ * Phase 4I upgrade pass: promote PrimitiveMediaNode.src → assetId.
10539
+ * Builds assetManifest from any media nodes that still use the legacy src field.
10540
+ * This is idempotent — safe to run multiple times.
10541
+ */
10542
+ private migrateV2Document;
10543
+ private createDefaultDocument;
10544
+ }
10545
+ declare const documentMigrator: DocumentMigrator;
10546
+
10547
+ interface TemplateManifest {
10548
+ kind: "smart-overlay-template";
10549
+ schemaVersion: "1.0";
10550
+ metadata: {
10551
+ id: string;
10552
+ name: string;
10553
+ category: string;
10554
+ tags: string[];
10555
+ thumbnailUrl?: string;
10556
+ createdAt: string;
10557
+ updatedAt: string;
10558
+ };
10559
+ document: OverlayDocument;
10560
+ }
10561
+ declare function serializeTemplate(doc: OverlayDocument, meta: Omit<TemplateManifest["metadata"], "createdAt" | "updatedAt">): TemplateManifest;
10562
+ declare function deserializeTemplate(manifest: TemplateManifest): OverlayDocument;
10563
+
10564
+ /**
10565
+ * Property Interpolation Registry
10566
+ * Handles type-aware interpolation for numbers, angles, colors, and discrete values.
10567
+ */
10568
+ declare class PropertyInterpolator {
10569
+ /**
10570
+ * Linear interpolation for standard numbers
10571
+ */
10572
+ interpolateNumber(a: number, b: number, t: number): number;
10573
+ /**
10574
+ * Shortest rotational path angle interpolation in degrees.
10575
+ * E.g., 350° → 10° rotates forward +20°, not backwards -340°.
10576
+ */
10577
+ interpolateAngle(a: number, b: number, t: number): number;
10578
+ /**
10579
+ * RGBA color lerp between hex/rgb strings
10580
+ */
10581
+ interpolateColor(colorA: string, colorB: string, t: number): string;
10582
+ /**
10583
+ * Discrete switch at t >= 0.5 for non-continuous values (e.g. strings, booleans)
10584
+ */
10585
+ interpolateDiscrete(a: any, b: any, t: number): any;
10586
+ /**
10587
+ * Dispatch interpolation based on property name or value types
10588
+ */
10589
+ interpolate(property: string, a: any, b: any, t: number): any;
10590
+ private isColorString;
10591
+ private parseColor;
10592
+ }
10593
+ declare const propertyInterpolator: PropertyInterpolator;
10594
+
10595
+ type PropertyValueType = "number" | "angle" | "color" | "discrete";
10596
+ interface PropertyAnimationDefinition {
10597
+ property: string;
10598
+ type: PropertyValueType;
10599
+ combineMode: "add" | "multiply" | "override";
10600
+ interpolate(a: any, b: any, t: number): any;
10601
+ }
10602
+ declare class PropertyAnimationRegistry {
10603
+ private properties;
10604
+ constructor();
10605
+ register(def: PropertyAnimationDefinition): void;
10606
+ get(property: string): PropertyAnimationDefinition | undefined;
10607
+ interpolate(property: string, a: any, b: any, t: number): any;
10608
+ private registerDefaults;
10609
+ }
10610
+ declare const propertyAnimationRegistry: PropertyAnimationRegistry;
10611
+
10612
+ interface MotionPresetParameter {
10613
+ key: string;
10614
+ label: string;
10615
+ type: "number" | "select" | "boolean";
10616
+ default: any;
10617
+ options?: Array<{
10618
+ label: string;
10619
+ value: string;
10620
+ }>;
10621
+ min?: number;
10622
+ max?: number;
10623
+ step?: number;
10624
+ }
10625
+ interface MotionPresetDefinition {
10626
+ id: string;
10627
+ name: string;
10628
+ category: "entrance" | "exit" | "attention" | "emphasis";
10629
+ /** Which node types this preset applies to. '*' = all. */
10630
+ supportedNodeTypes?: string[];
10631
+ /** Schema-driven parameter list — enables auto-generated config UI */
10632
+ parameters?: MotionPresetParameter[];
10633
+ buildTracks(preset: MotionPreset, clipDuration: number): KeyframeTrack[];
10634
+ }
10635
+ declare class MotionPresetRegistry {
10636
+ private presets;
10637
+ constructor();
10638
+ register(definition: MotionPresetDefinition): void;
10639
+ get(id: string): MotionPresetDefinition | undefined;
10640
+ list(category?: "entrance" | "exit" | "attention"): MotionPresetDefinition[];
10641
+ private registerBuiltIns;
10642
+ }
10643
+ declare const motionPresetRegistry: MotionPresetRegistry;
10644
+
10645
+ interface AlignmentGuide {
10646
+ type: "horizontal" | "vertical";
10647
+ position: number;
10648
+ }
10649
+ /** Spatial snap result for canvas node positioning (x/y/alignment guides). */
10650
+ interface CanvasSnapResult {
10651
+ x: number;
10652
+ y: number;
10653
+ guides: AlignmentGuide[];
10654
+ }
10655
+ declare class SnapEngine {
10656
+ /**
10657
+ * Calculate snapped position and active alignment guides for a moving node
10658
+ */
10659
+ calculateSnap(movingNode: {
10660
+ x: number;
10661
+ y: number;
10662
+ width: number;
10663
+ height: number;
10664
+ }, otherNodes: SceneNode[], canvasWidth?: number, canvasHeight?: number, threshold?: number): CanvasSnapResult;
10665
+ }
10666
+ declare const snapEngine: SnapEngine;
10667
+
10668
+ interface ComputedNodeBounds {
10669
+ x: number;
10670
+ y: number;
10671
+ width: number;
10672
+ height: number;
10673
+ }
10674
+ interface LayoutComputedState {
10675
+ nodes: Record<string, ComputedNodeBounds>;
10676
+ }
10677
+ declare class LayoutEngine {
10678
+ /**
10679
+ * Deterministically compute auto-layout geometry (fixed / hug / fill)
10680
+ * for an OverlayDocument before animation & rendering passes.
10681
+ */
10682
+ computeLayout(doc: OverlayDocument, contextData?: Record<string, any>): LayoutComputedState;
10683
+ /**
10684
+ * Compute layout for a specific breakpoint.
10685
+ * Resolves the document for the breakpoint first (canvas + node overrides),
10686
+ * then runs the standard layout pipeline on the resolved document.
10687
+ *
10688
+ * When breakpointId is null, behaves identically to computeLayout.
10689
+ */
10690
+ computeLayoutForBreakpoint(doc: OverlayDocument, breakpointId: string | null, contextData?: Record<string, any>): LayoutComputedState;
10691
+ private computeNodeGeometry;
10692
+ /** Apply min/max clamping and aspectRatioLock to resolved dimensions. */
10693
+ private applyDimensionConstraints;
10694
+ }
10695
+ declare const layoutEngine: LayoutEngine;
10696
+
10697
+ type ResourceState = "pending" | "loading" | "ready" | "missing" | "error";
10698
+ interface RegisteredAsset {
10699
+ ref: AssetRef;
10700
+ state: ResourceState;
10701
+ /** Number of document nodes currently referencing this asset */
10702
+ refCount: number;
10703
+ /** Final resolved URL — blob URL for local, original URI for remote */
10704
+ resolvedUrl?: string;
10705
+ error?: string;
10706
+ }
10707
+ /**
10708
+ * Central in-memory asset registry.
10709
+ *
10710
+ * Invariants:
10711
+ * - Same assetId always returns the same RegisteredAsset object (identity-stable)
10712
+ * - refCount tracks how many nodes reference the asset
10713
+ * - Releasing the last reference transitions state to "missing" (no delete — allows re-registration)
10714
+ * - Binary data is NEVER stored inside a registry entry
10715
+ */
10716
+ declare class AssetRegistry {
10717
+ private entries;
10718
+ /**
10719
+ * Register an asset reference. If already registered, increments refCount
10720
+ * and updates the ref metadata (source, uri, metadata may change).
10721
+ */
10722
+ register(ref: AssetRef): RegisteredAsset;
10723
+ /**
10724
+ * Mark an asset as loaded and ready, storing its resolved URL.
10725
+ * Binary data must NOT be passed here — only a URL.
10726
+ */
10727
+ markReady(assetId: string, resolvedUrl: string): void;
10728
+ /**
10729
+ * Mark an asset as currently loading (e.g. fetch in flight).
10730
+ */
10731
+ markLoading(assetId: string): void;
10732
+ /**
10733
+ * Mark an asset as errored with a diagnostic message.
10734
+ */
10735
+ markError(assetId: string, error: string): void;
10736
+ /**
10737
+ * Decrement refCount. If count reaches 0, transitions to "missing".
10738
+ * Does NOT delete the entry — allows re-registration without losing state identity.
10739
+ */
10740
+ release(assetId: string): void;
10741
+ /**
10742
+ * Returns the RegisteredAsset entry, or undefined if not known.
10743
+ */
10744
+ get(assetId: string): RegisteredAsset | undefined;
10745
+ /**
10746
+ * Returns the current ResourceState for an assetId.
10747
+ * Returns "missing" if the asset has never been registered.
10748
+ */
10749
+ getState(assetId: string): ResourceState;
10750
+ /**
10751
+ * Returns all currently registered AssetRef entries.
10752
+ */
10753
+ list(): AssetRef[];
10754
+ /**
10755
+ * Clears the entire registry. Use only for testing or full session reset.
10756
+ */
10757
+ clear(): void;
10758
+ /**
10759
+ * Returns the total number of registered assets (including missing/error states).
10760
+ */
10761
+ size(): number;
10762
+ }
10763
+ /** Singleton asset registry for the current studio session */
10764
+ declare const assetRegistry: AssetRegistry;
10765
+
10766
+ interface RegisteredFont {
10767
+ ref: FontRef;
10768
+ state: ResourceState;
10769
+ /** CSS font-family value to use in fallback scenarios */
10770
+ fallbackFamily: string;
10771
+ }
10772
+ /**
10773
+ * Central font registry.
10774
+ *
10775
+ * Invariants:
10776
+ * - A font reference can never crash resolution — getFallback() always returns a valid value
10777
+ * - Weight/style variants are registered and resolved independently
10778
+ * - Font state changes do NOT mutate the OverlayDocument
10779
+ * - Missing font always falls back to "system-ui" or a registered substitute
10780
+ */
10781
+ declare class FontRegistry {
10782
+ private entries;
10783
+ /** Compute a stable key for a font variant */
10784
+ private key;
10785
+ /**
10786
+ * Register a font reference. If the same variant is already registered,
10787
+ * updates state and metadata.
10788
+ */
10789
+ register(ref: FontRef): RegisteredFont;
10790
+ /**
10791
+ * Mark a font variant as loaded and ready (CSS @font-face registered with browser).
10792
+ */
10793
+ markReady(family: string, weight: number, style: "normal" | "italic"): void;
10794
+ /**
10795
+ * Mark a font variant as errored.
10796
+ */
10797
+ markError(family: string, weight: number, style: "normal" | "italic"): void;
10798
+ /**
10799
+ * Returns the current ResourceState for a font variant.
10800
+ * Returns "missing" if the font has never been registered.
10801
+ */
10802
+ getState(family: string, weight: number, style: "normal" | "italic"): ResourceState;
10803
+ /**
10804
+ * Returns the CSS font-family to apply for a given font request.
10805
+ * If the font is ready, returns the requested family.
10806
+ * If missing/error, returns the safe fallback — NEVER throws.
10807
+ */
10808
+ getFallback(family: string, weight?: number, style?: "normal" | "italic"): string;
10809
+ /**
10810
+ * Returns all registered FontRef entries.
10811
+ */
10812
+ list(): FontRef[];
10813
+ /**
10814
+ * Clears all font registrations. Use only for testing or session reset.
10815
+ */
10816
+ clear(): void;
10817
+ private computeFallback;
10818
+ }
10819
+ /** Singleton font registry for the current studio session */
10820
+ declare const fontRegistry: FontRegistry;
10821
+
10822
+ interface ResolvedAsset {
10823
+ assetId: string;
10824
+ state: ResourceState;
10825
+ /** Ready-to-use URL — blob URL for local, original URI for remote */
10826
+ url?: string;
10827
+ /** Always-available placeholder — checkerboard data URI */
10828
+ fallbackUrl: string;
10829
+ }
10830
+ interface ResolvedFont {
10831
+ family: string;
10832
+ /** Actual CSS font-family to apply — may be fallback */
10833
+ resolvedFamily: string;
10834
+ state: ResourceState;
10835
+ }
10836
+ /**
10837
+ * Async-capable asset and font resolver that sits between the document
10838
+ * and the projection/export layer.
10839
+ *
10840
+ * Key contract:
10841
+ * - resolve() is ALWAYS synchronous — never blocks, never throws
10842
+ * - Missing assets return a deterministic placeholder — never crash the renderer
10843
+ * - warmDocument() pre-fetches all assets declared in doc.assetManifest
10844
+ * - The projection layer calls resolve() exclusively; it never fetches directly
10845
+ */
10846
+ declare class RuntimeAssetResolver {
10847
+ /**
10848
+ * Synchronously resolves an asset.
10849
+ * Returns current cached state immediately — never blocks.
10850
+ * Safe to call 1000× per frame.
10851
+ */
10852
+ resolve(assetId: string): ResolvedAsset;
10853
+ /**
10854
+ * Synchronously resolves a font variant.
10855
+ * Returns a CSS-ready `resolvedFamily` — never throws, never blocks.
10856
+ */
10857
+ resolveFont(family: string, weight?: number, style?: "normal" | "italic"): ResolvedFont;
10858
+ /**
10859
+ * Asynchronously resolves an asset — waits for state to transition
10860
+ * to "ready" or "error". Initiates load if the asset is "pending".
10861
+ */
10862
+ resolveAsync(assetId: string): Promise<ResolvedAsset>;
10863
+ /**
10864
+ * Asynchronously resolves a font — loads the @font-face if needed.
10865
+ */
10866
+ resolveFontAsync(ref: FontRef): Promise<ResolvedFont>;
10867
+ /**
10868
+ * Pre-warm the resolver for all assets and fonts declared in a document's AssetManifest.
10869
+ * Fires all fetches concurrently. The projection layer does NOT need to await this —
10870
+ * it will get placeholders until assets transition to "ready".
10871
+ */
10872
+ warmDocument(doc: OverlayDocument): Promise<void>;
10873
+ private loadAsset;
10874
+ private loadFont;
10875
+ /**
10876
+ * Walk document nodes and collect all FontRef values.
10877
+ */
10878
+ private collectFontRefs;
10879
+ }
10880
+ /** Singleton runtime asset resolver */
10881
+ declare const runtimeAssetResolver: RuntimeAssetResolver;
10882
+
10883
+ /**
10884
+ * Phase 4J — Responsive Layout Resolver
10885
+ *
10886
+ * Pure, deterministic, side-effect-free functions that merge a node's
10887
+ * base properties with a breakpoint-specific sparse override patch.
10888
+ *
10889
+ * Architecture contract:
10890
+ * Base property → responsive override → resolved property
10891
+ *
10892
+ * Identity fields (id, type, children) are NEVER overridden.
10893
+ * Only layout/style/geometry fields participate in breakpoint resolution.
10894
+ */
10895
+
10896
+ /**
10897
+ * Merge a node's base properties with the responsive override for the given
10898
+ * breakpoint. Returns a new object — does NOT mutate the original node.
10899
+ *
10900
+ * When breakpointId is null (base layout), the node is returned unchanged.
10901
+ * When breakpointId is non-null but the node has no override for it, the node
10902
+ * is returned unchanged (graceful fallback, no throw).
10903
+ */
10904
+ declare function resolveNodeForBreakpoint(node: SceneNode, breakpointId: string | null): SceneNode;
10905
+ /**
10906
+ * Produce a shallow-cloned OverlayDocument where:
10907
+ * - `canvas` is replaced by the breakpoint's canvas dimensions
10908
+ * - all nodes are recursively resolved for the breakpoint
10909
+ *
10910
+ * When breakpointId is null, the original document is returned unchanged.
10911
+ * When the breakpoint is not found in doc.breakpoints, the document is
10912
+ * returned unchanged (graceful fallback, no throw).
10913
+ *
10914
+ * The returned document is suitable as the direct input to
10915
+ * `LayoutEngine.computeLayout` and `AnimationRuntime.evaluateScene`.
10916
+ */
10917
+ declare function resolveDocumentForBreakpoint(doc: OverlayDocument, breakpointId: string | null): OverlayDocument;
10918
+
10919
+ /**
10920
+ * Phase 4K / 4L / 4M — Production Export & Rendering Pipeline Types
10921
+ */
10922
+
10923
+ type ExportProfile = "720p-landscape" | "1080p-landscape" | "1080p-portrait" | "1080p-square" | "4:5-portrait" | "custom";
10924
+ interface ProfileCanvasDimensions {
10925
+ width: number;
10926
+ height: number;
10927
+ }
10928
+ declare const EXPORT_PROFILE_PRESETS: Record<Exclude<ExportProfile, "custom">, ProfileCanvasDimensions>;
10929
+ type ExportFormat = "png-sequence" | "webm" | "gif" | "raw-frames";
10930
+ interface ExportConfig {
10931
+ profile: ExportProfile;
10932
+ /** Breakpoint ID for responsive resolution. null = base document canvas */
10933
+ breakpointId?: string | null;
10934
+ /** Target resolution width when profile === 'custom' */
10935
+ customWidth?: number;
10936
+ /** Target resolution height when profile === 'custom' */
10937
+ customHeight?: number;
10938
+ /** Resolution multiplier (e.g. 1.0 = 100%, 2.0 = 200% super-sampled) */
10939
+ scale?: number;
10940
+ /** Frames per second for sequence stepping */
10941
+ fps?: number;
10942
+ /** Duration override in seconds. Defaults to document duration */
10943
+ duration?: number;
10944
+ /** If true, background color is cleared to transparent (RGBA alpha = 0) */
10945
+ transparent?: boolean;
10946
+ /** Target export output format */
10947
+ format?: ExportFormat;
10948
+ /** Context data overrides for variable evaluation during export */
10949
+ contextData?: Record<string, any>;
10950
+ }
10951
+ type ExportDiagnosticSeverity = "error" | "warning" | "info";
10952
+ type ExportDiagnosticCode = "MISSING_ASSET" | "MISSING_FONT" | "INVALID_BINDING" | "DURATION_OVERFLOW" | "UNRESOLVED_CONSTRAINTS" | "SUBPIXEL_DIMENSIONS" | "NON_STANDARD_FPS" | "RENDERER_FAILURE" | "CORS_TAINT_WARNING" | "REMOTE_ASSET_TIMEOUT" | "SNAPSHOT_ISOLATION_ERROR";
10953
+ interface ExportValidationDiagnostic {
10954
+ severity: ExportDiagnosticSeverity;
10955
+ code: ExportDiagnosticCode;
10956
+ nodeId?: string;
10957
+ message: string;
10958
+ details?: Record<string, any>;
10959
+ }
10960
+ interface EvaluatedExportFrame {
10961
+ frameIndex: number;
10962
+ time: number;
10963
+ resolvedDoc: OverlayDocument;
10964
+ layoutState: LayoutComputedState;
10965
+ evaluatedSceneState: EvaluatedSceneState;
10966
+ canvasWidth: number;
10967
+ canvasHeight: number;
10968
+ }
10969
+ interface ExportFrameDescriptor {
10970
+ frameIndex: number;
10971
+ time: number;
10972
+ width: number;
10973
+ height: number;
10974
+ dataUrl?: string;
10975
+ blob?: Blob;
10976
+ imageData?: ImageData;
10977
+ }
10978
+ interface ExportProgress {
10979
+ stage: "queued" | "validating" | "rendering" | "encoding" | "completed" | "completed-with-warnings" | "cancelled" | "failed";
10980
+ renderedFrames: number;
10981
+ encodedFrames: number;
10982
+ totalFrames: number;
10983
+ percent: number;
10984
+ currentTime: number;
10985
+ message?: string;
10986
+ }
10987
+ type JobStatus = "queued" | "validating" | "rendering" | "encoding" | "completed" | "completed-with-warnings" | "cancelled" | "failed";
10988
+ interface EncodedFileEntry {
10989
+ name: string;
10990
+ blob: Blob;
10991
+ }
10992
+ interface EncodedOutput {
10993
+ format: ExportFormat;
10994
+ blob?: Blob;
10995
+ dataUrl?: string;
10996
+ files?: EncodedFileEntry[];
10997
+ frameCount: number;
10998
+ sizeBytes?: number;
10999
+ }
11000
+ interface MediaEncoder {
11001
+ format: ExportFormat;
11002
+ encode(frames: AsyncIterable<EvaluatedExportFrame>, config: ExportConfig, signal?: AbortSignal, onProgress?: (progress: ExportProgress) => void): Promise<EncodedOutput>;
11003
+ }
11004
+ interface ExportJobRecord {
11005
+ id: string;
11006
+ documentId: string;
11007
+ documentTitle: string;
11008
+ config: ExportConfig;
11009
+ status: JobStatus;
11010
+ progress: ExportProgress;
11011
+ createdAt: string;
11012
+ completedAt?: string;
11013
+ output?: EncodedOutput;
11014
+ diagnostics: ExportValidationDiagnostic[];
11015
+ error?: string;
11016
+ retryCount?: number;
11017
+ docSnapshot?: OverlayDocument;
11018
+ }
11019
+
11020
+ /**
11021
+ * Phase 4K / 4M — Pre-Export Safety Validator
11022
+ *
11023
+ * Inspects an OverlayDocument and ExportConfig before rendering to flag
11024
+ * missing assets, missing fonts, syntax/expression errors, duration overflows,
11025
+ * invalid layout constraints, and CORS canvas taint risks.
11026
+ */
11027
+
11028
+ declare class ExportValidator {
11029
+ validate(doc: OverlayDocument, config?: Partial<ExportConfig>): ExportValidationDiagnostic[];
11030
+ private walkNodes;
11031
+ private validateNode;
11032
+ }
11033
+ declare const exportValidator: ExportValidator;
11034
+
11035
+ /**
11036
+ * Phase 4K — Deterministic Frame Pipeline
11037
+ *
11038
+ * Runs the exact engine evaluation pass for a given time t:
11039
+ * Document → Responsive Resolution → Asset Resolution → Layout Engine → Animation Runtime → EvaluatedSceneState
11040
+ *
11041
+ * Guaranteed byte-for-byte identical output for identical time inputs.
11042
+ * The editor preview and export pipeline consume this exact same evaluation flow.
11043
+ */
11044
+
11045
+ /**
11046
+ * Resolve target canvas dimensions based on ExportConfig profile and scale.
11047
+ */
11048
+ declare function resolveExportCanvasDimensions(doc: OverlayDocument, config?: Partial<ExportConfig>): {
11049
+ width: number;
11050
+ height: number;
11051
+ };
11052
+ /**
11053
+ * Evaluates a single export frame at time t.
11054
+ * Pure deterministic pass — returns resolved document, auto-layout bounds,
11055
+ * and evaluated scene state.
11056
+ */
11057
+ declare function evaluateExportFrame(doc: OverlayDocument, time: number, config?: Partial<ExportConfig>): EvaluatedExportFrame;
11058
+
11059
+ /**
11060
+ * Phase 4K — Offscreen Render Engine & Sequence Generator
11061
+ *
11062
+ * Renders evaluated frames to canvas/image buffers and generates discrete
11063
+ * frame sequences for video/image sequence export.
11064
+ */
11065
+
11066
+ declare class RenderEngine {
11067
+ /**
11068
+ * Evaluates and projects frame at time t onto PixiSceneProjection.
11069
+ * Returns evaluated export frame containing resolved bounds and EvaluatedSceneState.
11070
+ */
11071
+ evaluateFrame(doc: OverlayDocument, time: number, config?: Partial<ExportConfig>): EvaluatedExportFrame;
11072
+ /**
11073
+ * Render frame to an HTMLCanvasElement or 2D context.
11074
+ */
11075
+ renderFrameToCanvas(doc: OverlayDocument, time: number, config?: Partial<ExportConfig>, targetCanvas?: any): ExportFrameDescriptor;
11076
+ /**
11077
+ * Generates a complete frame sequence by stepping frame-by-frame from t=0 to t=duration.
11078
+ */
11079
+ renderFrameSequence(doc: OverlayDocument, config?: Partial<ExportConfig>, onProgress?: (progress: ExportProgress) => void): Promise<ExportFrameDescriptor[]>;
11080
+ }
11081
+ declare const renderEngine: RenderEngine;
11082
+
11083
+ /**
11084
+ * Phase 4L — Streaming Frame Pipeline
11085
+ *
11086
+ * Async generator yielding single EvaluatedExportFrame descriptors step-by-step:
11087
+ * t = frameIndex / fps
11088
+ *
11089
+ * Key Architectural Invariant:
11090
+ * The frame pipeline does not accumulate historical frames in application-level memory;
11091
+ * working memory is independent of frame count, excluding encoder/runtime/resource buffers.
11092
+ * Raw RGBA frame data is yielded one-by-one and discarded immediately by the consumer.
11093
+ * AbortSignal is checked on every step to support instant cancellation.
11094
+ */
11095
+
11096
+ /**
11097
+ * Custom error class thrown when export streaming is aborted mid-run.
11098
+ */
11099
+ declare class ExportAbortError extends Error {
11100
+ constructor(message?: string);
11101
+ }
11102
+ /**
11103
+ * Async generator yielding EvaluatedExportFrame one frame at a time.
11104
+ */
11105
+ declare function streamExportFrames(doc: OverlayDocument, config?: Partial<ExportConfig>, signal?: AbortSignal): AsyncGenerator<EvaluatedExportFrame, void, unknown>;
11106
+
11107
+ /**
11108
+ * Phase 4L — Media Encoder Abstraction & Implementations
11109
+ *
11110
+ * Decouples video/image encoding from the core engine renderer.
11111
+ * Consumes an AsyncIterable<EvaluatedExportFrame> stream and produces EncodedOutput.
11112
+ */
11113
+
11114
+ declare class PngSequenceEncoder implements MediaEncoder {
11115
+ format: ExportFormat;
11116
+ encode(frames: AsyncIterable<EvaluatedExportFrame>, config: ExportConfig, signal?: AbortSignal, onProgress?: (progress: ExportProgress) => void): Promise<EncodedOutput>;
11117
+ }
11118
+ declare class GifEncoder implements MediaEncoder {
11119
+ format: ExportFormat;
11120
+ encode(frames: AsyncIterable<EvaluatedExportFrame>, config: ExportConfig, signal?: AbortSignal, onProgress?: (progress: ExportProgress) => void): Promise<EncodedOutput>;
11121
+ }
11122
+ declare class WebMEncoder implements MediaEncoder {
11123
+ format: ExportFormat;
11124
+ encode(frames: AsyncIterable<EvaluatedExportFrame>, config: ExportConfig, signal?: AbortSignal, onProgress?: (progress: ExportProgress) => void): Promise<EncodedOutput>;
11125
+ }
11126
+ declare class RawFramesEncoder implements MediaEncoder {
11127
+ format: ExportFormat;
11128
+ encode(frames: AsyncIterable<EvaluatedExportFrame>, config: ExportConfig, signal?: AbortSignal, onProgress?: (progress: ExportProgress) => void): Promise<EncodedOutput>;
11129
+ }
11130
+ declare class MediaEncoderRegistry {
11131
+ private encoders;
11132
+ constructor();
11133
+ register(encoder: MediaEncoder): void;
11134
+ get(format: ExportFormat): MediaEncoder;
11135
+ }
11136
+ declare const mediaEncoderRegistry: MediaEncoderRegistry;
11137
+
11138
+ /**
11139
+ * Phase 4K / 4L / 4M — ExportJob Controller
11140
+ *
11141
+ * Stateful, decoupled job orchestrator managing document snapshotting, preflight validation,
11142
+ * streaming frame rendering, media encoding, status differentiation, and AbortSignal cancellation.
11143
+ */
11144
+
11145
+ type JobChangeListener = (job: ExportJob) => void;
11146
+ declare class ExportJob {
11147
+ id: string;
11148
+ doc: OverlayDocument;
11149
+ /** Immutable document snapshot captured at job creation time */
11150
+ docSnapshot: OverlayDocument;
11151
+ config: ExportConfig;
11152
+ status: JobStatus;
11153
+ progress: ExportProgress;
11154
+ diagnostics: ExportValidationDiagnostic[];
11155
+ output?: EncodedOutput;
11156
+ error?: string;
11157
+ createdAt: string;
11158
+ completedAt?: string;
11159
+ retryCount: number;
11160
+ private abortController;
11161
+ private listeners;
11162
+ constructor(doc: OverlayDocument, config: ExportConfig);
11163
+ subscribe(listener: JobChangeListener): () => void;
11164
+ private notify;
11165
+ /**
11166
+ * Run preflight validation on the captured document snapshot.
11167
+ * Returns true if export is allowed (zero error diagnostics).
11168
+ */
11169
+ validate(): boolean;
11170
+ /**
11171
+ * Start executing the export job using docSnapshot.
11172
+ * Preflight errors block execution; warnings permit execution with advisory.
11173
+ */
11174
+ start(): Promise<EncodedOutput>;
11175
+ /**
11176
+ * Retry executing a failed or cancelled export job using the document snapshot.
11177
+ */
11178
+ retry(): Promise<EncodedOutput>;
11179
+ /**
11180
+ * Cancel job execution immediately via AbortSignal.
11181
+ */
11182
+ cancel(): void;
11183
+ toRecord(): ExportJobRecord;
11184
+ }
11185
+
11186
+ /**
11187
+ * Phase 4R.2 — Modular Visualization Renderer & Projection Registry
11188
+ *
11189
+ * Decouples PixiJS rendering execution from engine geometry evaluation.
11190
+ * Consumes EvaluatedChartGeometry / EvaluatedGaugeGeometry / etc. and projects onto PixiJS Containers.
11191
+ */
11192
+
11193
+ interface VisualizationRenderContext {
11194
+ container: Container;
11195
+ hexToNumber: (hex: string | undefined, fallback?: number) => number;
11196
+ renderLabel: (parent: Container, name: string, text: string, x: number, y: number, size?: number, color?: string, bold?: boolean, fontFamily?: string) => void;
11197
+ }
11198
+ interface VisualizationRenderer<TGeometry = any> {
11199
+ render(geometry: TGeometry, context: VisualizationRenderContext): void;
11200
+ }
11201
+ declare class VisualizationRendererRegistry {
11202
+ private renderers;
11203
+ register<TGeometry = any>(type: string, renderer: VisualizationRenderer<TGeometry>): void;
11204
+ get<TGeometry = any>(type: string): VisualizationRenderer<TGeometry> | undefined;
11205
+ has(type: string): boolean;
11206
+ }
11207
+ declare const visualizationRendererRegistry: VisualizationRendererRegistry;
11208
+
11209
+ /**
11210
+ * Phase 4Q — VisualizationEngine (refactored)
11211
+ *
11212
+ * Pure geometry generator registry: (ChartNode, width, height, t) → EvaluatedChartGeometry.
11213
+ *
11214
+ * Architecture:
11215
+ * evaluate() — shared infrastructure + dispatcher
11216
+ * ├── computeBars() → "bar"
11217
+ * ├── computeLinePaths() → "line" | "area"
11218
+ * └── computeArcs() → "pie" | "donut"
11219
+ *
11220
+ * No Pixi, no DOM, no async. Deterministic and fully testable.
11221
+ */
11222
+
11223
+ interface BarGeometry {
11224
+ seriesId: string;
11225
+ categoryIndex: number;
11226
+ x: number;
11227
+ y: number;
11228
+ w: number;
11229
+ /** Animated bar height at current t */
11230
+ h: number;
11231
+ /** Full bar height at t=1 */
11232
+ fullH: number;
11233
+ color: string;
11234
+ rawValue: number;
11235
+ animatedValue: number;
11236
+ labelText: string;
11237
+ active: boolean;
11238
+ }
11239
+ interface LinePoint {
11240
+ seriesId: string;
11241
+ categoryIndex: number;
11242
+ /** Pixel x for this category */
11243
+ x: number;
11244
+ /** Animated pixel y (baseline at t=0, data position at t=1) */
11245
+ y: number;
11246
+ /** Full pixel y at t=1 */
11247
+ fullY: number;
11248
+ /** Bottom of plot (baseline y — used for area fill) */
11249
+ baseY: number;
11250
+ color: string;
11251
+ rawValue: number;
11252
+ animatedValue: number;
11253
+ labelText: string;
11254
+ active: boolean;
11255
+ }
11256
+ interface ArcGeometry {
11257
+ seriesId: string;
11258
+ /** Animated start angle (radians) */
11259
+ startAngle: number;
11260
+ /** Animated end angle (radians) — equals startAngle at t=0 */
11261
+ endAngle: number;
11262
+ /** Final end angle at t=1 */
11263
+ fullEndAngle: number;
11264
+ /** 0 for pie, >0 for donut */
11265
+ innerRadius: number;
11266
+ outerRadius: number;
11267
+ color: string;
11268
+ rawValue: number;
11269
+ animatedValue: number;
11270
+ percentage: number;
11271
+ labelText: string;
11272
+ /** Midpoint of arc — for label placement */
11273
+ labelX: number;
11274
+ labelY: number;
11275
+ }
11276
+ interface GridLineGeometry {
11277
+ y: number;
11278
+ label: string;
11279
+ value: number;
11280
+ }
11281
+ interface AxisLabel {
11282
+ x: number;
11283
+ y: number;
11284
+ text: string;
11285
+ anchor: "start" | "middle" | "end";
11286
+ }
11287
+ interface LegendEntry {
11288
+ x: number;
11289
+ y: number;
11290
+ color: string;
11291
+ label: string;
11292
+ }
11293
+ interface PlotArea {
11294
+ x: number;
11295
+ y: number;
11296
+ w: number;
11297
+ h: number;
11298
+ }
11299
+ interface GeometryAnchor {
11300
+ x: number;
11301
+ y: number;
11302
+ w: number;
11303
+ h: number;
11304
+ label: string;
11305
+ }
11306
+ interface AnchorMap {
11307
+ /** bar[seriesId][categoryIndex] → bounding box of top of bar */
11308
+ bars: Record<string, Record<number, GeometryAnchor>>;
11309
+ /** point[seriesId][categoryIndex] → point center coordinate */
11310
+ points: Record<string, Record<number, GeometryAnchor>>;
11311
+ /** arc[seriesId] → midpoint coordinate of arc */
11312
+ arcs: Record<string, GeometryAnchor>;
11313
+ }
11314
+ interface HighlightRegionGeometry {
11315
+ x: number;
11316
+ y: number;
11317
+ w: number;
11318
+ h: number;
11319
+ color: string;
11320
+ opacity: number;
11321
+ label?: string;
11322
+ }
11323
+ interface EvaluatedChartGeometry {
11324
+ bars: BarGeometry[];
11325
+ linePoints: LinePoint[];
11326
+ arcs: ArcGeometry[];
11327
+ centerX: number;
11328
+ centerY: number;
11329
+ gridLines: GridLineGeometry[];
11330
+ xAxisLabels: AxisLabel[];
11331
+ yAxisLabels: AxisLabel[];
11332
+ legendEntries: LegendEntry[];
11333
+ plotArea: PlotArea;
11334
+ t: number;
11335
+ anchors: AnchorMap;
11336
+ highlights: HighlightRegionGeometry[];
11337
+ }
11338
+ declare class VisualizationEngine {
11339
+ /**
11340
+ * Evaluate a ChartNode into flat geometry at normalized time t ∈ [0,1].
11341
+ *
11342
+ * @param node Fully data-bound ChartNode (series[].data populated by DataBindingEngine)
11343
+ * @param width Absolute pixel width
11344
+ * @param height Absolute pixel height
11345
+ * @param t Normalized animation time [0,1]
11346
+ */
11347
+ evaluate(node: ChartNode, width: number, height: number, t: number): EvaluatedChartGeometry;
11348
+ private normalizeSeries;
11349
+ private resolveCategories;
11350
+ private computeDomain;
11351
+ private niceMax;
11352
+ private valueToY;
11353
+ private computeGridLines;
11354
+ private computeYAxisLabels;
11355
+ private computeXAxisLabels;
11356
+ private computeBars;
11357
+ private computeLinePaths;
11358
+ private computeArcs;
11359
+ private computeLegend;
11360
+ private computeAnchors;
11361
+ private computeHighlights;
11362
+ private emptyGeometry;
11363
+ }
11364
+ declare const visualizationEngine: VisualizationEngine;
11365
+
8948
11366
  /**
8949
11367
  * @clypra-studio/engine — Canvas 2D text effects, Lottie tooling, and animation engine.
8950
11368
  * @version 0.1.0
@@ -8953,4 +11371,4 @@ declare function clearAllBodyEffectMasks(): void;
8953
11371
  /** Package version */
8954
11372
  declare const VERSION = "0.1.0";
8955
11373
 
8956
- export { AlphaEffect, type AnimBuildOpts, type AnimKeyframe, AnimTrack, type AnimTrackDef, type AnimatableParamDef, AnimatableValue, type AnimationCategory, AnimationPresetSchema, AnimationSchema, type AnimationState, AsciiEffect, type AssetHandle, type AssetKind, BUILTIN_CANVAS_TEMPLATES, type BatchInjection, type BodySegmentationOptions, type BodySegmentationRequest, type BodySegmentationResponse, type BodySegmentationRuntime, type BodySegmentationRuntimeConfig, BoundingBoxSchema, BulgePinchEffect, COMPOSITION_PRESETS, CRTEffect, CanvasDevice, CinematicLUTEffect, type ClipConform, type ClipSegment, type ColorAdjustments, ColorAdjustmentsEffect, ColorGradientEffect, ColorMatrixEffect, ColorOverlayEffect, CommandBuffer, CommandBufferBuilder, type CompositionPreset, type ConformMode, CrossHatchEffect, DEFAULT_TEXT_STYLE, DisplacementEffect, DotEffect, type DotLottieManifest, type DrawPerCharTextOptions, DropShadowEffect, EMPHASIS_PRESETS, ENTRANCE_PRESETS, EXIT_PRESETS, type EasingControlPoint, EffectBevelSchema, EffectFillSchema, EffectFullDefinitionSchema, EffectGlowSchema, EffectIndexItemSchema, type EffectInstance, EffectLayer, EffectPanelSchema, EffectShadowSchema, EffectStackSchema, EffectStrokeSchema, EmbossEffect, type ExecutionPlanner, FONT_WEIGHT_OPTIONS, type FillType, FilmGrainEffect, type FocalPoint, FontSchema, FrameGraph, FrameGraphBuilder, type FrameSource, GaussianBlurEffect, type GifExportOptions, type GifFrame, GlitchBandEffect, GlowEffect, GlowLayer, type GradientDir, GradientStop, GradientStopSchema, type GradingParams, GraphValidator, GrayscaleEffect, HalationEffect, HslAdjustmentEffect, ImageLayerSchema, InkBrushEngine, KawaseBlurEffect, Keyframe, LOOP_PRESETS, LOTTIE_ANIM_PRESETS, LOTTIE_TEMPLATE_PRESETS, LayerAnimationSchema, LensFlareEffect, LightLeakEffect, type LottieAnimPreset, type LottieFileInfo, type LottieFontEntry, type LottieFontUsage, type LottieGradientStop, type LottieKeyframe, type LottiePropertyPath, type LottieTemplatePreset, MPGFrameRenderer, type MediaFitMode, type MediaLayout, type MediaSpriteRecord, MotionBlurEffect, type Mp4ExportOptions, NeonGlowEffect, type NodeDefinition, NodeRegistry, type NormalizedCrop, NullBackend, OldFilmEffect, OutlineEffect, type ParsedTextLayer, PixelateEffect, PixiEffectDefinition, PixiRenderer, type PngSequenceFrame, type PngSequenceOptions, Preset, ProjectCompiler, ProjectHelper, type ProjectManifestV2, RGBSplitEffect, RadialBlurEffect, type RecordedExecution, ReflectionEffect, RenderBackend, type RenderViewport, type ResolvedFit, type ResolvedMediaLayout, type ResourceAllocation, SUPPORTED_FONT_FAMILIES, SceneDocument, type ShaderCompilation, ShapeLayerSchema, ShockwaveEffect, type Size, StaticNoiseEffect, StyleRecipe, TEMPLATE_CATEGORIES, TemplateCategory, TemplateCategorySchema, TemplateEasingFunction, TemplateKeyframe, TemplateLayer, TemplateLayerSchema, type TemplatePresetCategory, TemplateRenderer, type TextAlign, type TextCustomization, TextEffectBuilder, TextEffectConfig, TextEffectDefinition, TextEffectDefinitionSchema, type TextLayerConfig, TextLayerSchema, type TextLayerStyle, type TextLayoutBounds, type TextLayoutResult, type TextStyleOverride, TextTemplate, TextTemplateSchema, TiltShiftEffect, type TrackDefinition, TwistEffect, VERSION, VHSEffect, type ValidatedEffectDefinition, type ValidatedTextEffectDefinition, type ValidatedTextTemplate, type ValidationError, type ValidationResult, VignetteEffect, WEBM_EXPORT_MAX_FRAMES, type WebMExportOptions, ZoomBlurEffect, _resetPlatformCache, addImageLayer, addKeyframe, addKeyframeAtTime, addOrUpdateKeyframe, addShapeLayer, addSolidLayer, addTextLayer, addTrack, addVectorShape, alignToLottieJ, applyBodyEffectMask, applyFillColorToAll, applyLetterSpacing, applyMaskReveal, applyMediaTransform, applyRecipeToScene, applyStyleToLottie, applyStyleToLottieLayer, applyTimelineAtTime, backgroundBlurEffect, bakeAnimationIntoLayer, beginStickerFrame, beginTextFrame, blendConfigs, blendScenes, bloomEffect, bodyEffects, buildDotLottie, buildFontEntries, buildLottieFontName, buildPngSequenceZip, builtInRecipes, calculateCropFromFocalPoint, calculateDefaultCoverCrop, calculateMediaFit, captureImageSourceDimensions, captureLottieFrames, captureVideoSourceDimensions, chromaticAberrationEffect, clearAllBodyEffectMasks, clearAllMediaSprites, clearAllStickerBridges, clearAllTextBridges, clearAnimationFromLayer, clearBodyEffectMask, clearFontCache, clearPendingVideoLayers, clearRecipeCache, cloneSceneWithNewIds, colorIsolationEffect, computeAutoFitFontSize, computeFitZoom, computeTextLayout, countTextGlyphs, createBlankLottie, createCanvas, createDefaultRevealTrack, createGPUBodyGlowFilter, createGPUBodyOutlineFilter, createGPUBodyParticlesFilter, createKeyframed, createPulseOpacityTrack, cubicBezier, deleteKeyframe, downloadDotLottie, downloadLottieJson, downloadLottieMp4, downloadPngSequenceZip, downloadSceneWebM, drawPerCharText, drawRoundedRect, duplicateTrackAtPlayhead, ease, enableKeyframing, encodeGif, endStickerFrame, endTextFrame, ensureDefaultTimeline, ensureFontInLottie, evaluateAnimatable, exportLottieToMp4, filmGrainEffect, findTrackIndex, formatValidationErrors, getActiveMediaSpriteKeys, getAnimPreset, getAnimatableParamDef, getAnimatableParamsForLayer, getCanvasTemplatePreset, getCanvasTemplatesByCategory, getClipLayout, getDefaultText, getLayerById, getMediaSpriteRecord, getOrCreateMediaSprite, getPresetScene, getSharedPixiRenderer, getSourceCropRect, getSupportedWebMMimeType, getTemplatePreset, getTemplatesByCategory, getVideoEffect, getWebMFrameCount, heatDistortionEffect, hexToLottieColor, hexToLottieRgb, hexToRgb, identityEffect, injectBatch, injectColor, injectGlobalTextStyle, injectSolidColor, injectText, injectTextStyle, isKeyframed, isMp4ExportSupported, isWebMExportSupported, loadLottieFonts, lottieColorToHex, lottieJToAlign, measureTextFits, mergeGradingParams, moveKeyframe, neonOutlineEffect, parseHistorySnapshot, parseLottieJson, particleAuraEffect, preloadGoogleFont, presetToRecipe, pruneTracksForLayer, rainbowCharFillColors, readLayerScalar, readStyleFromLottieLayer, reindexLayers, releaseCanvas, releaseMediaSprite, releaseSharedPixiRenderer, removeKeyframe, removeTemplateKeyframe, removeTrack, renderPngSequence, renderSceneWebM, renderStickerLayerBridged, renderTextLayerBridged, resizeCharFillColors, resolveAnimatedScalar, resolveConform, resolveMediaLayout, restoreLetterSpacing, rotateCrop, scanLottieFonts, scanTextLayers, setCharFillColor, setTracks, shouldUsePerCharFill, snapshotScene, sortKeyframes, spotlightEffect, supportsCtxFilter, supportsLetterSpacing, supportsOffscreenCanvas, supportsRoundRect, supportsWebGL2, trackId, unmountStickerLayerBridge, unmountTextLayerBridge, updateKeyframe, updateSceneBevel, updateSceneCanvas, updateSceneCustomEngine, updateSceneFill, updateSceneGlow, updateScenePanel, updateSceneShadow, updateSceneStack, updateSceneStroke, updateSceneText, updateStaticProperty, updateTimeline, updateTrack, updateTrackMatte, upsertKeyframe, validateEffectDefinition, validateEffectDefinitionStrict, validateTextEffectDefinition, validateTextEffectDefinitionStrict, validateTextTemplate, validateTextTemplateStrict, vhsEffect, videoEffects, videoEffectsById, waitForFontsReady, wrapTextToWidth };
11374
+ export { type AddBreakpointCommand, type AddDataPreviewSetCommand, type AddNodeCommand, type AddTimelineMarkerCommand, type AddVariableCommand, type AlignmentGuide, type AlignmentMode, AlphaEffect, type AnchorMap, type AnchorXMode, type AnchorYMode, type AnimBuildOpts, type AnimKeyframe, AnimTrack, type AnimTrackDef, type AnimatableParamDef, AnimatableValue, type AnimationCategory, type AnimationDiagnostic, type AnimationDiagnosticSeverity, type AnimationEvaluationOptions, AnimationPresetSchema, AnimationRuntime, AnimationSchema, type AnimationStartSpec, type AnimationState, AnimationValidator, type AnnotationNode, AnnotationVisualizationDefinition, type ArcGeometry, AsciiEffect, type AssetHandle, type AssetKind, type AssetManifest, type AssetRef, AssetRegistry, type AssetSource, type AvatarNode, type AxisConfig, type AxisLabel, BUILTIN_CANVAS_TEMPLATES, type BarGeometry, type BaseCommand, type BatchCommandsCommand, type BatchInjection, type BodySegmentationOptions, type BodySegmentationRequest, type BodySegmentationResponse, type BodySegmentationRuntime, type BodySegmentationRuntimeConfig, BoundingBoxSchema, type Breakpoint, type BreakpointSet, BulgePinchEffect, COMPOSITION_PRESETS, CRTEffect, type CalloutNode, CanvasDevice, type CanvasSnapResult, type ChartAnimationConfig, type ChartBarStyle, type ChartNode, type ChartSeries, type ChartType, CinematicLUTEffect, type ClipConform, type ClipSegment, type CodeOverlayContent, type CodeSmartOverlayContent, type ColorAdjustments, ColorAdjustmentsEffect, ColorGradientEffect, ColorMatrixEffect, ColorOverlayEffect, CommandBuffer, CommandBufferBuilder, type CommandExecutionResult, CommandExecutor, CommandHistory, type CommandHistoryOptions, type CommandType, type ComparisonItem, type ComparisonOverlayContent, type ComparisonSmartOverlayContent, type ComponentCategory, type ComponentDefinition, type ComponentNode, type CompositionPreset, type ComputedNodeBounds, type ConformMode, type ConnectorNode, ConnectorVisualizationDefinition, type ContainerNode, CrossHatchEffect, DEFAULT_TEXT_STYLE, DataBindingEngine, type DataBindingRule, type DataPreviewSet, type DeleteNodeCommand, type DetachComponentCommand, type DimensionMode, DisplacementEffect, type DividerNode, type DocumentCommand, DocumentMigrator, type DocumentPoint, DocumentValidator, type DocumentVariable, DotEffect, type DotLottieManifest, type DrawPerCharTextOptions, DropShadowEffect, EMPHASIS_PRESETS, ENTRANCE_PRESETS, EXIT_PRESETS, EXPORT_PROFILE_PRESETS, type EasingControlPoint, EffectBevelSchema, EffectFillSchema, EffectFullDefinitionSchema, EffectGlowSchema, EffectIndexItemSchema, type EffectInstance, EffectLayer, EffectPanelSchema, EffectShadowSchema, EffectStackSchema, EffectStrokeSchema, EmbossEffect, type EncodedFileEntry, type EncodedOutput, type EvaluatedAnnotationGeometry, type EvaluatedChartGeometry, type EvaluatedConnectorGeometry, type EvaluatedExportFrame, type EvaluatedGaugeGeometry, type EvaluatedNodeState, type EvaluatedSceneState, type EvaluatedTimelineEvent, type EvaluatedTimelineGeometry, type ExecutionPlanner, ExportAbortError, type ExportConfig, type ExportDiagnosticCode, type ExportDiagnosticSeverity, type ExportFormat, type ExportFrameDescriptor, ExportJob, type ExportJobRecord, type ExportProfile, type ExportProgress, type ExportValidationDiagnostic, ExportValidator, FONT_WEIGHT_OPTIONS, type FillType, FilmGrainEffect, type FocalPoint, type FontRef, FontRegistry, FontSchema, type FontSpec, FrameGraph, FrameGraphBuilder, type FrameNode, type FrameSource, type GaugeNode, type GaugeThreshold, GaugeVisualizationDefinition, GaussianBlurEffect, type GeometryAnchor, GifEncoder, type GifExportOptions, type GifFrame, GlitchBandEffect, GlowEffect, GlowLayer, type GradientDir, type GradientNode, GradientStop, GradientStopSchema, type GradingParams, GraphValidator, GrayscaleEffect, type GridLineGeometry, type GroupNodesCommand, HalationEffect, type HighlightRegionGeometry, HslAdjustmentEffect, type IconNode, ImageLayerSchema, InkBrushEngine, type JobChangeListener, type JobStatus, KawaseBlurEffect, Keyframe, type KeyframeTrack, LOOP_PRESETS, LOTTIE_ANIM_PRESETS, LOTTIE_TEMPLATE_PRESETS, LayerAnimationSchema, type LayoutComputedState, LayoutEngine, type LayoutMode, type LegendEntry, LensFlareEffect, LightLeakEffect, type LinePoint, type ListOverlayContent, type ListOverlayItem, type ListSmartOverlayContent, type LottieAnimPreset, type LottieFileInfo, type LottieFontEntry, type LottieFontUsage, type LottieGradientStop, type LottieKeyframe, type LottiePropertyPath, type LottieTemplatePreset, type LowerThirdOverlayContent, type LowerThirdSmartOverlayContent, MPGFrameRenderer, type MediaEncoder, MediaEncoderRegistry, type MediaFitMode, type MediaLayout, type MediaSpriteRecord, type MetricNode, MotionBlurEffect, type MotionPreset, type MotionPresetDefinition, type MotionPresetParameter, MotionPresetRegistry, type Mp4ExportOptions, NeonGlowEffect, type NodeAnimationRules, type NodeConstraints, type NodeDefinition, type NodeLayoutRules, NodeRegistry, type NodeStyleRules, type NormalizedCrop, NullBackend, OldFilmEffect, OutlineEffect, type OverlayDefinition, type OverlayDocument, type OverlayLayerConfig, type ParsedTextLayer, PixelateEffect, PixiEffectDefinition, PixiRenderer, PixiSceneProjection, PixiSelectionOverlay, type PlotArea, PngSequenceEncoder, type PngSequenceFrame, type PngSequenceOptions, Preset, type PrimitiveDefinition, type PrimitiveMediaNode, PrimitiveRegistry, type PrimitiveShapeNode, type PrimitiveTextNode, type ProfileCanvasDimensions, type ProgressNode, ProjectCompiler, ProjectHelper, type ProjectManifestV2, type PropertyAnimationDefinition, PropertyAnimationRegistry, type PropertyDefinition, PropertyInterpolator, type PropertySchemaField, type PropertyValueType, type QuoteOverlayContent, type QuoteSmartOverlayContent, RGBSplitEffect, RadialBlurEffect, RawFramesEncoder, type RecordedExecution, ReflectionEffect, type RegisterAssetCommand, type RegisteredAsset, type RegisteredFont, type RemoveAssetCommand, type RemoveBreakpointCommand, type RemoveDataPreviewSetCommand, type RemoveTimelineMarkerCommand, type RemoveVariableCommand, RenderBackend, RenderEngine, type RenderViewport, type ReorderNodesCommand, type RepeaterNode, type ResolvedAsset, type ResolvedFit, type ResolvedFont, type ResolvedMediaLayout, type ResourceAllocation, type ResourceState, type ResponsiveNodeOverride, type RichTextNode, type RichTextSpan, RuntimeAssetResolver, SMART_OVERLAY_PRESETS, SUPPORTED_FONT_FAMILIES, SceneDocument, type SceneNode, type SceneNodeBase, type SceneNodeType, type ScratchElementBlock, type ScratchOverlayTemplate, type ScreenPoint, type SemanticAnimationConfig, type SetActiveBreakpointCommand, type SetAssetRefCommand, type SetBindingCommand, type SetDocumentCommand, type SetFontRefCommand, type SetResponsiveOverrideCommand, type ShaderCompilation, type ShapeKind, ShapeLayerSchema, ShockwaveEffect, type Size, type SmartOverlayAnimation, type SmartOverlayClip, type SmartOverlayContentUnion, type SmartOverlayLayout, type SmartOverlayPreset, type SmartOverlayRegistryItem, SmartOverlayRegistryService, SmartOverlayRenderer, type SmartOverlayStyle, type SmartOverlayType, SnapEngine, type SnapResult, type SocialOverlayContent, type SocialSmartOverlayContent, type StatOverlayContent, type StatSmartOverlayContent, StaticNoiseEffect, StyleRecipe, TEMPLATE_CATEGORIES, type TableColumn, type TableNode, TemplateCategory, TemplateCategorySchema, TemplateEasingFunction, TemplateKeyframe, TemplateLayer, TemplateLayerSchema, type TemplateManifest, type TemplatePresetCategory, TemplateRenderer, type TextAlign, type TextCustomization, TextEffectBuilder, TextEffectConfig, TextEffectDefinition, TextEffectDefinitionSchema, type TextLayerConfig, TextLayerSchema, type TextLayerStyle, type TextLayoutBounds, type TextLayoutResult, type TextStyleOverride, TextTemplate, TextTemplateSchema, TiltShiftEffect, type TimelineEvent, type TimelineMarker, type TimelineNode, type TimelineOverlayContent, type TimelineOverlayNode, type TimelineSmartOverlayContent, TimelineVisualizationDefinition, type TrackDefinition, TwistEffect, type UngroupNodesCommand, type UpdateAnimationCommand, type UpdateCanvasSizeCommand, type UpdateDataPreviewSetCommand, type UpdateKeyframeTracksCommand, type UpdateNodePropertyCommand, type UpdateNodeStyleCommand, type UpdateTimelineMarkerCommand, type UpdateVariableCommand, VERSION, VHSEffect, type ValidatedEffectDefinition, type ValidatedTextEffectDefinition, type ValidatedTextTemplate, type ValidationDiagnostic, type ValidationError, type ValidationResult, type ViewportState, ViewportTransform, VignetteEffect, type VisualizationCapabilities, type VisualizationDefinition, VisualizationEngine, type VisualizationEvaluationContext, VisualizationRegistry, type VisualizationRenderContext, type VisualizationRenderer, VisualizationRendererRegistry, WEBM_EXPORT_MAX_FRAMES, WebMEncoder, type WebMExportOptions, ZoomBlurEffect, _resetPlatformCache, addImageLayer, addKeyframe, addKeyframeAtTime, addOrUpdateKeyframe, addShapeLayer, addSolidLayer, addTextLayer, addTrack, addVectorShape, alignToLottieJ, animationRuntime, animationValidator, annotationVisualization, applyBodyEffectMask, applyFillColorToAll, applyLetterSpacing, applyMaskReveal, applyMediaTransform, applyRecipeToScene, applyStyleToLottie, applyStyleToLottieLayer, applyTimelineAtTime, assetRegistry, backgroundBlurEffect, bakeAnimationIntoLayer, beginStickerFrame, beginTextFrame, blendConfigs, blendScenes, bloomEffect, bodyEffects, buildDotLottie, buildFontEntries, buildLottieFontName, buildPngSequenceZip, builtInRecipes, calculateCropFromFocalPoint, calculateDefaultCoverCrop, calculateMediaFit, captureImageSourceDimensions, captureLottieFrames, captureVideoSourceDimensions, chromaticAberrationEffect, clearAllBodyEffectMasks, clearAllMediaSprites, clearAllOverlayBridges, clearAllStickerBridges, clearAllTextBridges, clearAnimationFromLayer, clearBodyEffectMask, clearFontCache, clearPendingVideoLayers, clearRecipeCache, cloneSceneWithNewIds, colorIsolationEffect, commandExecutor, componentRegistry, compositeOverlay2D, computeAutoFitFontSize, computeFitZoom, computeTextLayout, connectorVisualization, convertScratchTemplateToClip, countTextGlyphs, createBlankLottie, createBlankScratchTemplate, createCanvas, createDefaultRevealTrack, createDefaultScratchBlock, createGPUBodyGlowFilter, createGPUBodyOutlineFilter, createGPUBodyParticlesFilter, createKeyframed, createPulseOpacityTrack, cubicBezier, dataBindingEngine, deleteKeyframe, deserializeTemplate, documentMigrator, documentValidator, downloadDotLottie, downloadLottieJson, downloadLottieMp4, downloadPngSequenceZip, downloadSceneWebM, drawPerCharText, drawRoundedRect, duplicateTrackAtPlayhead, ease, enableKeyframing, encodeGif, endOverlayFrame, endStickerFrame, endTextFrame, ensureDefaultTimeline, ensureFontInLottie, evaluateAnimatable, evaluateExportFrame, exportLottieToMp4, exportValidator, filmGrainEffect, findTrackIndex, fontRegistry, formatValidationErrors, gaugeVisualization, generateOverlayCssStyle, generateOverlayWebGpuUniforms, getActiveMediaSpriteKeys, getAnimPreset, getAnimatableParamDef, getAnimatableParamsForLayer, getCanvasTemplatePreset, getCanvasTemplatesByCategory, getClipLayout, getDefaultText, getLayerById, getMediaSpriteRecord, getOrCreateMediaSprite, getPresetScene, getSharedPixiRenderer, getSourceCropRect, getSupportedWebMMimeType, getTemplatePreset, getTemplatesByCategory, getVideoEffect, getWebMFrameCount, heatDistortionEffect, hexToLottieColor, hexToLottieRgb, hexToRgb, identityEffect, injectBatch, injectColor, injectGlobalTextStyle, injectSolidColor, injectText, injectTextStyle, isKeyframed, isMp4ExportSupported, isWebMExportSupported, layoutEngine, loadLottieFonts, lottieColorToHex, lottieJToAlign, measureTextFits, mediaEncoderRegistry, mergeGradingParams, motionPresetRegistry, moveKeyframe, neonOutlineEffect, parseHistorySnapshot, parseLottieJson, particleAuraEffect, pixiSceneProjection, pixiSelectionOverlay, preloadGoogleFont, presetToRecipe, primitiveRegistry, propertyAnimationRegistry, propertyInterpolator, pruneTracksForLayer, rainbowCharFillColors, readLayerScalar, readStyleFromLottieLayer, reindexLayers, releaseCanvas, releaseMediaSprite, releaseSharedPixiRenderer, removeKeyframe, removeTemplateKeyframe, removeTrack, renderEngine, renderOverlayLayerBridged, renderPngSequence, renderSceneWebM, renderStickerLayerBridged, renderTextLayerBridged, resizeCharFillColors, resolveAnimatedScalar, resolveConform, resolveDocumentForBreakpoint, resolveExportCanvasDimensions, resolveMediaLayout, resolveNodeForBreakpoint, restoreLetterSpacing, rotateCrop, runtimeAssetResolver, scanLottieFonts, scanTextLayers, serializeTemplate, setCharFillColor, setTracks, shouldUsePerCharFill, smartOverlayRegistry, snapEngine, snapshotScene, sortKeyframes, spotlightEffect, streamExportFrames, supportsCtxFilter, supportsLetterSpacing, supportsOffscreenCanvas, supportsRoundRect, supportsWebGL2, timelineVisualization, trackId, unmountOverlayLayerBridge, unmountStickerLayerBridge, unmountTextLayerBridge, updateKeyframe, updateSceneBevel, updateSceneCanvas, updateSceneCustomEngine, updateSceneFill, updateSceneGlow, updateScenePanel, updateSceneShadow, updateSceneStack, updateSceneStroke, updateSceneText, updateStaticProperty, updateTimeline, updateTrack, updateTrackMatte, upsertKeyframe, validateEffectDefinition, validateEffectDefinitionStrict, validateTextEffectDefinition, validateTextEffectDefinitionStrict, validateTextTemplate, validateTextTemplateStrict, vhsEffect, videoEffects, videoEffectsById, viewportTransform, visualizationEngine, visualizationRegistry, visualizationRendererRegistry, waitForFontsReady, wrapTextToWidth };