pixi-effects 0.1.0 → 0.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.
Files changed (45) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +117 -7
  3. package/ai/SKILL.md +44 -0
  4. package/ai/reference/cheatsheet.md +120 -0
  5. package/ai/reference/pitfalls.md +54 -0
  6. package/ai/reference/recipes.md +375 -0
  7. package/ai/template.html +82 -0
  8. package/ai/tools/save-image.py +24 -0
  9. package/dist/Base-BDw6dKRB.d.cts +92 -0
  10. package/dist/Base-Ba4Ta4ap.d.ts +92 -0
  11. package/dist/Composition-6FDH5OPM.cjs +13 -0
  12. package/dist/Composition-6FDH5OPM.cjs.map +1 -0
  13. package/dist/Composition-FEYAUMFI.js +4 -0
  14. package/dist/Composition-FEYAUMFI.js.map +1 -0
  15. package/dist/Controller.d.cts +2 -1
  16. package/dist/Controller.d.ts +2 -1
  17. package/dist/Movie-DMpaT67V.d.ts +179 -0
  18. package/dist/Movie-W8ISiEBB.d.cts +179 -0
  19. package/dist/chunk-DIJG2RSF.js +370 -0
  20. package/dist/chunk-DIJG2RSF.js.map +1 -0
  21. package/dist/chunk-PN5A6QA7.js +2031 -0
  22. package/dist/chunk-PN5A6QA7.js.map +1 -0
  23. package/dist/chunk-SIRVULFF.cjs +2049 -0
  24. package/dist/chunk-SIRVULFF.cjs.map +1 -0
  25. package/dist/chunk-ZL262ZRM.cjs +372 -0
  26. package/dist/chunk-ZL262ZRM.cjs.map +1 -0
  27. package/dist/index.cjs +371 -1798
  28. package/dist/index.cjs.map +1 -1
  29. package/dist/index.d.cts +95 -24
  30. package/dist/index.d.ts +95 -24
  31. package/dist/index.js +364 -1796
  32. package/dist/index.js.map +1 -1
  33. package/dist/three.cjs +161 -0
  34. package/dist/three.cjs.map +1 -0
  35. package/dist/three.d.cts +79 -0
  36. package/dist/three.d.ts +79 -0
  37. package/dist/three.js +157 -0
  38. package/dist/three.js.map +1 -0
  39. package/dist/{Movie-Bp66rkaC.d.cts → types-3c8Vymgw.d.cts} +84 -81
  40. package/dist/{Movie-Bp66rkaC.d.ts → types-3c8Vymgw.d.ts} +84 -81
  41. package/docs/api.md +333 -0
  42. package/docs/dsl.md +1017 -0
  43. package/llms-full.txt +1966 -0
  44. package/llms.txt +30 -0
  45. package/package.json +19 -7
@@ -1,6 +1,3 @@
1
- import { Application } from 'pixi.js';
2
- import { gsap } from 'gsap';
3
-
4
1
  /**
5
2
  * pixi-effects public DSL types.
6
3
  *
@@ -16,9 +13,21 @@ type PropValue = number | string;
16
13
  type Props = Record<string, PropValue>;
17
14
  /** A single keyframe entry. Either `set`, `to`, `from`, or `from`+`to` is meaningful per kind. */
