@agrhub/engine-pixi 0.0.0-stage → 1.4.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 (93) hide show
  1. package/LICENSE +47 -0
  2. package/NOTICE.md +20 -0
  3. package/README.md +6 -2
  4. package/dist/animation/block-reveal-animation.d.ts +33 -0
  5. package/dist/animation/easings.d.ts +4 -0
  6. package/dist/animation/gsap-animation.d.ts +32 -0
  7. package/dist/animation/index.d.ts +9 -0
  8. package/dist/animation/keyframe-animation.d.ts +11 -0
  9. package/dist/animation/mask-animation.d.ts +170 -0
  10. package/dist/animation/pixi-animation-utils.d.ts +10 -0
  11. package/dist/animation/registry.d.ts +11 -0
  12. package/dist/animation/types.d.ts +211 -0
  13. package/dist/animation/wipe-animation.d.ts +53 -0
  14. package/dist/clips/audio-clip.d.ts +122 -0
  15. package/dist/clips/backdrop-clip.d.ts +56 -0
  16. package/dist/clips/base-clip.d.ts +150 -0
  17. package/dist/clips/base-text-clip.d.ts +228 -0
  18. package/dist/clips/caption-clip.d.ts +129 -0
  19. package/dist/clips/clip-registry.d.ts +56 -0
  20. package/dist/clips/effect-clip.d.ts +37 -0
  21. package/dist/clips/iclip.d.ts +235 -0
  22. package/dist/clips/image-clip.d.ts +116 -0
  23. package/dist/clips/index.d.ts +20 -0
  24. package/dist/clips/placeholder-clip.d.ts +22 -0
  25. package/dist/clips/shape-clip.d.ts +59 -0
  26. package/dist/clips/text-clip.d.ts +148 -0
  27. package/dist/clips/transition-clip.d.ts +45 -0
  28. package/dist/clips/video-clip.d.ts +216 -0
  29. package/dist/compositor/audio-mixer.d.ts +8 -0
  30. package/dist/compositor/av-encoder.d.ts +17 -0
  31. package/dist/compositor/clip-style-renderer.d.ts +23 -0
  32. package/dist/compositor/compositor-renderer.d.ts +29 -0
  33. package/dist/compositor/effect-manager.d.ts +30 -0
  34. package/dist/compositor/scheduler.d.ts +8 -0
  35. package/dist/compositor/transition-manager.d.ts +45 -0
  36. package/dist/compositor.d.ts +157 -0
  37. package/dist/effect/constant/index.d.ts +566 -0
  38. package/dist/effect/effect.d.ts +9 -0
  39. package/dist/effect/glsl/custom-glsl.d.ts +1043 -0
  40. package/dist/effect/glsl/gl-effect.d.ts +38 -0
  41. package/dist/effect/interface/index.d.ts +25 -0
  42. package/dist/effect/types.d.ts +26 -0
  43. package/dist/effect/vertex.d.ts +1 -0
  44. package/dist/event-emitter.d.ts +55 -0
  45. package/dist/filters/outline-filter.d.ts +28 -0
  46. package/dist/index.d.ts +27 -0
  47. package/dist/index.es.js +16144 -0
  48. package/dist/index.es.js.map +1 -0
  49. package/dist/index.umd.cjs +3335 -0
  50. package/dist/index.umd.cjs.map +1 -0
  51. package/dist/json-serialization.d.ts +312 -0
  52. package/dist/mp4-utils/index.d.ts +31 -0
  53. package/dist/mp4-utils/mp4box-utils.d.ts +44 -0
  54. package/dist/mp4-utils/sample-transform.d.ts +26 -0
  55. package/dist/sprite/base-sprite.d.ts +273 -0
  56. package/dist/sprite/pixi-sprite-renderer.d.ts +69 -0
  57. package/dist/standalone/index.es.js +94191 -0
  58. package/dist/standalone/index.es.js.map +1 -0
  59. package/dist/studio/history-manager.d.ts +46 -0
  60. package/dist/studio/resource-manager.d.ts +53 -0
  61. package/dist/studio/selection-manager.d.ts +66 -0
  62. package/dist/studio/timeline-model.d.ts +117 -0
  63. package/dist/studio/transport.d.ts +44 -0
  64. package/dist/studio-bridge.d.ts +50 -0
  65. package/dist/studio.d.ts +529 -0
  66. package/dist/transformer/handle.d.ts +17 -0
  67. package/dist/transformer/snapping.d.ts +45 -0
  68. package/dist/transformer/transformer.d.ts +38 -0
  69. package/dist/transformer/wireframe.d.ts +5 -0
  70. package/dist/transition/fragment.d.ts +1 -0
  71. package/dist/transition/glsl/custom-glsl.d.ts +231 -0
  72. package/dist/transition/glsl/gl-transition.d.ts +42 -0
  73. package/dist/transition/transition.d.ts +6 -0
  74. package/dist/transition/types.d.ts +31 -0
  75. package/dist/transition/uniforms.d.ts +35 -0
  76. package/dist/transition/vertex.d.ts +1 -0
  77. package/dist/utils/asset-manager.d.ts +15 -0
  78. package/dist/utils/audio-codec-detector.d.ts +39 -0
  79. package/dist/utils/audio.d.ts +81 -0
  80. package/dist/utils/chromakey.d.ts +24 -0
  81. package/dist/utils/color-adjustment.d.ts +53 -0
  82. package/dist/utils/color.d.ts +17 -0
  83. package/dist/utils/common.d.ts +7 -0
  84. package/dist/utils/dom.d.ts +48 -0
  85. package/dist/utils/effect.d.ts +1 -0
  86. package/dist/utils/fonts.d.ts +21 -0
  87. package/dist/utils/index.d.ts +6 -0
  88. package/dist/utils/log.d.ts +27 -0
  89. package/dist/utils/media-cache.d.ts +45 -0
  90. package/dist/utils/stream-utils.d.ts +4 -0
  91. package/dist/utils/video.d.ts +16 -0
  92. package/dist/utils/worker-timer.d.ts +1 -0
  93. package/package.json +63 -3
