@clypra-studio/engine 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -8,10 +8,10 @@ export { C as Canvas2DEffectDefinition, a as Canvas2DEngine, b as Canvas2DEngine
8
8
  export { ALL_TRANSITIONS, AppliedTransition, ChromaticPushTransition, CrossDissolveTransition, DepthPushTransition, DirectionalDissolveTransition, EasingFunction, ElasticSnapCutTransition, FilmBurnWipeTransition, FoldTurnTransition, FrameHoldStutterTransition, GlitchTransition, GravityDropTransition, IrisRevealTransition, LightLeakSweepTransition, LumaWipeTransition, ParallaxLayerSplitTransition, PixelateCollapseTransition, PushTransition, RackFocusBlendTransition, RefractionWarpTransition, ShatterBurstTransition, StrobeCutTransition, TRANSITION_CATEGORIES, TRANSITION_PRESETS, TransitionCategory, TransitionParameters, TransitionPreset, TransitionRenderer, TransitionRendererType, ZoomTransition, getAllTransitionTags, getAllTransitions, getRecommendedDuration, getTransitionById, getTransitionByRenderer, getTransitionCategories, getTransitionCountByCategory, getTransitionEffect, getTransitionsByCategory, getTransitionsByTags, searchTransitions, transitionEffects, transitionEffectsById } from './transitions/index.js';
9
9
  import { NodeCapabilities, NodeRequirements, GraphPin, MediaProcessingGraph } from '@clypra-studio/types';
10
10
  export { NodeCapabilities as EffectCapabilities, NodeRequirements as EffectRequirements, GraphDataType, GraphEdge, GraphHelper, GraphNode, GraphPin, GraphValue, MediaProcessingGraph, NodeCapabilities, NodeLifecycleState, NodeRequirements } from '@clypra-studio/types';
11
- import { R as RenderBackend, C as CommandBuffer, F as FrameGraph } from './index-Da47I6aX.js';
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';
11
+ import { R as RenderBackend, C as CommandBuffer, F as FrameGraph } from './index-BdQ3oRT4.js';
12
+ export { D as DependencyGraph, E as ExecutionPolicy, a as ExecutionQuality, P as PixiRenderBackend, b as PlaybackDirection, c as PlaybackMode, d as RenderPass, e as ResourceRequest, f as V2Command } from './index-BdQ3oRT4.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
@@ -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;
@@ -8779,13 +8779,13 @@ interface NormalizedCrop {
8779
8779
  right: number;
8780
8780
  bottom: number;
8781
8781
  }
8782
- interface FocalPoint {
8782
+ interface FocalPoint$1 {
8783
8783
  x: number;
8784
8784
  y: number;
8785
8785
  }
8786
8786
  interface MediaLayout {
8787
8787
  fit: MediaFitMode;
8788
- focalPoint: FocalPoint;
8788
+ focalPoint: FocalPoint$1;
8789
8789
  transform: {
8790
8790
  x: number;
8791
8791
  y: number;
@@ -8797,7 +8797,7 @@ interface MediaLayout {
8797
8797
  }
8798
8798
  interface ResolvedMediaLayout {
8799
8799
  fit: MediaFitMode;
8800
- focalPoint: FocalPoint;
8800
+ focalPoint: FocalPoint$1;
8801
8801
  sourceRect: {
8802
8802
  x: number;
8803
8803
  y: number;
@@ -8821,7 +8821,7 @@ declare function getSourceCropRect(source: Size, crop?: NormalizedCrop): {
8821
8821
  height: number;
8822
8822
  };
8823
8823
  declare function rotateCrop(crop: NormalizedCrop, rotation?: number): NormalizedCrop;
8824
- declare function calculateCropFromFocalPoint(source: Size, target: Size, focalPoint: FocalPoint): NormalizedCrop;
8824
+ declare function calculateCropFromFocalPoint(source: Size, target: Size, focalPoint: FocalPoint$1): NormalizedCrop;
8825
8825
  declare function resolveMediaLayout(params: {
8826
8826
  sourceSize: Size;
8827
8827
  projectFrame: Size;
@@ -8945,6 +8945,3832 @@ 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" | "line" | "divider" | "metric" | "progress" | "chart" | "table" | "container" | "callout" | "avatar" | "annotation" | "connector" | "gauge" | "timeline" | "video" | "audio" | "lottie";
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
+ horizontal?: "left" | "center" | "right" | "stretch" | AnchorXMode;
9308
+ vertical?: "top" | "center" | "bottom" | "stretch" | AnchorYMode;
9309
+ anchorX?: AnchorXMode;
9310
+ anchorY?: AnchorYMode;
9311
+ left?: number;
9312
+ top?: number;
9313
+ right?: number;
9314
+ bottom?: number;
9315
+ widthMode?: DimensionMode;
9316
+ heightMode?: DimensionMode;
9317
+ aspectRatio?: number;
9318
+ /** Clamp minimum resolved width (px) */
9319
+ minWidth?: number;
9320
+ /** Clamp maximum resolved width (px) */
9321
+ maxWidth?: number;
9322
+ /** Clamp minimum resolved height (px) */
9323
+ minHeight?: number;
9324
+ /** Clamp maximum resolved height (px) */
9325
+ maxHeight?: number;
9326
+ /** When true, height is derived from width × (1 / aspectRatio) after clamping */
9327
+ aspectRatioLock?: boolean;
9328
+ }
9329
+ interface NodeLayoutRules {
9330
+ mode?: LayoutMode;
9331
+ gap?: number | {
9332
+ col: number;
9333
+ row: number;
9334
+ };
9335
+ padding?: number | {
9336
+ top: number;
9337
+ right: number;
9338
+ bottom: number;
9339
+ left: number;
9340
+ };
9341
+ alignItems?: AlignmentMode | "flex-start" | "flex-end";
9342
+ justifyContent?: AlignmentMode | "flex-start" | "flex-end" | "space-between" | "space-around" | "space-evenly";
9343
+ wrap?: boolean | "wrap" | "nowrap";
9344
+ gridColumns?: number;
9345
+ constraints?: NodeConstraints;
9346
+ }
9347
+ /** @deprecated Use FontRef instead. Kept for migration compatibility. */
9348
+ interface FontSpec {
9349
+ family: string;
9350
+ weight?: number;
9351
+ source?: "system" | "web" | "asset";
9352
+ url?: string;
9353
+ }
9354
+ interface NodeStyleRules {
9355
+ fillColor?: string;
9356
+ fillGradient?: {
9357
+ type: "linear" | "radial";
9358
+ colors: string[];
9359
+ angle?: number;
9360
+ };
9361
+ fillOpacity?: number;
9362
+ strokeColor?: string;
9363
+ strokeWidth?: number;
9364
+ borderColor?: string;
9365
+ borderWidth?: number;
9366
+ borderRadius?: number;
9367
+ opacity?: number;
9368
+ fontFamily?: string;
9369
+ /** @deprecated Use fontRef instead */
9370
+ fontSpec?: FontSpec;
9371
+ /** Catalog-agnostic font reference — resolved via FontRegistry at runtime */
9372
+ fontRef?: FontRef;
9373
+ fontSize?: number;
9374
+ fontWeight?: "normal" | "bold" | "600" | "800" | string;
9375
+ textColor?: string;
9376
+ color?: string;
9377
+ textAlign?: "left" | "center" | "right";
9378
+ letterSpacing?: number;
9379
+ lineHeight?: number;
9380
+ textTransform?: "none" | "uppercase" | "lowercase";
9381
+ overflow?: "visible" | "hidden" | "truncate" | "shrink-to-fit" | "multiline" | string;
9382
+ minFontSize?: number;
9383
+ maxLines?: number;
9384
+ tabularNums?: boolean;
9385
+ shadowColor?: string;
9386
+ shadowBlur?: number;
9387
+ shadow?: {
9388
+ x: number;
9389
+ y: number;
9390
+ blur: number;
9391
+ spread?: number;
9392
+ color: string;
9393
+ };
9394
+ blurRadius?: number;
9395
+ backdropBlur?: number;
9396
+ }
9397
+ interface MotionPreset {
9398
+ type: "fade" | "slide" | "scale" | "pop" | "bounce" | "typewriter" | "glow-pulse";
9399
+ direction?: "up" | "down" | "left" | "right";
9400
+ duration: number;
9401
+ delay?: number;
9402
+ easing?: "linear" | "ease-out" | "ease-in-out" | "elastic";
9403
+ }
9404
+ /** Generalized start specification supporting absolute seconds or marker offsets */
9405
+ type AnimationStartSpec = {
9406
+ type: "absolute";
9407
+ time: number;
9408
+ } | {
9409
+ type: "marker";
9410
+ markerId: string;
9411
+ offset?: number;
9412
+ };
9413
+ /** Strongly typed semantic animation configuration */
9414
+ type SemanticAnimationConfig = {
9415
+ type: "count-up";
9416
+ from: number;
9417
+ to: number | string;
9418
+ duration: number;
9419
+ format?: string;
9420
+ } | {
9421
+ type: "typewriter";
9422
+ charsPerSecond: number;
9423
+ } | {
9424
+ type: "repeater-stagger";
9425
+ delay: number;
9426
+ direction: "forward" | "reverse";
9427
+ };
9428
+ interface KeyframeTrack {
9429
+ property: string;
9430
+ keyframes: Array<{
9431
+ time: number;
9432
+ value: number | string;
9433
+ easing?: string;
9434
+ }>;
9435
+ }
9436
+ interface NodeAnimationRules {
9437
+ entrance?: MotionPreset;
9438
+ exit?: MotionPreset;
9439
+ start?: AnimationStartSpec;
9440
+ semanticAnimation?: SemanticAnimationConfig;
9441
+ keyframeTracks?: KeyframeTrack[];
9442
+ /** Controls animation inheritance scope for child nodes */
9443
+ animationScope?: "node" | "children" | "subtree";
9444
+ /** Stagger delay applied incrementally to children based on scene tree order */
9445
+ staggerChildren?: number;
9446
+ /** If true, width/height animation triggers per-frame layout reflow passes instead of GPU transform scale */
9447
+ animatesLayout?: boolean;
9448
+ /** Layout transition duration for repeater/sibling reflows */
9449
+ layoutTransitionMs?: number;
9450
+ }
9451
+ interface DataBindingRule {
9452
+ targetProperty: string;
9453
+ expression: string;
9454
+ }
9455
+ /**
9456
+ * Sparse property patch stored per breakpoint on a node.
9457
+ * Only the properties that *change* at a given breakpoint are stored.
9458
+ * Identity fields (id, type, children) are never overridden.
9459
+ */
9460
+ interface ResponsiveNodeOverride {
9461
+ x?: number;
9462
+ y?: number;
9463
+ width?: number;
9464
+ height?: number;
9465
+ visible?: boolean;
9466
+ /** Partial deep-merge over base node.layout */
9467
+ layout?: Partial<NodeLayoutRules>;
9468
+ /** Partial deep-merge over base node.style */
9469
+ style?: Partial<NodeStyleRules>;
9470
+ /** Re-order this node within its parent at this breakpoint (0-based) */
9471
+ layoutOrder?: number;
9472
+ }
9473
+ type AnchorSide = "left" | "right" | "top" | "bottom" | "center";
9474
+ interface SpatialAnchorConfig {
9475
+ targetId: string;
9476
+ anchorSide?: AnchorSide;
9477
+ targetSide?: AnchorSide;
9478
+ offsetX?: number;
9479
+ offsetY?: number;
9480
+ }
9481
+ interface SceneNodeBase {
9482
+ id: string;
9483
+ name: string;
9484
+ type: SceneNodeType;
9485
+ x: number;
9486
+ y: number;
9487
+ width: number;
9488
+ height: number;
9489
+ rotation?: number;
9490
+ visible?: boolean;
9491
+ locked?: boolean;
9492
+ anchor?: SpatialAnchorConfig;
9493
+ layout?: NodeLayoutRules;
9494
+ style?: NodeStyleRules;
9495
+ animation?: NodeAnimationRules;
9496
+ bindings?: DataBindingRule[];
9497
+ visibilityExpression?: string;
9498
+ /**
9499
+ * Breakpoint-scoped property overrides.
9500
+ * Key = breakpoint id; value = sparse patch merged over base properties.
9501
+ * Only changed properties are stored — base properties are always inherited.
9502
+ */
9503
+ responsive?: Record<string, ResponsiveNodeOverride>;
9504
+ }
9505
+ interface FrameNode extends SceneNodeBase {
9506
+ type: "frame";
9507
+ children: SceneNode[];
9508
+ }
9509
+ interface PrimitiveTextNode extends SceneNodeBase {
9510
+ type: "text";
9511
+ text: string;
9512
+ }
9513
+ type ShapeKind = "rectangle" | "rounded-rectangle" | "circle" | "ellipse" | "triangle" | "polygon" | "star" | "arrow" | "chevron" | "hexagon" | "diamond" | "line" | "divider" | "custom-path";
9514
+ interface PrimitiveShapeNode extends SceneNodeBase {
9515
+ type: "shape";
9516
+ shapeType: ShapeKind;
9517
+ svgPath?: string;
9518
+ points?: number[];
9519
+ cornerRadius?: number;
9520
+ }
9521
+ interface PrimitiveMediaNode extends SceneNodeBase {
9522
+ type: "media";
9523
+ mediaType: "image" | "icon" | "svg" | "avatar" | "video" | "audio" | "lottie";
9524
+ /** @deprecated Prefer assetId. Kept as legacy fallback for migration. */
9525
+ src?: string;
9526
+ /** Stable reference to AssetRegistry — document never contains binary data */
9527
+ assetId?: string;
9528
+ intrinsicWidth?: number;
9529
+ intrinsicHeight?: number;
9530
+ aspectRatioLock?: boolean;
9531
+ objectFit?: "cover" | "contain" | "fill" | "none";
9532
+ }
9533
+ interface VideoPlaybackConfig {
9534
+ startTime?: number;
9535
+ trimIn?: number;
9536
+ trimOut?: number;
9537
+ speed?: number;
9538
+ loop?: boolean;
9539
+ volume?: number;
9540
+ muted?: boolean;
9541
+ }
9542
+ interface VideoNode extends SceneNodeBase {
9543
+ type: "video";
9544
+ assetId: string;
9545
+ intrinsicWidth?: number;
9546
+ intrinsicHeight?: number;
9547
+ aspectRatioLock?: boolean;
9548
+ objectFit?: "cover" | "contain" | "fill" | "none";
9549
+ playback?: VideoPlaybackConfig;
9550
+ }
9551
+ interface AudioPlaybackConfig {
9552
+ startTime?: number;
9553
+ trimIn?: number;
9554
+ trimOut?: number;
9555
+ speed?: number;
9556
+ loop?: boolean;
9557
+ volume?: number;
9558
+ muted?: boolean;
9559
+ fadeInDuration?: number;
9560
+ fadeOutDuration?: number;
9561
+ duckingDb?: number;
9562
+ }
9563
+ interface AudioNode extends SceneNodeBase {
9564
+ type: "audio";
9565
+ assetId: string;
9566
+ playback?: AudioPlaybackConfig;
9567
+ }
9568
+ interface LottieNode extends SceneNodeBase {
9569
+ type: "lottie";
9570
+ assetId: string;
9571
+ fps?: number;
9572
+ speed?: number;
9573
+ loop?: boolean;
9574
+ mode?: "forward" | "reverse" | "pingpong";
9575
+ slots?: Record<string, string | number>;
9576
+ }
9577
+ interface RepeaterNode extends SceneNodeBase {
9578
+ type: "repeater";
9579
+ datasetBinding: string;
9580
+ staggerDelay?: number;
9581
+ itemTemplate: SceneNode;
9582
+ direction?: "vertical" | "horizontal";
9583
+ previewItemCount?: number;
9584
+ /** Stable field name used to track instance identity across sort/reorder operations */
9585
+ keyField?: string;
9586
+ /** Maximum number of items to instantiate from the dataset (windowing limit) */
9587
+ maxItems?: number;
9588
+ /** Context variable name for the current item in templates (defaults to "item") */
9589
+ itemContextKey?: string;
9590
+ /** Context variable name for the current index in templates (defaults to "index") */
9591
+ indexContextKey?: string;
9592
+ }
9593
+ interface ComponentNode extends SceneNodeBase {
9594
+ type: "component";
9595
+ componentType: string;
9596
+ variant?: string;
9597
+ props: Record<string, any>;
9598
+ children?: SceneNode[];
9599
+ }
9600
+ interface RichTextSpan {
9601
+ text: string;
9602
+ style?: Partial<NodeStyleRules>;
9603
+ }
9604
+ interface RichTextNode extends SceneNodeBase {
9605
+ type: "rich-text";
9606
+ spans: RichTextSpan[];
9607
+ }
9608
+
9609
+ interface GradientNode extends SceneNodeBase {
9610
+ type: "gradient";
9611
+ gradientType: "linear" | "radial";
9612
+ angle?: number;
9613
+ stops: GradientStop[];
9614
+ }
9615
+ interface IconNode extends SceneNodeBase {
9616
+ type: "icon";
9617
+ iconName: string;
9618
+ size?: number;
9619
+ color?: string;
9620
+ strokeWidth?: number;
9621
+ assetId?: string;
9622
+ svgPath?: string;
9623
+ }
9624
+ interface LineNode extends SceneNodeBase {
9625
+ type: "line";
9626
+ startX?: number;
9627
+ startY?: number;
9628
+ endX?: number;
9629
+ endY?: number;
9630
+ startNodeId?: string;
9631
+ endNodeId?: string;
9632
+ strokeColor?: string;
9633
+ strokeWidth?: number;
9634
+ strokeCap?: "butt" | "round" | "square";
9635
+ strokeJoin?: "miter" | "round" | "bevel";
9636
+ dashPattern?: number[];
9637
+ }
9638
+ interface DividerNode extends SceneNodeBase {
9639
+ type: "divider";
9640
+ orientation: "horizontal" | "vertical";
9641
+ lineStyle?: "solid" | "dashed" | "dotted" | "gradient";
9642
+ thickness?: number;
9643
+ }
9644
+ interface MetricNode extends SceneNodeBase {
9645
+ type: "metric";
9646
+ value: number | string;
9647
+ prefix?: string;
9648
+ suffix?: string;
9649
+ label?: string;
9650
+ decimals?: number;
9651
+ /** Number formatting style */
9652
+ format?: "number" | "currency" | "percent" | "compact";
9653
+ locale?: string;
9654
+ /** Manual trend percentage (overrides auto-calculated delta) */
9655
+ trend?: number;
9656
+ trendDirection?: "up" | "down" | "neutral";
9657
+ /** Previous period value — delta and percentage change are auto-calculated */
9658
+ previousValue?: number;
9659
+ /** Show the delta/percentage change label below the primary value */
9660
+ showDelta?: boolean;
9661
+ /** Show the trend direction arrow (▲/▼) */
9662
+ showTrend?: boolean;
9663
+ /** Animate value counting up from 0. Uses existing semanticAnimation hook. */
9664
+ countUp?: boolean;
9665
+ /** Count-up animation duration in seconds. Default: 1.2 */
9666
+ countUpDuration?: number;
9667
+ }
9668
+ interface ProgressNode extends SceneNodeBase {
9669
+ type: "progress";
9670
+ value: number;
9671
+ max?: number;
9672
+ trackColor?: string;
9673
+ fillColor?: string;
9674
+ showLabel?: boolean;
9675
+ styleType?: "bar" | "circle";
9676
+ }
9677
+ type ChartType = "line" | "bar" | "area" | "donut" | "pie" | "radar" | "scatter";
9678
+ interface AxisConfig {
9679
+ /** Fixed minimum value. Undefined = auto from data. */
9680
+ min?: number;
9681
+ /** Fixed maximum value. Undefined = auto from data. */
9682
+ max?: number;
9683
+ /** Number of tick marks / grid lines. Default: 5 */
9684
+ tickCount?: number;
9685
+ /** Show horizontal grid lines across plot area */
9686
+ showGrid?: boolean;
9687
+ /** Show axis tick labels */
9688
+ showLabels?: boolean;
9689
+ /** Label format template e.g. "{{value}}%" or "${{value}}" */
9690
+ labelFormat?: string;
9691
+ }
9692
+ interface ChartBarStyle {
9693
+ /** Border radius on bar corners (px). Default: 4 */
9694
+ rounded?: number;
9695
+ /** Enable glow (rendered as DropShadowFilter with zero offset) */
9696
+ glow?: boolean;
9697
+ /** Glow/shadow color (RGBA hex). Default: series color at 40% opacity */
9698
+ glowColor?: string;
9699
+ /** Enable vertical gradient fill on each bar */
9700
+ gradient?: boolean;
9701
+ /** Spacing between grouped series bars within a category (px) */
9702
+ groupGap?: number;
9703
+ }
9704
+ interface ChartAnimationConfig {
9705
+ /** Animation style for bar entrance */
9706
+ mode: "grow" | "fade" | "none";
9707
+ /** Total animation duration in seconds. Default: 1.2 */
9708
+ duration?: number;
9709
+ /** Per-bar stagger delay in seconds. Default: 0.08 */
9710
+ stagger?: number;
9711
+ /** CSS easing name used for bar grow curve. Default: "easeOutCubic" */
9712
+ easing?: "linear" | "easeInCubic" | "easeOutCubic" | "easeInOutCubic" | "easeOutQuart" | "easeOutElastic";
9713
+ /** Animate the numeric label above each bar as a count-up */
9714
+ countUpLabels?: boolean;
9715
+ }
9716
+ interface ChartSeries {
9717
+ /** Unique key used as yField when populating from dataSource objects */
9718
+ id: string;
9719
+ /** Display name shown in legend */
9720
+ name: string;
9721
+ /** Bar fill color (hex) */
9722
+ color: string;
9723
+ /** Raw data values, one per category */
9724
+ data?: number[];
9725
+ /** Stack group key — bars sharing the same stackGroup are stacked (requires stacked: true) */
9726
+ stackGroup?: string;
9727
+ }
9728
+ interface ChartNode extends SceneNodeBase {
9729
+ type: "chart";
9730
+ chartType: ChartType;
9731
+ /** Stack series within each category (grouped otherwise) */
9732
+ stacked?: boolean;
9733
+ /** Bar orientation. Default: "vertical" */
9734
+ orientation?: "vertical" | "horizontal";
9735
+ /** Explicit category labels (X-axis). Populated from xField when dataSource is bound. */
9736
+ xLabels?: string[];
9737
+ /** Key in dataSource objects used to extract category labels */
9738
+ xField?: string;
9739
+ /** Keys in dataSource objects used for each series (deprecated: prefer series[].id) */
9740
+ yFields?: string[];
9741
+ /** Series definitions — color, label, and data */
9742
+ series?: ChartSeries[];
9743
+ /** Y-axis configuration */
9744
+ axis?: AxisConfig;
9745
+ /** Bar visual styling */
9746
+ barStyle?: ChartBarStyle;
9747
+ /** Chart-level animation, independent of NodeAnimationConfig entrance */
9748
+ chartAnimation?: ChartAnimationConfig;
9749
+ /** Default color palette — auto-assigned to series without explicit color */
9750
+ colorPalette?: string[];
9751
+ /** Chart title displayed above plot area (distinct from node.name) */
9752
+ title?: string;
9753
+ /** Show grid lines (shorthand for axis.showGrid) */
9754
+ showGrid?: boolean;
9755
+ /** Show legend */
9756
+ showLegend?: boolean;
9757
+ /** Legend placement. Default: "bottom" */
9758
+ legendPosition?: "bottom" | "right" | "top";
9759
+ /** Bound data source expression */
9760
+ dataSource?: string;
9761
+ /** Donut inner radius as fraction of outer radius. Default: 0.55 */
9762
+ donutHoleRatio?: number;
9763
+ /** Show percentage labels on pie/donut arcs */
9764
+ showPercentageLabels?: boolean;
9765
+ /** Area chart: fill the area below the line */
9766
+ showAreaFill?: boolean;
9767
+ /** Area chart: fill opacity 0–1. Default: 0.25 */
9768
+ areaFillOpacity?: number;
9769
+ /** Line chart: radius of data point dots (px). Default: 4 */
9770
+ pointRadius?: number;
9771
+ /** Line chart: animate as progressive path draw (left-to-right reveal) */
9772
+ drawProgress?: boolean;
9773
+ /** Phase 4R — Region highlights spotlighting specific category ranges */
9774
+ highlights?: Array<{
9775
+ seriesId?: string;
9776
+ dataIndexRange?: [number, number];
9777
+ color?: string;
9778
+ opacity?: number;
9779
+ label?: string;
9780
+ }>;
9781
+ }
9782
+ interface AnnotationNode extends Omit<SceneNodeBase, "anchor"> {
9783
+ type: "annotation";
9784
+ text: string;
9785
+ anchor?: {
9786
+ nodeId: string;
9787
+ seriesId?: string;
9788
+ dataIndex?: number;
9789
+ element?: "bar-top" | "bar-center" | "point" | "arc-mid" | "absolute";
9790
+ };
9791
+ offsetX?: number;
9792
+ offsetY?: number;
9793
+ showLeader?: boolean;
9794
+ leaderColor?: string;
9795
+ pointerStyle?: "dot" | "arrow" | "none";
9796
+ }
9797
+ interface ConnectorNode extends SceneNodeBase {
9798
+ type: "connector";
9799
+ fromNodeId: string;
9800
+ toNodeId: string;
9801
+ fromAnchor?: "top" | "bottom" | "left" | "right" | "center" | {
9802
+ x: number;
9803
+ y: number;
9804
+ };
9805
+ toAnchor?: "top" | "bottom" | "left" | "right" | "center" | {
9806
+ x: number;
9807
+ y: number;
9808
+ };
9809
+ fromElement?: "bar-top" | "point" | "arc-mid" | "center";
9810
+ toElement?: "bar-top" | "point" | "arc-mid" | "center";
9811
+ lineStyle?: "straight" | "curved" | "elbow" | "orthogonal" | "bezier";
9812
+ arrowHead?: "none" | "start" | "end" | "both";
9813
+ strokeColor?: string;
9814
+ strokeWidth?: number;
9815
+ dashPattern?: number[];
9816
+ }
9817
+ interface GaugeThreshold {
9818
+ value: number;
9819
+ color: string;
9820
+ }
9821
+ interface GaugeNode extends SceneNodeBase {
9822
+ type: "gauge";
9823
+ value: number;
9824
+ min?: number;
9825
+ max?: number;
9826
+ gaugeStyle?: "semicircle" | "full" | "arc";
9827
+ sweepAngle?: number;
9828
+ trackColor?: string;
9829
+ fillColor?: string;
9830
+ showValue?: boolean;
9831
+ showLabel?: boolean;
9832
+ label?: string;
9833
+ thresholds?: GaugeThreshold[];
9834
+ chartAnimation?: ChartAnimationConfig;
9835
+ }
9836
+ interface TimelineEvent {
9837
+ id: string;
9838
+ label: string;
9839
+ time: number;
9840
+ description?: string;
9841
+ color?: string;
9842
+ icon?: string;
9843
+ }
9844
+ interface TimelineNode extends SceneNodeBase {
9845
+ type: "timeline";
9846
+ events: TimelineEvent[];
9847
+ orientation?: "horizontal" | "vertical";
9848
+ trackColor?: string;
9849
+ eventColor?: string;
9850
+ showLabels?: boolean;
9851
+ animationMode?: "sequential" | "simultaneous";
9852
+ chartAnimation?: Pick<ChartAnimationConfig, "mode" | "stagger" | "easing">;
9853
+ }
9854
+ interface TableColumn {
9855
+ key: string;
9856
+ label: string;
9857
+ width?: number;
9858
+ format?: string;
9859
+ }
9860
+ interface TableNode extends SceneNodeBase {
9861
+ type: "table";
9862
+ columns: TableColumn[];
9863
+ dataSource?: string;
9864
+ rows?: Array<Record<string, any>>;
9865
+ }
9866
+ interface ContainerNode extends SceneNodeBase {
9867
+ type: "container";
9868
+ children: SceneNode[];
9869
+ clipContent?: boolean;
9870
+ }
9871
+ interface CalloutNode extends SceneNodeBase {
9872
+ type: "callout";
9873
+ title: string;
9874
+ body: string;
9875
+ iconName?: string;
9876
+ calloutType?: "info" | "warning" | "success" | "danger";
9877
+ }
9878
+ interface AvatarNode extends SceneNodeBase {
9879
+ type: "avatar";
9880
+ src?: string;
9881
+ initials?: string;
9882
+ assetId?: string;
9883
+ shape?: "circle" | "rounded" | "square";
9884
+ badgeStatus?: "online" | "offline" | "busy";
9885
+ }
9886
+ type SceneNode = FrameNode | PrimitiveTextNode | PrimitiveShapeNode | PrimitiveMediaNode | VideoNode | AudioNode | LottieNode | RepeaterNode | ComponentNode | RichTextNode | GradientNode | IconNode | LineNode | DividerNode | MetricNode | ProgressNode | ChartNode | TableNode | ContainerNode | CalloutNode | AvatarNode | AnnotationNode | ConnectorNode | GaugeNode | TimelineNode;
9887
+ interface DocumentVariable {
9888
+ key: string;
9889
+ type: "string" | "number" | "boolean" | "color" | "array";
9890
+ defaultValue: any;
9891
+ label?: string;
9892
+ }
9893
+ interface DataPreviewSet {
9894
+ id: string;
9895
+ label: string;
9896
+ values: Record<string, any>;
9897
+ }
9898
+ /** Timeline Marker for snapping, keyframing, and video synchronization */
9899
+ interface TimelineMarker {
9900
+ id: string;
9901
+ time: number;
9902
+ label: string;
9903
+ type: "transcript" | "keyword" | "chapter" | "beat";
9904
+ color?: string;
9905
+ }
9906
+ /**
9907
+ * A named viewport context that overrides the canvas dimensions and
9908
+ * allows nodes to carry responsive overrides for that viewport.
9909
+ */
9910
+ interface Breakpoint {
9911
+ id: string;
9912
+ label: string;
9913
+ canvas: {
9914
+ width: number;
9915
+ height: number;
9916
+ };
9917
+ description?: string;
9918
+ }
9919
+ /**
9920
+ * Document-level breakpoint registry.
9921
+ * `activeId === null` means the canonical / base layout is active.
9922
+ */
9923
+ interface BreakpointSet {
9924
+ /** null = base / canonical layout */
9925
+ activeId: string | null;
9926
+ breakpoints: Breakpoint[];
9927
+ }
9928
+ interface OverlayDocument {
9929
+ id: string;
9930
+ version: "2.0";
9931
+ title: string;
9932
+ description?: string;
9933
+ category: string;
9934
+ canvas: {
9935
+ width: number;
9936
+ height: number;
9937
+ backgroundColor?: string;
9938
+ };
9939
+ variables: DocumentVariable[];
9940
+ nodes: SceneNode[];
9941
+ duration: number;
9942
+ createdAt: string;
9943
+ updatedAt: string;
9944
+ dataPreviewSets?: DataPreviewSet[];
9945
+ /** Named timeline markers across the document duration */
9946
+ markers?: TimelineMarker[];
9947
+ /** Declares all asset dependencies for this document — used to pre-warm the resolver */
9948
+ assetManifest?: AssetManifest;
9949
+ /** Responsive breakpoint definitions and active selection */
9950
+ breakpoints?: BreakpointSet;
9951
+ }
9952
+ /**
9953
+ * Envelope for a Published Overlay Artifact.
9954
+ * Connecting Studio (Authoring) to Clypra Desktop (Execution).
9955
+ */
9956
+ interface PublishedOverlayArtifact {
9957
+ documentId: string;
9958
+ revision: number;
9959
+ schemaVersion: string;
9960
+ updatedAt: string;
9961
+ publishedAt?: string;
9962
+ author?: string;
9963
+ document: OverlayDocument;
9964
+ }
9965
+
9966
+ /**
9967
+ * Self-describing property that participates in the inspector, animation,
9968
+ * data binding, and validation simultaneously. Replaces PropertySchemaField.
9969
+ * Fully backwards-compatible — all old fields are preserved.
9970
+ */
9971
+ interface PropertyDefinition {
9972
+ key: string;
9973
+ label: string;
9974
+ type: "text" | "number" | "color" | "boolean" | "select" | "asset" | "json";
9975
+ defaultValue: any;
9976
+ editable?: boolean;
9977
+ animatable?: boolean;
9978
+ bindable?: boolean;
9979
+ exportable?: boolean;
9980
+ options?: Array<{
9981
+ label: string;
9982
+ value: any;
9983
+ }>;
9984
+ min?: number;
9985
+ max?: number;
9986
+ step?: number;
9987
+ group?: "Content" | "Layout" | "Style" | "Animation";
9988
+ required?: boolean;
9989
+ animationPropertyType?: "number" | "color" | "angle" | "discrete";
9990
+ }
9991
+ /** @deprecated Use PropertyDefinition instead */
9992
+ type PropertySchemaField = PropertyDefinition;
9993
+ type ComponentCategory = "metrics" | "comparison" | "typography" | "process" | "code" | "social" | "people" | "media" | "layout" | "primitives";
9994
+ interface ComponentDefinition {
9995
+ type: string;
9996
+ name: string;
9997
+ category: ComponentCategory;
9998
+ description: string;
9999
+ defaultProps: Record<string, any>;
10000
+ variants?: string[];
10001
+ /** Human-readable labels for each variant key */
10002
+ variantLabels?: Record<string, string>;
10003
+ semanticAnimations?: string[];
10004
+ schema: PropertyDefinition[];
10005
+ /** Returns the canonical inner scene tree (FrameNode with children).
10006
+ * Used when entering template editing mode. */
10007
+ structure?: () => FrameNode;
10008
+ createDefaultNode: () => ComponentNode | SceneNode;
10009
+ }
10010
+ declare class ComponentRegistry {
10011
+ private registry;
10012
+ register(def: ComponentDefinition): void;
10013
+ get(type: string): ComponentDefinition | undefined;
10014
+ getAll(): ComponentDefinition[];
10015
+ getTypes(): string[];
10016
+ }
10017
+ declare const componentRegistry: ComponentRegistry;
10018
+
10019
+ /**
10020
+ * Phase 4O — Single Source Primitive Registry & Default Node Factories
10021
+ *
10022
+ * Provides central registration, default node creation factories, and
10023
+ * metadata declarations for all 16 fundamental primitive node types.
10024
+ */
10025
+
10026
+ interface PrimitiveDefinition {
10027
+ type: SceneNodeType;
10028
+ label: string;
10029
+ category: "graphics" | "data" | "structure" | "media";
10030
+ createDefaultNode: (id?: string) => SceneNode;
10031
+ }
10032
+ declare class PrimitiveRegistry {
10033
+ private definitions;
10034
+ constructor();
10035
+ register(def: PrimitiveDefinition): void;
10036
+ get(type: SceneNodeType): PrimitiveDefinition | undefined;
10037
+ list(): PrimitiveDefinition[];
10038
+ createDefaultNode(type: SceneNodeType, customId?: string): SceneNode;
10039
+ private registerDefaults;
10040
+ }
10041
+ declare const primitiveRegistry: PrimitiveRegistry;
10042
+
10043
+ declare class DataBindingEngine {
10044
+ /**
10045
+ * Evaluate a variable template string like "{{revenue}}" or "Growth: {{growth}}%"
10046
+ * Returns the interpolated string with all {{key}} tokens replaced.
10047
+ */
10048
+ evaluateString(expr: string, context: Record<string, any>): string;
10049
+ /**
10050
+ * Evaluate a typed expression against context and return the computed value.
10051
+ * Unlike evaluateString (which always returns a string), this returns the
10052
+ * actual JS value: number, boolean, string, etc.
10053
+ *
10054
+ * Examples:
10055
+ * evaluateExpression("revenue / 1000000", { revenue: 1240000 }) => 1.24
10056
+ * evaluateExpression("growth > 0", { growth: -5 }) => false
10057
+ * evaluateExpression("firstName + ' ' + lastName", { firstName: "Alice", lastName: "Smith" }) => "Alice Smith"
10058
+ *
10059
+ * NOTE: Uses new Function() — acceptable for local authoring.
10060
+ * MUST be sandboxed (e.g. QuickJS / isolated-vm) before any server-side render path.
10061
+ */
10062
+ evaluateExpression(expr: string, context: Record<string, any>): any;
10063
+ /**
10064
+ * Evaluate boolean condition expressions like "growth > 0" or "type == 'guest'"
10065
+ */
10066
+ evaluateCondition(conditionExpr: string, context: Record<string, any>): boolean;
10067
+ /**
10068
+ * Expand a RepeaterNode for an array dataset context into instantiated nodes.
10069
+ * The key may be a raw variable name or a {{binding}} expression.
10070
+ */
10071
+ expandRepeater(repeater: RepeaterNode, context: Record<string, any>): SceneNode[];
10072
+ private prefixChildIds;
10073
+ /**
10074
+ * Recursively evaluate data bindings across a node tree.
10075
+ * Evaluates node.bindings rules, text content, and component props.
10076
+ */
10077
+ evaluateNodeBindings(node: SceneNode, context: Record<string, any>): void;
10078
+ private resolvePath;
10079
+ private setPath;
10080
+ }
10081
+ declare const dataBindingEngine: DataBindingEngine;
10082
+
10083
+ interface EvaluatedNodeState {
10084
+ x: number;
10085
+ y: number;
10086
+ width: number;
10087
+ height: number;
10088
+ opacity: number;
10089
+ visible: boolean;
10090
+ translateX: number;
10091
+ translateY: number;
10092
+ scaleX: number;
10093
+ scaleY: number;
10094
+ rotation: number;
10095
+ blur: number;
10096
+ fillColor?: string;
10097
+ typewriterProgress: number;
10098
+ numericValueOverride?: number;
10099
+ }
10100
+ interface AnimationEvaluationOptions {
10101
+ doc?: OverlayDocument;
10102
+ /** Ephemeral preview phase override for authoring view (never stored on doc) */
10103
+ previewState?: "rest" | "enter" | "hold" | "exit";
10104
+ /** Inherited delay accumulated from parent frames/groups */
10105
+ inheritedDelay?: number;
10106
+ /** Absolute playhead time — used by evaluateScene() */
10107
+ currentTime?: number;
10108
+ }
10109
+ /**
10110
+ * Canonical output contract of the animation runtime.
10111
+ * PixiSceneProjection must consume ONLY this — no preset/marker/keyframe logic.
10112
+ */
10113
+ interface EvaluatedSceneState {
10114
+ time: number;
10115
+ nodes: Record<string, EvaluatedNodeState>;
10116
+ }
10117
+ interface SnapResult {
10118
+ snappedTime: number;
10119
+ snappedMarker?: TimelineMarker;
10120
+ }
10121
+ declare class AnimationRuntime {
10122
+ /**
10123
+ * Evaluate motion state for a node at a given currentTime (seconds).
10124
+ * Fully deterministic and pure — does NOT mutate node or document.
10125
+ */
10126
+ evaluateNodeState(node: SceneNode, currentTime: number, clipDuration: number, options?: AnimationEvaluationOptions): EvaluatedNodeState;
10127
+ /**
10128
+ * Helper to compute child delays for parent-child animation inheritance.
10129
+ * Child order is deterministic based on scene tree array index.
10130
+ */
10131
+ computeChildInheritedDelay(parentAnimation: SceneNode["animation"], childIndex: number, parentInheritedDelay?: number): number;
10132
+ /**
10133
+ * Evaluate the full document scene graph at a given time, producing a flat
10134
+ * node map. PixiSceneProjection should consume this exclusively.
10135
+ */
10136
+ evaluateScene(doc: OverlayDocument, options?: AnimationEvaluationOptions): EvaluatedSceneState;
10137
+ private collectNodes;
10138
+ /**
10139
+ * Engine-level snap utility for magnetic snapping to timeline markers
10140
+ */
10141
+ snapTime(time: number, markers?: TimelineMarker[], threshold?: number): SnapResult;
10142
+ private resolveStartTime;
10143
+ private evaluateSemanticAnimation;
10144
+ private applyEntrancePreset;
10145
+ private applyEasing;
10146
+ private interpolateTrack;
10147
+ }
10148
+ declare const animationRuntime: AnimationRuntime;
10149
+
10150
+ interface BoundingRegion {
10151
+ id: string;
10152
+ name?: string;
10153
+ x: number;
10154
+ y: number;
10155
+ width: number;
10156
+ height: number;
10157
+ confidence?: number;
10158
+ }
10159
+ interface TemporalKeyframedRegion {
10160
+ time: number;
10161
+ region: BoundingRegion;
10162
+ }
10163
+ interface TrackedSubject {
10164
+ id: string;
10165
+ label: string;
10166
+ type: "person" | "face" | "object" | "speaker";
10167
+ track: TemporalKeyframedRegion[];
10168
+ }
10169
+ interface ShotBoundary {
10170
+ id: string;
10171
+ startTime: number;
10172
+ endTime: number;
10173
+ label?: string;
10174
+ }
10175
+ interface SubtitleRegion {
10176
+ x: number;
10177
+ y: number;
10178
+ width: number;
10179
+ height: number;
10180
+ active?: boolean;
10181
+ }
10182
+ interface TranscriptSegment {
10183
+ id: string;
10184
+ startTime: number;
10185
+ endTime: number;
10186
+ text: string;
10187
+ speakerId?: string;
10188
+ }
10189
+ interface VideoContext {
10190
+ canvas: {
10191
+ width: number;
10192
+ height: number;
10193
+ };
10194
+ duration: number;
10195
+ shots?: ShotBoundary[];
10196
+ subjects?: TrackedSubject[];
10197
+ safeRegions?: BoundingRegion[];
10198
+ subtitleRegion?: SubtitleRegion;
10199
+ transcript?: TranscriptSegment[];
10200
+ semanticMarkers?: Array<{
10201
+ time: number;
10202
+ label: string;
10203
+ category?: string;
10204
+ }>;
10205
+ }
10206
+ interface EvaluatedVideoStateAtTime {
10207
+ time: number;
10208
+ activeShot?: ShotBoundary;
10209
+ activeSubjects: Record<string, BoundingRegion>;
10210
+ activeTranscriptSegment?: TranscriptSegment;
10211
+ activeSpeakerId?: string;
10212
+ subtitleRegion?: SubtitleRegion;
10213
+ safeRegions: BoundingRegion[];
10214
+ }
10215
+ /**
10216
+ * Pure helper function to sample VideoContext at explicit playhead time `t`.
10217
+ * Interpolates subject bounding boxes between keyframe samples deterministically.
10218
+ */
10219
+ declare function sampleVideoContextAtTime(videoCtx: VideoContext, time: number): EvaluatedVideoStateAtTime;
10220
+
10221
+ interface EvaluatedTransform {
10222
+ x: number;
10223
+ y: number;
10224
+ width: number;
10225
+ height: number;
10226
+ rotation: number;
10227
+ scaleX: number;
10228
+ scaleY: number;
10229
+ translateX: number;
10230
+ translateY: number;
10231
+ anchorX: number;
10232
+ anchorY: number;
10233
+ }
10234
+ interface EvaluatedStyle {
10235
+ fillColor?: string;
10236
+ fillGradient?: {
10237
+ type: "linear" | "radial";
10238
+ colors: string[];
10239
+ angle?: number;
10240
+ };
10241
+ fillOpacity?: number;
10242
+ strokeColor?: string;
10243
+ strokeWidth?: number;
10244
+ borderRadius?: number;
10245
+ opacity: number;
10246
+ fontFamily?: string;
10247
+ fontSize?: number;
10248
+ fontWeight?: string;
10249
+ textColor?: string;
10250
+ textAlign?: "left" | "center" | "right";
10251
+ letterSpacing?: number;
10252
+ lineHeight?: number;
10253
+ shadowColor?: string;
10254
+ shadowBlur?: number;
10255
+ blurRadius?: number;
10256
+ backdropBlur?: number;
10257
+ }
10258
+ interface EvaluatedContent {
10259
+ text?: string;
10260
+ typewriterProgress?: number;
10261
+ assetId?: string;
10262
+ mediaUrl?: string;
10263
+ iconName?: string;
10264
+ shapeType?: ShapeKind;
10265
+ numericValue?: number | string;
10266
+ formattedValue?: string;
10267
+ componentType?: string;
10268
+ props?: Record<string, any>;
10269
+ }
10270
+ interface EvaluatedNode {
10271
+ id: string;
10272
+ name: string;
10273
+ type: string;
10274
+ parentId?: string;
10275
+ visible: boolean;
10276
+ transform: EvaluatedTransform;
10277
+ style: EvaluatedStyle;
10278
+ content?: EvaluatedContent;
10279
+ /** Pure evaluated geometry (e.g. Chart/Gauge/Timeline evaluated geometry from visualizationEngine) */
10280
+ geometry?: any;
10281
+ children?: EvaluatedNode[];
10282
+ metadata?: Record<string, any>;
10283
+ }
10284
+
10285
+ interface RendererCapabilities {
10286
+ text: boolean;
10287
+ gradients: boolean;
10288
+ shadows: boolean;
10289
+ blur: boolean;
10290
+ masks: boolean;
10291
+ charts: boolean;
10292
+ media: boolean;
10293
+ blendModes: boolean;
10294
+ filters: boolean;
10295
+ nativeExport: boolean;
10296
+ }
10297
+ interface RuntimeContext {
10298
+ viewport?: {
10299
+ zoom: number;
10300
+ panX: number;
10301
+ panY: number;
10302
+ canvasWidth: number;
10303
+ canvasHeight: number;
10304
+ };
10305
+ variables?: Record<string, any>;
10306
+ data?: Record<string, any>;
10307
+ activeBreakpointId?: string | null;
10308
+ video?: VideoContext;
10309
+ capabilities?: Partial<RendererCapabilities>;
10310
+ }
10311
+ interface EvaluationDiagnostic {
10312
+ level: "warning" | "error" | "info";
10313
+ nodeId?: string;
10314
+ code: string;
10315
+ message: string;
10316
+ }
10317
+ interface EvaluatedScene {
10318
+ version: "2.0";
10319
+ time: number;
10320
+ canvas: {
10321
+ width: number;
10322
+ height: number;
10323
+ backgroundColor?: string;
10324
+ };
10325
+ nodes: EvaluatedNode[];
10326
+ nodeMap: Record<string, EvaluatedNode>;
10327
+ videoState?: EvaluatedVideoStateAtTime;
10328
+ diagnostics: EvaluationDiagnostic[];
10329
+ metadata: {
10330
+ documentId: string;
10331
+ evaluatedAtTime: number;
10332
+ activeBreakpointId: string | null;
10333
+ };
10334
+ }
10335
+
10336
+ /**
10337
+ * Phase 4R.2 — Platform-independent Visualization Definition & Registry
10338
+ *
10339
+ * Pure evaluation contract: (node, context) → evaluated geometry.
10340
+ * Completely decoupled from PixiJS or DOM renderer implementations.
10341
+ */
10342
+
10343
+ interface VisualizationEvaluationContext {
10344
+ width: number;
10345
+ height: number;
10346
+ t: number;
10347
+ doc?: OverlayDocument;
10348
+ }
10349
+ interface VisualizationCapabilities {
10350
+ dataBinding: boolean;
10351
+ animation: boolean;
10352
+ responsive: boolean;
10353
+ }
10354
+ interface VisualizationDefinition<TNode = any, TGeometry = any> {
10355
+ type: string;
10356
+ name: string;
10357
+ category: "chart" | "metric" | "gauge" | "timeline" | "comparison" | "annotation";
10358
+ schema: PropertyDefinition[];
10359
+ supports: VisualizationCapabilities;
10360
+ evaluate(node: TNode, context: VisualizationEvaluationContext): TGeometry;
10361
+ }
10362
+ declare class VisualizationRegistry {
10363
+ private definitions;
10364
+ register<TNode, TGeometry>(def: VisualizationDefinition<TNode, TGeometry>): void;
10365
+ get<TNode = any, TGeometry = any>(type: string): VisualizationDefinition<TNode, TGeometry> | undefined;
10366
+ getAll(): VisualizationDefinition[];
10367
+ has(type: string): boolean;
10368
+ }
10369
+ declare const visualizationRegistry: VisualizationRegistry;
10370
+
10371
+ /**
10372
+ * Phase 4R.5 / 4R.7 — Gauge Visualization Definition & Renderer
10373
+ *
10374
+ * Evaluates GaugeNode geometry (semicircle/arc/full) and registers renderer in VisualizationRendererRegistry.
10375
+ */
10376
+
10377
+ interface EvaluatedGaugeGeometry {
10378
+ cx: number;
10379
+ cy: number;
10380
+ radius: number;
10381
+ innerRadius: number;
10382
+ startAngle: number;
10383
+ fullSweep: number;
10384
+ animSweep: number;
10385
+ fillColor: string;
10386
+ trackColor: string;
10387
+ formattedValue: string;
10388
+ label?: string;
10389
+ showValue: boolean;
10390
+ showLabel: boolean;
10391
+ }
10392
+ declare class GaugeVisualizationDefinition implements VisualizationDefinition<GaugeNode, EvaluatedGaugeGeometry> {
10393
+ type: string;
10394
+ name: string;
10395
+ category: "gauge";
10396
+ schema: any[];
10397
+ supports: {
10398
+ dataBinding: boolean;
10399
+ animation: boolean;
10400
+ responsive: boolean;
10401
+ };
10402
+ evaluate(node: GaugeNode, context: {
10403
+ width: number;
10404
+ height: number;
10405
+ t: number;
10406
+ }): EvaluatedGaugeGeometry;
10407
+ }
10408
+ declare const gaugeVisualization: GaugeVisualizationDefinition;
10409
+
10410
+ /**
10411
+ * Phase 4R.6 / 4R.7 — Timeline Visualization Definition & Renderer
10412
+ *
10413
+ * Evaluates TimelineNode geometry (events along a temporal axis) and registers renderer in VisualizationRendererRegistry.
10414
+ */
10415
+
10416
+ interface EvaluatedTimelineEvent {
10417
+ id: string;
10418
+ label: string;
10419
+ x: number;
10420
+ y: number;
10421
+ color: string;
10422
+ description?: string;
10423
+ active: boolean;
10424
+ }
10425
+ interface EvaluatedTimelineGeometry {
10426
+ axisX1: number;
10427
+ axisY1: number;
10428
+ axisX2: number;
10429
+ axisY2: number;
10430
+ trackColor: string;
10431
+ events: EvaluatedTimelineEvent[];
10432
+ }
10433
+ declare class TimelineVisualizationDefinition implements VisualizationDefinition<TimelineNode, EvaluatedTimelineGeometry> {
10434
+ type: string;
10435
+ name: string;
10436
+ category: "timeline";
10437
+ schema: any[];
10438
+ supports: {
10439
+ dataBinding: boolean;
10440
+ animation: boolean;
10441
+ responsive: boolean;
10442
+ };
10443
+ evaluate(node: TimelineNode, context: {
10444
+ width: number;
10445
+ height: number;
10446
+ t: number;
10447
+ }): EvaluatedTimelineGeometry;
10448
+ }
10449
+ declare const timelineVisualization: TimelineVisualizationDefinition;
10450
+
10451
+ /**
10452
+ * Phase 4R.4 / 4R.7 — Annotation & Connector Definitions & Renderers
10453
+ *
10454
+ * Resolves floating annotations and connectors against geometry anchors.
10455
+ */
10456
+
10457
+ interface EvaluatedAnnotationGeometry {
10458
+ text: string;
10459
+ x: number;
10460
+ y: number;
10461
+ width: number;
10462
+ height: number;
10463
+ anchorX?: number;
10464
+ anchorY?: number;
10465
+ showLeader: boolean;
10466
+ leaderColor: string;
10467
+ pointerStyle: "dot" | "arrow" | "none";
10468
+ }
10469
+ declare class AnnotationVisualizationDefinition implements VisualizationDefinition<AnnotationNode, EvaluatedAnnotationGeometry> {
10470
+ type: string;
10471
+ name: string;
10472
+ category: "annotation";
10473
+ schema: any[];
10474
+ supports: {
10475
+ dataBinding: boolean;
10476
+ animation: boolean;
10477
+ responsive: boolean;
10478
+ };
10479
+ evaluate(node: AnnotationNode, context: {
10480
+ width: number;
10481
+ height: number;
10482
+ t: number;
10483
+ }): EvaluatedAnnotationGeometry;
10484
+ }
10485
+ declare const annotationVisualization: AnnotationVisualizationDefinition;
10486
+ interface EvaluatedConnectorGeometry {
10487
+ fromX: number;
10488
+ fromY: number;
10489
+ toX: number;
10490
+ toY: number;
10491
+ strokeColor: string;
10492
+ strokeWidth: number;
10493
+ lineStyle: "straight" | "curved" | "elbow" | "orthogonal" | "bezier";
10494
+ arrowHead: "none" | "start" | "end" | "both";
10495
+ }
10496
+ declare class ConnectorVisualizationDefinition implements VisualizationDefinition<ConnectorNode, EvaluatedConnectorGeometry> {
10497
+ type: string;
10498
+ name: string;
10499
+ category: "annotation";
10500
+ schema: any[];
10501
+ supports: {
10502
+ dataBinding: boolean;
10503
+ animation: boolean;
10504
+ responsive: boolean;
10505
+ };
10506
+ evaluate(node: ConnectorNode, context: {
10507
+ width: number;
10508
+ height: number;
10509
+ t: number;
10510
+ }): EvaluatedConnectorGeometry;
10511
+ }
10512
+ declare const connectorVisualization: ConnectorVisualizationDefinition;
10513
+
10514
+ declare class PixiSceneProjection {
10515
+ rootContainer: Container;
10516
+ private nodeMap;
10517
+ constructor();
10518
+ /**
10519
+ * Sync and project an OverlayDocument onto PixiJS display tree at currentTime.
10520
+ * Evaluates document via evaluateOverlayDocument to maintain single semantic runtime authority.
10521
+ */
10522
+ project(doc: OverlayDocument, currentTime: number, contextData?: Record<string, any>,
10523
+ /** Optional ephemeral preview overrides — never persisted to the document */
10524
+ previewContext?: Record<string, any>): Container;
10525
+ /**
10526
+ * Directly project a renderer-neutral EvaluatedScene onto PixiJS display objects.
10527
+ */
10528
+ projectEvaluatedScene(evaluatedScene: EvaluatedScene, doc?: OverlayDocument, currentTime?: number, context?: Record<string, any>): Container;
10529
+ private projectNode;
10530
+ private renderComponentNode;
10531
+ private renderTextNode;
10532
+ private renderMediaNode;
10533
+ private renderShapeNode;
10534
+ private applyShadow;
10535
+ private renderLabel;
10536
+ private renderRichTextNode;
10537
+ private renderGradientNode;
10538
+ private renderIconNode;
10539
+ private renderDividerNode;
10540
+ private renderMetricNode;
10541
+ private renderProgressNode;
10542
+ private renderChartNode;
10543
+ private renderTableNode;
10544
+ private renderContainerNode;
10545
+ private renderCalloutNode;
10546
+ private renderVisualizationNode;
10547
+ private renderAvatarNode;
10548
+ }
10549
+ declare const pixiSceneProjection: PixiSceneProjection;
10550
+
10551
+ declare class PixiSelectionOverlay {
10552
+ overlayContainer: Container;
10553
+ private selectionGraphics;
10554
+ constructor();
10555
+ /**
10556
+ * Render selection bounding box, 8 resize handles, and rotation knob for single or multi-selected nodes
10557
+ */
10558
+ renderSelection(selectedNode: SceneNode | null, doc: OverlayDocument, selectedNodes?: SceneNode[]): Container;
10559
+ /**
10560
+ * Clear the selection overlay
10561
+ */
10562
+ clearSelection(): void;
10563
+ }
10564
+ declare const pixiSelectionOverlay: PixiSelectionOverlay;
10565
+
10566
+ 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" | "REPARENT_NODE" | "BATCH_COMMANDS";
10567
+ interface BaseCommand {
10568
+ type: CommandType;
10569
+ timestamp?: number;
10570
+ }
10571
+ interface SetDocumentCommand extends BaseCommand {
10572
+ type: "SET_DOCUMENT";
10573
+ doc: OverlayDocument;
10574
+ }
10575
+ interface AddNodeCommand extends BaseCommand {
10576
+ type: "ADD_NODE";
10577
+ node: SceneNode;
10578
+ parentId?: string;
10579
+ index?: number;
10580
+ }
10581
+ interface DeleteNodeCommand extends BaseCommand {
10582
+ type: "DELETE_NODE";
10583
+ nodeId: string;
10584
+ }
10585
+ interface UpdateNodePropertyCommand extends BaseCommand {
10586
+ type: "UPDATE_NODE_PROPERTY";
10587
+ nodeId: string;
10588
+ path: string;
10589
+ value: any;
10590
+ previousValue?: any;
10591
+ }
10592
+ interface UpdateNodeStyleCommand extends BaseCommand {
10593
+ type: "UPDATE_NODE_STYLE";
10594
+ nodeId: string;
10595
+ stylePath: string;
10596
+ value: any;
10597
+ previousValue?: any;
10598
+ }
10599
+ interface ReorderNodesCommand extends BaseCommand {
10600
+ type: "REORDER_NODES";
10601
+ sourceIndex: number;
10602
+ destinationIndex: number;
10603
+ parentId?: string;
10604
+ }
10605
+ interface AddVariableCommand extends BaseCommand {
10606
+ type: "ADD_VARIABLE";
10607
+ key: string;
10608
+ dataType: DocumentVariable["type"];
10609
+ defaultValue: any;
10610
+ label?: string;
10611
+ }
10612
+ interface RemoveVariableCommand extends BaseCommand {
10613
+ type: "REMOVE_VARIABLE";
10614
+ key: string;
10615
+ previousVariable?: DocumentVariable;
10616
+ }
10617
+ interface UpdateVariableCommand extends BaseCommand {
10618
+ type: "UPDATE_VARIABLE";
10619
+ key: string;
10620
+ patch: Partial<Omit<DocumentVariable, "key">>;
10621
+ previousPatch?: Partial<Omit<DocumentVariable, "key">>;
10622
+ }
10623
+ interface AddDataPreviewSetCommand extends BaseCommand {
10624
+ type: "ADD_DATA_PREVIEW_SET";
10625
+ set: DataPreviewSet;
10626
+ }
10627
+ interface UpdateDataPreviewSetCommand extends BaseCommand {
10628
+ type: "UPDATE_DATA_PREVIEW_SET";
10629
+ id: string;
10630
+ patch: Partial<Omit<DataPreviewSet, "id">>;
10631
+ previousPatch?: Partial<Omit<DataPreviewSet, "id">>;
10632
+ }
10633
+ interface RemoveDataPreviewSetCommand extends BaseCommand {
10634
+ type: "REMOVE_DATA_PREVIEW_SET";
10635
+ id: string;
10636
+ previousSet?: DataPreviewSet;
10637
+ }
10638
+ interface AddTimelineMarkerCommand extends BaseCommand {
10639
+ type: "ADD_TIMELINE_MARKER";
10640
+ marker: TimelineMarker;
10641
+ }
10642
+ interface UpdateTimelineMarkerCommand extends BaseCommand {
10643
+ type: "UPDATE_TIMELINE_MARKER";
10644
+ markerId: string;
10645
+ patch: Partial<Omit<TimelineMarker, "id">>;
10646
+ previousPatch?: Partial<Omit<TimelineMarker, "id">>;
10647
+ }
10648
+ interface RemoveTimelineMarkerCommand extends BaseCommand {
10649
+ type: "REMOVE_TIMELINE_MARKER";
10650
+ markerId: string;
10651
+ previousMarker?: TimelineMarker;
10652
+ }
10653
+ interface UpdateKeyframeTracksCommand extends BaseCommand {
10654
+ type: "UPDATE_KEYFRAME_TRACKS";
10655
+ nodeId: string;
10656
+ tracks: KeyframeTrack[];
10657
+ previousTracks?: KeyframeTrack[];
10658
+ }
10659
+ interface UpdateAnimationCommand extends BaseCommand {
10660
+ type: "UPDATE_ANIMATION";
10661
+ nodeId: string;
10662
+ animation: any;
10663
+ previousAnimation?: any;
10664
+ }
10665
+ interface GroupNodesCommand extends BaseCommand {
10666
+ type: "GROUP_NODES";
10667
+ nodeIds: string[];
10668
+ frameName?: string;
10669
+ }
10670
+ interface UngroupNodesCommand extends BaseCommand {
10671
+ type: "UNGROUP_NODES";
10672
+ frameId: string;
10673
+ }
10674
+ interface BatchCommandsCommand extends BaseCommand {
10675
+ type: "BATCH_COMMANDS";
10676
+ commands: DocumentCommand[];
10677
+ }
10678
+ interface AddBreakpointCommand extends BaseCommand {
10679
+ type: "ADD_BREAKPOINT";
10680
+ breakpoint: Breakpoint;
10681
+ }
10682
+ interface RemoveBreakpointCommand extends BaseCommand {
10683
+ type: "REMOVE_BREAKPOINT";
10684
+ breakpointId: string;
10685
+ /** Stored for undo */
10686
+ previousBreakpoint?: Breakpoint;
10687
+ }
10688
+ interface SetActiveBreakpointCommand extends BaseCommand {
10689
+ type: "SET_ACTIVE_BREAKPOINT";
10690
+ breakpointId: string | null;
10691
+ previousBreakpointId?: string | null;
10692
+ }
10693
+ interface SetResponsiveOverrideCommand extends BaseCommand {
10694
+ type: "SET_RESPONSIVE_OVERRIDE";
10695
+ nodeId: string;
10696
+ breakpointId: string;
10697
+ /**
10698
+ * Sparse patch to merge into node.responsive[breakpointId].
10699
+ * null = clear the entire override for this breakpoint on this node.
10700
+ */
10701
+ patch: Partial<ResponsiveNodeOverride> | null;
10702
+ /** Previous override value for undo */
10703
+ previousPatch?: Partial<ResponsiveNodeOverride> | null;
10704
+ }
10705
+ interface DetachComponentCommand extends BaseCommand {
10706
+ type: "DETACH_COMPONENT";
10707
+ /** ID of the ComponentNode to convert into a FrameNode with children */
10708
+ nodeId: string;
10709
+ }
10710
+ interface UpdateCanvasSizeCommand extends BaseCommand {
10711
+ type: "UPDATE_CANVAS_SIZE";
10712
+ width: number;
10713
+ height: number;
10714
+ previousWidth?: number;
10715
+ previousHeight?: number;
10716
+ }
10717
+ interface SetBindingCommand extends BaseCommand {
10718
+ type: "SET_BINDING";
10719
+ nodeId: string;
10720
+ /** Property path on the node (e.g. 'props.accentColor' or 'text') */
10721
+ targetProperty: string;
10722
+ /** Binding expression e.g. '{{revenue}}', or null/empty to clear */
10723
+ expression: string;
10724
+ previousExpression?: string;
10725
+ }
10726
+ interface RegisterAssetCommand extends BaseCommand {
10727
+ type: "REGISTER_ASSET";
10728
+ /** AssetRef to add to doc.assetManifest.assets */
10729
+ asset: AssetRef;
10730
+ }
10731
+ interface RemoveAssetCommand extends BaseCommand {
10732
+ type: "REMOVE_ASSET";
10733
+ assetId: string;
10734
+ /** Stored for undo */
10735
+ previousAsset?: AssetRef;
10736
+ }
10737
+ interface SetAssetRefCommand extends BaseCommand {
10738
+ type: "SET_ASSET_REF";
10739
+ /** ID of the PrimitiveMediaNode to update */
10740
+ nodeId: string;
10741
+ assetId: string;
10742
+ previousAssetId?: string;
10743
+ }
10744
+ interface SetFontRefCommand extends BaseCommand {
10745
+ type: "SET_FONT_REF";
10746
+ nodeId: string;
10747
+ fontRef: FontRef;
10748
+ previousFontRef?: FontRef;
10749
+ }
10750
+ interface ReparentNodeCommand extends BaseCommand {
10751
+ type: "REPARENT_NODE";
10752
+ nodeId: string;
10753
+ targetParentId?: string;
10754
+ previousParentId?: string;
10755
+ }
10756
+ 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 | ReparentNodeCommand | BatchCommandsCommand;
10757
+ type Command = DocumentCommand;
10758
+
10759
+ interface CommandExecutionResult {
10760
+ nextDocument: OverlayDocument;
10761
+ inverseCommand: DocumentCommand;
10762
+ }
10763
+ declare class CommandExecutor {
10764
+ /**
10765
+ * Execute a command on an OverlayDocument and return the new document + inverse command for undo
10766
+ */
10767
+ execute(doc: OverlayDocument, command: DocumentCommand): CommandExecutionResult;
10768
+ private findNode;
10769
+ private removeNode;
10770
+ private getNestedProperty;
10771
+ private setNestedProperty;
10772
+ /**
10773
+ * Recursively remove node.responsive[breakpointId] from all nodes.
10774
+ * Called by REMOVE_BREAKPOINT to prevent orphan override data.
10775
+ */
10776
+ private purgeBreakpointOverrides;
10777
+ }
10778
+ declare const commandExecutor: CommandExecutor;
10779
+
10780
+ interface CommandHistoryOptions {
10781
+ maxSize?: number;
10782
+ }
10783
+ declare class CommandHistory {
10784
+ private past;
10785
+ private future;
10786
+ private maxSize;
10787
+ constructor(options?: CommandHistoryOptions);
10788
+ execute(doc: OverlayDocument, command: DocumentCommand): OverlayDocument;
10789
+ undo(doc: OverlayDocument): OverlayDocument;
10790
+ redo(doc: OverlayDocument): OverlayDocument;
10791
+ canUndo(): boolean;
10792
+ canRedo(): boolean;
10793
+ clear(): void;
10794
+ }
10795
+
10796
+ interface ViewportState {
10797
+ zoom: number;
10798
+ panX: number;
10799
+ panY: number;
10800
+ canvasWidth: number;
10801
+ canvasHeight: number;
10802
+ }
10803
+ interface ScreenPoint {
10804
+ x: number;
10805
+ y: number;
10806
+ }
10807
+ interface DocumentPoint {
10808
+ x: number;
10809
+ y: number;
10810
+ }
10811
+ declare class ViewportTransform {
10812
+ /**
10813
+ * Convert Document Point (1280x720) to Screen Canvas Point
10814
+ */
10815
+ documentToScreen(point: DocumentPoint, viewport: ViewportState): ScreenPoint;
10816
+ /**
10817
+ * Convert Screen Canvas Mouse Point to Document Point (1280x720)
10818
+ */
10819
+ screenToDocument(point: ScreenPoint, viewport: ViewportState): DocumentPoint;
10820
+ /**
10821
+ * Snap point to grid increment (e.g. 8px grid or 16px grid)
10822
+ */
10823
+ snapToGrid(val: number, gridSize?: number): number;
10824
+ }
10825
+ declare const viewportTransform: ViewportTransform;
10826
+
10827
+ type HandleType = "tl" | "tr" | "bl" | "br" | "t" | "b" | "l" | "r" | "rot" | null;
10828
+ interface BoundingBox {
10829
+ x: number;
10830
+ y: number;
10831
+ width: number;
10832
+ height: number;
10833
+ }
10834
+ interface NodeStartTransform extends BoundingBox {
10835
+ id: string;
10836
+ rotation: number;
10837
+ }
10838
+ /**
10839
+ * Hit-test 8 resize handles (4 corners, 4 midpoints) and rotation knob against document coordinates.
10840
+ */
10841
+ declare function hitTestTransformHandles(docX: number, docY: number, box: BoundingBox, threshold?: number): HandleType;
10842
+ /**
10843
+ * Compute new spatial bounds given handle type, delta mouse movement, and aspect-ratio constraint.
10844
+ */
10845
+ declare function calculateResizeBounds(start: BoundingBox, handle: HandleType, deltaX: number, deltaY: number, lockAspectRatio?: boolean, minDimension?: number): BoundingBox;
10846
+ /**
10847
+ * Compute rotation angle (degrees 0-360) around box center, supporting 15-degree angle snapping.
10848
+ */
10849
+ declare function calculateRotationAngle(centerX: number, centerY: number, docPtX: number, docPtY: number, snap15Deg?: boolean): number;
10850
+
10851
+ interface ValidationDiagnostic {
10852
+ severity: "error" | "warning";
10853
+ code: string;
10854
+ message: string;
10855
+ nodeId?: string;
10856
+ }
10857
+ declare class DocumentValidator {
10858
+ validate(doc: OverlayDocument): ValidationDiagnostic[];
10859
+ private validateNode;
10860
+ }
10861
+ declare const documentValidator: DocumentValidator;
10862
+
10863
+ type AnimationDiagnosticSeverity = "error" | "warning" | "info";
10864
+ interface AnimationDiagnostic {
10865
+ nodeId: string;
10866
+ nodeName: string;
10867
+ severity: AnimationDiagnosticSeverity;
10868
+ code: string;
10869
+ message: string;
10870
+ }
10871
+ declare class AnimationValidator {
10872
+ validate(doc: OverlayDocument): AnimationDiagnostic[];
10873
+ private walkNodes;
10874
+ private validateNode;
10875
+ }
10876
+ declare const animationValidator: AnimationValidator;
10877
+
10878
+ declare class DocumentMigrator {
10879
+ /**
10880
+ * Migrate any raw document or legacy clip to latest OverlayDocument v2.0
10881
+ */
10882
+ migrate(rawInput: any): OverlayDocument;
10883
+ fromLegacyClip(clip: SmartOverlayClip): OverlayDocument;
10884
+ /**
10885
+ * Phase 4I upgrade pass: promote PrimitiveMediaNode.src → assetId.
10886
+ * Builds assetManifest from any media nodes that still use the legacy src field.
10887
+ * This is idempotent — safe to run multiple times.
10888
+ */
10889
+ private migrateV2Document;
10890
+ private createDefaultDocument;
10891
+ }
10892
+ declare const documentMigrator: DocumentMigrator;
10893
+
10894
+ interface TemplateManifest {
10895
+ kind: "smart-overlay-template";
10896
+ schemaVersion: "1.0";
10897
+ metadata: {
10898
+ id: string;
10899
+ name: string;
10900
+ category: string;
10901
+ tags: string[];
10902
+ thumbnailUrl?: string;
10903
+ createdAt: string;
10904
+ updatedAt: string;
10905
+ };
10906
+ document: OverlayDocument;
10907
+ }
10908
+ declare function serializeTemplate(doc: OverlayDocument, meta: Omit<TemplateManifest["metadata"], "createdAt" | "updatedAt">): TemplateManifest;
10909
+ declare function deserializeTemplate(manifest: TemplateManifest): OverlayDocument;
10910
+
10911
+ /**
10912
+ * Property Interpolation Registry
10913
+ * Handles type-aware interpolation for numbers, angles, colors, and discrete values.
10914
+ */
10915
+ declare class PropertyInterpolator {
10916
+ /**
10917
+ * Linear interpolation for standard numbers
10918
+ */
10919
+ interpolateNumber(a: number, b: number, t: number): number;
10920
+ /**
10921
+ * Shortest rotational path angle interpolation in degrees.
10922
+ * E.g., 350° → 10° rotates forward +20°, not backwards -340°.
10923
+ */
10924
+ interpolateAngle(a: number, b: number, t: number): number;
10925
+ /**
10926
+ * RGBA color lerp between hex/rgb strings
10927
+ */
10928
+ interpolateColor(colorA: string, colorB: string, t: number): string;
10929
+ /**
10930
+ * Discrete switch at t >= 0.5 for non-continuous values (e.g. strings, booleans)
10931
+ */
10932
+ interpolateDiscrete(a: any, b: any, t: number): any;
10933
+ /**
10934
+ * Dispatch interpolation based on property name or value types
10935
+ */
10936
+ interpolate(property: string, a: any, b: any, t: number): any;
10937
+ private isColorString;
10938
+ private parseColor;
10939
+ }
10940
+ declare const propertyInterpolator: PropertyInterpolator;
10941
+
10942
+ type PropertyValueType = "number" | "angle" | "color" | "discrete";
10943
+ interface PropertyAnimationDefinition {
10944
+ property: string;
10945
+ type: PropertyValueType;
10946
+ combineMode: "add" | "multiply" | "override";
10947
+ interpolate(a: any, b: any, t: number): any;
10948
+ }
10949
+ declare class PropertyAnimationRegistry {
10950
+ private properties;
10951
+ constructor();
10952
+ register(def: PropertyAnimationDefinition): void;
10953
+ get(property: string): PropertyAnimationDefinition | undefined;
10954
+ interpolate(property: string, a: any, b: any, t: number): any;
10955
+ private registerDefaults;
10956
+ }
10957
+ declare const propertyAnimationRegistry: PropertyAnimationRegistry;
10958
+
10959
+ interface MotionPresetParameter {
10960
+ key: string;
10961
+ label: string;
10962
+ type: "number" | "select" | "boolean";
10963
+ default: any;
10964
+ options?: Array<{
10965
+ label: string;
10966
+ value: string;
10967
+ }>;
10968
+ min?: number;
10969
+ max?: number;
10970
+ step?: number;
10971
+ }
10972
+ interface MotionPresetDefinition {
10973
+ id: string;
10974
+ name: string;
10975
+ category: "entrance" | "exit" | "attention" | "emphasis";
10976
+ /** Which node types this preset applies to. '*' = all. */
10977
+ supportedNodeTypes?: string[];
10978
+ /** Schema-driven parameter list — enables auto-generated config UI */
10979
+ parameters?: MotionPresetParameter[];
10980
+ buildTracks(preset: MotionPreset, clipDuration: number): KeyframeTrack[];
10981
+ }
10982
+ declare class MotionPresetRegistry {
10983
+ private presets;
10984
+ constructor();
10985
+ register(definition: MotionPresetDefinition): void;
10986
+ get(id: string): MotionPresetDefinition | undefined;
10987
+ list(category?: "entrance" | "exit" | "attention"): MotionPresetDefinition[];
10988
+ private registerBuiltIns;
10989
+ }
10990
+ declare const motionPresetRegistry: MotionPresetRegistry;
10991
+
10992
+ interface AlignmentGuide {
10993
+ type: "horizontal" | "vertical";
10994
+ position: number;
10995
+ }
10996
+ /** Spatial snap result for canvas node positioning (x/y/alignment guides). */
10997
+ interface CanvasSnapResult {
10998
+ x: number;
10999
+ y: number;
11000
+ guides: AlignmentGuide[];
11001
+ }
11002
+ declare class SnapEngine {
11003
+ /**
11004
+ * Calculate snapped position and active alignment guides for a moving node
11005
+ */
11006
+ calculateSnap(movingNode: {
11007
+ x: number;
11008
+ y: number;
11009
+ width: number;
11010
+ height: number;
11011
+ }, otherNodes: SceneNode[], canvasWidth?: number, canvasHeight?: number, threshold?: number): CanvasSnapResult;
11012
+ /**
11013
+ * Calculate snapped bounds and alignment guides during handle resizing
11014
+ */
11015
+ calculateResizeSnap(resizingBounds: {
11016
+ x: number;
11017
+ y: number;
11018
+ width: number;
11019
+ height: number;
11020
+ }, handle: string, otherNodes: Array<{
11021
+ x: number;
11022
+ y: number;
11023
+ width: number;
11024
+ height: number;
11025
+ }>, canvasWidth?: number, canvasHeight?: number, threshold?: number): {
11026
+ x: number;
11027
+ y: number;
11028
+ width: number;
11029
+ height: number;
11030
+ guides: AlignmentGuide[];
11031
+ };
11032
+ }
11033
+ declare const snapEngine: SnapEngine;
11034
+
11035
+ /**
11036
+ * Measure exact pixel width of text string across browser canvas / headless environments.
11037
+ */
11038
+ declare function measureTextWidth(text: string, fontSize: number, fontWeight?: string | number, fontFamily?: string, tabularNums?: boolean): number;
11039
+ interface ComputedNodeBounds {
11040
+ x: number;
11041
+ y: number;
11042
+ width: number;
11043
+ height: number;
11044
+ }
11045
+ interface LayoutComputedState {
11046
+ nodes: Record<string, ComputedNodeBounds>;
11047
+ }
11048
+ declare class LayoutEngine {
11049
+ /**
11050
+ * Deterministically compute auto-layout geometry (fixed / hug / fill)
11051
+ * for an OverlayDocument before animation & rendering passes.
11052
+ */
11053
+ computeLayout(doc: OverlayDocument, contextData?: Record<string, any>): LayoutComputedState;
11054
+ /** Resolve anchor point coordinates on a target bounding box */
11055
+ resolveAnchorPoint(target: ComputedNodeBounds, anchor?: "top" | "bottom" | "left" | "right" | "center" | {
11056
+ x: number;
11057
+ y: number;
11058
+ } | string): {
11059
+ x: number;
11060
+ y: number;
11061
+ };
11062
+ /**
11063
+ * Compute layout for a specific breakpoint.
11064
+ * Resolves the document for the breakpoint first (canvas + node overrides),
11065
+ * then runs the standard layout pipeline on the resolved document.
11066
+ *
11067
+ * When breakpointId is null, behaves identically to computeLayout.
11068
+ */
11069
+ computeLayoutForBreakpoint(doc: OverlayDocument, breakpointId: string | null, contextData?: Record<string, any>): LayoutComputedState;
11070
+ private computeNodeGeometry;
11071
+ /** Apply min/max clamping and aspectRatioLock to resolved dimensions. */
11072
+ private applyDimensionConstraints;
11073
+ }
11074
+ declare const layoutEngine: LayoutEngine;
11075
+
11076
+ interface BreadcrumbItem {
11077
+ id: string;
11078
+ name: string;
11079
+ type: string;
11080
+ }
11081
+ declare class SelectionEngine {
11082
+ private selectedIds;
11083
+ private focusedId;
11084
+ /**
11085
+ * Set single selected node.
11086
+ */
11087
+ select(nodeId: string, doc?: OverlayDocument): void;
11088
+ /**
11089
+ * Replace selection with multiple node IDs.
11090
+ */
11091
+ multiSelect(nodeIds: string[], doc?: OverlayDocument): void;
11092
+ /**
11093
+ * Toggle a node's selection state (Cmd/Ctrl + Click).
11094
+ */
11095
+ toggleSelect(nodeId: string, doc?: OverlayDocument): void;
11096
+ /**
11097
+ * Select all unlocked nodes on the canvas.
11098
+ */
11099
+ selectAll(doc: OverlayDocument): void;
11100
+ /**
11101
+ * Clear all active selections.
11102
+ */
11103
+ clear(): void;
11104
+ getSelectedIds(): string[];
11105
+ getFocusedId(): string | null;
11106
+ isSelected(nodeId: string): boolean;
11107
+ /**
11108
+ * Retrieve active selected SceneNodes from document.
11109
+ */
11110
+ getSelectedNodes(doc: OverlayDocument): SceneNode[];
11111
+ /**
11112
+ * Drill down into container child nodes (Double click interaction).
11113
+ */
11114
+ drillDown(doc: OverlayDocument, containerId: string, clickPoint?: {
11115
+ x: number;
11116
+ y: number;
11117
+ }): boolean;
11118
+ /**
11119
+ * Select parent container of the currently selected child (Esc key or click outside).
11120
+ */
11121
+ selectParent(doc: OverlayDocument, childId: string): boolean;
11122
+ /**
11123
+ * Generate breadcrumb hierarchy path from root document down to selected node.
11124
+ */
11125
+ getBreadcrumbs(doc: OverlayDocument, targetId: string): BreadcrumbItem[];
11126
+ /**
11127
+ * Calculate collective bounding box of all selected nodes.
11128
+ */
11129
+ getSelectionBounds(doc: OverlayDocument, layoutBounds: Record<string, ComputedNodeBounds>): ComputedNodeBounds | null;
11130
+ private findNodeById;
11131
+ private findParentNode;
11132
+ }
11133
+ declare const selectionEngine: SelectionEngine;
11134
+
11135
+ type ResizeHandle = "nw" | "n" | "ne" | "e" | "se" | "s" | "sw" | "w";
11136
+ interface ResizeOptions {
11137
+ lockAspectRatio?: boolean;
11138
+ minWidth?: number;
11139
+ minHeight?: number;
11140
+ }
11141
+ declare class TransformEngine {
11142
+ /**
11143
+ * Translate node coordinates by delta (dx, dy).
11144
+ */
11145
+ static moveNode<T extends SceneNode>(node: T, dx: number, dy: number): T;
11146
+ /**
11147
+ * Keyboard directional nudge (1px step or 10px shift-step).
11148
+ */
11149
+ static nudgeNode<T extends SceneNode>(node: T, direction: "up" | "down" | "left" | "right", amount?: number): T;
11150
+ /**
11151
+ * Resize a node from an 8-direction handle knob.
11152
+ */
11153
+ static resizeNode<T extends SceneNode>(node: T, handle: ResizeHandle, dx: number, dy: number, options?: ResizeOptions): T;
11154
+ /**
11155
+ * Align multiple nodes relative to each other or canvas boundaries.
11156
+ */
11157
+ static alignNodes(nodes: SceneNode[], alignment: "left" | "center" | "right" | "top" | "middle" | "bottom", canvasBounds?: {
11158
+ width: number;
11159
+ height: number;
11160
+ }): SceneNode[];
11161
+ /**
11162
+ * Distribute multiple nodes evenly along horizontal or vertical axis.
11163
+ */
11164
+ static distributeNodes(nodes: SceneNode[], axis: "horizontal" | "vertical"): SceneNode[];
11165
+ }
11166
+
11167
+ type EditorCommandType = "MOVE_NODES" | "RESIZE_NODE" | "UPDATE_STYLE" | "UPDATE_PROP" | "ADD_NODE" | "DELETE_NODES" | "DUPLICATE_NODES" | "BATCH";
11168
+ interface BaseEditorCommand {
11169
+ id?: string;
11170
+ type: EditorCommandType;
11171
+ description?: string;
11172
+ timestamp?: number;
11173
+ }
11174
+ interface MoveNodesCommand extends BaseEditorCommand {
11175
+ type: "MOVE_NODES";
11176
+ moves: Array<{
11177
+ nodeId: string;
11178
+ fromX: number;
11179
+ fromY: number;
11180
+ toX: number;
11181
+ toY: number;
11182
+ }>;
11183
+ }
11184
+ interface ResizeNodeCommand extends BaseEditorCommand {
11185
+ type: "RESIZE_NODE";
11186
+ nodeId: string;
11187
+ from: {
11188
+ x: number;
11189
+ y: number;
11190
+ width: number;
11191
+ height: number;
11192
+ };
11193
+ to: {
11194
+ x: number;
11195
+ y: number;
11196
+ width: number;
11197
+ height: number;
11198
+ };
11199
+ }
11200
+ interface UpdateStyleCommand extends BaseEditorCommand {
11201
+ type: "UPDATE_STYLE";
11202
+ nodeId: string;
11203
+ property: string;
11204
+ previousValue: any;
11205
+ nextValue: any;
11206
+ }
11207
+ interface UpdatePropCommand extends BaseEditorCommand {
11208
+ type: "UPDATE_PROP";
11209
+ nodeId: string;
11210
+ property: string;
11211
+ previousValue: any;
11212
+ nextValue: any;
11213
+ }
11214
+ interface EditorAddNodeCommand extends BaseEditorCommand {
11215
+ type: "ADD_NODE";
11216
+ node: SceneNode;
11217
+ parentId?: string;
11218
+ index?: number;
11219
+ }
11220
+ interface DeleteNodesCommand extends BaseEditorCommand {
11221
+ type: "DELETE_NODES";
11222
+ deletedNodes: Array<{
11223
+ node: SceneNode;
11224
+ parentId?: string;
11225
+ index: number;
11226
+ }>;
11227
+ }
11228
+ interface DuplicateNodesCommand extends BaseEditorCommand {
11229
+ type: "DUPLICATE_NODES";
11230
+ sourceIds: string[];
11231
+ createdNodes: SceneNode[];
11232
+ }
11233
+ interface BatchCommand extends BaseEditorCommand {
11234
+ type: "BATCH";
11235
+ commands: EditorCommand[];
11236
+ }
11237
+ type EditorCommand = MoveNodesCommand | ResizeNodeCommand | UpdateStyleCommand | UpdatePropCommand | EditorAddNodeCommand | DeleteNodesCommand | DuplicateNodesCommand | BatchCommand;
11238
+ interface EditorExecutionResult {
11239
+ nextDoc: OverlayDocument;
11240
+ inverseCommand: EditorCommand;
11241
+ }
11242
+ declare class EditorCommandSystem {
11243
+ private undoStack;
11244
+ private redoStack;
11245
+ private maxHistory;
11246
+ private activeDragSession;
11247
+ /**
11248
+ * Execute a command against document, returning updated document and storing inverse in undo stack.
11249
+ */
11250
+ execute(doc: OverlayDocument, command: EditorCommand): OverlayDocument;
11251
+ /**
11252
+ * Undo last executed command.
11253
+ */
11254
+ undo(doc: OverlayDocument): OverlayDocument;
11255
+ /**
11256
+ * Redo previously undone command.
11257
+ */
11258
+ redo(doc: OverlayDocument): OverlayDocument;
11259
+ canUndo(): boolean;
11260
+ canRedo(): boolean;
11261
+ getUndoCount(): number;
11262
+ getRedoCount(): number;
11263
+ clear(): void;
11264
+ beginDragSession(nodes: SceneNode[]): void;
11265
+ commitDragSession(doc: OverlayDocument, currentNodes: SceneNode[]): OverlayDocument;
11266
+ applyCommand(doc: OverlayDocument, command: EditorCommand): EditorExecutionResult;
11267
+ private updateNodeInDoc;
11268
+ private insertNodeIntoDoc;
11269
+ private removeNodeFromDoc;
11270
+ }
11271
+ declare const editorCommandSystem: EditorCommandSystem;
11272
+
11273
+ declare class PropertyInspectorEngine {
11274
+ private commandSystem;
11275
+ constructor(commandSystem?: EditorCommandSystem);
11276
+ /**
11277
+ * Update Shape / Frame Fill Color.
11278
+ */
11279
+ setFillColor(doc: OverlayDocument, nodeId: string, fillColor: string): OverlayDocument;
11280
+ /**
11281
+ * Update Stroke (Border) styling.
11282
+ */
11283
+ setStroke(doc: OverlayDocument, nodeId: string, strokeColor: string, strokeWidth?: number): OverlayDocument;
11284
+ /**
11285
+ * Update Corner Radius.
11286
+ */
11287
+ setCornerRadius(doc: OverlayDocument, nodeId: string, borderRadius: number): OverlayDocument;
11288
+ /**
11289
+ * Update Text Typography properties.
11290
+ */
11291
+ setTypography(doc: OverlayDocument, nodeId: string, options: {
11292
+ text?: string;
11293
+ fontSize?: number;
11294
+ fontWeight?: string;
11295
+ color?: string;
11296
+ textAlign?: "left" | "center" | "right";
11297
+ }): OverlayDocument;
11298
+ /**
11299
+ * Update Frame Spatial Layout properties.
11300
+ */
11301
+ setFrameLayout(doc: OverlayDocument, nodeId: string, layout: {
11302
+ mode?: "flex-row" | "flex-column" | "none" | "grid";
11303
+ gap?: number | {
11304
+ col: number;
11305
+ row: number;
11306
+ };
11307
+ padding?: number | {
11308
+ top: number;
11309
+ right: number;
11310
+ bottom: number;
11311
+ left: number;
11312
+ };
11313
+ alignItems?: "flex-start" | "center" | "flex-end" | "stretch";
11314
+ justifyContent?: "flex-start" | "center" | "flex-end" | "space-between" | "space-around" | "space-evenly";
11315
+ widthMode?: "fixed" | "hug" | "fill";
11316
+ heightMode?: "fixed" | "hug" | "fill";
11317
+ }): OverlayDocument;
11318
+ /**
11319
+ * Update Media Sizing, ObjectFit & Asset reference.
11320
+ */
11321
+ setMediaProps(doc: OverlayDocument, nodeId: string, props: {
11322
+ assetId?: string;
11323
+ objectFit?: "cover" | "contain" | "fill" | "none";
11324
+ aspectRatioLock?: boolean;
11325
+ }): OverlayDocument;
11326
+ private findNode;
11327
+ }
11328
+ declare const propertyInspectorEngine: PropertyInspectorEngine;
11329
+
11330
+ interface SmartAlignmentGuide {
11331
+ type: "horizontal" | "vertical";
11332
+ position: number;
11333
+ label?: string;
11334
+ start?: number;
11335
+ end?: number;
11336
+ }
11337
+ interface SmartSnapResult {
11338
+ x: number;
11339
+ y: number;
11340
+ snappedX: boolean;
11341
+ snappedY: boolean;
11342
+ guides: SmartAlignmentGuide[];
11343
+ }
11344
+ declare class SmartGuideEngine {
11345
+ /**
11346
+ * Calculate snapped position and active visual guides for a moving node bounding box.
11347
+ */
11348
+ static calculateSnap(moving: {
11349
+ x: number;
11350
+ y: number;
11351
+ width: number;
11352
+ height: number;
11353
+ }, otherNodes: SceneNode[], canvasWidth?: number, canvasHeight?: number, threshold?: number): SmartSnapResult;
11354
+ }
11355
+
11356
+ interface BindingDefinition {
11357
+ targetProperty: string;
11358
+ expression: string;
11359
+ }
11360
+ declare class DataBindingAuthoringEngine {
11361
+ private commandSystem;
11362
+ constructor(commandSystem?: EditorCommandSystem);
11363
+ /**
11364
+ * Bind a node property to a dynamic variable expression (e.g. "{{speaker.name}}").
11365
+ */
11366
+ bindProperty(doc: OverlayDocument, nodeId: string, targetProperty: string, expression: string): OverlayDocument;
11367
+ /**
11368
+ * Unbind a dynamic variable expression from a node property.
11369
+ */
11370
+ unbindProperty(doc: OverlayDocument, nodeId: string, targetProperty: string): OverlayDocument;
11371
+ /**
11372
+ * List all declared document variables and dataset fields.
11373
+ */
11374
+ getAvailableVariables(doc: OverlayDocument): DocumentVariable[];
11375
+ /**
11376
+ * Add a new document variable to the schema.
11377
+ */
11378
+ addVariable(doc: OverlayDocument, variable: DocumentVariable): OverlayDocument;
11379
+ private findNode;
11380
+ }
11381
+ declare const dataBindingAuthoringEngine: DataBindingAuthoringEngine;
11382
+
11383
+ /**
11384
+ * Metric Engine
11385
+ *
11386
+ * Governing evaluation subsystem for KPI, Metric, and Telemetry cards.
11387
+ * Provides deterministic number/currency/percent formatting, robust delta
11388
+ * and trend calculations, and keyframe count-up interpolation.
11389
+ */
11390
+ interface MetricFormatOptions {
11391
+ format?: "number" | "currency" | "percent" | "compact";
11392
+ currencySymbol?: string;
11393
+ decimals?: number;
11394
+ locale?: string;
11395
+ prefix?: string;
11396
+ suffix?: string;
11397
+ }
11398
+ interface MetricDelta {
11399
+ absoluteChange: number;
11400
+ percentageChange: number;
11401
+ direction: "up" | "down" | "neutral";
11402
+ formattedDelta: string;
11403
+ formattedPercentage: string;
11404
+ }
11405
+ interface MetricEvaluationResult {
11406
+ rawValue: number;
11407
+ animatedValue: number;
11408
+ formattedValue: string;
11409
+ label?: string;
11410
+ prefix?: string;
11411
+ suffix?: string;
11412
+ delta?: MetricDelta;
11413
+ progress: number;
11414
+ }
11415
+ type CountUpEasing = "linear" | "easeIn" | "easeOut" | "easeInOut";
11416
+ declare class MetricEngine {
11417
+ /**
11418
+ * Format numeric value into human-readable strings (currency, percent, compact abbreviations).
11419
+ */
11420
+ static formatValue(value: number | string, options?: MetricFormatOptions): string;
11421
+ /**
11422
+ * Calculate absolute delta, percentage difference, and directional trend with edge-case hardening.
11423
+ */
11424
+ static calculateDelta(currentValue: number, previousValue?: number): MetricDelta | undefined;
11425
+ /**
11426
+ * Interpolate count-up animation progress from start to target value using easing curves.
11427
+ */
11428
+ static interpolateCountUp(targetValue: number, startValue?: number, progress?: number, easing?: CountUpEasing): number;
11429
+ /**
11430
+ * Evaluate full Metric state for animation timestamp t.
11431
+ */
11432
+ static evaluateMetric(rawValue: number | string, options?: MetricFormatOptions & {
11433
+ previousValue?: number;
11434
+ countUp?: boolean;
11435
+ progress?: number;
11436
+ easing?: CountUpEasing;
11437
+ label?: string;
11438
+ }): MetricEvaluationResult;
11439
+ }
11440
+
11441
+ /**
11442
+ * Series Engine
11443
+ *
11444
+ * Core mathematical engine for series-based visual analytics:
11445
+ * - Domain / Range mapping and scale normalization
11446
+ * - Radial / Arc sweep calculations (Gauges)
11447
+ * - Multi-series chart geometry (Bar, Line, Area, Donut)
11448
+ * - Threshold band state evaluation
11449
+ * - Milestone status evaluation (Timeline)
11450
+ */
11451
+ interface ThresholdBand {
11452
+ value: number;
11453
+ state?: "normal" | "warning" | "critical";
11454
+ color?: string;
11455
+ label?: string;
11456
+ }
11457
+ interface EvaluatedThreshold {
11458
+ value: number;
11459
+ state: "normal" | "warning" | "critical";
11460
+ color: string;
11461
+ label?: string;
11462
+ }
11463
+ interface ArcGeometryOutput {
11464
+ cx: number;
11465
+ cy: number;
11466
+ radius: number;
11467
+ innerRadius: number;
11468
+ startAngle: number;
11469
+ fullSweep: number;
11470
+ animSweep: number;
11471
+ normalizedProgress: number;
11472
+ }
11473
+ interface SeriesPoint {
11474
+ x: number;
11475
+ y: number;
11476
+ rawValue: number;
11477
+ category: string;
11478
+ seriesId: string;
11479
+ color: string;
11480
+ }
11481
+ interface BarGeometryItem {
11482
+ seriesId: string;
11483
+ categoryIndex: number;
11484
+ category: string;
11485
+ x: number;
11486
+ y: number;
11487
+ width: number;
11488
+ height: number;
11489
+ rawValue: number;
11490
+ color: string;
11491
+ }
11492
+ interface ChartScale {
11493
+ domainMin: number;
11494
+ domainMax: number;
11495
+ categories: string[];
11496
+ seriesIds: string[];
11497
+ }
11498
+ interface MilestoneItem {
11499
+ id: string;
11500
+ title: string;
11501
+ time?: number;
11502
+ timestamp?: string;
11503
+ description?: string;
11504
+ }
11505
+ interface EvaluatedMilestone {
11506
+ id: string;
11507
+ title: string;
11508
+ x: number;
11509
+ y: number;
11510
+ status: "completed" | "active" | "future";
11511
+ progress: number;
11512
+ }
11513
+ declare class SeriesEngine {
11514
+ /**
11515
+ * Evaluate threshold state and color from sorted threshold bands.
11516
+ */
11517
+ static evaluateThreshold(value: number, thresholds?: ThresholdBand[], defaultColor?: string, defaultState?: "normal" | "warning" | "critical"): EvaluatedThreshold;
11518
+ /**
11519
+ * Calculate radial and arc sweep geometry for Gauges and Circular Indicators.
11520
+ */
11521
+ static computeArcGeometry(value: number, min?: number, max?: number, width?: number, height?: number, style?: "semicircle" | "arc" | "full", sweepAngleDeg?: number, animationProgress?: number): ArcGeometryOutput;
11522
+ /**
11523
+ * Extract domain scale and categorical metadata across arbitrary dataset arrays.
11524
+ */
11525
+ static computeScale(data: any[], xField?: string, seriesKeys?: string[]): ChartScale;
11526
+ /**
11527
+ * Generate bar geometries (grouped or single series) mapped to plot bounds.
11528
+ */
11529
+ static computeBars(data: any[], scale: ChartScale, plotWidth: number, plotHeight: number, xField?: string, seriesConfig?: Array<{
11530
+ id: string;
11531
+ color?: string;
11532
+ }>, animationProgress?: number): BarGeometryItem[];
11533
+ /**
11534
+ * Generate polyline points and area paths for line charts.
11535
+ */
11536
+ static computeLinePoints(data: any[], scale: ChartScale, plotWidth: number, plotHeight: number, xField?: string, seriesConfig?: Array<{
11537
+ id: string;
11538
+ color?: string;
11539
+ }>, animationProgress?: number): Map<string, SeriesPoint[]>;
11540
+ /**
11541
+ * Evaluate milestone sequences for timeline progress indicators.
11542
+ */
11543
+ static evaluateMilestones(milestones: MilestoneItem[], activeMilestoneIndex?: number, width?: number, height?: number, orientation?: "horizontal" | "vertical"): EvaluatedMilestone[];
11544
+ }
11545
+
11546
+ /**
11547
+ * Grid Engine
11548
+ *
11549
+ * Core engine for tabular data structures and data grids:
11550
+ * - Dynamic column width distribution (Fixed, Hug, Fill weights)
11551
+ * - Cell value formatting and alignment
11552
+ * - Row striping and cell bounding boxes
11553
+ * - Row virtualization windowing math
11554
+ */
11555
+ interface ColumnDefinition {
11556
+ key: string;
11557
+ label?: string;
11558
+ width?: number;
11559
+ widthMode?: "fixed" | "hug" | "fill";
11560
+ flexWeight?: number;
11561
+ align?: "left" | "center" | "right";
11562
+ format?: "text" | "number" | "currency" | "percent";
11563
+ decimals?: number;
11564
+ }
11565
+ interface ComputedColumn {
11566
+ key: string;
11567
+ label: string;
11568
+ x: number;
11569
+ width: number;
11570
+ align: "left" | "center" | "right";
11571
+ format?: "text" | "number" | "currency" | "percent";
11572
+ }
11573
+ interface ComputedCell {
11574
+ columnKey: string;
11575
+ rawValue: any;
11576
+ formattedValue: string;
11577
+ x: number;
11578
+ y: number;
11579
+ width: number;
11580
+ height: number;
11581
+ align: "left" | "center" | "right";
11582
+ }
11583
+ interface ComputedRow {
11584
+ rowIndex: number;
11585
+ y: number;
11586
+ height: number;
11587
+ isEven: boolean;
11588
+ cells: ComputedCell[];
11589
+ }
11590
+ interface TableLayoutResult {
11591
+ columns: ComputedColumn[];
11592
+ rows: ComputedRow[];
11593
+ totalWidth: number;
11594
+ totalHeight: number;
11595
+ headerHeight: number;
11596
+ }
11597
+ interface VirtualWindow {
11598
+ startIndex: number;
11599
+ endIndex: number;
11600
+ offsetY: number;
11601
+ totalHeight: number;
11602
+ }
11603
+ declare class GridEngine {
11604
+ /**
11605
+ * Compute column horizontal distribution across available container width.
11606
+ */
11607
+ static distributeColumns(columns: ColumnDefinition[], containerWidth: number, minColWidth?: number): ComputedColumn[];
11608
+ /**
11609
+ * Format individual table cell values based on column formatting schema.
11610
+ */
11611
+ static formatCell(value: any, format?: "text" | "number" | "currency" | "percent", decimals?: number): string;
11612
+ /**
11613
+ * Compute full tabular grid layout including headers and rows.
11614
+ */
11615
+ static computeTableLayout(data: any[], columnDefs: ColumnDefinition[], containerWidth?: number, rowHeight?: number, headerHeight?: number): TableLayoutResult;
11616
+ /**
11617
+ * Compute virtual windowing bounds for large dataset rendering.
11618
+ */
11619
+ static computeVirtualWindow(totalRows: number, rowHeight?: number, scrollTop?: number, viewportHeight?: number, overscan?: number): VirtualWindow;
11620
+ }
11621
+
11622
+ type ResourceState$1 = "pending" | "loading" | "ready" | "missing" | "error";
11623
+ interface RegisteredAsset {
11624
+ ref: AssetRef;
11625
+ state: ResourceState$1;
11626
+ /** Number of document nodes currently referencing this asset */
11627
+ refCount: number;
11628
+ /** Final resolved URL — blob URL for local, original URI for remote */
11629
+ resolvedUrl?: string;
11630
+ error?: string;
11631
+ }
11632
+ /**
11633
+ * Central in-memory asset registry.
11634
+ *
11635
+ * Invariants:
11636
+ * - Same assetId always returns the same RegisteredAsset object (identity-stable)
11637
+ * - refCount tracks how many nodes reference the asset
11638
+ * - Releasing the last reference transitions state to "missing" (no delete — allows re-registration)
11639
+ * - Binary data is NEVER stored inside a registry entry
11640
+ */
11641
+ declare class AssetRegistry$1 {
11642
+ private entries;
11643
+ /**
11644
+ * Register an asset reference. If already registered, increments refCount
11645
+ * and updates the ref metadata (source, uri, metadata may change).
11646
+ */
11647
+ register(ref: AssetRef): RegisteredAsset;
11648
+ /**
11649
+ * Mark an asset as loaded and ready, storing its resolved URL.
11650
+ * Binary data must NOT be passed here — only a URL.
11651
+ */
11652
+ markReady(assetId: string, resolvedUrl: string): void;
11653
+ /**
11654
+ * Mark an asset as currently loading (e.g. fetch in flight).
11655
+ */
11656
+ markLoading(assetId: string): void;
11657
+ /**
11658
+ * Mark an asset as errored with a diagnostic message.
11659
+ */
11660
+ markError(assetId: string, error: string): void;
11661
+ /**
11662
+ * Decrement refCount. If count reaches 0, transitions to "missing".
11663
+ * Does NOT delete the entry — allows re-registration without losing state identity.
11664
+ */
11665
+ release(assetId: string): void;
11666
+ /**
11667
+ * Returns the RegisteredAsset entry, or undefined if not known.
11668
+ */
11669
+ get(assetId: string): RegisteredAsset | undefined;
11670
+ /**
11671
+ * Returns the current ResourceState for an assetId.
11672
+ * Returns "missing" if the asset has never been registered.
11673
+ */
11674
+ getState(assetId: string): ResourceState$1;
11675
+ /**
11676
+ * Returns all currently registered AssetRef entries.
11677
+ */
11678
+ list(): AssetRef[];
11679
+ /**
11680
+ * Clears the entire registry. Use only for testing or full session reset.
11681
+ */
11682
+ clear(): void;
11683
+ /**
11684
+ * Returns the total number of registered assets (including missing/error states).
11685
+ */
11686
+ size(): number;
11687
+ }
11688
+ /** Singleton asset registry for the current studio session */
11689
+ declare const assetRegistry: AssetRegistry$1;
11690
+
11691
+ interface RegisteredFont {
11692
+ ref: FontRef;
11693
+ state: ResourceState$1;
11694
+ /** CSS font-family value to use in fallback scenarios */
11695
+ fallbackFamily: string;
11696
+ }
11697
+ /**
11698
+ * Central font registry.
11699
+ *
11700
+ * Invariants:
11701
+ * - A font reference can never crash resolution — getFallback() always returns a valid value
11702
+ * - Weight/style variants are registered and resolved independently
11703
+ * - Font state changes do NOT mutate the OverlayDocument
11704
+ * - Missing font always falls back to "system-ui" or a registered substitute
11705
+ */
11706
+ declare class FontRegistry {
11707
+ private entries;
11708
+ /** Compute a stable key for a font variant */
11709
+ private key;
11710
+ /**
11711
+ * Register a font reference. If the same variant is already registered,
11712
+ * updates state and metadata.
11713
+ */
11714
+ register(ref: FontRef): RegisteredFont;
11715
+ /**
11716
+ * Mark a font variant as loaded and ready (CSS @font-face registered with browser).
11717
+ */
11718
+ markReady(family: string, weight: number, style: "normal" | "italic"): void;
11719
+ /**
11720
+ * Mark a font variant as errored.
11721
+ */
11722
+ markError(family: string, weight: number, style: "normal" | "italic"): void;
11723
+ /**
11724
+ * Returns the current ResourceState for a font variant.
11725
+ * Returns "missing" if the font has never been registered.
11726
+ */
11727
+ getState(family: string, weight: number, style: "normal" | "italic"): ResourceState$1;
11728
+ /**
11729
+ * Returns the CSS font-family to apply for a given font request.
11730
+ * If the font is ready, returns the requested family.
11731
+ * If missing/error, returns the safe fallback — NEVER throws.
11732
+ */
11733
+ getFallback(family: string, weight?: number, style?: "normal" | "italic"): string;
11734
+ /**
11735
+ * Returns all registered FontRef entries.
11736
+ */
11737
+ list(): FontRef[];
11738
+ /**
11739
+ * Clears all font registrations. Use only for testing or session reset.
11740
+ */
11741
+ clear(): void;
11742
+ private computeFallback;
11743
+ }
11744
+ /** Singleton font registry for the current studio session */
11745
+ declare const fontRegistry: FontRegistry;
11746
+
11747
+ interface ResolvedAsset {
11748
+ assetId: string;
11749
+ state: ResourceState$1;
11750
+ /** Ready-to-use URL — blob URL for local, original URI for remote */
11751
+ url?: string;
11752
+ /** Always-available placeholder — checkerboard data URI */
11753
+ fallbackUrl: string;
11754
+ }
11755
+ interface ResolvedFont {
11756
+ family: string;
11757
+ /** Actual CSS font-family to apply — may be fallback */
11758
+ resolvedFamily: string;
11759
+ state: ResourceState$1;
11760
+ }
11761
+ /**
11762
+ * Async-capable asset and font resolver that sits between the document
11763
+ * and the projection/export layer.
11764
+ *
11765
+ * Key contract:
11766
+ * - resolve() is ALWAYS synchronous — never blocks, never throws
11767
+ * - Missing assets return a deterministic placeholder — never crash the renderer
11768
+ * - warmDocument() pre-fetches all assets declared in doc.assetManifest
11769
+ * - The projection layer calls resolve() exclusively; it never fetches directly
11770
+ */
11771
+ declare class RuntimeAssetResolver {
11772
+ /**
11773
+ * Synchronously resolves an asset.
11774
+ * Returns current cached state immediately — never blocks.
11775
+ * Safe to call 1000× per frame.
11776
+ */
11777
+ resolve(assetId: string): ResolvedAsset;
11778
+ /**
11779
+ * Synchronously resolves a font variant.
11780
+ * Returns a CSS-ready `resolvedFamily` — never throws, never blocks.
11781
+ */
11782
+ resolveFont(family: string, weight?: number, style?: "normal" | "italic"): ResolvedFont;
11783
+ /**
11784
+ * Asynchronously resolves an asset — waits for state to transition
11785
+ * to "ready" or "error". Initiates load if the asset is "pending".
11786
+ */
11787
+ resolveAsync(assetId: string): Promise<ResolvedAsset>;
11788
+ /**
11789
+ * Asynchronously resolves a font — loads the @font-face if needed.
11790
+ */
11791
+ resolveFontAsync(ref: FontRef): Promise<ResolvedFont>;
11792
+ /**
11793
+ * Pre-warm the resolver for all assets and fonts declared in a document's AssetManifest.
11794
+ * Fires all fetches concurrently. The projection layer does NOT need to await this —
11795
+ * it will get placeholders until assets transition to "ready".
11796
+ */
11797
+ warmDocument(doc: OverlayDocument): Promise<void>;
11798
+ private loadAsset;
11799
+ private loadFont;
11800
+ /**
11801
+ * Walk document nodes and collect all FontRef values.
11802
+ */
11803
+ private collectFontRefs;
11804
+ }
11805
+ /** Singleton runtime asset resolver */
11806
+ declare const runtimeAssetResolver: RuntimeAssetResolver;
11807
+
11808
+ /**
11809
+ * Phase 4J — Responsive Layout Resolver
11810
+ *
11811
+ * Pure, deterministic, side-effect-free functions that merge a node's
11812
+ * base properties with a breakpoint-specific sparse override patch.
11813
+ *
11814
+ * Architecture contract:
11815
+ * Base property → responsive override → resolved property
11816
+ *
11817
+ * Identity fields (id, type, children) are NEVER overridden.
11818
+ * Only layout/style/geometry fields participate in breakpoint resolution.
11819
+ */
11820
+
11821
+ /**
11822
+ * Merge a node's base properties with the responsive override for the given
11823
+ * breakpoint. Returns a new object — does NOT mutate the original node.
11824
+ *
11825
+ * When breakpointId is null (base layout), the node is returned unchanged.
11826
+ * When breakpointId is non-null but the node has no override for it, the node
11827
+ * is returned unchanged (graceful fallback, no throw).
11828
+ */
11829
+ declare function resolveNodeForBreakpoint(node: SceneNode, breakpointId: string | null): SceneNode;
11830
+ /**
11831
+ * Produce a shallow-cloned OverlayDocument where:
11832
+ * - `canvas` is replaced by the breakpoint's canvas dimensions
11833
+ * - all nodes are recursively resolved for the breakpoint
11834
+ *
11835
+ * When breakpointId is null, the original document is returned unchanged.
11836
+ * When the breakpoint is not found in doc.breakpoints, the document is
11837
+ * returned unchanged (graceful fallback, no throw).
11838
+ *
11839
+ * The returned document is suitable as the direct input to
11840
+ * `LayoutEngine.computeLayout` and `AnimationRuntime.evaluateScene`.
11841
+ */
11842
+ declare function resolveDocumentForBreakpoint(doc: OverlayDocument, breakpointId: string | null): OverlayDocument;
11843
+
11844
+ /**
11845
+ * Phase 4K / 4L / 4M — Production Export & Rendering Pipeline Types
11846
+ */
11847
+
11848
+ type ExportProfile = "720p-landscape" | "1080p-landscape" | "1080p-portrait" | "1080p-square" | "4:5-portrait" | "4k-landscape" | "custom";
11849
+ interface ProfileCanvasDimensions {
11850
+ width: number;
11851
+ height: number;
11852
+ }
11853
+ declare const EXPORT_PROFILE_PRESETS: Record<Exclude<ExportProfile, "custom">, ProfileCanvasDimensions>;
11854
+ type ExportFormat = "png-sequence" | "webm" | "gif" | "raw-frames" | "mp4" | "prores";
11855
+ type VideoCodecProfile = "h264" | "hevc" | "av1" | "prores-4444" | "prores-422";
11856
+ interface ExportConfig {
11857
+ profile: ExportProfile;
11858
+ /** Breakpoint ID for responsive resolution. null = base document canvas */
11859
+ breakpointId?: string | null;
11860
+ /** Target resolution width when profile === 'custom' */
11861
+ customWidth?: number;
11862
+ /** Target resolution height when profile === 'custom' */
11863
+ customHeight?: number;
11864
+ /** Resolution multiplier (e.g. 1.0 = 100%, 2.0 = 200% super-sampled) */
11865
+ scale?: number;
11866
+ /** Frames per second for sequence stepping */
11867
+ fps?: number;
11868
+ /** Duration override in seconds. Defaults to document duration */
11869
+ duration?: number;
11870
+ /** If true, background color is cleared to transparent (RGBA alpha = 0) */
11871
+ transparent?: boolean;
11872
+ /** Target export output format */
11873
+ format?: ExportFormat;
11874
+ /** Video codec profile */
11875
+ codec?: VideoCodecProfile;
11876
+ /** Target bitrate in bps (e.g. 12_000_000 for 12 Mbps) */
11877
+ bitrate?: number;
11878
+ /** Context data overrides for variable evaluation during export */
11879
+ contextData?: Record<string, any>;
11880
+ }
11881
+ type ExportDiagnosticSeverity = "error" | "warning" | "info";
11882
+ 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";
11883
+ interface ExportValidationDiagnostic {
11884
+ severity: ExportDiagnosticSeverity;
11885
+ code: ExportDiagnosticCode;
11886
+ nodeId?: string;
11887
+ message: string;
11888
+ details?: Record<string, any>;
11889
+ }
11890
+ interface EvaluatedExportFrame {
11891
+ frameIndex: number;
11892
+ time: number;
11893
+ resolvedDoc: OverlayDocument;
11894
+ layoutState: LayoutComputedState;
11895
+ evaluatedSceneState: EvaluatedSceneState;
11896
+ canvasWidth: number;
11897
+ canvasHeight: number;
11898
+ }
11899
+ interface ExportFrameDescriptor {
11900
+ frameIndex: number;
11901
+ time: number;
11902
+ width: number;
11903
+ height: number;
11904
+ dataUrl?: string;
11905
+ blob?: Blob;
11906
+ imageData?: ImageData;
11907
+ }
11908
+ interface ExportProgress {
11909
+ stage: "queued" | "validating" | "rendering" | "encoding" | "completed" | "completed-with-warnings" | "cancelled" | "failed";
11910
+ renderedFrames: number;
11911
+ encodedFrames: number;
11912
+ totalFrames: number;
11913
+ percent: number;
11914
+ currentTime: number;
11915
+ message?: string;
11916
+ }
11917
+ type JobStatus = "queued" | "validating" | "rendering" | "encoding" | "completed" | "completed-with-warnings" | "cancelled" | "failed";
11918
+ interface EncodedFileEntry {
11919
+ name: string;
11920
+ blob: Blob;
11921
+ }
11922
+ interface EncodedOutput {
11923
+ format: ExportFormat;
11924
+ blob?: Blob;
11925
+ dataUrl?: string;
11926
+ files?: EncodedFileEntry[];
11927
+ frameCount: number;
11928
+ sizeBytes?: number;
11929
+ }
11930
+ interface MediaEncoder {
11931
+ format: ExportFormat;
11932
+ encode(frames: AsyncIterable<EvaluatedExportFrame>, config: ExportConfig, signal?: AbortSignal, onProgress?: (progress: ExportProgress) => void): Promise<EncodedOutput>;
11933
+ }
11934
+ interface ExportJobRecord {
11935
+ id: string;
11936
+ documentId: string;
11937
+ documentTitle: string;
11938
+ config: ExportConfig;
11939
+ status: JobStatus;
11940
+ progress: ExportProgress;
11941
+ createdAt: string;
11942
+ completedAt?: string;
11943
+ output?: EncodedOutput;
11944
+ diagnostics: ExportValidationDiagnostic[];
11945
+ error?: string;
11946
+ retryCount?: number;
11947
+ docSnapshot?: OverlayDocument;
11948
+ }
11949
+
11950
+ /**
11951
+ * Phase 4K / 4M — Pre-Export Safety Validator
11952
+ *
11953
+ * Inspects an OverlayDocument and ExportConfig before rendering to flag
11954
+ * missing assets, missing fonts, syntax/expression errors, duration overflows,
11955
+ * invalid layout constraints, and CORS canvas taint risks.
11956
+ */
11957
+
11958
+ declare class ExportValidator {
11959
+ validate(doc: OverlayDocument, config?: Partial<ExportConfig>): ExportValidationDiagnostic[];
11960
+ private walkNodes;
11961
+ private validateNode;
11962
+ }
11963
+ declare const exportValidator: ExportValidator;
11964
+
11965
+ /**
11966
+ * Phase 4K — Deterministic Frame Pipeline
11967
+ *
11968
+ * Runs the exact engine evaluation pass for a given time t:
11969
+ * Document → Responsive Resolution → Asset Resolution → Layout Engine → Animation Runtime → EvaluatedSceneState
11970
+ *
11971
+ * Guaranteed byte-for-byte identical output for identical time inputs.
11972
+ * The editor preview and export pipeline consume this exact same evaluation flow.
11973
+ */
11974
+
11975
+ /**
11976
+ * Resolve target canvas dimensions based on ExportConfig profile and scale.
11977
+ */
11978
+ declare function resolveExportCanvasDimensions(doc: OverlayDocument, config?: Partial<ExportConfig>): {
11979
+ width: number;
11980
+ height: number;
11981
+ };
11982
+ /**
11983
+ * Evaluates a single export frame at time t.
11984
+ * Pure deterministic pass — returns resolved document, auto-layout bounds,
11985
+ * and evaluated scene state.
11986
+ */
11987
+ declare function evaluateExportFrame(doc: OverlayDocument, time: number, config?: Partial<ExportConfig>): EvaluatedExportFrame;
11988
+
11989
+ /**
11990
+ * Phase 4K — Offscreen Render Engine & Sequence Generator
11991
+ *
11992
+ * Renders evaluated frames to canvas/image buffers and generates discrete
11993
+ * frame sequences for video/image sequence export.
11994
+ */
11995
+
11996
+ declare class RenderEngine {
11997
+ /**
11998
+ * Evaluates and projects frame at time t onto PixiSceneProjection.
11999
+ * Returns evaluated export frame containing resolved bounds and EvaluatedSceneState.
12000
+ */
12001
+ evaluateFrame(doc: OverlayDocument, time: number, config?: Partial<ExportConfig>): EvaluatedExportFrame;
12002
+ /**
12003
+ * Render frame to an HTMLCanvasElement or 2D context.
12004
+ */
12005
+ renderFrameToCanvas(doc: OverlayDocument, time: number, config?: Partial<ExportConfig>, targetCanvas?: any): ExportFrameDescriptor;
12006
+ /**
12007
+ * Generates a complete frame sequence by stepping frame-by-frame from t=0 to t=duration.
12008
+ */
12009
+ renderFrameSequence(doc: OverlayDocument, config?: Partial<ExportConfig>, onProgress?: (progress: ExportProgress) => void): Promise<ExportFrameDescriptor[]>;
12010
+ }
12011
+ declare const renderEngine: RenderEngine;
12012
+
12013
+ /**
12014
+ * Phase 4L — Streaming Frame Pipeline
12015
+ *
12016
+ * Async generator yielding single EvaluatedExportFrame descriptors step-by-step:
12017
+ * t = frameIndex / fps
12018
+ *
12019
+ * Key Architectural Invariant:
12020
+ * The frame pipeline does not accumulate historical frames in application-level memory;
12021
+ * working memory is independent of frame count, excluding encoder/runtime/resource buffers.
12022
+ * Raw RGBA frame data is yielded one-by-one and discarded immediately by the consumer.
12023
+ * AbortSignal is checked on every step to support instant cancellation.
12024
+ */
12025
+
12026
+ /**
12027
+ * Custom error class thrown when export streaming is aborted mid-run.
12028
+ */
12029
+ declare class ExportAbortError extends Error {
12030
+ constructor(message?: string);
12031
+ }
12032
+ /**
12033
+ * Async generator yielding EvaluatedExportFrame one frame at a time.
12034
+ */
12035
+ declare function streamExportFrames(doc: OverlayDocument, config?: Partial<ExportConfig>, signal?: AbortSignal): AsyncGenerator<EvaluatedExportFrame, void, unknown>;
12036
+
12037
+ /**
12038
+ * Phase 4L — Media Encoder Abstraction & Implementations
12039
+ *
12040
+ * Decouples video/image encoding from the core engine renderer.
12041
+ * Consumes an AsyncIterable<EvaluatedExportFrame> stream and produces EncodedOutput.
12042
+ */
12043
+
12044
+ declare class PngSequenceEncoder implements MediaEncoder {
12045
+ format: ExportFormat;
12046
+ encode(frames: AsyncIterable<EvaluatedExportFrame>, config: ExportConfig, signal?: AbortSignal, onProgress?: (progress: ExportProgress) => void): Promise<EncodedOutput>;
12047
+ }
12048
+ declare class GifEncoder implements MediaEncoder {
12049
+ format: ExportFormat;
12050
+ encode(frames: AsyncIterable<EvaluatedExportFrame>, config: ExportConfig, signal?: AbortSignal, onProgress?: (progress: ExportProgress) => void): Promise<EncodedOutput>;
12051
+ }
12052
+ declare class WebMEncoder implements MediaEncoder {
12053
+ format: ExportFormat;
12054
+ encode(frames: AsyncIterable<EvaluatedExportFrame>, config: ExportConfig, signal?: AbortSignal, onProgress?: (progress: ExportProgress) => void): Promise<EncodedOutput>;
12055
+ }
12056
+ declare class RawFramesEncoder implements MediaEncoder {
12057
+ format: ExportFormat;
12058
+ encode(frames: AsyncIterable<EvaluatedExportFrame>, config: ExportConfig, signal?: AbortSignal, onProgress?: (progress: ExportProgress) => void): Promise<EncodedOutput>;
12059
+ }
12060
+ declare class Mp4VideoEncoder implements MediaEncoder {
12061
+ format: ExportFormat;
12062
+ encode(frames: AsyncIterable<EvaluatedExportFrame>, config: ExportConfig, signal?: AbortSignal, onProgress?: (progress: ExportProgress) => void): Promise<EncodedOutput>;
12063
+ }
12064
+ declare class ProResVideoEncoder implements MediaEncoder {
12065
+ format: ExportFormat;
12066
+ encode(frames: AsyncIterable<EvaluatedExportFrame>, config: ExportConfig, signal?: AbortSignal, onProgress?: (progress: ExportProgress) => void): Promise<EncodedOutput>;
12067
+ }
12068
+ declare class MediaEncoderRegistry {
12069
+ private encoders;
12070
+ constructor();
12071
+ register(encoder: MediaEncoder): void;
12072
+ get(format: ExportFormat): MediaEncoder;
12073
+ }
12074
+ declare const mediaEncoderRegistry: MediaEncoderRegistry;
12075
+
12076
+ /**
12077
+ * Phase 4K / 4L / 4M — ExportJob Controller
12078
+ *
12079
+ * Stateful, decoupled job orchestrator managing document snapshotting, preflight validation,
12080
+ * streaming frame rendering, media encoding, status differentiation, and AbortSignal cancellation.
12081
+ */
12082
+
12083
+ type JobChangeListener = (job: ExportJob) => void;
12084
+ declare class ExportJob {
12085
+ id: string;
12086
+ doc: OverlayDocument;
12087
+ /** Immutable document snapshot captured at job creation time */
12088
+ docSnapshot: OverlayDocument;
12089
+ config: ExportConfig;
12090
+ status: JobStatus;
12091
+ progress: ExportProgress;
12092
+ diagnostics: ExportValidationDiagnostic[];
12093
+ output?: EncodedOutput;
12094
+ error?: string;
12095
+ createdAt: string;
12096
+ completedAt?: string;
12097
+ retryCount: number;
12098
+ private abortController;
12099
+ private listeners;
12100
+ constructor(doc: OverlayDocument, config: ExportConfig);
12101
+ subscribe(listener: JobChangeListener): () => void;
12102
+ private notify;
12103
+ /**
12104
+ * Run preflight validation on the captured document snapshot.
12105
+ * Returns true if export is allowed (zero error diagnostics).
12106
+ */
12107
+ validate(): boolean;
12108
+ /**
12109
+ * Start executing the export job using docSnapshot.
12110
+ * Preflight errors block execution; warnings permit execution with advisory.
12111
+ */
12112
+ start(): Promise<EncodedOutput>;
12113
+ /**
12114
+ * Retry executing a failed or cancelled export job using the document snapshot.
12115
+ */
12116
+ retry(): Promise<EncodedOutput>;
12117
+ /**
12118
+ * Cancel job execution immediately via AbortSignal.
12119
+ */
12120
+ cancel(): void;
12121
+ toRecord(): ExportJobRecord;
12122
+ }
12123
+
12124
+ /**
12125
+ * Clypra Asset Runtime Core Types
12126
+ *
12127
+ * Universal contracts for asset identity, protocol resolution,
12128
+ * resource caching, and frame-level export determinism.
12129
+ */
12130
+ type AssetProtocol = "asset" | "https" | "http" | "file" | "blob" | "binding" | "font";
12131
+ interface FocalPoint {
12132
+ x: number;
12133
+ y: number;
12134
+ }
12135
+ interface IntrinsicMetadata {
12136
+ width: number;
12137
+ height: number;
12138
+ aspectRatio: number;
12139
+ mimeType?: string;
12140
+ duration?: number;
12141
+ }
12142
+ interface AssetDescriptor {
12143
+ id: string;
12144
+ protocol: AssetProtocol;
12145
+ source: string;
12146
+ version?: string | number;
12147
+ focalPoint?: FocalPoint;
12148
+ intrinsicMeta?: IntrinsicMetadata;
12149
+ tags?: string[];
12150
+ }
12151
+ type ResourceKind = "image-bitmap" | "gpu-texture" | "video-frame" | "audio-buffer" | "svg-vector" | "font-face" | "lottie-tree" | "placeholder";
12152
+ type ResourceState = "idle" | "loading" | "decoded" | "ready" | "error";
12153
+ interface ResolvedResource<T = any> {
12154
+ handle: string;
12155
+ assetId: string;
12156
+ kind: ResourceKind;
12157
+ data: T | null;
12158
+ width: number;
12159
+ height: number;
12160
+ byteSize: number;
12161
+ state: ResourceState;
12162
+ error?: string;
12163
+ refCount: number;
12164
+ lastAccessTime: number;
12165
+ }
12166
+ interface CacheKeyOptions {
12167
+ assetId: string;
12168
+ version?: string | number;
12169
+ targetWidth?: number;
12170
+ targetHeight?: number;
12171
+ fitMode?: string;
12172
+ focalPoint?: FocalPoint;
12173
+ }
12174
+ interface FrameAssetDependency {
12175
+ nodeId: string;
12176
+ assetId: string;
12177
+ timelineStart: number;
12178
+ timelineEnd: number;
12179
+ }
12180
+
12181
+ /**
12182
+ * Universal Resource Cache
12183
+ *
12184
+ * Provides thread-safe, deduplicated memory management for decoded
12185
+ * images, textures, audio buffers, and parsed vectors with LRU eviction.
12186
+ */
12187
+ declare class ResourceCache {
12188
+ private resources;
12189
+ private pendingPromises;
12190
+ private maxByteSize;
12191
+ private currentByteSize;
12192
+ constructor(maxByteSize?: number);
12193
+ /**
12194
+ * Deterministically generate a composite cache key.
12195
+ */
12196
+ static generateKey(options: CacheKeyOptions): string;
12197
+ /**
12198
+ * Retrieve a cached resource synchronously if available.
12199
+ */
12200
+ get<T = any>(key: string): ResolvedResource<T> | undefined;
12201
+ /**
12202
+ * Check if a resource key is currently ready in cache.
12203
+ */
12204
+ isReady(key: string): boolean;
12205
+ /**
12206
+ * Acquire a resource (increments reference count).
12207
+ */
12208
+ acquire<T = any>(key: string): ResolvedResource<T> | undefined;
12209
+ /**
12210
+ * Release a resource (decrements reference count).
12211
+ */
12212
+ release(key: string): void;
12213
+ /**
12214
+ * Store or update a resolved resource in cache.
12215
+ */
12216
+ set<T = any>(key: string, resource: Omit<ResolvedResource<T>, "handle" | "lastAccessTime" | "refCount">): ResolvedResource<T>;
12217
+ /**
12218
+ * Load or retrieve an asset resource asynchronously with deduplicated in-flight requests.
12219
+ */
12220
+ loadResource<T = any>(key: string, loader: () => Promise<{
12221
+ data: T;
12222
+ width: number;
12223
+ height: number;
12224
+ byteSize?: number;
12225
+ kind: ResourceKind;
12226
+ }>, assetId: string): Promise<ResolvedResource<T>>;
12227
+ /**
12228
+ * Evict least-recently-used unreferenced resources when memory threshold is reached.
12229
+ */
12230
+ private evictIfNeeded;
12231
+ /**
12232
+ * Get current resource cache size and memory stats.
12233
+ */
12234
+ getStats(): {
12235
+ resourceCount: number;
12236
+ pendingCount: number;
12237
+ currentByteSize: number;
12238
+ maxByteSize: number;
12239
+ };
12240
+ /**
12241
+ * Clear all cached resources.
12242
+ */
12243
+ clear(): void;
12244
+ }
12245
+
12246
+ /**
12247
+ * Universal Asset Registry
12248
+ *
12249
+ * Serves as the single source of truth for project media assets,
12250
+ * managing asset identity, protocol extraction, metadata caching,
12251
+ * and project-level serialization.
12252
+ */
12253
+ declare class AssetRegistry {
12254
+ private assets;
12255
+ /**
12256
+ * Infer the AssetProtocol from a raw URI/string source.
12257
+ */
12258
+ static inferProtocol(source: string): AssetProtocol;
12259
+ /**
12260
+ * Register a new asset or update an existing descriptor.
12261
+ */
12262
+ register(descriptor: AssetDescriptor): AssetDescriptor;
12263
+ /**
12264
+ * Convenience registration from raw URI.
12265
+ */
12266
+ registerFromSource(id: string, source: string, options?: {
12267
+ focalPoint?: FocalPoint;
12268
+ intrinsicMeta?: IntrinsicMetadata;
12269
+ version?: string | number;
12270
+ tags?: string[];
12271
+ }): AssetDescriptor;
12272
+ /**
12273
+ * Retrieve asset descriptor by canonical ID.
12274
+ */
12275
+ get(id: string): AssetDescriptor | undefined;
12276
+ /**
12277
+ * Check if an asset ID is registered.
12278
+ */
12279
+ has(id: string): boolean;
12280
+ /**
12281
+ * Update intrinsic metadata for a registered asset (e.g. after decoding).
12282
+ */
12283
+ updateIntrinsicMetadata(id: string, meta: IntrinsicMetadata): void;
12284
+ /**
12285
+ * Update default focal point for smart cropping.
12286
+ */
12287
+ updateFocalPoint(id: string, focalPoint: FocalPoint): void;
12288
+ /**
12289
+ * List all registered asset descriptors.
12290
+ */
12291
+ list(): AssetDescriptor[];
12292
+ /**
12293
+ * Remove an asset by ID.
12294
+ */
12295
+ unregister(id: string): boolean;
12296
+ /**
12297
+ * Clear all registered assets.
12298
+ */
12299
+ clear(): void;
12300
+ /**
12301
+ * Export asset manifest for project packaging.
12302
+ */
12303
+ toJSON(): AssetDescriptor[];
12304
+ /**
12305
+ * Import asset manifest from project package.
12306
+ */
12307
+ fromJSON(manifest: AssetDescriptor[]): void;
12308
+ }
12309
+
12310
+ /**
12311
+ * Export Dependency Graph & Frame Readiness Barrier
12312
+ *
12313
+ * Ensures deterministic, zero-frame-drop rendering in headless export pipelines
12314
+ * by verifying all active asset dependencies at timestamp `t` are decoded and ready.
12315
+ */
12316
+ declare class ExportDependencyGraph {
12317
+ private dependencies;
12318
+ /**
12319
+ * Register a node's asset dependency across a timeline interval.
12320
+ */
12321
+ registerDependency(dep: FrameAssetDependency): void;
12322
+ /**
12323
+ * Clear all registered timeline dependencies.
12324
+ */
12325
+ clear(): void;
12326
+ /**
12327
+ * Find all asset IDs required at the given timeline timestamp.
12328
+ */
12329
+ getRequiredAssetIdsAt(timelineTime: number): string[];
12330
+ /**
12331
+ * Check if all required assets for the given timeline timestamp are ready in the resource cache.
12332
+ */
12333
+ isFrameReady(timelineTime: number, cache?: ResourceCache, registry?: AssetRegistry): boolean;
12334
+ /**
12335
+ * Get the list of asset IDs that are still pending or missing for the given timestamp.
12336
+ */
12337
+ getPendingAssetIdsAt(timelineTime: number, cache?: ResourceCache, registry?: AssetRegistry): string[];
12338
+ }
12339
+
12340
+ /**
12341
+ * Live Broadcast Bridge
12342
+ *
12343
+ * Real-time zero-frame-drop overlay streaming engine for OBS Studio,
12344
+ * NDI feeds, WebRTC broadcast pipelines, and virtual camera sinks.
12345
+ */
12346
+
12347
+ interface LiveBroadcastOptions {
12348
+ fps?: number;
12349
+ width?: number;
12350
+ height?: number;
12351
+ transparent?: boolean;
12352
+ onFrame?: (frame: EvaluatedBroadcastFrame) => void;
12353
+ onError?: (err: Error) => void;
12354
+ }
12355
+ interface EvaluatedBroadcastFrame extends EvaluatedExportFrame {
12356
+ isAssetReady: boolean;
12357
+ pendingAssetIds: string[];
12358
+ dropped: boolean;
12359
+ }
12360
+ declare class LiveBroadcastBridge {
12361
+ private active;
12362
+ private currentDoc;
12363
+ private options;
12364
+ private frameCount;
12365
+ private startTime;
12366
+ private depGraph;
12367
+ private cache;
12368
+ private registry;
12369
+ constructor(depGraph?: ExportDependencyGraph, cache?: ResourceCache, registry?: AssetRegistry);
12370
+ /**
12371
+ * Initialize a live broadcast session for an OverlayDocument.
12372
+ */
12373
+ start(doc: OverlayDocument, options?: LiveBroadcastOptions): void;
12374
+ /**
12375
+ * Stop active broadcast session.
12376
+ */
12377
+ stop(): void;
12378
+ isActive(): boolean;
12379
+ getFrameCount(): number;
12380
+ /**
12381
+ * Generate next broadcast frame at exact timestamp with live telemetry data overrides.
12382
+ */
12383
+ emitFrame(time: number, liveTelemetry?: Record<string, any>): EvaluatedBroadcastFrame;
12384
+ /**
12385
+ * Dynamically hot-swap or update the broadcast document without dropping running stream connection.
12386
+ */
12387
+ updateDocument(nextDoc: OverlayDocument): void;
12388
+ }
12389
+ declare const liveBroadcastBridge: LiveBroadcastBridge;
12390
+
12391
+ /**
12392
+ * Phase 4R.2 — Modular Visualization Renderer & Projection Registry
12393
+ *
12394
+ * Decouples PixiJS rendering execution from engine geometry evaluation.
12395
+ * Consumes EvaluatedChartGeometry / EvaluatedGaugeGeometry / etc. and projects onto PixiJS Containers.
12396
+ */
12397
+
12398
+ interface VisualizationRenderContext {
12399
+ container: Container;
12400
+ hexToNumber: (hex: string | undefined, fallback?: number) => number;
12401
+ renderLabel: (parent: Container, name: string, text: string, x: number, y: number, size?: number, color?: string, bold?: boolean, fontFamily?: string) => void;
12402
+ }
12403
+ interface VisualizationRenderer<TGeometry = any> {
12404
+ render(geometry: TGeometry, context: VisualizationRenderContext): void;
12405
+ }
12406
+ declare class VisualizationRendererRegistry {
12407
+ private renderers;
12408
+ register<TGeometry = any>(type: string, renderer: VisualizationRenderer<TGeometry>): void;
12409
+ get<TGeometry = any>(type: string): VisualizationRenderer<TGeometry> | undefined;
12410
+ has(type: string): boolean;
12411
+ }
12412
+ declare const visualizationRendererRegistry: VisualizationRendererRegistry;
12413
+
12414
+ /**
12415
+ * Phase 4Q — VisualizationEngine (refactored)
12416
+ *
12417
+ * Pure geometry generator registry: (ChartNode, width, height, t) → EvaluatedChartGeometry.
12418
+ *
12419
+ * Architecture:
12420
+ * evaluate() — shared infrastructure + dispatcher
12421
+ * ├── computeBars() → "bar"
12422
+ * ├── computeLinePaths() → "line" | "area"
12423
+ * └── computeArcs() → "pie" | "donut"
12424
+ *
12425
+ * No Pixi, no DOM, no async. Deterministic and fully testable.
12426
+ */
12427
+
12428
+ interface BarGeometry {
12429
+ seriesId: string;
12430
+ categoryIndex: number;
12431
+ x: number;
12432
+ y: number;
12433
+ w: number;
12434
+ /** Animated bar height at current t */
12435
+ h: number;
12436
+ /** Full bar height at t=1 */
12437
+ fullH: number;
12438
+ color: string;
12439
+ rawValue: number;
12440
+ animatedValue: number;
12441
+ labelText: string;
12442
+ active: boolean;
12443
+ }
12444
+ interface LinePoint {
12445
+ seriesId: string;
12446
+ categoryIndex: number;
12447
+ /** Pixel x for this category */
12448
+ x: number;
12449
+ /** Animated pixel y (baseline at t=0, data position at t=1) */
12450
+ y: number;
12451
+ /** Full pixel y at t=1 */
12452
+ fullY: number;
12453
+ /** Bottom of plot (baseline y — used for area fill) */
12454
+ baseY: number;
12455
+ color: string;
12456
+ rawValue: number;
12457
+ animatedValue: number;
12458
+ labelText: string;
12459
+ active: boolean;
12460
+ }
12461
+ interface ArcGeometry {
12462
+ seriesId: string;
12463
+ /** Animated start angle (radians) */
12464
+ startAngle: number;
12465
+ /** Animated end angle (radians) — equals startAngle at t=0 */
12466
+ endAngle: number;
12467
+ /** Final end angle at t=1 */
12468
+ fullEndAngle: number;
12469
+ /** 0 for pie, >0 for donut */
12470
+ innerRadius: number;
12471
+ outerRadius: number;
12472
+ color: string;
12473
+ rawValue: number;
12474
+ animatedValue: number;
12475
+ percentage: number;
12476
+ labelText: string;
12477
+ /** Midpoint of arc — for label placement */
12478
+ labelX: number;
12479
+ labelY: number;
12480
+ }
12481
+ interface GridLineGeometry {
12482
+ y: number;
12483
+ label: string;
12484
+ value: number;
12485
+ }
12486
+ interface AxisLabel {
12487
+ x: number;
12488
+ y: number;
12489
+ text: string;
12490
+ anchor: "start" | "middle" | "end";
12491
+ }
12492
+ interface LegendEntry {
12493
+ x: number;
12494
+ y: number;
12495
+ color: string;
12496
+ label: string;
12497
+ }
12498
+ interface PlotArea {
12499
+ x: number;
12500
+ y: number;
12501
+ w: number;
12502
+ h: number;
12503
+ }
12504
+ interface GeometryAnchor {
12505
+ x: number;
12506
+ y: number;
12507
+ w: number;
12508
+ h: number;
12509
+ label: string;
12510
+ }
12511
+ interface AnchorMap {
12512
+ /** bar[seriesId][categoryIndex] → bounding box of top of bar */
12513
+ bars: Record<string, Record<number, GeometryAnchor>>;
12514
+ /** point[seriesId][categoryIndex] → point center coordinate */
12515
+ points: Record<string, Record<number, GeometryAnchor>>;
12516
+ /** arc[seriesId] → midpoint coordinate of arc */
12517
+ arcs: Record<string, GeometryAnchor>;
12518
+ }
12519
+ interface HighlightRegionGeometry {
12520
+ x: number;
12521
+ y: number;
12522
+ w: number;
12523
+ h: number;
12524
+ color: string;
12525
+ opacity: number;
12526
+ label?: string;
12527
+ }
12528
+ interface EvaluatedChartGeometry {
12529
+ bars: BarGeometry[];
12530
+ linePoints: LinePoint[];
12531
+ arcs: ArcGeometry[];
12532
+ centerX: number;
12533
+ centerY: number;
12534
+ gridLines: GridLineGeometry[];
12535
+ xAxisLabels: AxisLabel[];
12536
+ yAxisLabels: AxisLabel[];
12537
+ legendEntries: LegendEntry[];
12538
+ plotArea: PlotArea;
12539
+ t: number;
12540
+ anchors: AnchorMap;
12541
+ highlights: HighlightRegionGeometry[];
12542
+ }
12543
+ declare class VisualizationEngine {
12544
+ /**
12545
+ * Evaluate a ChartNode into flat geometry at normalized time t ∈ [0,1].
12546
+ *
12547
+ * @param node Fully data-bound ChartNode (series[].data populated by DataBindingEngine)
12548
+ * @param width Absolute pixel width
12549
+ * @param height Absolute pixel height
12550
+ * @param t Normalized animation time [0,1]
12551
+ */
12552
+ evaluate(node: ChartNode, width: number, height: number, t: number): EvaluatedChartGeometry;
12553
+ private normalizeSeries;
12554
+ private resolveCategories;
12555
+ private computeDomain;
12556
+ private niceMax;
12557
+ private valueToY;
12558
+ private computeGridLines;
12559
+ private computeYAxisLabels;
12560
+ private computeXAxisLabels;
12561
+ private computeBars;
12562
+ private computeLinePaths;
12563
+ private computeArcs;
12564
+ private computeLegend;
12565
+ private computeAnchors;
12566
+ private computeHighlights;
12567
+ private emptyGeometry;
12568
+ }
12569
+ declare const visualizationEngine: VisualizationEngine;
12570
+
12571
+ /**
12572
+ * Phase 4R.1 — Executable Capability Registry
12573
+ *
12574
+ * Defines machine-readable capability entries and executable probe interfaces
12575
+ * for all 19 primitive node types in Clypra Studio.
12576
+ */
12577
+ type CapabilityStatus = "complete" | "partial" | "missing" | "limitation";
12578
+ interface CapabilityEntry {
12579
+ id: string;
12580
+ name: string;
12581
+ primitiveType: string;
12582
+ category: "graphics" | "data" | "visualization" | "structure" | "media";
12583
+ status: {
12584
+ schema: CapabilityStatus;
12585
+ factory: CapabilityStatus;
12586
+ command: CapabilityStatus;
12587
+ inspector: CapabilityStatus;
12588
+ animation: CapabilityStatus;
12589
+ responsive: CapabilityStatus;
12590
+ preview: CapabilityStatus;
12591
+ export: CapabilityStatus;
12592
+ desktopGeometry: CapabilityStatus;
12593
+ desktopPixels: CapabilityStatus;
12594
+ };
12595
+ testProbe?: () => boolean;
12596
+ }
12597
+ declare const CAPABILITY_REGISTRY: Record<string, CapabilityEntry>;
12598
+ declare function getCapabilityReport(): {
12599
+ total: number;
12600
+ complete: number;
12601
+ missingDesktop: number;
12602
+ };
12603
+
12604
+ /**
12605
+ * Pure functional runtime evaluator.
12606
+ * Evaluates an OverlayDocument at explicit time `t` with runtime context.
12607
+ *
12608
+ * Guaranteed Invariants:
12609
+ * - Deterministic: (doc, context, time) => identical EvaluatedScene.
12610
+ * - Renderer-neutral: Zero DOM, PixiJS, WebGL, React, or GPU objects in EvaluatedScene.
12611
+ * - No wall-clock dependencies: Never calls Date.now(), performance.now(), or rAF.
12612
+ */
12613
+ declare function evaluateOverlayDocument(doc: OverlayDocument, context?: RuntimeContext, time?: number): EvaluatedScene;
12614
+
12615
+ type SemanticIntent = "inform" | "explain" | "compare" | "emphasize" | "identify" | "quote" | "summarize" | "enumerate" | "warn" | "demonstrate" | "annotate" | "transition";
12616
+ interface SemanticSlotDefinition {
12617
+ id: string;
12618
+ name: string;
12619
+ type: "text" | "metric" | "image" | "code" | "list" | "comparison-pair";
12620
+ required?: boolean;
12621
+ defaultValue?: any;
12622
+ }
12623
+ interface SemanticBehaviorConfig {
12624
+ entrancePattern?: "fade" | "slide-up" | "stagger-children" | "typewriter" | "pop";
12625
+ emphasisTarget?: string;
12626
+ exitPattern?: "fade" | "slide-down";
12627
+ duration?: number;
12628
+ }
12629
+ interface SemanticSpatialConstraints {
12630
+ anchorTarget?: string;
12631
+ preferredPosition?: "top-left" | "top-right" | "bottom-left" | "bottom-right" | "center" | "lower-third";
12632
+ avoidRegions?: Array<"face" | "subtitle" | "watermark">;
12633
+ collisionPolicy?: "avoid" | "push" | "stack";
12634
+ offsetPixelX?: number;
12635
+ offsetPixelY?: number;
12636
+ }
12637
+ interface SemanticOverlayDefinition {
12638
+ id: string;
12639
+ name: string;
12640
+ intent: SemanticIntent;
12641
+ description?: string;
12642
+ slots: SemanticSlotDefinition[];
12643
+ defaultBehavior?: SemanticBehaviorConfig;
12644
+ spatialConstraints?: SemanticSpatialConstraints;
12645
+ canvasDefaults?: {
12646
+ width: number;
12647
+ height: number;
12648
+ backgroundColor?: string;
12649
+ };
12650
+ }
12651
+ interface SemanticContent {
12652
+ templateId: string;
12653
+ values: Record<string, any>;
12654
+ theme?: {
12655
+ primaryColor?: string;
12656
+ secondaryColor?: string;
12657
+ backgroundColor?: string;
12658
+ textColor?: string;
12659
+ fontFamily?: string;
12660
+ };
12661
+ }
12662
+
12663
+ /**
12664
+ * Pure compiler that transforms a Semantic Overlay Definition + Content payload
12665
+ * into a canonical v2.0 OverlayDocument scene graph.
12666
+ *
12667
+ * Compilation pipeline:
12668
+ * Semantic Overlay Intent -> Slot Binding -> Scene Node Graph -> Layout Rules -> Animation Tracks
12669
+ */
12670
+ declare function compileSemanticOverlay(definition: SemanticOverlayDefinition, content: SemanticContent): OverlayDocument;
12671
+
12672
+ type AvoidRegionKind = "face" | "subtitle" | "watermark" | "safe-zone";
12673
+ interface SpatialConstraintSpec {
12674
+ anchorTo?: string;
12675
+ preferPlacement?: "top-left" | "top-right" | "bottom-left" | "bottom-right" | "center" | "lower-third" | "side-right" | "side-left";
12676
+ avoidRegions?: AvoidRegionKind[];
12677
+ collisionPolicy?: "avoid" | "push" | "stack";
12678
+ safeMargin?: number;
12679
+ offsetPixelX?: number;
12680
+ offsetPixelY?: number;
12681
+ }
12682
+ /**
12683
+ * Pure evaluator that resolves semantic spatial constraints (anchorTo, avoid, prefer, offset)
12684
+ * into deterministic EvaluatedTransform coordinates at frame time `t`.
12685
+ */
12686
+ declare function resolveSpatialConstraints(initialTransform: EvaluatedTransform, constraints: SpatialConstraintSpec, videoState?: EvaluatedVideoStateAtTime, canvasWidth?: number, canvasHeight?: number): EvaluatedTransform;
12687
+
12688
+ type BehaviorKind = "enter" | "exit" | "reveal" | "emphasize" | "attention" | "follow" | "connect";
12689
+ interface BehaviorSpec {
12690
+ kind: BehaviorKind;
12691
+ pattern?: "fade" | "slide" | "pop" | "typewriter" | "stagger" | "glow-pulse" | "scale-bounce";
12692
+ startTime?: number;
12693
+ duration?: number;
12694
+ delay?: number;
12695
+ targetNodeId?: string;
12696
+ intensity?: number;
12697
+ easing?: "linear" | "ease-out" | "ease-in-out" | "elastic" | string;
12698
+ }
12699
+ /**
12700
+ * Pure compiler that resolves a high-level BehaviorSpec into deterministic NodeAnimationRules keyframe/preset tracks.
12701
+ * High-level authoring behavior -> low-level keyframe tracks.
12702
+ */
12703
+ declare function resolveBehaviorToAnimationSpec(behavior: BehaviorSpec, node?: SceneNode): NodeAnimationRules;
12704
+
12705
+ type ImageFitMode = "cover" | "contain" | "fill" | "none";
12706
+ interface SizingDimensionInput {
12707
+ specifiedWidth?: number | string;
12708
+ specifiedHeight?: number | string;
12709
+ intrinsicWidth?: number;
12710
+ intrinsicHeight?: number;
12711
+ containerWidth?: number;
12712
+ containerHeight?: number;
12713
+ defaultWidth?: number;
12714
+ defaultHeight?: number;
12715
+ }
12716
+ interface ResolvedImageDimensions {
12717
+ width: number;
12718
+ height: number;
12719
+ aspectRatio: number;
12720
+ isAutoWidth: boolean;
12721
+ isAutoHeight: boolean;
12722
+ }
12723
+ interface ImageFittingInput {
12724
+ containerWidth: number;
12725
+ containerHeight: number;
12726
+ intrinsicWidth: number;
12727
+ intrinsicHeight: number;
12728
+ fitMode?: ImageFitMode;
12729
+ focalPoint?: FocalPoint;
12730
+ }
12731
+ interface ImageFittingResult {
12732
+ sourceCrop: {
12733
+ sx: number;
12734
+ sy: number;
12735
+ sWidth: number;
12736
+ sHeight: number;
12737
+ };
12738
+ destinationBox: {
12739
+ dx: number;
12740
+ dy: number;
12741
+ dWidth: number;
12742
+ dHeight: number;
12743
+ };
12744
+ scale: number;
12745
+ scaleX: number;
12746
+ scaleY: number;
12747
+ }
12748
+ /**
12749
+ * MediaImage Sizing & Focal Point Engine
12750
+ *
12751
+ * Implements deterministic aspect-ratio math, 4-mode sizing matrix resolution,
12752
+ * and focal-point smart cropping for leaf media and avatar primitives.
12753
+ */
12754
+ declare class MediaImageEngine {
12755
+ /**
12756
+ * Resolve node dimensions based on the 4-mode sizing matrix:
12757
+ * 1. (auto, auto) -> intrinsic dimensions
12758
+ * 2. (fixed, auto) -> width locked, height preserves aspect ratio
12759
+ * 3. (auto, fixed) -> height locked, width preserves aspect ratio
12760
+ * 4. (fixed, fixed) -> container locked
12761
+ */
12762
+ static resolveDimensions(input: SizingDimensionInput): ResolvedImageDimensions;
12763
+ /**
12764
+ * Compute source crop and destination mapping given container bounds,
12765
+ * intrinsic image dimensions, fit mode, and normalized focal point.
12766
+ */
12767
+ static computeFitting(input: ImageFittingInput): ImageFittingResult;
12768
+ /**
12769
+ * Convenience circular avatar fitting calculation.
12770
+ */
12771
+ static computeCircularAvatarFitting(diameter: number, intrinsicWidth: number, intrinsicHeight: number, focalPoint?: FocalPoint): ImageFittingResult;
12772
+ }
12773
+
8948
12774
  /**
8949
12775
  * @clypra-studio/engine — Canvas 2D text effects, Lottie tooling, and animation engine.
8950
12776
  * @version 0.1.0
@@ -8953,4 +12779,4 @@ declare function clearAllBodyEffectMasks(): void;
8953
12779
  /** Package version */
8954
12780
  declare const VERSION = "0.1.0";
8955
12781
 
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 };
12782
+ export { type AddBreakpointCommand, type AddDataPreviewSetCommand, type AddNodeCommand, type AddTimelineMarkerCommand, type AddVariableCommand, type AlignmentGuide, type AlignmentMode, AlphaEffect, type AnchorMap, type AnchorSide, 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, type ArcGeometryOutput, AsciiEffect, type AssetHandle, type AssetKind, type AssetManifest, type AssetRef, AssetRegistry$1 as AssetRegistry, type AssetSource, type AudioNode, type AudioPlaybackConfig, type AvatarNode, type AvoidRegionKind, type AxisConfig, type AxisLabel, BUILTIN_CANVAS_TEMPLATES, type BarGeometry, type BarGeometryItem, type BaseCommand, type BaseEditorCommand, type BatchCommand, type BatchCommandsCommand, type BatchInjection, type BehaviorKind, type BehaviorSpec, type BindingDefinition, type BodySegmentationOptions, type BodySegmentationRequest, type BodySegmentationResponse, type BodySegmentationRuntime, type BodySegmentationRuntimeConfig, type BoundingBox, BoundingBoxSchema, type BoundingRegion, type BreadcrumbItem, type Breakpoint, type BreakpointSet, BulgePinchEffect, CAPABILITY_REGISTRY, COMPOSITION_PRESETS, CRTEffect, type CalloutNode, CanvasDevice, type CanvasSnapResult, type CapabilityEntry, type CapabilityStatus, type ChartAnimationConfig, type ChartBarStyle, type ChartNode, type ChartScale, type ChartSeries, type ChartType, CinematicLUTEffect, type ClipConform, type ClipSegment, type CodeOverlayContent, type CodeSmartOverlayContent, type ColorAdjustments, ColorAdjustmentsEffect, ColorGradientEffect, ColorMatrixEffect, ColorOverlayEffect, type ColumnDefinition, type Command, 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 ComputedCell, type ComputedColumn, type ComputedNodeBounds, type ComputedRow, type ConformMode, type ConnectorNode, ConnectorVisualizationDefinition, type ContainerNode, type CountUpEasing, CrossHatchEffect, DEFAULT_TEXT_STYLE, DataBindingAuthoringEngine, DataBindingEngine, type DataBindingRule, type DataPreviewSet, type DeleteNodeCommand, type DeleteNodesCommand, type DetachComponentCommand, type DimensionMode, DisplacementEffect, type DividerNode, type DocumentCommand, DocumentMigrator, type DocumentPoint, DocumentValidator, type DocumentVariable, DotEffect, type DotLottieManifest, type DrawPerCharTextOptions, DropShadowEffect, type DuplicateNodesCommand, EMPHASIS_PRESETS, ENTRANCE_PRESETS, EXIT_PRESETS, EXPORT_PROFILE_PRESETS, type EasingControlPoint, type EditorAddNodeCommand, type EditorCommand, EditorCommandSystem, type EditorCommandType, type EditorExecutionResult, EffectBevelSchema, EffectFillSchema, EffectFullDefinitionSchema, EffectGlowSchema, EffectIndexItemSchema, type EffectInstance, EffectLayer, EffectPanelSchema, EffectShadowSchema, EffectStackSchema, EffectStrokeSchema, EmbossEffect, type EncodedFileEntry, type EncodedOutput, type EvaluatedAnnotationGeometry, type EvaluatedBroadcastFrame, type EvaluatedChartGeometry, type EvaluatedConnectorGeometry, type EvaluatedContent, type EvaluatedExportFrame, type EvaluatedGaugeGeometry, type EvaluatedMilestone, type EvaluatedNode, type EvaluatedNodeState, type EvaluatedScene, type EvaluatedSceneState, type EvaluatedStyle, type EvaluatedThreshold, type EvaluatedTimelineEvent, type EvaluatedTimelineGeometry, type EvaluatedTransform, type EvaluatedVideoStateAtTime, type EvaluationDiagnostic, 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$1 as 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, GridEngine, type GridLineGeometry, type GroupNodesCommand, HalationEffect, type HandleType, type HighlightRegionGeometry, HslAdjustmentEffect, type IconNode, type ImageFitMode, type ImageFittingInput, type ImageFittingResult, 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 LineNode, type LinePoint, type ListOverlayContent, type ListOverlayItem, type ListSmartOverlayContent, LiveBroadcastBridge, type LiveBroadcastOptions, type LottieAnimPreset, type LottieFileInfo, type LottieFontEntry, type LottieFontUsage, type LottieGradientStop, type LottieKeyframe, type LottieNode, type LottiePropertyPath, type LottieTemplatePreset, type LowerThirdOverlayContent, type LowerThirdSmartOverlayContent, MPGFrameRenderer, type MediaEncoder, MediaEncoderRegistry, type MediaFitMode, MediaImageEngine, type MediaLayout, type MediaSpriteRecord, type MetricDelta, MetricEngine, type MetricEvaluationResult, type MetricFormatOptions, type MetricNode, type MilestoneItem, MotionBlurEffect, type MotionPreset, type MotionPresetDefinition, type MotionPresetParameter, MotionPresetRegistry, type MoveNodesCommand, type Mp4ExportOptions, Mp4VideoEncoder, NeonGlowEffect, type NodeAnimationRules, type NodeConstraints, type NodeDefinition, type NodeLayoutRules, NodeRegistry, type NodeStartTransform, 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, ProResVideoEncoder, type ProfileCanvasDimensions, type ProgressNode, ProjectCompiler, ProjectHelper, type ProjectManifestV2, type PropertyAnimationDefinition, PropertyAnimationRegistry, type PropertyDefinition, PropertyInspectorEngine, PropertyInterpolator, type PropertySchemaField, type PropertyValueType, type PublishedOverlayArtifact, 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 RendererCapabilities, type ReorderNodesCommand, type ReparentNodeCommand, type RepeaterNode, type ResizeHandle, type ResizeNodeCommand, type ResizeOptions, type ResolvedAsset, type ResolvedFit, type ResolvedFont, type ResolvedImageDimensions, type ResolvedMediaLayout, type ResourceAllocation, type ResourceState$1 as ResourceState, type ResponsiveNodeOverride, type RichTextNode, type RichTextSpan, RuntimeAssetResolver, type RuntimeContext, SMART_OVERLAY_PRESETS, SUPPORTED_FONT_FAMILIES, SceneDocument, type SceneNode, type SceneNodeBase, type SceneNodeType, type ScratchElementBlock, type ScratchOverlayTemplate, type ScreenPoint, SelectionEngine, type SemanticAnimationConfig, type SemanticBehaviorConfig, type SemanticContent, type SemanticIntent, type SemanticOverlayDefinition, type SemanticSlotDefinition, type SemanticSpatialConstraints, SeriesEngine, type SeriesPoint, type SetActiveBreakpointCommand, type SetAssetRefCommand, type SetBindingCommand, type SetDocumentCommand, type SetFontRefCommand, type SetResponsiveOverrideCommand, type ShaderCompilation, type ShapeKind, ShapeLayerSchema, ShockwaveEffect, type ShotBoundary, type Size, type SizingDimensionInput, type SmartAlignmentGuide, SmartGuideEngine, type SmartOverlayAnimation, type SmartOverlayClip, type SmartOverlayContentUnion, type SmartOverlayLayout, type SmartOverlayPreset, type SmartOverlayRegistryItem, SmartOverlayRegistryService, SmartOverlayRenderer, type SmartOverlayStyle, type SmartOverlayType, type SmartSnapResult, SnapEngine, type SnapResult, type SocialOverlayContent, type SocialSmartOverlayContent, type SpatialAnchorConfig, type SpatialConstraintSpec, type StatOverlayContent, type StatSmartOverlayContent, StaticNoiseEffect, StyleRecipe, type SubtitleRegion, TEMPLATE_CATEGORIES, type TableColumn, type TableLayoutResult, type TableNode, TemplateCategory, TemplateCategorySchema, TemplateEasingFunction, TemplateKeyframe, TemplateLayer, TemplateLayerSchema, type TemplateManifest, type TemplatePresetCategory, TemplateRenderer, type TemporalKeyframedRegion, type TextAlign, type TextCustomization, TextEffectBuilder, TextEffectConfig, TextEffectDefinition, TextEffectDefinitionSchema, type TextLayerConfig, TextLayerSchema, type TextLayerStyle, type TextLayoutBounds, type TextLayoutResult, type TextStyleOverride, TextTemplate, TextTemplateSchema, type ThresholdBand, TiltShiftEffect, type TimelineEvent, type TimelineMarker, type TimelineNode, type TimelineOverlayContent, type TimelineOverlayNode, type TimelineSmartOverlayContent, TimelineVisualizationDefinition, type TrackDefinition, type TrackedSubject, type TranscriptSegment, TransformEngine, TwistEffect, type UngroupNodesCommand, type UpdateAnimationCommand, type UpdateCanvasSizeCommand, type UpdateDataPreviewSetCommand, type UpdateKeyframeTracksCommand, type UpdateNodePropertyCommand, type UpdateNodeStyleCommand, type UpdatePropCommand, type UpdateStyleCommand, type UpdateTimelineMarkerCommand, type UpdateVariableCommand, VERSION, VHSEffect, type ValidatedEffectDefinition, type ValidatedTextEffectDefinition, type ValidatedTextTemplate, type ValidationDiagnostic, type ValidationError, type ValidationResult, type VideoCodecProfile, type VideoContext, type VideoNode, type VideoPlaybackConfig, type ViewportState, ViewportTransform, VignetteEffect, type VirtualWindow, 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, calculateResizeBounds, calculateRotationAngle, captureImageSourceDimensions, captureLottieFrames, captureVideoSourceDimensions, chromaticAberrationEffect, clearAllBodyEffectMasks, clearAllMediaSprites, clearAllOverlayBridges, clearAllStickerBridges, clearAllTextBridges, clearAnimationFromLayer, clearBodyEffectMask, clearFontCache, clearPendingVideoLayers, clearRecipeCache, cloneSceneWithNewIds, colorIsolationEffect, commandExecutor, compileSemanticOverlay, componentRegistry, compositeOverlay2D, computeAutoFitFontSize, computeFitZoom, computeTextLayout, connectorVisualization, convertScratchTemplateToClip, countTextGlyphs, createBlankLottie, createBlankScratchTemplate, createCanvas, createDefaultRevealTrack, createDefaultScratchBlock, createGPUBodyGlowFilter, createGPUBodyOutlineFilter, createGPUBodyParticlesFilter, createKeyframed, createPulseOpacityTrack, cubicBezier, dataBindingAuthoringEngine, dataBindingEngine, deleteKeyframe, deserializeTemplate, documentMigrator, documentValidator, downloadDotLottie, downloadLottieJson, downloadLottieMp4, downloadPngSequenceZip, downloadSceneWebM, drawPerCharText, drawRoundedRect, duplicateTrackAtPlayhead, ease, editorCommandSystem, enableKeyframing, encodeGif, endOverlayFrame, endStickerFrame, endTextFrame, ensureDefaultTimeline, ensureFontInLottie, evaluateAnimatable, evaluateExportFrame, evaluateOverlayDocument, exportLottieToMp4, exportValidator, filmGrainEffect, findTrackIndex, fontRegistry, formatValidationErrors, gaugeVisualization, generateOverlayCssStyle, generateOverlayWebGpuUniforms, getActiveMediaSpriteKeys, getAnimPreset, getAnimatableParamDef, getAnimatableParamsForLayer, getCanvasTemplatePreset, getCanvasTemplatesByCategory, getCapabilityReport, getClipLayout, getDefaultText, getLayerById, getMediaSpriteRecord, getOrCreateMediaSprite, getPresetScene, getSharedPixiRenderer, getSourceCropRect, getSupportedWebMMimeType, getTemplatePreset, getTemplatesByCategory, getVideoEffect, getWebMFrameCount, heatDistortionEffect, hexToLottieColor, hexToLottieRgb, hexToRgb, hitTestTransformHandles, identityEffect, injectBatch, injectColor, injectGlobalTextStyle, injectSolidColor, injectText, injectTextStyle, isKeyframed, isMp4ExportSupported, isWebMExportSupported, layoutEngine, liveBroadcastBridge, loadLottieFonts, lottieColorToHex, lottieJToAlign, measureTextFits, measureTextWidth, mediaEncoderRegistry, mergeGradingParams, motionPresetRegistry, moveKeyframe, neonOutlineEffect, parseHistorySnapshot, parseLottieJson, particleAuraEffect, pixiSceneProjection, pixiSelectionOverlay, preloadGoogleFont, presetToRecipe, primitiveRegistry, propertyAnimationRegistry, propertyInspectorEngine, propertyInterpolator, pruneTracksForLayer, rainbowCharFillColors, readLayerScalar, readStyleFromLottieLayer, reindexLayers, releaseCanvas, releaseMediaSprite, releaseSharedPixiRenderer, removeKeyframe, removeTemplateKeyframe, removeTrack, renderEngine, renderOverlayLayerBridged, renderPngSequence, renderSceneWebM, renderStickerLayerBridged, renderTextLayerBridged, resizeCharFillColors, resolveAnimatedScalar, resolveBehaviorToAnimationSpec, resolveConform, resolveDocumentForBreakpoint, resolveExportCanvasDimensions, resolveMediaLayout, resolveNodeForBreakpoint, resolveSpatialConstraints, restoreLetterSpacing, rotateCrop, runtimeAssetResolver, sampleVideoContextAtTime, scanLottieFonts, scanTextLayers, selectionEngine, 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 };