18
15
  interface Keyframe {
16
+ /**
17
+ * Start time in seconds, measured from the start of the sequence this
18
+ * keyframe belongs to (After Effects style): `0` = the moment the layer
19
+ * appears. Negative values count back from the sequence's end
20
+ * (`-0.5` = 0.5 s before it ends).
21
+ */
19
22
  at?: number;
20
23
  duration?: number;
21
24
  ease?: string;
25
+ /** Extra plays of this tween after the first (a finite count; infinite repeats are not allowed — the timeline needs a fixed length). Total time = duration × (repeat + 1) plus delays. */
26
+ repeat?: number;
27
+ /** With `repeat`: every other play runs backwards (there-and-back). */
28
+ yoyo?: boolean;
29
+ /** With `repeat`: seconds to wait between plays. */
30
+ repeatDelay?: number;
22
31
  set?: Props;
23
32
  to?: Props;
24
33
  from?: Props;
@@ -66,7 +75,7 @@ interface TransitionCommon {
66
75
  from: string;
67
76
  /** Sibling sequence's `name` — the incoming scene. Must be declared after `from` in the parent's `sequences[]`. */
68
77
  to: string;
69
- /** Start time (parent-relative seconds). Same `at` semantics as Keyframe. */
78
+ /** Start time in the PARENT composition's time (like a sequence's `at`, not sequence-local). Negative = back from the parent's end. */
70
79
  at: number;
71
80
  /** Length of the transition in seconds. Must be > 0. */
72
81
  duration: number;
@@ -130,10 +139,11 @@ interface SequenceCommon {
130
139
  filters?: FilterSpec[];
131
140
  /**
132
141
  * Override PIXI's auto-computed filter region. By default, filters apply
133
- * only inside the target's bounding box. Setting this to a parent-relative
134
- * rectangle lets a filter (e.g. a wipe / iris transition) draw across an
135
- * area larger than the sprite — useful when the sprite content is small
136
- * but the visual effect should cover the whole composition.
142
+ * only inside the target's bounding box. This rectangle is in the layer's
143
+ * OWN coordinate space (origin = the layer's local origin, before its
144
+ * x/y/scale/rotation — e.g. a circle's centre), not the parent's. Use it to
145
+ * let a filter (blur, glow, a wipe / iris transition) draw beyond the
146
+ * layer's own bounds; without it a blur is clipped to the bounding box.
137
147
  */
138
148
  filterArea?: {
139
149
  x: number;
@@ -164,6 +174,13 @@ interface SequenceCommon {
164
174
  * Routed through PIXI's native `setMask({ inverse: true })`.
165
175
  */
166
176
  maskInverted?: boolean;
177
+ /**
178
+ * Opt this layer into 2.5D: it can then use `z`, `rotationX`, `rotationY`
179
+ * (in `initial` / keyframes) and is projected through the composition's
180
+ * `camera` layer. Default false. With z = 0, no 3D rotation and the default
181
+ * camera, a threeD layer renders exactly like a 2D one.
182
+ */
183
+ threeD?: boolean;
167
184
  }
168
185
  interface VideoSequenceSpec extends SequenceCommon {
169
186
  type: 'video';
@@ -185,7 +202,17 @@ interface ImageSequenceSpec extends SequenceCommon {
185
202
  }
186
203
  interface TextSequenceSpec extends SequenceCommon {
187
204
  type: 'text';
205
+ /**
206
+ * The text. May contain `{value}`, replaced by the layer's animatable number
207
+ * `value` (a counter): `text: '{value} users'`, `initial: { value: 0 }`,
208
+ * keyframe `to: { value: 2480 }`. Format it with `format`.
209
+ */
188
210
  text?: string;
211
+ /** How `{value}` is printed: `decimals` (default 0) and thousands `grouping` (default false). */
212
+ format?: {
213
+ decimals?: number;
214
+ grouping?: boolean;
215
+ };
189
216
  /** Subset of PIXI v8 TextStyleOptions. String values may be exprs (e.g. fontSize: 'GW * 0.05'). */
190
217
  style?: Record<string, PropValue | {
191
218
  color?: PropValue;
@@ -212,8 +239,41 @@ interface CompositionSequenceSpec extends SequenceCommon {
212
239
  sequences?: SequenceSpec[];
213
240
  transitions?: TransitionSpec[];
214
241
  }
242
+ /**
243
+ * A camera layer. Put its props in `initial` / `keyframes`:
244
+ * `x`, `y`, `z`, `lookAtX`, `lookAtY`, `lookAtZ`, `fov` (vertical degrees, default 40).
245
+ * Unset `z` follows `fov` so the z = 0 plane stays 1:1. Affects only `threeD`
246
+ * siblings in the same composition. +z points toward the viewer.
247
+ */
248
+ interface CameraSequenceSpec extends SequenceCommon {
249
+ type: 'camera';
250
+ }
251
+ /**
252
+ * A gradient fill for a shape (replaces `fillColor`). Positions are relative to the shape's own
253
+ * bounds (0–1), so it follows the shape's size. Colours may have alpha (`'rgba(0,0,0,0.6)'`), so a
254
+ * radial gradient from transparent to dark is a vignette. Not animatable.
255
+ */
256
+ interface GradientSpec {
257
+ /** Default `'linear'`. */
258
+ type?: 'linear' | 'radial';
259
+ /** Colour stops, `[offset 0–1, colour]` or `{ offset, color }`. At least two. */
260
+ stops: Array<[number, string | number] | {
261
+ offset: number;
262
+ color: string | number;
263
+ }>;
264
+ /** linear: direction in degrees — 0 = left → right, 90 = top → bottom (default). */
265
+ angle?: number;
266
+ /** radial: centre in 0–1 of the bounds. Default `[0.5, 0.5]`. */
267
+ center?: [number, number];
268
+ /** radial: inner radius where the first stop applies, 0–1. Default 0. */
269
+ innerRadius?: number;
270
+ /** radial: outer radius where the last stop applies, 0–1. Default 0.5. */
271
+ radius?: number;
272
+ }
215
273
  interface ShapeBase extends SequenceCommon {
216
274
  type: 'shape';
275
+ /** Fill with a gradient instead of `fillColor` (top level or in `initial`). */
276
+ fillGradient?: GradientSpec;
217
277
  /**
218
278
  * Colour space used to interpolate `fillColor` / `strokeColor` keyframes.
219
279
  *
@@ -277,7 +337,7 @@ interface PathShapeSpec extends ShapeBase {
277
337
  d: string;
278
338
  }
279
339
  type ShapeSequenceSpec = RectShapeSpec | CircleShapeSpec | EllipseShapeSpec | LineShapeSpec | PolygonShapeSpec | PathShapeSpec;
280
- type SequenceSpec = VideoSequenceSpec | ImageSequenceSpec | TextSequenceSpec | AudioSequenceSpec | CompositionSequenceSpec | ShapeSequenceSpec;
340
+ type SequenceSpec = VideoSequenceSpec | ImageSequenceSpec | TextSequenceSpec | AudioSequenceSpec | CompositionSequenceSpec | CameraSequenceSpec | ShapeSequenceSpec;
281
341
  /** Top-level composition (root node) — same as `CompositionSequenceSpec` minus the discriminant. */
282
342
  interface CompositionSpec extends SequenceCommon {
283
343
  width?: number;
@@ -285,80 +345,23 @@ interface CompositionSpec extends SequenceCommon {
285
345
  sequences?: SequenceSpec[];
286
346
  transitions?: TransitionSpec[];
287
347
  }
288
-
289
- interface MovieOptions {
290
- width?: number;
291
- height?: number;
292
- duration?: number;
293
- frameRate?: number;
294
- background?: string;
295
- canvas?: HTMLCanvasElement;
296
- assets?: AssetSpec[];
297
- composition?: CompositionSpec;
298
- }
299
- interface RenderOptions {
300
- format?: 'mp4' | 'mov' | 'webm' | 'mkv';
301
- video?: {
302
- codec?: string;
303
- bitrate?: 'very-low' | 'low' | 'medium' | 'high' | 'very-high';
304
- };
305
- audio?: {
306
- codec?: string;
307
- bitrate?: 'very-low' | 'low' | 'medium' | 'high' | 'very-high';
308
- };
309
- }
310
- interface FrameEvent {
311
- frame: number;
312
- totalFrames: number;
313
- }
314
- interface ProgressEvent {
315
- progress: number;
316
- frame: number;
317
- totalFrames: number;
318
- }
319
- type Listener = (...args: any[]) => void;
320
- declare class Movie {
321
- private _events;
322
- private _initState;
323
- app: Application | null;
324
- timeline: ReturnType<typeof gsap.timeline> | null;
325
- audioBuffer: AudioBuffer | null;
326
- audioSource: AudioBufferSourceNode | null;
327
- gainNode: GainNode | null;
328
- private _volume;
329
- private _muted;
330
- isPlaying: boolean;
331
- currentFrame: number;
332
- totalFrames: number;
348
+ /** Resolved parent / root composition shape used for scope and sizing. */
349
+ interface CompositionShape {
333
350
  width: number;
334
351
  height: number;
335
352
  duration: number;
336
- frameRate: number;
337
- background: string;
338
- private _audioContext;
339
- private _rootSequence;
340
- private _rootContainer;
341
- private _raf;
342
- on(event: 'ready', fn: () => void): this;
343
- on(event: 'frame', fn: (e: FrameEvent) => void): this;
344
- on(event: 'progress', fn: (e: ProgressEvent) => void): this;
345
- on(event: 'pause', fn: () => void): this;
346
- off(event: string, fn: Listener): this;
347
- emit(event: string, ...args: unknown[]): void;
348
- get isReady(): boolean;
349
- private _ensureAudioContext;
350
- init(options?: MovieOptions): Promise<void>;
351
- gotoFrame(frame: number, force?: boolean): Promise<void>;
352
- private _awaitVideoFrames;
353
- play(): void;
354
- pause(): void;
355
- set volume(v: number);
356
- get volume(): number;
357
- set muted(v: boolean);
358
- get muted(): boolean;
359
- toggleMute(): boolean;
360
- render(options?: RenderOptions): Promise<Blob>;
361
- destroy(): Promise<void>;
353
+ }
354
+ /** Audio descriptor pushed to the mixdown queue by AudioSequence/VideoSequence. */
355
+ interface AudioDescriptor {
356
+ buffer: AudioBuffer;
357
+ loop: boolean;
358
+ start: number;
359
+ end: number;
360
+ initialVolume: number;
361
+ volumeKeyframes: {
362
+ time: number;
363
+ value: number;
364
+ }[];
362
365
  }
363
366
 
364
- export { type AssetSpec as A, type ChromaKeyFilterSpec as C, type DipTransition as D, type EllipseShapeSpec as E, type FilterSpec as F, type ImageSequenceSpec as I, type Keyframe as K, type LineShapeSpec as L, Movie as M, type PathShapeSpec as P, type RectShapeSpec as R, type SequenceCommon as S, type TextSequenceSpec as T, type VideoSequenceSpec as V, type WipeTransition as W, type ZoomTransition as Z, type AudioSequenceSpec as a, type CircleShapeSpec as b, type CompositionSequenceSpec as c, type CompositionSpec as d, type CrossfadeTransition as e, type CustomFilterSpec as f, type DissolveTransition as g, type Expr as h, type FrameEvent as i, type IrisTransition as j, type MovieOptions as k, type PolygonShapeSpec as l, type ProgressEvent as m, type PropValue as n, type Props as o, type RenderOptions as p, type SequenceSpec as q, type ShapeSequenceSpec as r, type SlideTransition as s, type TransitionCommon as t, type TransitionSpec as u };
367
+ export type { AssetSpec as A, CompositionShape as C, DipTransition as D, EllipseShapeSpec as E, FilterSpec as F, GradientSpec as G, ImageSequenceSpec as I, Keyframe as K, LineShapeSpec as L, PathShapeSpec as P, RectShapeSpec as R, SequenceSpec as S, TextSequenceSpec as T, VideoSequenceSpec as V, WipeTransition as W, ZoomTransition as Z, CameraSequenceSpec as a, SequenceCommon as b, AudioSequenceSpec as c, ChromaKeyFilterSpec as d, CircleShapeSpec as e, CompositionSequenceSpec as f, CompositionSpec as g, CrossfadeTransition as h, CustomFilterSpec as i, DissolveTransition as j, Expr as k, IrisTransition as l, PolygonShapeSpec as m, PropValue as n, Props as o, ShapeSequenceSpec as p, SlideTransition as q, TransitionCommon as r, TransitionSpec as s, AudioDescriptor as t };
@@ -1,6 +1,3 @@
1
- import { Application } from 'pixi.js';
2
- import { gsap } from 'gsap';
3
-
4
1
  /**
5
2
  * pixi-effects public DSL types.
6
3
  *
@@ -16,9 +13,21 @@ type PropValue = number | string;
16
13
  type Props = Record<string, PropValue>;
17
14
  /** A single keyframe entry. Either `set`, `to`, `from`, or `from`+`to` is meaningful per kind. */
18
15
  interface Keyframe {
16
+ /**
17
+ * Start time in seconds, measured from the start of the sequence this
18
+ * keyframe belongs to (After Effects style): `0` = the moment the layer
19
+ * appears. Negative values count back from the sequence's end
20
+ * (`-0.5` = 0.5 s before it ends).
21
+ */
19
22
  at?: number;
20
23
  duration?: number;
21
24
  ease?: string;
25
+ /** Extra plays of this tween after the first (a finite count; infinite repeats are not allowed — the timeline needs a fixed length). Total time = duration × (repeat + 1) plus delays. */
26
+ repeat?: number;
27
+ /** With `repeat`: every other play runs backwards (there-and-back). */
28
+ yoyo?: boolean;
29
+ /** With `repeat`: seconds to wait between plays. */
30
+ repeatDelay?: number;
22
31
  set?: Props;
23
32
  to?: Props;
24
33
  from?: Props;
@@ -66,7 +75,7 @@ interface TransitionCommon {
66
75
  from: string;
67
76
  /** Sibling sequence's `name` — the incoming scene. Must be declared after `from` in the parent's `sequences[]`. */
68
77
  to: string;
69
- /** Start time (parent-relative seconds). Same `at` semantics as Keyframe. */
78
+ /** Start time in the PARENT composition's time (like a sequence's `at`, not sequence-local). Negative = back from the parent's end. */
70
79
  at: number;
71
80
  /** Length of the transition in seconds. Must be > 0. */
72
81
  duration: number;
@@ -130,10 +139,11 @@ interface SequenceCommon {
130
139
  filters?: FilterSpec[];
131
140
  /**
132
141
  * Override PIXI's auto-computed filter region. By default, filters apply
133
- * only inside the target's bounding box. Setting this to a parent-relative
134
- * rectangle lets a filter (e.g. a wipe / iris transition) draw across an
135
- * area larger than the sprite — useful when the sprite content is small
136
- * but the visual effect should cover the whole composition.
142
+ * only inside the target's bounding box. This rectangle is in the layer's
143
+ * OWN coordinate space (origin = the layer's local origin, before its
144
+ * x/y/scale/rotation — e.g. a circle's centre), not the parent's. Use it to
145
+ * let a filter (blur, glow, a wipe / iris transition) draw beyond the
146
+ * layer's own bounds; without it a blur is clipped to the bounding box.
137
147
  */
138
148
  filterArea?: {
139
149
  x: number;
@@ -164,6 +174,13 @@ interface SequenceCommon {
164
174
  * Routed through PIXI's native `setMask({ inverse: true })`.
165
175
  */
166
176
  maskInverted?: boolean;
177
+ /**
178
+ * Opt this layer into 2.5D: it can then use `z`, `rotationX`, `rotationY`
179
+ * (in `initial` / keyframes) and is projected through the composition's
180
+ * `camera` layer. Default false. With z = 0, no 3D rotation and the default
181
+ * camera, a threeD layer renders exactly like a 2D one.
182
+ */
183
+ threeD?: boolean;
167
184
  }
168
185
  interface VideoSequenceSpec extends SequenceCommon {
169
186
  type: 'video';
@@ -185,7 +202,17 @@ interface ImageSequenceSpec extends SequenceCommon {
185
202
  }
186
203
  interface TextSequenceSpec extends SequenceCommon {
187
204
  type: 'text';
205
+ /**
206
+ * The text. May contain `{value}`, replaced by the layer's animatable number
207
+ * `value` (a counter): `text: '{value} users'`, `initial: { value: 0 }`,
208
+ * keyframe `to: { value: 2480 }`. Format it with `format`.
209
+ */
188
210
  text?: string;
211
+ /** How `{value}` is printed: `decimals` (default 0) and thousands `grouping` (default false). */
212
+ format?: {
213
+ decimals?: number;
214
+ grouping?: boolean;
215
+ };
189
216
  /** Subset of PIXI v8 TextStyleOptions. String values may be exprs (e.g. fontSize: 'GW * 0.05'). */
190
217
  style?: Record<string, PropValue | {
191
218
  color?: PropValue;
@@ -212,8 +239,41 @@ interface CompositionSequenceSpec extends SequenceCommon {
212
239
  sequences?: SequenceSpec[];
213
240
  transitions?: TransitionSpec[];
214
241
  }
242
+ /**
243
+ * A camera layer. Put its props in `initial` / `keyframes`:
244
+ * `x`, `y`, `z`, `lookAtX`, `lookAtY`, `lookAtZ`, `fov` (vertical degrees, default 40).
245
+ * Unset `z` follows `fov` so the z = 0 plane stays 1:1. Affects only `threeD`
246
+ * siblings in the same composition. +z points toward the viewer.
247
+ */
248
+ interface CameraSequenceSpec extends SequenceCommon {
249
+ type: 'camera';
250
+ }
251
+ /**
252
+ * A gradient fill for a shape (replaces `fillColor`). Positions are relative to the shape's own
253
+ * bounds (0–1), so it follows the shape's size. Colours may have alpha (`'rgba(0,0,0,0.6)'`), so a
254
+ * radial gradient from transparent to dark is a vignette. Not animatable.
255
+ */
256
+ interface GradientSpec {
257
+ /** Default `'linear'`. */
258
+ type?: 'linear' | 'radial';
259
+ /** Colour stops, `[offset 0–1, colour]` or `{ offset, color }`. At least two. */
260
+ stops: Array<[number, string | number] | {
261
+ offset: number;
262
+ color: string | number;
263
+ }>;
264
+ /** linear: direction in degrees — 0 = left → right, 90 = top → bottom (default). */
265
+ angle?: number;
266
+ /** radial: centre in 0–1 of the bounds. Default `[0.5, 0.5]`. */
267
+ center?: [number, number];
268
+ /** radial: inner radius where the first stop applies, 0–1. Default 0. */
269
+ innerRadius?: number;
270
+ /** radial: outer radius where the last stop applies, 0–1. Default 0.5. */
271
+ radius?: number;
272
+ }
215
273
  interface ShapeBase extends SequenceCommon {
216
274
  type: 'shape';
275
+ /** Fill with a gradient instead of `fillColor` (top level or in `initial`). */
276
+ fillGradient?: GradientSpec;
217
277
  /**
218
278
  * Colour space used to interpolate `fillColor` / `strokeColor` keyframes.
219
279
  *
@@ -277,7 +337,7 @@ interface PathShapeSpec extends ShapeBase {
277
337
  d: string;
278
338
  }
279
339
  type ShapeSequenceSpec = RectShapeSpec | CircleShapeSpec | EllipseShapeSpec | LineShapeSpec | PolygonShapeSpec | PathShapeSpec;
280
- type SequenceSpec = VideoSequenceSpec | ImageSequenceSpec | TextSequenceSpec | AudioSequenceSpec | CompositionSequenceSpec | ShapeSequenceSpec;
340
+ type SequenceSpec = VideoSequenceSpec | ImageSequenceSpec | TextSequenceSpec | AudioSequenceSpec | CompositionSequenceSpec | CameraSequenceSpec | ShapeSequenceSpec;
281
341
  /** Top-level composition (root node) — same as `CompositionSequenceSpec` minus the discriminant. */
282
342
  interface CompositionSpec extends SequenceCommon {
283
343
  width?: number;
@@ -285,80 +345,23 @@ interface CompositionSpec extends SequenceCommon {
285
345
  sequences?: SequenceSpec[];
286
346
  transitions?: TransitionSpec[];
287
347
  }
288
-
289
- interface MovieOptions {
290
- width?: number;
291
- height?: number;
292
- duration?: number;
293
- frameRate?: number;
294
- background?: string;
295
- canvas?: HTMLCanvasElement;
296
- assets?: AssetSpec[];
297
- composition?: CompositionSpec;
298
- }
299
- interface RenderOptions {
300
- format?: 'mp4' | 'mov' | 'webm' | 'mkv';
301
- video?: {
302
- codec?: string;
303
- bitrate?: 'very-low' | 'low' | 'medium' | 'high' | 'very-high';
304
- };
305
- audio?: {
306
- codec?: string;
307
- bitrate?: 'very-low' | 'low' | 'medium' | 'high' | 'very-high';
308
- };
309
- }
310
- interface FrameEvent {
311
- frame: number;
312
- totalFrames: number;
313
- }
314
- interface ProgressEvent {
315
- progress: number;
316
- frame: number;
317
- totalFrames: number;
318
- }
319
- type Listener = (...args: any[]) => void;
320
- declare class Movie {
321
- private _events;
322
- private _initState;
323
- app: Application | null;
324
- timeline: ReturnType<typeof gsap.timeline> | null;
325
- audioBuffer: AudioBuffer | null;
326
- audioSource: AudioBufferSourceNode | null;
327
- gainNode: GainNode | null;
328
- private _volume;
329
- private _muted;
330
- isPlaying: boolean;
331
- currentFrame: number;
332
- totalFrames: number;
348
+ /** Resolved parent / root composition shape used for scope and sizing. */
349
+ interface CompositionShape {
333
350
  width: number;
334
351
  height: number;
335
352
  duration: number;
336
- frameRate: number;
337
- background: string;
338
- private _audioContext;
339
- private _rootSequence;
340
- private _rootContainer;
341
- private _raf;
342
- on(event: 'ready', fn: () => void): this;
343
- on(event: 'frame', fn: (e: FrameEvent) => void): this;
344
- on(event: 'progress', fn: (e: ProgressEvent) => void): this;
345
- on(event: 'pause', fn: () => void): this;
346
- off(event: string, fn: Listener): this;
347
- emit(event: string, ...args: unknown[]): void;
348
- get isReady(): boolean;
349
- private _ensureAudioContext;
350
- init(options?: MovieOptions): Promise<void>;
351
- gotoFrame(frame: number, force?: boolean): Promise<void>;
352
- private _awaitVideoFrames;
353
- play(): void;
354
- pause(): void;
355
- set volume(v: number);
356
- get volume(): number;
357
- set muted(v: boolean);
358
- get muted(): boolean;
359
- toggleMute(): boolean;
360
- render(options?: RenderOptions): Promise<Blob>;
361
- destroy(): Promise<void>;
353
+ }
354
+ /** Audio descriptor pushed to the mixdown queue by AudioSequence/VideoSequence. */
355
+ interface AudioDescriptor {
356
+ buffer: AudioBuffer;
357
+ loop: boolean;
358
+ start: number;
359
+ end: number;
360
+ initialVolume: number;
361
+ volumeKeyframes: {
362
+ time: number;
363
+ value: number;
364
+ }[];
362
365
  }
363
366
 
364
- export { type AssetSpec as A, type ChromaKeyFilterSpec as C, type DipTransition as D, type EllipseShapeSpec as E, type FilterSpec as F, type ImageSequenceSpec as I, type Keyframe as K, type LineShapeSpec as L, Movie as M, type PathShapeSpec as P, type RectShapeSpec as R, type SequenceCommon as S, type TextSequenceSpec as T, type VideoSequenceSpec as V, type WipeTransition as W, type ZoomTransition as Z, type AudioSequenceSpec as a, type CircleShapeSpec as b, type CompositionSequenceSpec as c, type CompositionSpec as d, type CrossfadeTransition as e, type CustomFilterSpec as f, type DissolveTransition as g, type Expr as h, type FrameEvent as i, type IrisTransition as j, type MovieOptions as k, type PolygonShapeSpec as l, type ProgressEvent as m, type PropValue as n, type Props as o, type RenderOptions as p, type SequenceSpec as q, type ShapeSequenceSpec as r, type SlideTransition as s, type TransitionCommon as t, type TransitionSpec as u };
367
+ export type { AssetSpec as A, CompositionShape as C, DipTransition as D, EllipseShapeSpec as E, FilterSpec as F, GradientSpec as G, ImageSequenceSpec as I, Keyframe as K, LineShapeSpec as L, PathShapeSpec as P, RectShapeSpec as R, SequenceSpec as S, TextSequenceSpec as T, VideoSequenceSpec as V, WipeTransition as W, ZoomTransition as Z, CameraSequenceSpec as a, SequenceCommon as b, AudioSequenceSpec as c, ChromaKeyFilterSpec as d, CircleShapeSpec as e, CompositionSequenceSpec as f, CompositionSpec as g, CrossfadeTransition as h, CustomFilterSpec as i, DissolveTransition as j, Expr as k, IrisTransition as l, PolygonShapeSpec as m, PropValue as n, Props as o, ShapeSequenceSpec as p, SlideTransition as q, TransitionCommon as r, TransitionSpec as s, AudioDescriptor as t };