@@ -0,0 +1,312 @@
1
+ import { IClip, ITransitionInfo, ClipContext, IChromaKeyOpts } from './clips';
2
+ import { ColorAdjustment } from './utils/color-adjustment';
3
+ import { ShapeType } from '@agrhub/core';
4
+ export interface ClipTimingJSON {
5
+ display: {
6
+ from: number;
7
+ to: number;
8
+ };
9
+ trim?: {
10
+ from: number;
11
+ to: number;
12
+ };
13
+ duration: number;
14
+ playbackRate: number;
15
+ fadeIn?: {
16
+ duration: number;
17
+ curve?: "linear" | "ease-in" | "ease-out" | "ease-in-out";
18
+ };
19
+ fadeOut?: {
20
+ duration: number;
21
+ curve?: "linear" | "ease-in" | "ease-out" | "ease-in-out";
22
+ };
23
+ }
24
+ export interface ClipTransformJSON {
25
+ x: number;
26
+ y: number;
27
+ width: number;
28
+ height: number;
29
+ angle: number;
30
+ opacity: number;
31
+ zIndex: number;
32
+ flip?: {
33
+ x: boolean;
34
+ y: boolean;
35
+ } | null;
36
+ }
37
+ interface BaseClipJSON {
38
+ id?: string;
39
+ name?: string;
40
+ metadata?: Record<string, any>;
41
+ effects?: Array<{
42
+ id: string;
43
+ key: string;
44
+ startTime: number;
45
+ duration: number;
46
+ targets?: number[];
47
+ }>;
48
+ src?: string;
49
+ timing?: ClipTimingJSON;
50
+ transform?: ClipTransformJSON;
51
+ display?: {
52
+ from: number;
53
+ to: number;
54
+ };
55
+ playbackRate?: number;
56
+ duration?: number;
57
+ trim?: {
58
+ from: number;
59
+ to: number;
60
+ };
61
+ transition?: ITransitionInfo;
62
+ style?: any;
63
+ locked?: boolean;
64
+ muted?: boolean;
65
+ colorAdjustment?: ColorAdjustment;
66
+ chromaKey?: IChromaKeyOpts;
67
+ animation?: {
68
+ keyFrames: Record<string, Partial<{
69
+ x: number;
70
+ y: number;
71
+ w: number;
72
+ h: number;
73
+ angle: number;
74
+ opacity: number;
75
+ }>>;
76
+ options: {
77
+ duration: number;
78
+ delay?: number;
79
+ iterCount?: number;
80
+ };
81
+ };
82
+ animations?: Array<{
83
+ type: string;
84
+ options: any;
85
+ params?: any;
86
+ }>;
87
+ main?: boolean;
88
+ }
89
+ export interface ClipVisualStyleJSON {
90
+ borderRadius?: number;
91
+ stroke?: {
92
+ color: string;
93
+ width: number;
94
+ };
95
+ shadow?: {
96
+ color?: string;
97
+ alpha?: number;
98
+ blur?: number;
99
+ offsetX?: number;
100
+ offsetY?: number;
101
+ };
102
+ }
103
+ export interface VideoJSON extends BaseClipJSON {
104
+ type: "Video";
105
+ audio?: boolean;
106
+ volume?: number;
107
+ style?: ClipVisualStyleJSON;
108
+ }
109
+ export interface AudioJSON extends BaseClipJSON {
110
+ type: "Audio";
111
+ loop?: boolean;
112
+ volume?: number;
113
+ style?: ClipVisualStyleJSON;
114
+ }
115
+ export interface ImageJSON extends BaseClipJSON {
116
+ type: "Image";
117
+ style?: ClipVisualStyleJSON;
118
+ }
119
+ export interface TextStyleJSON {
120
+ fontSize?: number;
121
+ fontFamily?: string;
122
+ fontWeight?: string | number;
123
+ fontStyle?: string;
124
+ color?: string | number | {
125
+ type: "gradient";
126
+ x0: number;
127
+ y0: number;
128
+ x1: number;
129
+ y1: number;
130
+ colors: Array<{
131
+ ratio: number;
132
+ color: string | number;
133
+ }>;
134
+ };
135
+ align?: "left" | "center" | "right";
136
+ fontUrl?: string;
137
+ stroke?: {
138
+ color: string | number;
139
+ width: number;
140
+ join?: "miter" | "round" | "bevel";
141
+ cap?: "butt" | "round" | "square";
142
+ miterLimit?: number;
143
+ };
144
+ shadow?: {
145
+ color?: string | number;
146
+ alpha?: number;
147
+ blur?: number;
148
+ offsetX?: number;
149
+ offsetY?: number;
150
+ };
151
+ wordWrap?: boolean;
152
+ wordWrapWidth?: number;
153
+ lineHeight?: number;
154
+ letterSpacing?: number;
155
+ textCase?: "none" | "uppercase" | "lowercase" | "title";
156
+ wordsPerLine?: "single" | "multiple";
157
+ verticalAlign?: "top" | "center" | "bottom";
158
+ wordAnimation?: ICaptionWordAnimation;
159
+ textBoxStyle?: TextBoxStyleJSON;
160
+ appeared?: string;
161
+ active?: string;
162
+ activeFill?: string;
163
+ captionBackground?: string;
164
+ keyword?: string;
165
+ background?: {
166
+ color?: string;
167
+ opacity?: number;
168
+ borderRadius?: number;
169
+ paddingX?: number;
170
+ paddingY?: number;
171
+ };
172
+ }
173
+ export interface ICaptionWordAnimation {
174
+ type: "scale" | "opacity";
175
+ application: "active" | "keyword" | "none";
176
+ value: number;
177
+ mode?: "static" | "dynamic";
178
+ }
179
+ export interface TextBoxStyleJSON {
180
+ style?: "tiktok" | "none";
181
+ textAlign?: "left" | "center" | "right" | "";
182
+ maxLines?: number;
183
+ borderRadius?: number;
184
+ horizontalPadding?: number;
185
+ verticalPadding?: number;
186
+ }
187
+ export interface TextJSON extends BaseClipJSON {
188
+ type: "Text";
189
+ text: string;
190
+ style?: TextStyleJSON;
191
+ }
192
+ export interface CaptionWordStyleJSON {
193
+ color?: string;
194
+ border?: {
195
+ color?: string;
196
+ width?: number;
197
+ };
198
+ background?: string;
199
+ }
200
+ export interface CaptionColorsJSON {
201
+ /** Currently spoken word */
202
+ active?: CaptionWordStyleJSON;
203
+ /** Upcoming / future words */
204
+ future?: CaptionWordStyleJSON;
205
+ /** Keyword words */
206
+ keyword?: {
207
+ color?: string;
208
+ preserveAfterSpoken?: boolean;
209
+ };
210
+ }
211
+ export interface CaptionPositioningJSON {
212
+ bottomOffset?: number;
213
+ videoWidth?: number;
214
+ videoHeight?: number;
215
+ }
216
+ export interface CaptionDataJSON {
217
+ words?: Array<{
218
+ text: string;
219
+ from: number;
220
+ to: number;
221
+ isKeyWord?: boolean;
222
+ paragraphIndex?: number;
223
+ }>;
224
+ colors?: CaptionColorsJSON;
225
+ positioning?: CaptionPositioningJSON;
226
+ wordAnimation?: ICaptionWordAnimation;
227
+ textBoxStyle?: TextBoxStyleJSON;
228
+ }
229
+ export interface CaptionJSON extends BaseClipJSON {
230
+ type: "Caption";
231
+ text: string;
232
+ style?: TextStyleJSON;
233
+ caption?: CaptionDataJSON;
234
+ fontUrl?: string;
235
+ mediaId?: string;
236
+ wordsPerLine?: "single" | "multiple";
237
+ textBoxStyle?: TextBoxStyleJSON;
238
+ }
239
+ export interface EffectJSON extends BaseClipJSON {
240
+ type: "Effect";
241
+ effectKey: string;
242
+ values?: Record<string, any>;
243
+ }
244
+ export interface TransitionJSON extends BaseClipJSON {
245
+ type: "Transition";
246
+ transitionKey: string;
247
+ fromClipId?: string | null;
248
+ toClipId?: string | null;
249
+ }
250
+ export interface PlaceholderJSON extends BaseClipJSON {
251
+ type: "Placeholder";
252
+ }
253
+ export interface ShapeJSON extends BaseClipJSON {
254
+ type: "Shape";
255
+ shapeType: ShapeType;
256
+ }
257
+ export interface GlobalTransitionJSON {
258
+ key: string;
259
+ duration: number;
260
+ clips: string[];
261
+ }
262
+ export type ClipJSON = VideoJSON | AudioJSON | ImageJSON | TextJSON | CaptionJSON | EffectJSON | TransitionJSON | PlaceholderJSON | ShapeJSON;
263
+ export interface StudioTrackJSON {
264
+ id: string;
265
+ name: string;
266
+ type: string;
267
+ clipIds: string[];
268
+ muted?: boolean;
269
+ }
270
+ export interface ProjectJSON {
271
+ tracks?: StudioTrackJSON[];
272
+ clips: Record<string, ClipJSON>;
273
+ transition?: GlobalTransitionJSON[];
274
+ transitions?: GlobalTransitionJSON[];
275
+ globalEffects?: Array<{
276
+ id: string;
277
+ key: string;
278
+ startTime: number;
279
+ duration: number;
280
+ }>;
281
+ settings?: {
282
+ width?: number;
283
+ height?: number;
284
+ fps?: number;
285
+ duration?: number;
286
+ backgroundColor?: string;
287
+ format?: string;
288
+ videoCodec?: string;
289
+ bitrate?: number;
290
+ audio?: boolean;
291
+ audioCodec?: string;
292
+ audioSampleRate?: number;
293
+ metaDataTags?: Record<string, string>;
294
+ };
295
+ }
296
+ /**
297
+ * Normalize a clip's JSON structure to ensure compatibility and migrate old property structures
298
+ */
299
+ export declare function normalizeClipJSON(json: ClipJSON): ClipJSON;
300
+ export declare function normalizeClipStyleJSON(style: any, type: string): any;
301
+ /**
302
+ * Serialize a clip to JSON format
303
+ * @param clip The clip to serialize
304
+ * @param main Whether this is the main clip (for Compositor)
305
+ */
306
+ export declare function clipToJSON(clip: IClip, main?: boolean): ClipJSON;
307
+ /**
308
+ * Deserialize JSON to a clip instance
309
+ * Uses fromObject static method if available (fabric.js pattern), otherwise falls back to manual construction
310
+ */
311
+ export declare function jsonToClip(json: ClipJSON, context?: ClipContext): Promise<IClip>;
312
+ export {};
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Quick concatenate multiple MP4 file streams, requires all MP4s to have consistent properties,
3
+ * properties include (but not limited to): audio/video codec format, resolution, sample rate
4
+ *
5
+ * @param streams An array of readable streams containing Uint8Array.
6
+ * @returns Returns a Promise that resolves to a readable stream containing merged MP4 data.
7
+ * @throws Will throw error if unable to generate file from streams.
8
+ *
9
+ * @example
10
+ * const streams = [stream1, stream2, stream3];
11
+ * const resultStream = await fastConcatMP4(streams);
12
+ */
13
+ export declare function fastConcatMP4(streams: ReadableStream<Uint8Array>[]): Promise<ReadableStream<Uint8Array>>;
14
+ /**
15
+ * Set correct duration value for fMP4 files generated
16
+ */
17
+ export declare function fixFMP4Duration(stream: ReadableStream<Uint8Array>): Promise<ReadableStream<Uint8Array>>;
18
+ /**
19
+ * Video dubbing; mix MP4 with audio file, only re-encode audio, video track unchanged
20
+ * @param mp4Stream - MP4 stream
21
+ * @param audio - Audio information
22
+ * @param audio.stream - Audio data stream
23
+ * @param audio.volume - Audio volume
24
+ * @param audio.loop - When audio duration is less than video, whether to loop audio stream
25
+ * @returns Output mixed audio stream
26
+ */
27
+ export declare function mixinMP4AndAudio(mp4Stream: ReadableStream<Uint8Array>, audio: {
28
+ stream: ReadableStream<Uint8Array>;
29
+ volume: number;
30
+ loop: boolean;
31
+ }): ReadableStream<Uint8Array<ArrayBufferLike>>;
@@ -0,0 +1,44 @@
1
+ import { AudioTrackOpts, MP4File, MP4Info, MP4Sample, VideoTrackOpts } from 'wrapbox';
2
+ import { file } from 'opfs-tools';
3
+ interface ExtractedConfig {
4
+ videoTrackConf?: VideoTrackOpts;
5
+ videoDecoderConf?: VideoDecoderConfig;
6
+ audioTrackConf?: AudioTrackOpts;
7
+ audioDecoderConf?: AudioDecoderConfig;
8
+ }
9
+ /**
10
+ * Extracts video and audio configurations from an MP4 file.
11
+ */
12
+ export declare function extractFileConfig(file: MP4File, info: MP4Info): ExtractedConfig;
13
+ /**
14
+ * Quick parse mp4 file, prioritizing header parsing to save memory.
15
+ */
16
+ export declare function quickParseMP4File(reader: Awaited<ReturnType<ReturnType<typeof file>["createReader"]>>, onReady: (data: {
17
+ mp4boxFile: MP4File;
18
+ info: MP4Info;
19
+ }) => void, onSamples: (id: number, sampleType: "video" | "audio", samples: MP4Sample[]) => void): Promise<void>;
20
+ /**
21
+ * Parses transformation matrix to extract scale, rotation, and translation.
22
+ */
23
+ export declare function parseMatrix(matrix?: Int32Array): {
24
+ scaleX?: undefined;
25
+ scaleY?: undefined;
26
+ rotationRad?: undefined;
27
+ rotationDeg?: undefined;
28
+ translateX?: undefined;
29
+ translateY?: undefined;
30
+ perspective?: undefined;
31
+ } | {
32
+ scaleX: number;
33
+ scaleY: number;
34
+ rotationRad: number;
35
+ rotationDeg: number;
36
+ translateX: number;
37
+ translateY: number;
38
+ perspective: number;
39
+ };
40
+ /**
41
+ * Creates a function to rotate VideoFrames using Canvas.
42
+ */
43
+ export declare function createVFRotater(width: number, height: number, rotationDeg: number): (vf: VideoFrame | null) => VideoFrame | null;
44
+ export {};
@@ -0,0 +1,26 @@
1
+ import { MP4File, MP4Info, MP4Sample } from 'wrapbox';
2
+ export type TransformChunk = {
3
+ chunkType: "ready";
4
+ data: {
5
+ info: MP4Info;
6
+ file: MP4File;
7
+ };
8
+ } | {
9
+ chunkType: "samples";
10
+ data: {
11
+ id: number;
12
+ type: "video" | "audio";
13
+ samples: MP4Sample[];
14
+ };
15
+ };
16
+ /**
17
+ * Transforms a raw byte stream into an MP4Sample stream using mp4box.js.
18
+ */
19
+ export declare class SampleTransform {
20
+ readonly readable: ReadableStream<TransformChunk>;
21
+ readonly writable: WritableStream<Uint8Array>;
22
+ private inputBufOffset;
23
+ private isStreamCancelled;
24
+ constructor();
25
+ private initMP4Box;
26
+ }
@@ -0,0 +1,273 @@
1
+ import { default as EventEmitter } from '../event-emitter';
2
+ import { IAnimation, AnimationTransform } from '../animation';
3
+ import { IChromaKeyOpts } from '../clips/iclip';
4
+ import { ColorAdjustment } from '../utils/color-adjustment';
5
+ import { IClipTiming } from '@agrhub/core';
6
+ type IRectBaseProps = any;
7
+ interface IAnimationOptions {
8
+ duration: number;
9
+ delay?: number;
10
+ iterCount?: number;
11
+ }
12
+ type TAnimateProps = IRectBaseProps & {
13
+ opacity: number;
14
+ };
15
+ export type TAnimationKeyFrame = Array<[number, Partial<TAnimateProps>]>;
16
+ type TKeyFrameOptions = Partial<Record<`${number}%` | "from" | "to", Partial<TAnimateProps>>>;
17
+ export interface BaseSpriteEvents {
18
+ propsChange: Partial<{
19
+ left: number;
20
+ top: number;
21
+ width: number;
22
+ height: number;
23
+ angle: number;
24
+ zIndex: number;
25
+ opacity: number;
26
+ volume: number;
27
+ animations: IAnimation[];
28
+ locked: boolean;
29
+ muted: boolean;
30
+ }>;
31
+ [key: string]: any;
32
+ [key: symbol]: any;
33
+ }
34
+ /**
35
+ * Sprite base class
36
+ *
37
+ * @see {@link OffscreenSprite}
38
+ */
39
+ export declare abstract class BaseSprite<T extends BaseSpriteEvents = BaseSpriteEvents> extends EventEmitter<T> {
40
+ /**
41
+ * Unique identifier for the sprite/clip
42
+ */
43
+ id: string;
44
+ /**
45
+ * Name of the sprite/clip
46
+ */
47
+ name: string;
48
+ /**
49
+ * Nested timing property group (Phase 1 Refactoring)
50
+ */
51
+ timing: IClipTiming;
52
+ /**
53
+ * Control display time range of clips, commonly used in editing scenario timeline (track) module
54
+ * from: start time offset in microseconds
55
+ * to: end time (from + duration) in microseconds
56
+ */
57
+ get display(): {
58
+ from: number;
59
+ to: number;
60
+ };
61
+ set display(v: {
62
+ from: number;
63
+ to: number;
64
+ });
65
+ /**
66
+ * Duration of the clip in microseconds
67
+ * Cannot exceed the duration of the referenced {@link IClip}
68
+ */
69
+ get duration(): number;
70
+ set duration(v: number);
71
+ /**
72
+ * Playback rate of current clip, 1 means normal playback
73
+ * **Note**
74
+ * 1. When setting playbackRate, duration must be actively corrected
75
+ * 2. Audio uses the simplest interpolation algorithm to change rate, so changing rate will cause pitch variation, for custom algorithm please use {@link Video.tickInterceptor} to implement
76
+ */
77
+ get playbackRate(): number;
78
+ set playbackRate(v: number);
79
+ /**
80
+ * Trim range of the source media in microseconds
81
+ * from: start time in microseconds
82
+ * to: end time in microseconds
83
+ */
84
+ get trim(): {
85
+ from: number;
86
+ to: number;
87
+ };
88
+ set trim(v: {
89
+ from: number;
90
+ to: number;
91
+ });
92
+ constructor();
93
+ protected _left: number;
94
+ /**
95
+ * Left position (x coordinate)
96
+ */
97
+ get left(): number;
98
+ set left(v: number);
99
+ protected _top: number;
100
+ /**
101
+ * Top position (y coordinate)
102
+ */
103
+ get top(): number;
104
+ set top(v: number);
105
+ protected _width: number;
106
+ /**
107
+ * Width
108
+ */
109
+ get width(): number;
110
+ set width(v: number);
111
+ protected _height: number;
112
+ /**
113
+ * Height
114
+ */
115
+ get height(): number;
116
+ set height(v: number);
117
+ private _angle;
118
+ /**
119
+ * Rotation angle in degrees
120
+ */
121
+ get angle(): number;
122
+ set angle(v: number);
123
+ /**
124
+ * Center point calculated from position and dimensions
125
+ */
126
+ get center(): {
127
+ x: number;
128
+ y: number;
129
+ };
130
+ private _zIndex;
131
+ get zIndex(): number;
132
+ /**
133
+ * Control layering relationship between clips, clips with smaller zIndex will be occluded
134
+ */
135
+ set zIndex(v: number);
136
+ private _opacity;
137
+ /**
138
+ * Opacity (0.0 to 1.0)
139
+ */
140
+ get opacity(): number;
141
+ set opacity(v: number);
142
+ private _volume;
143
+ /**
144
+ * Audio volume level (0.0 to 1.0)
145
+ */
146
+ get volume(): number;
147
+ set volume(v: number);
148
+ private _locked;
149
+ /**
150
+ * Whether the sprite is locked (preventing interactions)
151
+ */
152
+ get locked(): boolean;
153
+ set locked(v: boolean);
154
+ private _muted;
155
+ /**
156
+ * Whether the clip's audio is muted (volume is kept, so unmuting restores it)
157
+ */
158
+ get muted(): boolean;
159
+ set muted(v: boolean);
160
+ private _trackMuted;
161
+ /**
162
+ * Set by Studio/Compositor when the clip's track is muted. Not serialized and does not emit
163
+ * propsChange, so it can be refreshed every frame.
164
+ */
165
+ get trackMuted(): boolean;
166
+ set trackMuted(v: boolean);
167
+ /** Called when the track-level mute flips (clip-level changes arrive via propsChange). */
168
+ protected onEffectiveVolumeChange(): void;
169
+ /** Volume actually applied to audio output: 0 when the clip or its track is muted. */
170
+ get effectiveVolume(): number;
171
+ /**
172
+ * Flip clip horizontally or vertically
173
+ */
174
+ flip: {
175
+ x: boolean;
176
+ y: boolean;
177
+ } | null;
178
+ effects: Array<{
179
+ id: string;
180
+ key: string;
181
+ startTime: number;
182
+ duration: number;
183
+ targets?: number[];
184
+ }>;
185
+ /**
186
+ * Chroma key settings (green screen removal)
187
+ */
188
+ chromaKey?: IChromaKeyOpts;
189
+ colorAdjustment?: ColorAdjustment;
190
+ /**
191
+ * Styling properties (e.g., stroke, dropShadow, borderRadius)
192
+ * This is a generic object to hold visual styles across different clip types
193
+ */
194
+ protected _style: any;
195
+ get style(): any;
196
+ set style(v: any);
197
+ private animatKeyFrame;
198
+ private animatOptions;
199
+ private _animations;
200
+ /**
201
+ * List of active animations.
202
+ * When setting this property, raw objects are automatically converted to IAnimation instances.
203
+ */
204
+ get animations(): IAnimation[];
205
+ set animations(v: IAnimation[]);
206
+ /**
207
+ * Current transform offsets/multipliers from animations
208
+ * Resets every frame in animate()
209
+ */
210
+ renderTransform: AnimationTransform;
211
+ /**
212
+ * @see {@link IClip.ready}
213
+ * For clips, this should be Promise<IClipMeta>, but for BaseSprite it's just Promise<void>
214
+ */
215
+ protected _render(ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D): void;
216
+ /**
217
+ * Add animation to clip, usage reference CSS animation
218
+ *
219
+ * @example
220
+ * sprite.setAnimation(
221
+ * {
222
+ * '0%': { x: 0, y: 0 },
223
+ * '25%': { x: 1200, y: 680 },
224
+ * '50%': { x: 1200, y: 0 },
225
+ * '75%': { x: 0, y: 680 },
226
+ * '100%': { x: 0, y: 0 },
227
+ * },
228
+ * { duration: 4e6, iterCount: 1 },
229
+ * );
230
+ *
231
+ */
232
+ setAnimation(keyFrame: TKeyFrameOptions, options: IAnimationOptions): void;
233
+ /**
234
+ * If current sprite has animation set, set sprite's animation properties to state at specified time
235
+ */
236
+ animate(time: number, target?: any): void;
237
+ /**
238
+ * Add a modular animation to the clip
239
+ * @param name Preset name or 'keyframes'
240
+ * @param opts Animation options (duration, delay, etc.)
241
+ * @param params Preset-specific parameters or KeyframeData
242
+ */
243
+ addAnimation(name: string, options: any, params?: any): string;
244
+ /**
245
+ * Remove an animation by ID
246
+ */
247
+ removeAnimation(id: string): void;
248
+ /**
249
+ * Clear all modular animations
250
+ */
251
+ clearAnimations(): void;
252
+ /**
253
+ * Update an existing animation by ID
254
+ * @param id Animation ID to update
255
+ * @param type Animation type (preset name or 'keyframes')
256
+ * @param opts Animation options
257
+ * @param params Preset-specific parameters or KeyframeData
258
+ */
259
+ updateAnimation(id: string, type: string, options: any, params?: any): void;
260
+ /**
261
+ * Copy current sprite's properties to target
262
+ *
263
+ * Used for cloning or copying state between {@link OffscreenSprite} instances
264
+ */
265
+ copyStateTo<T extends BaseSprite>(target: T): void;
266
+ /**
267
+ * Update multiple properties at once
268
+ */
269
+ update(updates: Partial<this>): void;
270
+ protected destroy(): void;
271
+ }
272
+ export declare function linearTimeFn(time: number, keyFrame: TAnimationKeyFrame, options: Required<IAnimationOptions>): Partial<TAnimateProps>;
273
+ export {};