@vvfx/sdk 0.1.19-alpha.1 → 0.1.19-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,602 +1,755 @@
1
1
  import * as _galacean_effects from '@galacean/effects';
2
- import { spec, math, Player } from '@galacean/effects';
2
+ import { math, spec, Player } from '@galacean/effects';
3
3
  export { generateGUID, spec } from '@galacean/effects';
4
4
  import { Point } from '@pixi/constants';
5
5
 
6
6
  /**
7
- * @description SDKItem 基础选项接口
8
- * @description 支持扩展属性,允许添加任意额外属性
7
+ * @class 二维线段
9
8
  */
10
- type SDKItemOptions = {
11
- /**
12
- * @description 元素ID
13
- */
14
- id: string;
9
+ declare class Line2 {
10
+ start: Vector2;
11
+ end: Vector2;
12
+ constructor(start?: Vector2, end?: Vector2);
15
13
  /**
16
- * @description 元素名称
14
+ * 设置二维线段
15
+ * @param {Vector2} start 线段起点
16
+ * @param {Vector2} end 线段终点
17
+ * @returns {Line2} 二维线段
17
18
  */
18
- name: string;
19
+ set(start: Vector2, end: Vector2): this;
19
20
  /**
20
- * @description 父节点ID
21
+ * 复制二维线段
22
+ * @param {Line2} line 复制对象
23
+ * @returns {Line2} 复制结果
21
24
  */
22
- parentId?: string;
25
+ copyFrom(line: Line2): this;
23
26
  /**
24
- * @description 子元素ID列表
27
+ * 二维线段求方向
28
+ * @returns {Vector2} 二维线段方向
25
29
  */
26
- children?: string[];
30
+ direction(): Vector2;
27
31
  /**
28
- * @description 元素生命周期
32
+ * 二维线段求中点
33
+ * @param {Vector2} [target=new Vector2()] 目标保存对象
34
+ * @returns {Vector2} 二维线段中点
29
35
  */
30
- duration?: number;
36
+ getCenter(target?: Vector2): Vector2;
31
37
  /**
32
- * @description 元素生命周期延时
38
+ * 二维线段向量值
39
+ * @param {Vector2} [target=new Vector2()] 目标保存对象
40
+ * @returns {Vector2} 二维线段向量值
33
41
  */
34
- delay?: number;
42
+ delta(target?: Vector2): Vector2;
35
43
  /**
36
- * @description 可视状态
44
+ * 二维线段欧式距离平方(应用于计算)
45
+ * @returns {number} 计算结果
37
46
  */
38
- visible?: boolean;
47
+ distanceSq(): number;
39
48
  /**
40
- * @description 元素结束行为
49
+ * 二维线段欧式距离
50
+ * @returns {number} 计算结果
41
51
  */
42
- endBehavior?: spec.EndBehavior;
52
+ distance(): number;
43
53
  /**
44
- * @description 是否处于锁定状态
54
+ * 求二维线段比例点
55
+ * @param {number} t 比例值
56
+ * @param {Vector2} target 目标保存对象
57
+ * @returns {Vector2} 比例点结果
45
58
  */
46
- isLocked?: boolean;
59
+ at(t: number, target?: Vector2): Vector2;
47
60
  /**
48
- * @description 关键属性是否可编辑
61
+ * 求点与线段的最短距离
62
+ * @param {Vector2} point 二维空间点
63
+ * @param {boolean} clampToLine 是否限制于线段内
64
+ * @returns {number} 距离结果
49
65
  */
50
- isCoreEditable: boolean;
66
+ closestPointToPointParameter(point: Vector2, clampToLine: boolean): number;
51
67
  /**
52
- * @description 扩展属性存储(属性名 -> 属性值)
68
+ * 求点与线段的最近交点
69
+ * @param {Vector2} point 二维空间点
70
+ * @param {boolean} clampToLine 是否限制于线段内
71
+ * @param {Vector2} target 目标保存对象
72
+ * @returns {Vector2} 最近交点
53
73
  */
54
- extension?: Record<string, any>;
74
+ closestPointToPoint(point: Vector2, clampToLine: boolean, target?: Vector2): Vector2;
55
75
  /**
56
- * @description 允许任意额外属性(用于兼容旧代码)
76
+ * 二维线段判等
77
+ * @param {Line2} line 二维线段
78
+ * @returns {boolean} 判等结果
57
79
  */
58
- [extraProp: string]: any;
59
- };
60
- /**
61
- * @description Sprite SDKItem 选项
62
- */
63
- type SpriteItemOptions = SDKItemOptions & {
80
+ equals(line: Line2): boolean;
64
81
  /**
65
- * @description 元素属性
82
+ * 克隆二维线段
83
+ * @returns {Line2} 克隆结果
66
84
  */
67
- property?: Partial<SpriteItemProperty>;
68
- };
69
- /**
70
- * @description Text SDKItem 选项
71
- */
72
- type TextItemOptions = SDKItemOptions & {
85
+ clone(): Line2;
73
86
  /**
74
- * @description 元素属性
87
+ * 二维线段求长度
88
+ * @returns {number} 长度
75
89
  */
76
- property?: Partial<TextItemProperty>;
77
- };
78
- /**
79
- * @description Video SDKItem 选项
80
- */
81
- type VideoItemOptions = SDKItemOptions & {
90
+ length(): number;
82
91
  /**
83
- * @description 元素属性
92
+ * 二维线段判断相交
93
+ * @param {Line2} other 二维线段
94
+ * @returns {boolean} 相交判断结果
84
95
  */
85
- property?: Partial<VideoItemProperty>;
86
- };
87
- /**
88
- * @description Group SDKItem 选项(空节点/组)
89
- */
90
- type GroupItemOptions = SDKItemOptions & {
96
+ crossWithLine(other: Line2): boolean;
97
+ }
98
+
99
+ declare class Vector2 extends math.Vector2 {
100
+ subtract(other: Vector2): this;
101
+ toViewCoordinate(width: number, height: number): this;
102
+ clone(): Vector2;
103
+ distanceTo(other: Vector2): number;
104
+ scaleByCenter(scalar: Vector2, anchor?: Vector2): this;
105
+ round(precision?: number): this;
91
106
  /**
92
- * @description 元素属性
107
+ * 点到直线的最短距离
108
+ * @returns {{d: number, t: number}} d表示距离,t表示最近点在直线的比例
93
109
  */
94
- property?: Partial<GroupItemProperty>;
95
- };
96
- /**
97
- * @description Generator SDKItem 选项(资源生成器)
98
- * @description 支持 image 和 video 两种生成器类型
99
- * @description 使用 GeneratorItemProperty 包含 generatorType
100
- */
101
- type GeneratorItemOptions = SDKItemOptions & {
110
+ distanceToLine(line: Line2): {
111
+ d: number;
112
+ t: number;
113
+ };
102
114
  /**
103
- * @description 元素属性(包含 generatorType)
115
+ * 二维向量与x轴夹角
116
+ * @returns {number} 弧度值
104
117
  */
105
- property?: Partial<GeneratorItemProperty>;
106
- };
107
- type EffectsItemOptions = SDKItemOptions & {
108
- property?: Partial<EffectsItemProperty>;
109
- };
110
- /**
111
- * @description Frame 画板元素 SDKItem 选项
112
- */
113
- type FrameItemOptions = SDKItemOptions & {
118
+ angle(): number;
114
119
  /**
115
- * @description 元素属性
120
+ * 二维点绕点旋转
121
+ * @param {Vec2} center 旋转中心
122
+ * @param {number} angle 旋转角度
123
+ * @returns {Vec2} 旋转结果
116
124
  */
117
- property?: Partial<FrameItemProperty>;
118
- };
119
- /**
120
- * @description SDKItem 类型(独立于 spec.ItemType)
121
- * @description 包含所有 SDK 层级的元素类型,包括虚拟类型如 generator
122
- */
123
- declare enum SDKItemType {
124
- SPRITE = "sprite",
125
- TEXT = "text",
126
- VIDEO = "video",
127
- GROUP = "group",
128
- GENERATOR = "generator",
129
- EFFECTS = "effects",
130
- FRAME = "frame"
125
+ rotateAround(center: Vector2, angle: number): this;
131
126
  }
132
127
 
133
128
  /**
134
- * @description SDKItem 抽象基类
135
- * @description 支持属性扩展,允许添加任意自定义属性
129
+ * @class 二维包围盒
136
130
  */
137
- declare abstract class BaseItem {
131
+ declare class Box2 {
138
132
  /**
139
- * @description 元素ID
133
+ * @member {Vector2[]} corners 二维包围盒角点
140
134
  */
141
- id: string;
135
+ corners: Vector2[];
136
+ min: Vector2;
137
+ max: Vector2;
142
138
  /**
143
- * @description 元素名称
139
+ * 构造函数,传入值为空时表示空包围盒
140
+ * @param {Vector2} [min=new Vector2(Infinity, Infinity)] 最小点
141
+ * @param {Vector2} [max=new Vector2(-Infinity, -Infinity)] 最大点
144
142
  */
145
- name: string;
143
+ constructor(min?: Vector2, max?: Vector2);
146
144
  /**
147
- * @description 父节点ID
145
+ * 通过最大最小点设置二维包围盒
146
+ * @param {Vector2} min 最小点
147
+ * @param {Vector2} max 最大点
148
+ * @returns {Box2} 二维包围盒
148
149
  */
149
- parentId?: string;
150
+ set(min: Vector2, max: Vector2): this;
150
151
  /**
151
- * @description 元素生命周期
152
+ * 通过角点设置二维包围盒
153
+ * @param {Vector2[]} vecArray 二维空间点数组
154
+ * @returns {Box2} 二维包围盒
152
155
  */
153
- duration: number;
156
+ setFromVec2Array(vecArray: Vector2[]): this;
154
157
  /**
155
- * @description 元素生命周期延时
158
+ * 通过屏幕坐标点设置二维包围盒 - 点为屏幕坐标点,x正方向为右,y正方向为向上
159
+ * @param vecArray 屏幕坐标点
156
160
  */
157
- delay: number;
161
+ setFromVec2ArrayWithOutCorners(vecArray: Vector2[]): this;
158
162
  /**
159
- * @description 元素结束行为
163
+ * 通过中心与大小设置二维包围盒
164
+ * @param {Vector2} center 二维中心点
165
+ * @param {Vector2} size 二维大小
166
+ * @returns {Box2} 二维包围盒
160
167
  */
161
- endBehavior: spec.EndBehavior;
168
+ setFromCenterAndSize(center: Vector2, size: Vector2): this;
162
169
  /**
163
- * @description 是否可见
170
+ * 克隆二维包围盒
171
+ * @returns {Box2} 克隆结果
164
172
  */
165
- visible: boolean;
173
+ clone(): Box2;
166
174
  /**
167
- * @description 是否处于锁定状态
175
+ * 复制二维包围盒
176
+ * @param {Box2} box 二维包围盒
177
+ * @returns {Box2} 复制结果
168
178
  */
169
- isLocked: boolean;
170
- isCoreEditable: boolean;
179
+ copyFrom(box: Box2): this;
171
180
  /**
172
- * @description 扩展属性存储(与 property 同级)
181
+ * 二维包围盒置空
182
+ * @returns {Box2} 置空结果
173
183
  */
174
- private _extension;
184
+ makeEmpty(): this;
175
185
  /**
176
- * @description 元素类型(由子类实现)
177
- * @description 支持 spec.ItemType 或扩展的 SDKItemType
186
+ * 二维包围盒判空
187
+ * @returns {boolean} 判空结果
178
188
  */
179
- abstract readonly type: SDKItemType;
189
+ isEmpty(): boolean;
180
190
  /**
181
- * @description 元素属性(由子类实现)
191
+ * 获取二维包围盒角点
192
+ * @returns {Vector2[]} 二维包围盒角点
182
193
  */
183
- abstract readonly property: BaseItemProperty;
184
- constructor(options: SDKItemOptions);
194
+ getCorners(): Vector2[];
185
195
  /**
186
- * @description 设置扩展属性
187
- * @param key 属性名
188
- * @param value 属性值
196
+ * 获取二维包围盒中心点
197
+ * @param {Vector2} [target=new Vector2()] 目标点(用以存放二维包围盒中心点)
198
+ * @returns {Vector2} 二维包围盒中心点
189
199
  */
190
- setExtension(key: string, value: any): void;
200
+ getCenter(target?: Vector2): Vector2;
191
201
  /**
192
- * @description 获取扩展属性
193
- * @param key 属性名
194
- * @returns 属性值
195
- */
196
- getExtension(key: string): any;
202
+ * 获取二维包围盒大小
203
+ * @param {Vector2} [target=new Vector2()] 目标向量(用以存放二维包围盒大小)
204
+ * @returns {Vector2} 二维包围盒大小
205
+ */
206
+ getSize(target?: Vector2): Vector2;
197
207
  /**
198
- * @description 检查是否存在指定扩展属性
199
- * @param key 属性名
200
- * @returns 是否存在
208
+ * 通过二维空间点扩展二维包围盒
209
+ * @param {Vector2} point 二维空间点
210
+ * @returns {Box2} 扩展包围盒
201
211
  */
202
- hasExtension(key: string): boolean;
212
+ expandByPoint(point: Vector2): this;
203
213
  /**
204
- * @description 删除扩展属性
205
- * @param key 属性名
206
- * @returns 是否删除成功
214
+ * 通过向量扩展二维包围盒
215
+ * @param {Vector2} vector 二维向量
216
+ * @returns {Box2} 扩展结果
207
217
  */
208
- deleteExtension(key: string): boolean;
218
+ expandByVector(vector: Vector2): this;
209
219
  /**
210
- * @description 获取所有扩展属性的键名列表
211
- * @returns 键名数组
220
+ * 通过大小扩展二维包围盒
221
+ * @param {number} scalar 扩展大小
222
+ * @returns {Box2} 扩展结果
212
223
  */
213
- getExtensionKeys(): string[];
224
+ expandByScalar(scalar: number): this;
214
225
  /**
215
- * @description 获取所有扩展属性
216
- * @returns 扩展属性对象
226
+ * 判断二维包围盒是否包含二维空间点
227
+ * @param {Vector2} point 二维空间点
228
+ * @param {boolean} [isOrthogonal=true] 包围盒正交判断(默认为true)
229
+ * @returns {boolean} 点包含判断结果
217
230
  */
218
- getAllExtension(): Record<string, any>;
231
+ containsPoint(point: Vector2, isOrthogonal?: boolean): boolean;
219
232
  /**
220
- * @description 批量设置扩展属性
221
- * @param extensions 扩展属性对象
233
+ * 判断二维包围盒包含关系(if this contains other)
234
+ * @param {Box2} box 其它包围盒
235
+ * @returns {boolean} 二维包围盒包含判断结果
222
236
  */
223
- setExtensions(extensions: Record<string, any>): void;
237
+ containsBox(box: Box2): boolean;
224
238
  /**
225
- * @description 清空所有扩展属性
239
+ * 获取点以包围盒左上角顶点为原点的相对位置
240
+ * @param {Vector2} point 指定二维空间点
241
+ * @param {Vector2} [target=new Vector2()] 目标空间点
242
+ * @returns {Vector2} 计算结果空间点
226
243
  */
227
- clearExtension(): void;
244
+ getParameter(point: Vector2, target?: Vector2): Vector2;
228
245
  /**
229
- * @description 转换为 CreateInfo(用于元素复制/导出)
230
- * @param withParent 是否包含父节点ID
231
- * @returns CreateInfo 对象
246
+ * 求点与二维包围盒的最近点
247
+ * @param {Vector2} point 二维空间点
248
+ * @param {Vector2} [target=new Vector2()] 结果点
249
+ * @returns {Vector2} 二维空间点
232
250
  */
233
- abstract toCreateInfo(withParent?: boolean): ItemCreateInfo;
251
+ clampPoint(point: Vector2, target?: Vector2): Vector2;
234
252
  /**
235
- * @description 克隆 SDKItem
236
- * @returns 新的 SDKItem 实例
253
+ * 求点到二维包围盒的距离
254
+ * @param {Vector2} point 二维空间点
255
+ * @returns {number} 距离
237
256
  */
238
- abstract clone(): BaseItem;
257
+ distanceToPoint(point: Vector2): number;
239
258
  /**
240
- * @description 获取基础属性的 JSON 对象,转换为普通对象(用于序列化)
241
- * @returns 普通对象
259
+ * 二维包围盒求交集
260
+ * @param {Box2} box 二维包围盒
261
+ * @returns {Box2} 求交结果
242
262
  */
243
- toJSON(): Record<string, any>;
263
+ intersect(box: Box2): this;
264
+ /**
265
+ * 二维包围盒求并集
266
+ * @param {Box2} box 二维包围盒
267
+ * @returns {Box2} 求并结果
268
+ */
269
+ union(target: Box2 | Vector2): this;
270
+ /**
271
+ * 二维包围盒位移
272
+ * @param {Vector2} offset 位移向量
273
+ * @returns {Box2} 位移结果
274
+ */
275
+ translate(offset: Vector2): this;
276
+ scale(scalar: number | Vector2, anchor?: Vector2): this;
277
+ /**
278
+ * 二维包围盒判等
279
+ * @param {Box2} box 二维包围盒
280
+ * @returns {boolean} 判等结果
281
+ */
282
+ equals(box: Box2): boolean;
283
+ /**
284
+ * 判断二维包围盒相交关系(if this intersect other)
285
+ * @param {Box2} box 二维包围盒
286
+ * @param {boolean} [isOrthogonal=true] 正交判断(当前包围盒)
287
+ * @returns {boolean} 相交判断结果
288
+ */
289
+ intersectsBox(box: Box2, isOrthogonal?: boolean): boolean;
290
+ rotate(angle: number, center?: Vector2): this;
244
291
  }
245
- /**
246
- * @description 类型守卫函数:检查对象是否是 BaseItem
247
- * @param obj 要检查的对象
248
- * @returns 是否是 BaseItem 实例
249
- */
250
- declare function isBaseItem(obj: any): obj is BaseItem;
251
292
 
293
+ type SizeAdaptDirection = 'x' | 'y';
294
+
295
+ declare const MEDIA_TYPE: {
296
+ readonly APNG: "APNG";
297
+ readonly MP4: "MP4";
298
+ readonly WebM: "WebM";
299
+ readonly Images: "Images";
300
+ readonly WebP: "WebP";
301
+ readonly GIF: "GIF";
302
+ readonly AlphaMaskVideo: "AlphaMaskVideo";
303
+ };
252
304
  /**
253
- * @description 图片元素 SDKItem 类
254
- * @description 支持属性扩展
305
+ * GIF 压缩参数
306
+ * 核心通过参数 flags + palettegen + paletteuse 实现
307
+ * highest: lanczos + max_colors=256 + dither=bayer
308
+ * high: bicubic + max_colors=200 + dither=bayer
309
+ * medium: bilinear + max_colors=64 + dither=bayer
310
+ * low: neighbor + max_colors=32 + dither=none
255
311
  */
256
- declare class SpriteItem extends BaseItem {
312
+ declare const GIF_QUALITY_TO_FFMPEG_ARGS: {
313
+ highest: string;
314
+ high: string;
315
+ medium: string;
316
+ low: string;
317
+ };
318
+
319
+ declare global {
320
+ interface Window {
321
+ /**
322
+ * @description 创建 WebP Core 实例
323
+ */
324
+ createWebPCore: (config: any) => Promise<Img2WebPCore>;
325
+ }
326
+ }
327
+ type FileBuffer = ArrayBuffer | Uint8Array;
328
+ type MediaType = typeof MEDIA_TYPE[keyof typeof MEDIA_TYPE];
329
+ type FS = {
330
+ writeFile: (path: string, data: Uint8Array | string) => void;
331
+ readFile(path: string, opts: {
332
+ encoding: 'binary';
333
+ flags?: string | undefined;
334
+ }): Uint8Array;
335
+ readFile(path: string, opts: {
336
+ encoding: 'utf8';
337
+ flags?: string | undefined;
338
+ }): string;
339
+ readFile(path: string, opts?: {
340
+ flags?: string | undefined;
341
+ }): Uint8Array;
342
+ unlink: (path: string) => void;
343
+ quit: () => void;
344
+ };
345
+ type Pointer = number;
346
+ type Img2WebPCore = {
347
+ FS: FS;
348
+ run: (...args: string[]) => number;
349
+ cwrap: (ident: string, returnType: string, argTypes: string[]) => ((argc: number, argv: Pointer) => number);
350
+ _malloc: (size: number) => Pointer;
351
+ writeAsciiToMemory: (str: string, buffer: number, dontAddNull?: boolean) => void;
352
+ setValue: (ptr: number, value: any, type: string, noSafe?: boolean) => void;
353
+ };
354
+ type ExportMediaInitOptions = {
257
355
  /**
258
- * @description 元素类型
356
+ * 导出类型
259
357
  */
260
- readonly type = SDKItemType.SPRITE;
358
+ mediaType: MediaType;
261
359
  /**
262
- * @description 元素属性
360
+ * 额外画布,导出透明视频时使用
263
361
  */
264
- property: SpriteItemProperty;
265
- constructor(options: SpriteItemOptions);
362
+ extraCanvas?: HTMLCanvasElement | null;
266
363
  /**
267
- * @description 图片地址
364
+ * 是否打印转码过程中的日志,仅在导出 MP4/AlphaMaskVideo 时有效, 默认 false
365
+ * 供开发调试使用
268
366
  */
269
- get image(): string;
270
- set image(value: string);
367
+ loggerInTranscoding?: boolean;
271
368
  /**
272
- * @description 位置
369
+ * ffmpeg 转码是否开启多线程,默认 false,确保环境支持 SharedArrayBuffer
273
370
  */
274
- get position(): [number, number];
275
- set position(value: [number, number]);
276
- get width(): number;
277
- set width(value: number);
278
- get height(): number;
279
- set height(value: number);
371
+ multiThreading?: boolean;
280
372
  /**
281
- * @description 旋转(二维旋转角度)
373
+ * 是否输出 buffer,默认 false
282
374
  */
283
- get rotation(): number;
284
- set rotation(value: number);
375
+ isOutputBuffer?: boolean;
376
+ };
377
+ type MP4Config = {
285
378
  /**
286
- * @description 完整旋转(包含 x, y, z)
379
+ * @description MP4 导出时是否需要导出最后一帧 PNG
287
380
  */
288
- get fullRotation(): [number, number, number];
289
- set fullRotation(value: [number, number, number]);
381
+ isExportLastFrameJPEG?: boolean;
382
+ };
383
+ type GifConfig = {
290
384
  /**
291
- * @description 是否正在编辑关键属性
292
- * @deprecated 该属性即将废弃,使用 isCoreEditable 代替
385
+ * @description GIF 导出时的帧率
293
386
  */
294
- get keyPropertyEditing(): boolean;
295
- set keyPropertyEditing(value: boolean);
387
+ fps?: number;
296
388
  /**
297
- * @description 转换为 CreateInfo
298
- * @param withParent 是否包含父节点ID
389
+ * @description GIF 导出时的缩放比例
390
+ * 默认 '-1:-1', 表示不缩放
391
+ * 例如 '100:-1', 表示宽度 100,高度自动
392
+ * 例如 '-1:100', 表示宽度自动,高度 100
299
393
  */
300
- toCreateInfo(withParent?: boolean): SpriteCreateInfo;
394
+ scale?: string;
301
395
  /**
302
- * @description 克隆 SDKItem
396
+ * @description GIF 导出时的质量
397
+ * 默认 'highest'
398
+ * 可选 'highest', 'high', 'medium', 'low'
303
399
  */
304
- clone(): SpriteItem;
400
+ quality?: keyof typeof GIF_QUALITY_TO_FFMPEG_ARGS;
401
+ };
402
+ type ApngConfig = {
305
403
  /**
306
- * @description 创建包含扩展属性的 CreateInfo
307
- * @param withParent 是否包含父节点ID
308
- * @param extraProps 额外的属性
404
+ * @description APNG 导出时的帧率
309
405
  */
310
- toCreateInfoWithExtensions(withParent?: boolean, extraProps?: Record<string, any>): SpriteCreateInfo;
311
- }
312
- /**
313
- * @description 类型守卫:检查是否是 SpriteItem
314
- */
315
- declare function isSpriteItem(obj: any): obj is SpriteItem;
316
-
317
- /**
318
- * @description 文本元素 SDKItem 类
319
- * @description 支持属性扩展
320
- */
321
- declare class TextItem extends BaseItem {
406
+ fps?: number;
322
407
  /**
323
- * @description 元素类型
408
+ * @description APNG 导出时的缩放比例
409
+ * 默认 '-1:-1', 表示不缩放
410
+ * 例如 '100:-1', 表示宽度 100,高度自动
411
+ * 例如 '-1:100', 表示宽度自动,高度 100
324
412
  */
325
- readonly type = SDKItemType.TEXT;
413
+ scale?: string;
326
414
  /**
327
- * @description 元素属性
415
+ * @description APNG 导出时的质量
416
+ * 默认 'highest'
417
+ * 可选 'highest', 'high', 'medium', 'low'
328
418
  */
329
- property: TextItemProperty;
330
- constructor(options: TextItemOptions);
419
+ quality?: keyof typeof GIF_QUALITY_TO_FFMPEG_ARGS;
420
+ };
421
+ type ExportMediaItemOptions = {
331
422
  /**
332
- * @description 文本内容
423
+ * 尺寸
333
424
  */
334
- get text(): string;
335
- set text(value: string);
425
+ size: [number, number];
336
426
  /**
337
- * @description 字体名称
427
+ * 动效资源
338
428
  */
339
- get fontFamily(): string;
340
- set fontFamily(value: string);
429
+ scene: spec.JSONScene;
341
430
  /**
342
- * @description 字号
431
+ * 视频时长,目前仅在导出 MP4 / AlphaMaskVideo 时有效,默认取动效资源时长
343
432
  */
344
- get fontSize(): number;
345
- set fontSize(value: number);
433
+ time?: number;
346
434
  /**
347
- * @description 字重
435
+ * 是否生成音轨,默认 false,仅在导出 MP4 时有效
348
436
  */
349
- get fontWeight(): spec.TextWeight;
350
- set fontWeight(value: spec.TextWeight);
437
+ audioEnable?: boolean;
351
438
  /**
352
- * @description 字体样式
439
+ * 帧率, 默认 30
353
440
  */
354
- get fontStyle(): spec.FontStyle;
355
- set fontStyle(value: spec.FontStyle);
441
+ fps?: number;
356
442
  /**
357
- * @description 文本对齐方式
443
+ * 是否循环,默认 true
358
444
  */
359
- get textAlign(): spec.TextAlignment;
360
- set textAlign(value: spec.TextAlignment);
445
+ loop?: boolean;
361
446
  /**
362
- * @description 文本颜色 [r, g, b, a]
447
+ * 视频背景颜色,默认 #000000
363
448
  */
364
- get color(): [number, number, number, number];
365
- set color(value: [number, number, number, number]);
449
+ backgroundColor?: string;
366
450
  /**
367
- * @description 文本宽度
451
+ * 导出 MP4 时,设置的导出配置
368
452
  */
369
- get width(): number;
370
- set width(value: number);
453
+ mp4Config?: MP4Config;
371
454
  /**
372
- * @description 行高
455
+ * 导出 GIF 时,设置的导出配置
373
456
  */
374
- get lineHeight(): number;
375
- set lineHeight(value: number);
457
+ gifConfig?: GifConfig;
376
458
  /**
377
- * @description 文本高度
459
+ * 导出 APNG 时,设置的导出配置
378
460
  */
379
- get height(): number;
380
- set height(value: number);
461
+ apngConfig?: ApngConfig;
462
+ };
463
+ type ExportMediaItemDownloadInfo = {
381
464
  /**
382
- * @description 描边颜色
465
+ * @description 导出文件夹名称
383
466
  */
384
- get outlineColor(): spec.vec4 | undefined;
385
- set outlineColor(value: spec.vec4 | undefined);
467
+ folderName: string;
386
468
  /**
387
- * @description 描边宽度
469
+ * @description 导出视频名称
388
470
  */
389
- get outlineWidth(): number | undefined;
390
- set outlineWidth(value: number | undefined);
471
+ name: string;
472
+ };
473
+ type ExportItemParams = ExportMediaItemOptions & ExportMediaItemDownloadInfo;
474
+ type ExportParams = ExportItemParams[];
475
+ type Buffers = FileBuffer[] | undefined;
476
+ type Extras = (FileBuffer | null)[] | null | undefined;
477
+
478
+ /**
479
+ * @description SDKItem 基础选项接口
480
+ * @description 支持扩展属性,允许添加任意额外属性
481
+ */
482
+ type SDKItemOptions = {
391
483
  /**
392
- * @description 描边开关
484
+ * @description 元素ID
393
485
  */
394
- get outlineEnabled(): boolean;
395
- set outlineEnabled(value: boolean);
486
+ id: string;
396
487
  /**
397
- * @description 位置
488
+ * @description 元素名称
398
489
  */
399
- get position(): [number, number];
400
- set position(value: [number, number]);
490
+ name: string;
401
491
  /**
402
- * @description 旋转(二维旋转角度)
492
+ * @description 父节点ID
403
493
  */
404
- get rotation(): number;
405
- set rotation(value: number);
494
+ parentId?: string;
406
495
  /**
407
- * @description 转换为 CreateInfo
408
- * @param withParent 是否包含父节点ID
496
+ * @description 子元素ID列表
409
497
  */
410
- toCreateInfo(withParent?: boolean): TextCreateInfo;
498
+ children?: string[];
411
499
  /**
412
- * @description 克隆 SDKItem
500
+ * @description 元素生命周期
413
501
  */
414
- clone(): TextItem;
415
- }
502
+ duration?: number;
503
+ /**
504
+ * @description 元素生命周期延时
505
+ */
506
+ delay?: number;
507
+ /**
508
+ * @description 可视状态
509
+ */
510
+ visible?: boolean;
511
+ /**
512
+ * @description 元素结束行为
513
+ */
514
+ endBehavior?: spec.EndBehavior;
515
+ /**
516
+ * @description 是否处于锁定状态
517
+ */
518
+ isLocked?: boolean;
519
+ /**
520
+ * @description 关键属性是否可编辑
521
+ */
522
+ isCoreEditable: boolean;
523
+ /**
524
+ * @description 扩展属性存储(属性名 -> 属性值)
525
+ */
526
+ extension?: Record<string, any>;
527
+ /**
528
+ * @description 允许任意额外属性(用于兼容旧代码)
529
+ */
530
+ [extraProp: string]: any;
531
+ };
416
532
  /**
417
- * @description 类型守卫:检查是否是 TextItem
533
+ * @description Sprite SDKItem 选项
418
534
  */
419
- declare function isTextItem(obj: any): obj is TextItem;
420
-
535
+ type SpriteItemOptions = SDKItemOptions & {
536
+ /**
537
+ * @description 元素属性
538
+ */
539
+ property?: Partial<SpriteItemProperty>;
540
+ };
421
541
  /**
422
- * @description 视频元素 SDKItem
423
- * @description 支持属性扩展
542
+ * @description Text SDKItem 选项
424
543
  */
425
- declare class VideoItem extends BaseItem {
544
+ type TextItemOptions = SDKItemOptions & {
426
545
  /**
427
- * @description 元素类型
546
+ * @description 元素属性
428
547
  */
429
- readonly type = SDKItemType.VIDEO;
548
+ property?: Partial<TextItemProperty>;
549
+ };
550
+ /**
551
+ * @description Video SDKItem 选项
552
+ */
553
+ type VideoItemOptions = SDKItemOptions & {
430
554
  /**
431
555
  * @description 元素属性
432
556
  */
433
- property: VideoItemProperty;
434
- constructor(options: VideoItemOptions);
557
+ property?: Partial<VideoItemProperty>;
558
+ };
559
+ /**
560
+ * @description Group SDKItem 选项(空节点/组)
561
+ */
562
+ type GroupItemOptions = SDKItemOptions & {
435
563
  /**
436
- * @description 视频地址
564
+ * @description 元素属性
437
565
  */
438
- get video(): string;
439
- set video(value: string);
566
+ property?: Partial<GroupItemProperty>;
567
+ };
568
+ /**
569
+ * @description Generator SDKItem 选项(资源生成器)
570
+ * @description 支持 image 和 video 两种生成器类型
571
+ * @description 使用 GeneratorItemProperty 包含 generatorType
572
+ */
573
+ type GeneratorItemOptions = SDKItemOptions & {
440
574
  /**
441
- * @description 位置
575
+ * @description 元素属性(包含 generatorType)
442
576
  */
443
- get position(): [number, number];
444
- set position(value: [number, number]);
577
+ property?: Partial<GeneratorItemProperty>;
578
+ };
579
+ type EffectsItemOptions = SDKItemOptions & {
580
+ property?: Partial<EffectsItemProperty>;
581
+ };
582
+ /**
583
+ * @description Frame 画板元素 SDKItem 选项
584
+ */
585
+ type FrameItemOptions = SDKItemOptions & {
445
586
  /**
446
- * @description 宽度
587
+ * @description 元素属性
447
588
  */
448
- get width(): number;
449
- set width(value: number);
589
+ property?: Partial<FrameItemProperty>;
590
+ };
591
+ /**
592
+ * @description SDKItem 类型(独立于 spec.ItemType)
593
+ * @description 包含所有 SDK 层级的元素类型,包括虚拟类型如 generator
594
+ */
595
+ declare enum SDKItemType {
596
+ SPRITE = "sprite",
597
+ TEXT = "text",
598
+ VIDEO = "video",
599
+ GROUP = "group",
600
+ GENERATOR = "generator",
601
+ EFFECTS = "effects",
602
+ FRAME = "frame"
603
+ }
604
+
605
+ /**
606
+ * @description SDKItem 抽象基类
607
+ * @description 支持属性扩展,允许添加任意自定义属性
608
+ */
609
+ declare abstract class BaseItem {
450
610
  /**
451
- * @description 高度
611
+ * @description 元素ID
452
612
  */
453
- get height(): number;
454
- set height(value: number);
613
+ id: string;
455
614
  /**
456
- * @description 旋转(二维旋转角度)
615
+ * @description 元素名称
616
+ */
617
+ name: string;
618
+ /**
619
+ * @description 父节点ID
620
+ */
621
+ parentId?: string;
622
+ /**
623
+ * @description 元素生命周期
624
+ */
625
+ duration: number;
626
+ /**
627
+ * @description 元素生命周期延时
457
628
  */
458
- get rotation(): number;
459
- set rotation(value: number);
629
+ delay: number;
460
630
  /**
461
- * @description 完整旋转(包含 x, y, z)
631
+ * @description 元素结束行为
462
632
  */
463
- get fullRotation(): [number, number, number];
464
- set fullRotation(value: [number, number, number]);
633
+ endBehavior: spec.EndBehavior;
465
634
  /**
466
- * @description 是否正在编辑关键属性
467
- * @deprecated 该属性即将废弃,使用 isCoreEditable 代替
635
+ * @description 是否可见
468
636
  */
469
- get keyPropertyEditing(): boolean;
470
- set keyPropertyEditing(value: boolean);
637
+ visible: boolean;
471
638
  /**
472
- * @description 是否静音
639
+ * @description 是否处于锁定状态
473
640
  */
474
- get muted(): boolean;
475
- set muted(state: boolean);
641
+ isLocked: boolean;
476
642
  /**
477
- * @description 是否为透明视频
643
+ * @description 核心数据是否支持编辑
478
644
  */
479
- get transparent(): boolean;
480
- set transparent(state: boolean);
645
+ isCoreEditable: boolean;
481
646
  /**
482
- * @description 播放音量
647
+ * @description 扩展属性存储(与 property 同级)
483
648
  */
484
- get volume(): number;
485
- set volume(value: number);
649
+ extension: Map<string, any>;
486
650
  /**
487
- * @description 播放速率
651
+ * @description 元素类型(由子类实现)
652
+ * @description 支持 spec.ItemType 或扩展的 SDKItemType
488
653
  */
489
- get playbackRate(): number;
490
- set playbackRate(value: number);
654
+ abstract readonly type: SDKItemType;
491
655
  /**
492
- * @description 转换为 CreateInfo
493
- * @param withParent 是否包含父节点ID
656
+ * @description 元素属性(由子类实现)
494
657
  */
495
- toCreateInfo(withParent?: boolean): VideoCreateInfo;
658
+ abstract readonly property: BaseItemProperty;
659
+ constructor(options: SDKItemOptions);
496
660
  /**
497
- * @description 克隆 SDKItem
661
+ * @description 设置扩展属性
662
+ * @param key 属性名
663
+ * @param value 属性值
498
664
  */
499
- clone(): VideoItem;
500
- }
501
- /**
502
- * @description 类型守卫:检查是否是 VideoItem
503
- */
504
- declare function isVideoItem(obj: any): obj is VideoItem;
505
-
506
- /**
507
- * @description 空节点/组 SDKItem 类
508
- * @description 支持属性扩展
509
- */
510
- declare class GroupItem extends BaseItem {
665
+ setExtension(key: string, value: any): void;
511
666
  /**
512
- * @description 元素类型
667
+ * @description 获取扩展属性
668
+ * @param key 属性名
669
+ * @returns 属性值
513
670
  */
514
- readonly type = SDKItemType.GROUP;
671
+ getExtension(key: string): any;
515
672
  /**
516
- * @description 元素属性
673
+ * @description 检查是否存在指定扩展属性
674
+ * @param key 属性名
675
+ * @returns 是否存在
517
676
  */
518
- property: GroupItemProperty;
519
- constructor(options: GroupItemOptions);
677
+ hasExtension(key: string): boolean;
520
678
  /**
521
- * @description 位置
679
+ * @description 删除扩展属性
680
+ * @param key 属性名
681
+ * @returns 是否删除成功
522
682
  */
523
- get position(): [number, number];
524
- set position(value: [number, number]);
683
+ deleteExtension(key: string): boolean;
525
684
  /**
526
- * @description 大小
685
+ * @description 获取所有扩展属性的键名列表
686
+ * @returns 键名数组
527
687
  */
528
- get scale(): [number, number];
529
- set scale(value: [number, number]);
688
+ getExtensionKeys(): string[];
530
689
  /**
531
- * @description 旋转(二维旋转角度)
690
+ * @description 获取所有扩展属性
691
+ * @returns 扩展属性对象
532
692
  */
533
- get rotation(): number;
534
- set rotation(value: number);
693
+ getAllExtension(): Record<string, any>;
535
694
  /**
536
- * @description 完整旋转(包含 x, y, z)
695
+ * @description 批量设置扩展属性
696
+ * @param extensions 扩展属性对象
537
697
  */
538
- get fullRotation(): [number, number, number];
539
- set fullRotation(value: [number, number, number]);
698
+ setExtensions(extensions: Record<string, any>): void;
540
699
  /**
541
- * @description 是否正在编辑关键属性
542
- * @deprecated 该属性即将废弃,使用 isCoreEditable 代替
700
+ * @description 清空所有扩展属性
543
701
  */
544
- get keyPropertyEditing(): boolean;
545
- set keyPropertyEditing(value: boolean);
702
+ clearExtension(): void;
546
703
  /**
547
- * @description 转换为 CreateInfo
704
+ * @description 转换为 CreateInfo(用于元素复制/导出)
548
705
  * @param withParent 是否包含父节点ID
706
+ * @returns CreateInfo 对象
549
707
  */
550
- toCreateInfo(withParent?: boolean): GroupCreateInfo;
708
+ abstract toCreateInfo(withParent?: boolean): ItemCreateInfo;
551
709
  /**
552
710
  * @description 克隆 SDKItem
711
+ * @returns 新的 SDKItem 实例
553
712
  */
554
- clone(): GroupItem;
713
+ abstract clone(): BaseItem;
714
+ /**
715
+ * @description 获取基础属性的 JSON 对象,转换为普通对象(用于序列化)
716
+ * @returns 普通对象
717
+ */
718
+ toJSON(): Record<string, any>;
555
719
  }
556
720
  /**
557
- * @description 类型守卫:检查是否是 GroupItem
721
+ * @description 类型守卫函数:检查对象是否是 BaseItem
722
+ * @param obj 要检查的对象
723
+ * @returns 是否是 BaseItem 实例
558
724
  */
559
- declare function isGroupItem(obj: any): obj is GroupItem;
725
+ declare function isBaseItem(obj: any): obj is BaseItem;
560
726
 
561
727
  /**
562
- * @description 资源生成器元素 SDKItem 类
563
- * @description 支持 image 和 video 两种生成器类型
564
- * @description 在 Player 中以透明 SpriteItem 形式渲染
565
- * @description 支持属性扩展,可转换为 SpriteItem 或 VideoItem
728
+ * @description 图片元素 SDKItem 类
729
+ * @description 支持属性扩展
566
730
  */
567
- declare class GeneratorItem extends BaseItem {
568
- /**
569
- * @description 元素类型(独立类型,不属于 spec.ItemType)
570
- */
571
- readonly type = SDKItemType.GENERATOR;
731
+ declare class SpriteItem extends BaseItem {
572
732
  /**
573
- * @description 元素属性(包含 generatorType)
733
+ * @description 元素类型
574
734
  */
575
- property: GeneratorItemProperty;
576
- constructor(options: GeneratorItemOptions);
735
+ readonly type = SDKItemType.SPRITE;
577
736
  /**
578
- * @description 生成器类型
737
+ * @description 元素属性
579
738
  */
580
- get generatorType(): 'image' | 'video';
581
- set generatorType(value: 'image' | 'video');
739
+ property: SpriteItemProperty;
740
+ constructor(options: SpriteItemOptions);
582
741
  /**
583
- * @description 图片地址(生成器返回空)
742
+ * @description 图片地址
584
743
  */
585
744
  get image(): string;
586
- set image(_value: string);
745
+ set image(value: string);
587
746
  /**
588
747
  * @description 位置
589
748
  */
590
749
  get position(): [number, number];
591
750
  set position(value: [number, number]);
592
- /**
593
- * @description 宽度
594
- */
595
751
  get width(): number;
596
752
  set width(value: number);
597
- /**
598
- * @description 高度
599
- */
600
753
  get height(): number;
601
754
  set height(value: number);
602
755
  /**
@@ -616,120 +769,149 @@ declare class GeneratorItem extends BaseItem {
616
769
  get keyPropertyEditing(): boolean;
617
770
  set keyPropertyEditing(value: boolean);
618
771
  /**
619
- * @description 转换为 GeneratorCreateInfo
772
+ * @description 转换为 CreateInfo
620
773
  * @param withParent 是否包含父节点ID
621
774
  */
622
- toCreateInfo(withParent?: boolean): GeneratorCreateInfo;
775
+ toCreateInfo(withParent?: boolean): SpriteCreateInfo;
623
776
  /**
624
- * @description 转换为 VideoCreateInfo(用于转换为视频元素)
625
- * @param videoUrl 视频资源地址
626
- * @param withParent 是否包含父节点ID
777
+ * @description 克隆 SDKItem
627
778
  */
628
- toVideoCreateInfo(videoUrl: string, withParent?: boolean): VideoCreateInfo;
779
+ clone(): SpriteItem;
629
780
  /**
630
- * @description 转换为 SpriteCreateInfo(用于转换为图片元素)
631
- * @param imageUrl 图片资源地址
781
+ * @description 创建包含扩展属性的 CreateInfo
632
782
  * @param withParent 是否包含父节点ID
783
+ * @param extraProps 额外的属性
633
784
  */
634
- toSpriteCreateInfo(imageUrl: string, withParent?: boolean): SpriteCreateInfo;
635
- /**
636
- * @description 克隆 SDKItem
637
- */
638
- clone(): GeneratorItem;
785
+ toCreateInfoWithExtensions(withParent?: boolean, extraProps?: Record<string, any>): SpriteCreateInfo;
639
786
  }
640
787
  /**
641
- * @description 类型守卫:检查是否是 GeneratorItem
788
+ * @description 类型守卫:检查是否是 SpriteItem
642
789
  */
643
- declare function isGeneratorItem(obj: any): obj is GeneratorItem;
790
+ declare function isSpriteItem(obj: any): obj is SpriteItem;
644
791
 
645
792
  /**
646
- * @description 特效产物 元素 SDKItem 类
793
+ * @description 文本元素 SDKItem 类
794
+ * @description 支持属性扩展
647
795
  */
648
- declare class EffectsItem extends BaseItem {
796
+ declare class TextItem extends BaseItem {
649
797
  /**
650
- * @description 元素类型(独立类型,不属于 spec.ItemType)
798
+ * @description 元素类型
651
799
  */
652
- readonly type = SDKItemType.EFFECTS;
800
+ readonly type = SDKItemType.TEXT;
653
801
  /**
654
802
  * @description 元素属性
655
803
  */
656
- property: EffectsItemProperty;
657
- constructor(options: EffectsItemOptions);
804
+ property: TextItemProperty;
805
+ constructor(options: TextItemOptions);
658
806
  /**
659
- * @description 特效资源地址
807
+ * @description 文本内容
660
808
  */
661
- get effects(): string;
662
- set effects(value: string);
809
+ get text(): string;
810
+ set text(value: string);
663
811
  /**
664
- * @description 位置
812
+ * @description 字体名称
665
813
  */
666
- get position(): [number, number];
667
- set position(value: [number, number]);
814
+ get fontFamily(): string;
815
+ set fontFamily(value: string);
668
816
  /**
669
- * @description 宽度
817
+ * @description 字号
818
+ */
819
+ get fontSize(): number;
820
+ set fontSize(value: number);
821
+ /**
822
+ * @description 字重
823
+ */
824
+ get fontWeight(): spec.TextWeight;
825
+ set fontWeight(value: spec.TextWeight);
826
+ /**
827
+ * @description 字体样式
828
+ */
829
+ get fontStyle(): spec.FontStyle;
830
+ set fontStyle(value: spec.FontStyle);
831
+ /**
832
+ * @description 文本对齐方式
833
+ */
834
+ get textAlign(): spec.TextAlignment;
835
+ set textAlign(value: spec.TextAlignment);
836
+ /**
837
+ * @description 文本颜色 [r, g, b, a]
838
+ */
839
+ get color(): [number, number, number, number];
840
+ set color(value: [number, number, number, number]);
841
+ /**
842
+ * @description 文本宽度
670
843
  */
671
844
  get width(): number;
672
845
  set width(value: number);
673
846
  /**
674
- * @description 高度
847
+ * @description 行高
848
+ */
849
+ get lineHeight(): number;
850
+ set lineHeight(value: number);
851
+ /**
852
+ * @description 文本高度
675
853
  */
676
854
  get height(): number;
677
855
  set height(value: number);
678
856
  /**
679
- * @description 旋转(二维旋转角度)
857
+ * @description 描边颜色
680
858
  */
681
- get rotation(): number;
682
- set rotation(value: number);
859
+ get outlineColor(): spec.vec4 | undefined;
860
+ set outlineColor(value: spec.vec4 | undefined);
683
861
  /**
684
- * @description 完整旋转(包含 x, y, z)
862
+ * @description 描边宽度
685
863
  */
686
- get fullRotation(): [number, number, number];
687
- set fullRotation(value: [number, number, number]);
864
+ get outlineWidth(): number | undefined;
865
+ set outlineWidth(value: number | undefined);
866
+ /**
867
+ * @description 描边开关
868
+ */
869
+ get outlineEnabled(): boolean;
870
+ set outlineEnabled(value: boolean);
871
+ /**
872
+ * @description 位置
873
+ */
874
+ get position(): [number, number];
875
+ set position(value: [number, number]);
688
876
  /**
689
- * @description 是否正在编辑关键属性
690
- * @deprecated 该属性即将废弃,使用 isCoreEditable 代替
877
+ * @description 旋转(二维旋转角度)
691
878
  */
692
- get keyPropertyEditing(): boolean;
693
- set keyPropertyEditing(value: boolean);
879
+ get rotation(): number;
880
+ set rotation(value: number);
694
881
  /**
695
- * @description 转换为 EffectsCreateInfo
882
+ * @description 转换为 CreateInfo
696
883
  * @param withParent 是否包含父节点ID
697
884
  */
698
- toCreateInfo(withParent?: boolean): EffectsCreateInfo;
885
+ toCreateInfo(withParent?: boolean): TextCreateInfo;
699
886
  /**
700
887
  * @description 克隆 SDKItem
701
888
  */
702
- clone(): EffectsItem;
889
+ clone(): TextItem;
703
890
  }
704
891
  /**
705
- * @description 类型守卫:检查是否是 EffectsItem
892
+ * @description 类型守卫:检查是否是 TextItem
706
893
  */
707
- declare function isEffectsItem(obj: any): obj is EffectsItem;
894
+ declare function isTextItem(obj: any): obj is TextItem;
708
895
 
709
896
  /**
710
- * @description 画板/框架元素 SDKItem 类
711
- * @description 支持自动布局和自由布局两种模式
712
- * @description 底层以 composition 形式渲染
897
+ * @description 视频元素 SDKItem 类
898
+ * @description 支持属性扩展
713
899
  */
714
- declare class FrameItem extends BaseItem {
900
+ declare class VideoItem extends BaseItem {
715
901
  /**
716
902
  * @description 元素类型
717
903
  */
718
- readonly type = SDKItemType.FRAME;
904
+ readonly type = SDKItemType.VIDEO;
719
905
  /**
720
906
  * @description 元素属性
721
907
  */
722
- property: FrameItemProperty;
723
- constructor(options: FrameItemOptions);
724
- /**
725
- * @description 子元素ID列表(只读)
726
- */
727
- get children(): readonly string[];
908
+ property: VideoItemProperty;
909
+ constructor(options: VideoItemOptions);
728
910
  /**
729
- * @description 布局模式
911
+ * @description 视频地址
730
912
  */
731
- get layoutMode(): FrameLayoutMode;
732
- set layoutMode(value: FrameLayoutMode);
913
+ get video(): string;
914
+ set video(value: string);
733
915
  /**
734
916
  * @description 位置
735
917
  */
@@ -745,11 +927,6 @@ declare class FrameItem extends BaseItem {
745
927
  */
746
928
  get height(): number;
747
929
  set height(value: number);
748
- /**
749
- * @description 缩放
750
- */
751
- get scale(): [number, number];
752
- set scale(value: [number, number]);
753
930
  /**
754
931
  * @description 旋转(二维旋转角度)
755
932
  */
@@ -761,535 +938,369 @@ declare class FrameItem extends BaseItem {
761
938
  get fullRotation(): [number, number, number];
762
939
  set fullRotation(value: [number, number, number]);
763
940
  /**
764
- * @description 添加子元素
765
- * @param itemId 子元素ID
766
- * @returns 是否添加成功
767
- */
768
- addChild(itemId: string): boolean;
769
- /**
770
- * @description 批量添加子元素
771
- * @param itemIds 子元素ID列表
941
+ * @description 是否正在编辑关键属性
942
+ * @deprecated 该属性即将废弃,使用 isCoreEditable 代替
772
943
  */
773
- addChildren(itemIds: string[]): void;
944
+ get keyPropertyEditing(): boolean;
945
+ set keyPropertyEditing(value: boolean);
774
946
  /**
775
- * @description 移除子元素
776
- * @param itemId 子元素ID
777
- * @returns 是否移除成功
947
+ * @description 是否静音
778
948
  */
779
- removeChild(itemId: string): boolean;
949
+ get muted(): boolean;
950
+ set muted(state: boolean);
780
951
  /**
781
- * @description 批量移除子元素
782
- * @param itemIds 子元素ID列表
952
+ * @description 是否为透明视频
783
953
  */
784
- removeChildren(itemIds: string[]): void;
954
+ get transparent(): boolean;
955
+ set transparent(state: boolean);
785
956
  /**
786
- * @description 是否包含指定子元素
787
- * @param itemId 子元素ID
957
+ * @description 播放音量
788
958
  */
789
- hasChild(itemId: string): boolean;
959
+ get volume(): number;
960
+ set volume(value: number);
790
961
  /**
791
- * @description 清空所有子元素
962
+ * @description 播放速率
792
963
  */
793
- clearChildren(): void;
964
+ get playbackRate(): number;
965
+ set playbackRate(value: number);
794
966
  /**
795
- * @description 转换为 FrameCreateInfo
967
+ * @description 转换为 CreateInfo
796
968
  * @param withParent 是否包含父节点ID
797
969
  */
798
- toCreateInfo(withParent?: boolean): FrameCreateInfo;
970
+ toCreateInfo(withParent?: boolean): VideoCreateInfo;
799
971
  /**
800
972
  * @description 克隆 SDKItem
801
973
  */
802
- clone(): FrameItem;
974
+ clone(): VideoItem;
803
975
  }
804
976
  /**
805
- * @description 类型守卫:检查是否是 FrameItem
806
- */
807
- declare function isFrameItem(obj: any): obj is FrameItem;
808
-
809
- /**
810
- * @description 根据 item type 创建对应的 SDKItem 实例
811
- * @param type 元素类型
812
- * @param options SDKItem 选项
813
- * @returns SDKItem 实例
814
- */
815
- declare function createSDKItem(type: spec.ItemType, options: SDKItemOptions): BaseItem;
816
- /**
817
- * @description SDKItem 类型联合
818
- * @description 用于替换原来的 SDKItem type
819
- */
820
- type SDKItem$1 = SpriteItem | TextItem | VideoItem | GroupItem | GeneratorItem | EffectsItem | FrameItem;
821
-
822
- /**
823
- * @class 二维线段
977
+ * @description 类型守卫:检查是否是 VideoItem
824
978
  */
825
- declare class Line2 {
826
- start: Vector2;
827
- end: Vector2;
828
- constructor(start?: Vector2, end?: Vector2);
829
- /**
830
- * 设置二维线段
831
- * @param {Vector2} start 线段起点
832
- * @param {Vector2} end 线段终点
833
- * @returns {Line2} 二维线段
834
- */
835
- set(start: Vector2, end: Vector2): this;
836
- /**
837
- * 复制二维线段
838
- * @param {Line2} line 复制对象
839
- * @returns {Line2} 复制结果
840
- */
841
- copyFrom(line: Line2): this;
842
- /**
843
- * 二维线段求方向
844
- * @returns {Vector2} 二维线段方向
845
- */
846
- direction(): Vector2;
847
- /**
848
- * 二维线段求中点
849
- * @param {Vector2} [target=new Vector2()] 目标保存对象
850
- * @returns {Vector2} 二维线段中点
851
- */
852
- getCenter(target?: Vector2): Vector2;
853
- /**
854
- * 二维线段向量值
855
- * @param {Vector2} [target=new Vector2()] 目标保存对象
856
- * @returns {Vector2} 二维线段向量值
857
- */
858
- delta(target?: Vector2): Vector2;
859
- /**
860
- * 二维线段欧式距离平方(应用于计算)
861
- * @returns {number} 计算结果
862
- */
863
- distanceSq(): number;
864
- /**
865
- * 二维线段欧式距离
866
- * @returns {number} 计算结果
867
- */
868
- distance(): number;
869
- /**
870
- * 求二维线段比例点
871
- * @param {number} t 比例值
872
- * @param {Vector2} target 目标保存对象
873
- * @returns {Vector2} 比例点结果
874
- */
875
- at(t: number, target?: Vector2): Vector2;
876
- /**
877
- * 求点与线段的最短距离
878
- * @param {Vector2} point 二维空间点
879
- * @param {boolean} clampToLine 是否限制于线段内
880
- * @returns {number} 距离结果
881
- */
882
- closestPointToPointParameter(point: Vector2, clampToLine: boolean): number;
883
- /**
884
- * 求点与线段的最近交点
885
- * @param {Vector2} point 二维空间点
886
- * @param {boolean} clampToLine 是否限制于线段内
887
- * @param {Vector2} target 目标保存对象
888
- * @returns {Vector2} 最近交点
889
- */
890
- closestPointToPoint(point: Vector2, clampToLine: boolean, target?: Vector2): Vector2;
891
- /**
892
- * 二维线段判等
893
- * @param {Line2} line 二维线段
894
- * @returns {boolean} 判等结果
895
- */
896
- equals(line: Line2): boolean;
897
- /**
898
- * 克隆二维线段
899
- * @returns {Line2} 克隆结果
900
- */
901
- clone(): Line2;
902
- /**
903
- * 二维线段求长度
904
- * @returns {number} 长度
905
- */
906
- length(): number;
907
- /**
908
- * 二维线段判断相交
909
- * @param {Line2} other 二维线段
910
- * @returns {boolean} 相交判断结果
911
- */
912
- crossWithLine(other: Line2): boolean;
913
- }
914
-
915
- declare class Vector2 extends math.Vector2 {
916
- subtract(other: Vector2): this;
917
- toViewCoordinate(width: number, height: number): this;
918
- clone(): Vector2;
919
- distanceTo(other: Vector2): number;
920
- scaleByCenter(scalar: Vector2, anchor?: Vector2): this;
921
- round(precision?: number): this;
922
- /**
923
- * 点到直线的最短距离
924
- * @returns {{d: number, t: number}} d表示距离,t表示最近点在直线的比例
925
- */
926
- distanceToLine(line: Line2): {
927
- d: number;
928
- t: number;
929
- };
930
- /**
931
- * 二维向量与x轴夹角
932
- * @returns {number} 弧度值
933
- */
934
- angle(): number;
935
- /**
936
- * 二维点绕点旋转
937
- * @param {Vec2} center 旋转中心
938
- * @param {number} angle 旋转角度
939
- * @returns {Vec2} 旋转结果
940
- */
941
- rotateAround(center: Vector2, angle: number): this;
942
- }
979
+ declare function isVideoItem(obj: any): obj is VideoItem;
943
980
 
944
981
  /**
945
- * @class 二维包围盒
982
+ * @description 空节点/组 SDKItem 类
983
+ * @description 支持属性扩展
946
984
  */
947
- declare class Box2 {
948
- /**
949
- * @member {Vector2[]} corners 二维包围盒角点
950
- */
951
- corners: Vector2[];
952
- min: Vector2;
953
- max: Vector2;
954
- /**
955
- * 构造函数,传入值为空时表示空包围盒
956
- * @param {Vector2} [min=new Vector2(Infinity, Infinity)] 最小点
957
- * @param {Vector2} [max=new Vector2(-Infinity, -Infinity)] 最大点
958
- */
959
- constructor(min?: Vector2, max?: Vector2);
960
- /**
961
- * 通过最大最小点设置二维包围盒
962
- * @param {Vector2} min 最小点
963
- * @param {Vector2} max 最大点
964
- * @returns {Box2} 二维包围盒
965
- */
966
- set(min: Vector2, max: Vector2): this;
967
- /**
968
- * 通过角点设置二维包围盒
969
- * @param {Vector2[]} vecArray 二维空间点数组
970
- * @returns {Box2} 二维包围盒
985
+ declare class GroupItem extends BaseItem {
986
+ /**
987
+ * @description 元素类型
971
988
  */
972
- setFromVec2Array(vecArray: Vector2[]): this;
989
+ readonly type = SDKItemType.GROUP;
973
990
  /**
974
- * 通过屏幕坐标点设置二维包围盒 - 点为屏幕坐标点,x正方向为右,y正方向为向上
975
- * @param vecArray 屏幕坐标点
991
+ * @description 元素属性
976
992
  */
977
- setFromVec2ArrayWithOutCorners(vecArray: Vector2[]): this;
993
+ property: GroupItemProperty;
994
+ constructor(options: GroupItemOptions);
978
995
  /**
979
- * 通过中心与大小设置二维包围盒
980
- * @param {Vector2} center 二维中心点
981
- * @param {Vector2} size 二维大小
982
- * @returns {Box2} 二维包围盒
996
+ * @description 位置
983
997
  */
984
- setFromCenterAndSize(center: Vector2, size: Vector2): this;
998
+ get position(): [number, number];
999
+ set position(value: [number, number]);
985
1000
  /**
986
- * 克隆二维包围盒
987
- * @returns {Box2} 克隆结果
1001
+ * @description 大小
988
1002
  */
989
- clone(): Box2;
1003
+ get scale(): [number, number];
1004
+ set scale(value: [number, number]);
990
1005
  /**
991
- * 复制二维包围盒
992
- * @param {Box2} box 二维包围盒
993
- * @returns {Box2} 复制结果
1006
+ * @description 旋转(二维旋转角度)
994
1007
  */
995
- copyFrom(box: Box2): this;
1008
+ get rotation(): number;
1009
+ set rotation(value: number);
996
1010
  /**
997
- * 二维包围盒置空
998
- * @returns {Box2} 置空结果
1011
+ * @description 完整旋转(包含 x, y, z)
999
1012
  */
1000
- makeEmpty(): this;
1013
+ get fullRotation(): [number, number, number];
1014
+ set fullRotation(value: [number, number, number]);
1001
1015
  /**
1002
- * 二维包围盒判空
1003
- * @returns {boolean} 判空结果
1016
+ * @description 是否正在编辑关键属性
1017
+ * @deprecated 该属性即将废弃,使用 isCoreEditable 代替
1004
1018
  */
1005
- isEmpty(): boolean;
1019
+ get keyPropertyEditing(): boolean;
1020
+ set keyPropertyEditing(value: boolean);
1006
1021
  /**
1007
- * 获取二维包围盒角点
1008
- * @returns {Vector2[]} 二维包围盒角点
1022
+ * @description 转换为 CreateInfo
1023
+ * @param withParent 是否包含父节点ID
1009
1024
  */
1010
- getCorners(): Vector2[];
1025
+ toCreateInfo(withParent?: boolean): GroupCreateInfo;
1011
1026
  /**
1012
- * 获取二维包围盒中心点
1013
- * @param {Vector2} [target=new Vector2()] 目标点(用以存放二维包围盒中心点)
1014
- * @returns {Vector2} 二维包围盒中心点
1027
+ * @description 克隆 SDKItem
1015
1028
  */
1016
- getCenter(target?: Vector2): Vector2;
1029
+ clone(): GroupItem;
1030
+ }
1031
+ /**
1032
+ * @description 类型守卫:检查是否是 GroupItem
1033
+ */
1034
+ declare function isGroupItem(obj: any): obj is GroupItem;
1035
+
1036
+ /**
1037
+ * @description 资源生成器元素 SDKItem 类
1038
+ * @description 支持 image 和 video 两种生成器类型
1039
+ * @description 在 Player 中以透明 SpriteItem 形式渲染
1040
+ * @description 支持属性扩展,可转换为 SpriteItem 或 VideoItem
1041
+ */
1042
+ declare class GeneratorItem extends BaseItem {
1017
1043
  /**
1018
- * 获取二维包围盒大小
1019
- * @param {Vector2} [target=new Vector2()] 目标向量(用以存放二维包围盒大小)
1020
- * @returns {Vector2} 二维包围盒大小
1044
+ * @description 元素类型(独立类型,不属于 spec.ItemType)
1021
1045
  */
1022
- getSize(target?: Vector2): Vector2;
1046
+ readonly type = SDKItemType.GENERATOR;
1023
1047
  /**
1024
- * 通过二维空间点扩展二维包围盒
1025
- * @param {Vector2} point 二维空间点
1026
- * @returns {Box2} 扩展包围盒
1048
+ * @description 元素属性(包含 generatorType)
1027
1049
  */
1028
- expandByPoint(point: Vector2): this;
1050
+ property: GeneratorItemProperty;
1051
+ constructor(options: GeneratorItemOptions);
1029
1052
  /**
1030
- * 通过向量扩展二维包围盒
1031
- * @param {Vector2} vector 二维向量
1032
- * @returns {Box2} 扩展结果
1053
+ * @description 生成器类型
1033
1054
  */
1034
- expandByVector(vector: Vector2): this;
1055
+ get generatorType(): 'image' | 'video';
1056
+ set generatorType(value: 'image' | 'video');
1035
1057
  /**
1036
- * 通过大小扩展二维包围盒
1037
- * @param {number} scalar 扩展大小
1038
- * @returns {Box2} 扩展结果
1058
+ * @description 图片地址(生成器返回空)
1039
1059
  */
1040
- expandByScalar(scalar: number): this;
1060
+ get image(): string;
1061
+ set image(_value: string);
1041
1062
  /**
1042
- * 判断二维包围盒是否包含二维空间点
1043
- * @param {Vector2} point 二维空间点
1044
- * @param {boolean} [isOrthogonal=true] 包围盒正交判断(默认为true)
1045
- * @returns {boolean} 点包含判断结果
1063
+ * @description 位置
1046
1064
  */
1047
- containsPoint(point: Vector2, isOrthogonal?: boolean): boolean;
1065
+ get position(): [number, number];
1066
+ set position(value: [number, number]);
1048
1067
  /**
1049
- * 判断二维包围盒包含关系(if this contains other)
1050
- * @param {Box2} box 其它包围盒
1051
- * @returns {boolean} 二维包围盒包含判断结果
1068
+ * @description 宽度
1052
1069
  */
1053
- containsBox(box: Box2): boolean;
1070
+ get width(): number;
1071
+ set width(value: number);
1054
1072
  /**
1055
- * 获取点以包围盒左上角顶点为原点的相对位置
1056
- * @param {Vector2} point 指定二维空间点
1057
- * @param {Vector2} [target=new Vector2()] 目标空间点
1058
- * @returns {Vector2} 计算结果空间点
1073
+ * @description 高度
1059
1074
  */
1060
- getParameter(point: Vector2, target?: Vector2): Vector2;
1075
+ get height(): number;
1076
+ set height(value: number);
1061
1077
  /**
1062
- * 求点与二维包围盒的最近点
1063
- * @param {Vector2} point 二维空间点
1064
- * @param {Vector2} [target=new Vector2()] 结果点
1065
- * @returns {Vector2} 二维空间点
1078
+ * @description 旋转(二维旋转角度)
1066
1079
  */
1067
- clampPoint(point: Vector2, target?: Vector2): Vector2;
1080
+ get rotation(): number;
1081
+ set rotation(value: number);
1068
1082
  /**
1069
- * 求点到二维包围盒的距离
1070
- * @param {Vector2} point 二维空间点
1071
- * @returns {number} 距离
1083
+ * @description 完整旋转(包含 x, y, z)
1072
1084
  */
1073
- distanceToPoint(point: Vector2): number;
1085
+ get fullRotation(): [number, number, number];
1086
+ set fullRotation(value: [number, number, number]);
1074
1087
  /**
1075
- * 二维包围盒求交集
1076
- * @param {Box2} box 二维包围盒
1077
- * @returns {Box2} 求交结果
1088
+ * @description 是否正在编辑关键属性
1089
+ * @deprecated 该属性即将废弃,使用 isCoreEditable 代替
1078
1090
  */
1079
- intersect(box: Box2): this;
1091
+ get keyPropertyEditing(): boolean;
1092
+ set keyPropertyEditing(value: boolean);
1080
1093
  /**
1081
- * 二维包围盒求并集
1082
- * @param {Box2} box 二维包围盒
1083
- * @returns {Box2} 求并结果
1094
+ * @description 转换为 GeneratorCreateInfo
1095
+ * @param withParent 是否包含父节点ID
1084
1096
  */
1085
- union(target: Box2 | Vector2): this;
1097
+ toCreateInfo(withParent?: boolean): GeneratorCreateInfo;
1086
1098
  /**
1087
- * 二维包围盒位移
1088
- * @param {Vector2} offset 位移向量
1089
- * @returns {Box2} 位移结果
1099
+ * @description 转换为 VideoCreateInfo(用于转换为视频元素)
1100
+ * @param videoUrl 视频资源地址
1101
+ * @param withParent 是否包含父节点ID
1090
1102
  */
1091
- translate(offset: Vector2): this;
1092
- scale(scalar: number | Vector2, anchor?: Vector2): this;
1103
+ toVideoCreateInfo(videoUrl: string, withParent?: boolean): VideoCreateInfo;
1093
1104
  /**
1094
- * 二维包围盒判等
1095
- * @param {Box2} box 二维包围盒
1096
- * @returns {boolean} 判等结果
1105
+ * @description 转换为 SpriteCreateInfo(用于转换为图片元素)
1106
+ * @param imageUrl 图片资源地址
1107
+ * @param withParent 是否包含父节点ID
1097
1108
  */
1098
- equals(box: Box2): boolean;
1109
+ toSpriteCreateInfo(imageUrl: string, withParent?: boolean): SpriteCreateInfo;
1099
1110
  /**
1100
- * 判断二维包围盒相交关系(if this intersect other)
1101
- * @param {Box2} box 二维包围盒
1102
- * @param {boolean} [isOrthogonal=true] 正交判断(当前包围盒)
1103
- * @returns {boolean} 相交判断结果
1111
+ * @description 克隆 SDKItem
1104
1112
  */
1105
- intersectsBox(box: Box2, isOrthogonal?: boolean): boolean;
1106
- rotate(angle: number, center?: Vector2): this;
1113
+ clone(): GeneratorItem;
1107
1114
  }
1108
-
1109
- type SizeAdaptDirection = 'x' | 'y';
1110
-
1111
- declare const MEDIA_TYPE: {
1112
- readonly APNG: "APNG";
1113
- readonly MP4: "MP4";
1114
- readonly WebM: "WebM";
1115
- readonly Images: "Images";
1116
- readonly WebP: "WebP";
1117
- readonly GIF: "GIF";
1118
- readonly AlphaMaskVideo: "AlphaMaskVideo";
1119
- };
1120
1115
  /**
1121
- * GIF 压缩参数
1122
- * 核心通过参数 flags + palettegen + paletteuse 实现
1123
- * highest: lanczos + max_colors=256 + dither=bayer
1124
- * high: bicubic + max_colors=200 + dither=bayer
1125
- * medium: bilinear + max_colors=64 + dither=bayer
1126
- * low: neighbor + max_colors=32 + dither=none
1116
+ * @description 类型守卫:检查是否是 GeneratorItem
1127
1117
  */
1128
- declare const GIF_QUALITY_TO_FFMPEG_ARGS: {
1129
- highest: string;
1130
- high: string;
1131
- medium: string;
1132
- low: string;
1133
- };
1118
+ declare function isGeneratorItem(obj: any): obj is GeneratorItem;
1134
1119
 
1135
- declare global {
1136
- interface Window {
1137
- /**
1138
- * @description 创建 WebP Core 实例
1139
- */
1140
- createWebPCore: (config: any) => Promise<Img2WebPCore>;
1141
- }
1142
- }
1143
- type FileBuffer = ArrayBuffer | Uint8Array;
1144
- type MediaType = typeof MEDIA_TYPE[keyof typeof MEDIA_TYPE];
1145
- type FS = {
1146
- writeFile: (path: string, data: Uint8Array | string) => void;
1147
- readFile(path: string, opts: {
1148
- encoding: 'binary';
1149
- flags?: string | undefined;
1150
- }): Uint8Array;
1151
- readFile(path: string, opts: {
1152
- encoding: 'utf8';
1153
- flags?: string | undefined;
1154
- }): string;
1155
- readFile(path: string, opts?: {
1156
- flags?: string | undefined;
1157
- }): Uint8Array;
1158
- unlink: (path: string) => void;
1159
- quit: () => void;
1160
- };
1161
- type Pointer = number;
1162
- type Img2WebPCore = {
1163
- FS: FS;
1164
- run: (...args: string[]) => number;
1165
- cwrap: (ident: string, returnType: string, argTypes: string[]) => ((argc: number, argv: Pointer) => number);
1166
- _malloc: (size: number) => Pointer;
1167
- writeAsciiToMemory: (str: string, buffer: number, dontAddNull?: boolean) => void;
1168
- setValue: (ptr: number, value: any, type: string, noSafe?: boolean) => void;
1169
- };
1170
- type ExportMediaInitOptions = {
1120
+ /**
1121
+ * @description 特效产物 元素 SDKItem 类
1122
+ */
1123
+ declare class EffectsItem extends BaseItem {
1124
+ /**
1125
+ * @description 元素类型(独立类型,不属于 spec.ItemType)
1126
+ */
1127
+ readonly type = SDKItemType.EFFECTS;
1128
+ /**
1129
+ * @description 预合成元素ID
1130
+ */
1131
+ subCompositionItemId: string;
1132
+ /**
1133
+ * @description 元素属性
1134
+ */
1135
+ property: EffectsItemProperty;
1136
+ constructor(options: EffectsItemOptions);
1137
+ /**
1138
+ * @description 特效资源地址
1139
+ */
1140
+ get effects(): string;
1141
+ set effects(value: string);
1171
1142
  /**
1172
- * 导出类型
1143
+ * @description 位置
1173
1144
  */
1174
- mediaType: MediaType;
1145
+ get position(): [number, number];
1146
+ set position(value: [number, number]);
1175
1147
  /**
1176
- * 额外画布,导出透明视频时使用
1148
+ * @description 宽度
1177
1149
  */
1178
- extraCanvas?: HTMLCanvasElement | null;
1150
+ get width(): number;
1151
+ set width(value: number);
1179
1152
  /**
1180
- * 是否打印转码过程中的日志,仅在导出 MP4/AlphaMaskVideo 时有效, 默认 false
1181
- * 供开发调试使用
1153
+ * @description 高度
1182
1154
  */
1183
- loggerInTranscoding?: boolean;
1155
+ get height(): number;
1156
+ set height(value: number);
1184
1157
  /**
1185
- * ffmpeg 转码是否开启多线程,默认 false,确保环境支持 SharedArrayBuffer
1158
+ * @description 旋转(二维旋转角度)
1186
1159
  */
1187
- multiThreading?: boolean;
1160
+ get rotation(): number;
1161
+ set rotation(value: number);
1188
1162
  /**
1189
- * 是否输出 buffer,默认 false
1163
+ * @description 完整旋转(包含 x, y, z)
1190
1164
  */
1191
- isOutputBuffer?: boolean;
1192
- };
1193
- type MP4Config = {
1165
+ get fullRotation(): [number, number, number];
1166
+ set fullRotation(value: [number, number, number]);
1194
1167
  /**
1195
- * @description MP4 导出时是否需要导出最后一帧 PNG
1168
+ * @description 是否正在编辑关键属性
1169
+ * @deprecated 该属性即将废弃,使用 isCoreEditable 代替
1196
1170
  */
1197
- isExportLastFrameJPEG?: boolean;
1198
- };
1199
- type GifConfig = {
1171
+ get keyPropertyEditing(): boolean;
1172
+ set keyPropertyEditing(value: boolean);
1200
1173
  /**
1201
- * @description GIF 导出时的帧率
1174
+ * @description 转换为 EffectsCreateInfo
1175
+ * @param withParent 是否包含父节点ID
1202
1176
  */
1203
- fps?: number;
1177
+ toCreateInfo(withParent?: boolean): EffectsCreateInfo;
1204
1178
  /**
1205
- * @description GIF 导出时的缩放比例
1206
- * 默认 '-1:-1', 表示不缩放
1207
- * 例如 '100:-1', 表示宽度 100,高度自动
1208
- * 例如 '-1:100', 表示宽度自动,高度 100
1179
+ * @description 克隆 SDKItem
1209
1180
  */
1210
- scale?: string;
1181
+ clone(): EffectsItem;
1182
+ }
1183
+ /**
1184
+ * @description 类型守卫:检查是否是 EffectsItem
1185
+ */
1186
+ declare function isEffectsItem(obj: any): obj is EffectsItem;
1187
+
1188
+ /**
1189
+ * @description 画板/框架元素 SDKItem 类
1190
+ * @description 支持自动布局和自由布局两种模式
1191
+ * @description 底层以 composition 形式渲染
1192
+ */
1193
+ declare class FrameItem extends BaseItem {
1211
1194
  /**
1212
- * @description GIF 导出时的质量
1213
- * 默认 'highest'
1214
- * 可选 'highest', 'high', 'medium', 'low'
1195
+ * @description 元素类型
1215
1196
  */
1216
- quality?: keyof typeof GIF_QUALITY_TO_FFMPEG_ARGS;
1217
- };
1218
- type ApngConfig = {
1197
+ readonly type = SDKItemType.FRAME;
1219
1198
  /**
1220
- * @description APNG 导出时的帧率
1199
+ * @description 预合成元素ID
1221
1200
  */
1222
- fps?: number;
1201
+ subCompositionItemId: string;
1223
1202
  /**
1224
- * @description APNG 导出时的缩放比例
1225
- * 默认 '-1:-1', 表示不缩放
1226
- * 例如 '100:-1', 表示宽度 100,高度自动
1227
- * 例如 '-1:100', 表示宽度自动,高度 100
1203
+ * @description 元素属性
1228
1204
  */
1229
- scale?: string;
1205
+ property: FrameItemProperty;
1206
+ constructor(options: FrameItemOptions);
1230
1207
  /**
1231
- * @description APNG 导出时的质量
1232
- * 默认 'highest'
1233
- * 可选 'highest', 'high', 'medium', 'low'
1208
+ * @description 子元素ID列表(只读)
1234
1209
  */
1235
- quality?: keyof typeof GIF_QUALITY_TO_FFMPEG_ARGS;
1236
- };
1237
- type ExportMediaItemOptions = {
1210
+ get children(): readonly string[];
1238
1211
  /**
1239
- * 尺寸
1212
+ * @description 布局模式
1240
1213
  */
1241
- size: [number, number];
1214
+ get layoutMode(): FrameLayoutMode;
1215
+ set layoutMode(value: FrameLayoutMode);
1242
1216
  /**
1243
- * 动效资源
1217
+ * @description 位置
1244
1218
  */
1245
- scene: spec.JSONScene;
1219
+ get position(): [number, number];
1220
+ set position(value: [number, number]);
1246
1221
  /**
1247
- * 视频时长,目前仅在导出 MP4 / AlphaMaskVideo 时有效,默认取动效资源时长
1222
+ * @description 宽度
1248
1223
  */
1249
- time?: number;
1224
+ get width(): number;
1225
+ set width(value: number);
1250
1226
  /**
1251
- * 是否生成音轨,默认 false,仅在导出 MP4 时有效
1227
+ * @description 高度
1252
1228
  */
1253
- audioEnable?: boolean;
1229
+ get height(): number;
1230
+ set height(value: number);
1254
1231
  /**
1255
- * 帧率, 默认 30
1232
+ * @description 缩放
1256
1233
  */
1257
- fps?: number;
1234
+ get scale(): [number, number];
1235
+ set scale(value: [number, number]);
1258
1236
  /**
1259
- * 是否循环,默认 true
1237
+ * @description 旋转(二维旋转角度)
1260
1238
  */
1261
- loop?: boolean;
1239
+ get rotation(): number;
1240
+ set rotation(value: number);
1262
1241
  /**
1263
- * 视频背景颜色,默认 #000000
1242
+ * @description 完整旋转(包含 x, y, z)
1264
1243
  */
1265
- backgroundColor?: string;
1244
+ get fullRotation(): [number, number, number];
1245
+ set fullRotation(value: [number, number, number]);
1266
1246
  /**
1267
- * 导出 MP4 时,设置的导出配置
1247
+ * @description 添加子元素
1248
+ * @param itemId 子元素ID
1249
+ * @returns 是否添加成功
1268
1250
  */
1269
- mp4Config?: MP4Config;
1251
+ addChild(itemId: string): boolean;
1270
1252
  /**
1271
- * 导出 GIF 时,设置的导出配置
1253
+ * @description 批量添加子元素
1254
+ * @param itemIds 子元素ID列表
1272
1255
  */
1273
- gifConfig?: GifConfig;
1256
+ addChildren(itemIds: string[]): void;
1274
1257
  /**
1275
- * 导出 APNG 时,设置的导出配置
1258
+ * @description 移除子元素
1259
+ * @param itemId 子元素ID
1260
+ * @returns 是否移除成功
1276
1261
  */
1277
- apngConfig?: ApngConfig;
1278
- };
1279
- type ExportMediaItemDownloadInfo = {
1262
+ removeChild(itemId: string): boolean;
1280
1263
  /**
1281
- * @description 导出文件夹名称
1264
+ * @description 批量移除子元素
1265
+ * @param itemIds 子元素ID列表
1282
1266
  */
1283
- folderName: string;
1267
+ removeChildren(itemIds: string[]): void;
1284
1268
  /**
1285
- * @description 导出视频名称
1269
+ * @description 是否包含指定子元素
1270
+ * @param itemId 子元素ID
1286
1271
  */
1287
- name: string;
1288
- };
1289
- type ExportItemParams = ExportMediaItemOptions & ExportMediaItemDownloadInfo;
1290
- type ExportParams = ExportItemParams[];
1291
- type Buffers = FileBuffer[] | undefined;
1292
- type Extras = (FileBuffer | null)[] | null | undefined;
1272
+ hasChild(itemId: string): boolean;
1273
+ /**
1274
+ * @description 清空所有子元素
1275
+ */
1276
+ clearChildren(): void;
1277
+ /**
1278
+ * @description 转换为 FrameCreateInfo
1279
+ * @param withParent 是否包含父节点ID
1280
+ */
1281
+ toCreateInfo(withParent?: boolean): FrameCreateInfo;
1282
+ /**
1283
+ * @description 克隆 SDKItem
1284
+ */
1285
+ clone(): FrameItem;
1286
+ }
1287
+ /**
1288
+ * @description 类型守卫:检查是否是 FrameItem
1289
+ */
1290
+ declare function isFrameItem(obj: any): obj is FrameItem;
1291
+
1292
+ /**
1293
+ * @description 根据 item type 创建对应的 SDKItem 实例
1294
+ * @param type 元素类型
1295
+ * @param options SDKItem 选项
1296
+ * @returns SDKItem 实例
1297
+ */
1298
+ declare function createSDKItem(type: spec.ItemType, options: SDKItemOptions): BaseItem;
1299
+ /**
1300
+ * @description SDKItem 类型联合
1301
+ * @description 用于替换原来的 SDKItem type
1302
+ */
1303
+ type SDKItem = SpriteItem | TextItem | VideoItem | GroupItem | GeneratorItem | EffectsItem | FrameItem;
1293
1304
 
1294
1305
  type BaseItemProperty = {
1295
1306
  position: [number, number];
@@ -1319,6 +1330,10 @@ type TextItemProperty = BaseItemProperty & {
1319
1330
  * @description 描边开关
1320
1331
  */
1321
1332
  outlineEnabled?: boolean;
1333
+ /**
1334
+ * @description 文本字间距
1335
+ */
1336
+ letterSpacing?: number;
1322
1337
  fontUrl?: string;
1323
1338
  };
1324
1339
  type VideoItemProperty = BaseItemProperty & {
@@ -1351,6 +1366,7 @@ type GeneratorItemProperty = BaseItemProperty & {
1351
1366
  };
1352
1367
  type EffectsItemProperty = BaseItemProperty & {
1353
1368
  effects: string;
1369
+ children?: string[];
1354
1370
  };
1355
1371
  /**
1356
1372
  * @description Frame 画板元素布局模式
@@ -1670,13 +1686,6 @@ type ActiveData = {
1670
1686
  */
1671
1687
  loadingItems?: string[];
1672
1688
  };
1673
- /**
1674
- * @description 视图元素
1675
- * @description 注意:SDKItem 现在已从类实现中导入,见 view-item/index.ts
1676
- * @description SDKItem 现在是类实例而非普通对象,支持属性扩展
1677
- * @description 保持类型兼容性:新 SDKItem 类拥有与旧类型相同的属性
1678
- */
1679
- type SDKItem = SDKItem$1;
1680
1689
  type SDKBackgroundType = 'color' | 'image' | 'chess-board' | 'dot-board';
1681
1690
  /**
1682
1691
  * @description 图层创建信息
@@ -1706,7 +1715,7 @@ type SpriteCreateInfo = {
1706
1715
  /**
1707
1716
  * @description 图片资源地址 | 数据
1708
1717
  */
1709
- image: string;
1718
+ image?: string;
1710
1719
  /**
1711
1720
  * @description 图层像素宽度
1712
1721
  */
@@ -1865,6 +1874,10 @@ type TextCreateInfo = {
1865
1874
  * @description 字体文件地址
1866
1875
  */
1867
1876
  fontUrl?: string;
1877
+ /**
1878
+ * @description 文本字间距
1879
+ */
1880
+ letterSpacing?: number;
1868
1881
  };
1869
1882
  };
1870
1883
  /**
@@ -1895,7 +1908,7 @@ type VideoCreateInfo = {
1895
1908
  /**
1896
1909
  * @description 视频资源地址 | 数据
1897
1910
  */
1898
- video: string;
1911
+ video?: string;
1899
1912
  /**
1900
1913
  * @description 视频元素像素宽度
1901
1914
  */
@@ -2092,7 +2105,7 @@ type EffectsCreateInfo = {
2092
2105
  /**
2093
2106
  * @description 动效资源地址
2094
2107
  */
2095
- effects: string | spec.JSONScene;
2108
+ effects: string;
2096
2109
  };
2097
2110
  /**
2098
2111
  * @description 扩展属性
@@ -2147,6 +2160,10 @@ type FrameCreateInfo = {
2147
2160
  * @description 布局模式: 'auto' | 'free'
2148
2161
  */
2149
2162
  layoutMode?: FrameLayoutMode;
2163
+ /**
2164
+ * @description 子元素序号
2165
+ */
2166
+ children: string[];
2150
2167
  };
2151
2168
  /**
2152
2169
  * @description 扩展属性
@@ -2209,6 +2226,14 @@ type UpdateOperation = {
2209
2226
  oldData: ItemCreateInfo[];
2210
2227
  };
2211
2228
  type Operation = CreateOperation | UpdateOperation | DeleteOperation;
2229
+ /**
2230
+ * 通用撤销重做操作类型
2231
+ */
2232
+ type GizmoOperation<T> = {
2233
+ type: 'update';
2234
+ newData: T;
2235
+ oldData: T;
2236
+ };
2212
2237
  declare class UndoRedo {
2213
2238
  private index;
2214
2239
  private operations;
@@ -2332,6 +2357,7 @@ type ExportConfig = {
2332
2357
  */
2333
2358
  type ScreenShotConfig = {
2334
2359
  enabled: boolean;
2360
+ defaultBackgroundColor: [number, number, number, number];
2335
2361
  };
2336
2362
  /**
2337
2363
  * @description 尺寸自适应功能配置
@@ -2491,6 +2517,14 @@ type TransformGizmoConfig = {
2491
2517
  * @description 视频Logo地址
2492
2518
  */
2493
2519
  videoLogoUrl: string;
2520
+ /**
2521
+ * @description 画板Logo地址
2522
+ */
2523
+ frameLogoUrl: string;
2524
+ /**
2525
+ * @description 特效Logo地址
2526
+ */
2527
+ effectsLogoUrl: string;
2494
2528
  /**
2495
2529
  * @description 大小文字颜色
2496
2530
  */
@@ -2757,6 +2791,10 @@ type MaskGizmoConfig = {
2757
2791
  * @description 蒙版透明度
2758
2792
  */
2759
2793
  maskAlpha: number;
2794
+ /**
2795
+ * @description 蒙版图片
2796
+ */
2797
+ maskImage?: HTMLImageElement;
2760
2798
  /**
2761
2799
  * @description 元素包围盒线框宽度
2762
2800
  */
@@ -2910,8 +2948,41 @@ type ItemCreateGizmoConfig = {
2910
2948
  * @description 填充透明度
2911
2949
  */
2912
2950
  frameFillAlpha: number;
2951
+ /**
2952
+ * @description 选中子元素包围盒透明度
2953
+ */
2954
+ frameChildBoxAlpha: number;
2955
+ /**
2956
+ * @description 选中子元素包围盒颜色
2957
+ */
2958
+ frameChildBoxColor: number;
2913
2959
  };
2914
2960
 
2961
+ /**
2962
+ * @description 图片蒙版工具结果
2963
+ */
2964
+ type MaskResult = {
2965
+ /**
2966
+ * @description 状态
2967
+ */
2968
+ status: 'init' | 'done';
2969
+ /**
2970
+ * @description 包围盒
2971
+ */
2972
+ box?: Box2;
2973
+ /**
2974
+ * @description 鼠标位置
2975
+ */
2976
+ point?: Vector2;
2977
+ /**
2978
+ * @description 蒙版线条列表
2979
+ */
2980
+ lines: {
2981
+ brushSize: number;
2982
+ points: Vector2[];
2983
+ type?: 'paint' | 'erase';
2984
+ }[];
2985
+ };
2915
2986
  /**
2916
2987
  * @description 精准改字功能初始化信息
2917
2988
  */
@@ -2955,6 +3026,35 @@ declare module '@pixi/graphics' {
2955
3026
  }
2956
3027
  }
2957
3028
 
3029
+ type LoadingGizmoTip = {
3030
+ text: string;
3031
+ fontSize?: number;
3032
+ fontFamily?: string;
3033
+ color?: number;
3034
+ };
3035
+ type LoadingGizmoItemOptions = {
3036
+ /** Loading 提示文案 */
3037
+ tip?: LoadingGizmoTip;
3038
+ /** 指定 Loading 区域 */
3039
+ loadingBox?: Box2;
3040
+ /** 清理选中 */
3041
+ clearSelected?: boolean;
3042
+ };
3043
+
3044
+ /**
3045
+ * 蒙版工具的撤销重做数据类型
3046
+ */
3047
+ type MaskUndoRedoData = {
3048
+ lines: MaskResult['lines'];
3049
+ };
3050
+
3051
+ /**
3052
+ * 图片裁切工具的撤销重做数据类型
3053
+ */
3054
+ type PictureCutUndoRedoData = {
3055
+ normalizeCutBox: Box2;
3056
+ };
3057
+
2958
3058
  type SDKEvents = {
2959
3059
  'loadingItemChange': [id: string[]];
2960
3060
  'selectedItemChange': [id: string[]];
@@ -2970,7 +3070,7 @@ type SDKEvents = {
2970
3070
  }];
2971
3071
  'itemPropertyChange': [{
2972
3072
  id: string;
2973
- property: string;
3073
+ propertyKeys: string[];
2974
3074
  }];
2975
3075
  'exportProgress': [progress?: number];
2976
3076
  'exportDone': [item: ExportItemParams | undefined, success: boolean, buffer?: FileBuffer];
@@ -2984,6 +3084,8 @@ type SDKEvents = {
2984
3084
  fontFamily: string;
2985
3085
  }];
2986
3086
  'undoRedoChange': [Operation];
3087
+ 'maskGizmoUndoRedoChange': [GizmoOperation<MaskUndoRedoData>];
3088
+ 'pictureCutGizmoUndoRedoChange': [GizmoOperation<PictureCutUndoRedoData>];
2987
3089
  'viewportTransform': [{
2988
3090
  zoom: number;
2989
3091
  translation: [number, number];
@@ -3031,7 +3133,7 @@ declare class SDK {
3031
3133
  get undoRedo(): UndoRedo;
3032
3134
  private get exportOptions();
3033
3135
  dispose(): void;
3034
- on: <E extends "progress" | "loadingItemChange" | "selectedItemChange" | "preSelectedItemChange" | "selectedViewChange" | "pageDataChange" | "zoomChange" | "itemPropertyChange" | "exportProgress" | "exportDone" | "exportComplete" | "sdkConfigChange" | "cutBoxChange" | "expandBoxChange" | "textInput" | "undoRedoChange" | "viewportTransform" | "itemOnDragStart" | "itemOnDrag" | "itemOnDragEnd" | "spriteTextClick" | "videoPlay" | "itemCreate" | "viewLost" | "viewRebuildFinish">(eventName: E, listener: _galacean_effects.EventEmitterListener<SDKEvents[E]>, options?: _galacean_effects.EventEmitterOptions) => () => void;
3136
+ on: <E extends "progress" | "loadingItemChange" | "selectedItemChange" | "preSelectedItemChange" | "selectedViewChange" | "pageDataChange" | "zoomChange" | "itemPropertyChange" | "exportProgress" | "exportDone" | "exportComplete" | "sdkConfigChange" | "cutBoxChange" | "expandBoxChange" | "textInput" | "undoRedoChange" | "maskGizmoUndoRedoChange" | "pictureCutGizmoUndoRedoChange" | "viewportTransform" | "itemOnDragStart" | "itemOnDrag" | "itemOnDragEnd" | "spriteTextClick" | "videoPlay" | "itemCreate" | "viewLost" | "viewRebuildFinish">(eventName: E, listener: _galacean_effects.EventEmitterListener<SDKEvents[E]>, options?: _galacean_effects.EventEmitterOptions) => () => void;
3035
3137
  initPlayer(mode: SDKMode): void;
3036
3138
  setSDKMode(mode: SDKMode): void;
3037
3139
  private getInitParam;
@@ -3075,13 +3177,13 @@ declare class SDK {
3075
3177
  * @param id 元素ID
3076
3178
  * @returns 元素
3077
3179
  * */
3078
- getSDKItem(id: string): SDKItem$1 | undefined;
3180
+ getSDKItem(id: string): SDKItem | undefined;
3079
3181
  /**
3080
3182
  * @description 获取元素数组
3081
3183
  * @param id 元素ID数组
3082
3184
  * @returns 元素数组
3083
3185
  * */
3084
- getSDKItems(ids?: string[]): SDKItem$1[];
3186
+ getSDKItems(ids?: string[]): SDKItem[];
3085
3187
  setPlayState(playState: 'play' | 'pause'): Promise<void>;
3086
3188
  /**
3087
3189
  * @description 获取场景预览图
@@ -3246,7 +3348,54 @@ declare class SDK {
3246
3348
  * @param mode 模式类型:'paint' 表示涂抹,'erase' 表示擦除
3247
3349
  */
3248
3350
  setMaskGizmoMode(mode: 'paint' | 'erase'): void;
3249
- openLoadingGizmo(id: string, loadingBox?: Box2, clearResult?: boolean): void;
3351
+ /**
3352
+ * 撤销蒙版操作
3353
+ * @returns 是否成功撤销
3354
+ */
3355
+ undoMaskGizmo(): boolean;
3356
+ /**
3357
+ * 重做蒙版操作
3358
+ * @returns 是否成功重做
3359
+ */
3360
+ redoMaskGizmo(): boolean;
3361
+ /**
3362
+ * 检查蒙版是否可以撤销
3363
+ */
3364
+ get canUndoMaskGizmo(): boolean;
3365
+ /**
3366
+ * 检查蒙版是否可以重做
3367
+ */
3368
+ get canRedoMaskGizmo(): boolean;
3369
+ /**
3370
+ * 清空蒙版 undoRedo 历史
3371
+ */
3372
+ clearMaskGizmoUndoRedo(): void;
3373
+ /**
3374
+ * 撤销图片裁切操作
3375
+ * @returns 是否成功撤销
3376
+ */
3377
+ undoPictureCutGizmo(): boolean;
3378
+ /**
3379
+ * 重做图片裁切操作
3380
+ * @returns 是否成功重做
3381
+ */
3382
+ redoPictureCutGizmo(): boolean;
3383
+ /**
3384
+ * 检查图片裁切是否可以撤销
3385
+ */
3386
+ get canUndoPictureCutGizmo(): boolean;
3387
+ /**
3388
+ * 检查图片裁切是否可以重做
3389
+ */
3390
+ get canRedoPictureCutGizmo(): boolean;
3391
+ /**
3392
+ * 清空图片裁切 undoRedo 历史
3393
+ */
3394
+ clearPictureCutGizmoUndoRedo(): void;
3395
+ openLoadingGizmo(id: string, options?: LoadingGizmoItemOptions): void;
3396
+ updateLoadingGizmo(id: string, options: {
3397
+ tip?: LoadingGizmoTip;
3398
+ }): void;
3250
3399
  closeLoadingGizmo(id: string): void;
3251
3400
  /**
3252
3401
  * @description 元素打组
@@ -3261,6 +3410,7 @@ declare class SDK {
3261
3410
  getItemCreateInfo(id: string): ItemCreateInfo | undefined;
3262
3411
  getItemCreateInfos(ids?: string[]): ItemCreateInfo[];
3263
3412
  createScreenShotSceneByIds(idInfo: string | string[], time?: number): Promise<string | undefined>;
3413
+ createScreenShotByFrame(id: string): Promise<string | undefined>;
3264
3414
  getChildrenIds(id: string): string[];
3265
3415
  /**
3266
3416
  * @description 更新元素在图层中的顺序
@@ -3355,9 +3505,13 @@ declare class SDK {
3355
3505
  setSpriteTextEditState(id: string, index: number, isEditing: boolean): void;
3356
3506
  getVideoItemPlayTime(id: string): number;
3357
3507
  setVideoItemPlayTime(id: string, time: number): void;
3508
+ getEffectsItemPlayTime(id: string): number | undefined;
3509
+ setEffectsItemPlayTime(id: string, time: number): void;
3510
+ setEffectsResource(id: string, effects: string): void;
3358
3511
  getPixelPositionByViewPosition(viewPosition: Vector2): Vector2;
3359
3512
  hitTest(x: number, y: number): string[] | undefined;
3360
3513
  setInteractType(type: GestureHandlerInteractType): void;
3514
+ getInteractType(): GestureHandlerInteractType;
3361
3515
  makeItemAlign(type: AlignType, ids?: string[]): void;
3362
3516
  makeItemDistribute(type: DistributeType, ids?: string[]): void;
3363
3517
  /**
@@ -3367,7 +3521,7 @@ declare class SDK {
3367
3521
  */
3368
3522
  addGeneratorItem(createInfo: GeneratorCreateInfo): string;
3369
3523
  /**
3370
- * @description 创建动效元素(仅限调试使用)
3524
+ * @description 创建动效元素
3371
3525
  * @param effectsInfo 动效创建信息
3372
3526
  */
3373
3527
  addEffectsItem(effectsInfo: EffectsCreateInfo): Promise<string | undefined>;
@@ -3376,7 +3530,19 @@ declare class SDK {
3376
3530
  * @param createInfo 画板创建信息
3377
3531
  * @returns 画板元素ID
3378
3532
  */
3379
- addFrameItem(createInfo: FrameCreateInfo): string;
3533
+ addFrameItem(createInfo: FrameCreateInfo): Promise<string>;
3534
+ /**
3535
+ * @description 将元素移动到 Frame 中
3536
+ * @param itemIds 要移动的元素ID列表
3537
+ * @param frameId 目标 Frame ID
3538
+ */
3539
+ moveItemsToFrame(itemIds: string[], frameId: string): void;
3540
+ /**
3541
+ * @description 将元素从 Frame 中移出到主场景
3542
+ * @param itemIds 要移动的元素ID列表
3543
+ * @param frameId 源 Frame ID(可选,如果不传则从元素的 parentId 推断)
3544
+ */
3545
+ moveItemsOutOfFrame(itemIds: string[], frameId?: string): void;
3380
3546
  /**
3381
3547
  * @description 设置生成器资源,将生成器转换为对应的元素
3382
3548
  * @param id 生成器元素ID
@@ -3407,4 +3573,4 @@ declare class SDK {
3407
3573
  setSafeAreaPreviewVisible(id: number, type: 'url' | 'color', visible: boolean): void;
3408
3574
  }
3409
3575
 
3410
- export { type ActiveData, BaseItem, type BaseItemProperty, type BaseItemPropertyKey, type BaseItemPropertyValueMap, Box2, type CreateOperation, type DeleteOperation, type EffectsCreateInfo, EffectsItem, type EffectsItemOptions, type FrameCreateInfo, FrameItem, type FrameItemOptions, type FrameItemProperty, FrameLayoutMode, type GeneratorCreateInfo, GeneratorItem, type GeneratorItemOptions, type GeneratorItemProperty, type GizmoType, type GroupCreateInfo, GroupItem, type GroupItemOptions, type ItemCreateInfo, ItemOrderAction, type ItemPropertyMap, type Operation, type PageData, type PageProperty, SDK, type SDKEvents, type SDKInputParam, type SDKItem$1 as SDKItem, type SDKItemOptions, SDKItemType, type SDKOptions, type SetItemPropertyParam, type SetSingleItemMultiplePropertiesParam, type SetSingleItemSinglePropertyParam, type SpriteCreateInfo, SpriteItem, type SpriteItemOptions, type SpriteItemProperty, type TextCreateInfo, TextItem, type TextItemOptions, type TextItemProperty, type UpdateOperation, Vector2, type VideoCreateInfo, VideoItem, type VideoItemOptions, type VideoItemProperty, type ViewParam, type ViewProperty, createSDKItem, isBaseItem, isEffectsItem, isFrameItem, isGeneratorItem, isGroupItem, isSpriteItem, isTextItem, isVideoItem };
3576
+ export { type ActiveData, BaseItem, type BaseItemProperty, type BaseItemPropertyKey, type BaseItemPropertyValueMap, Box2, type CreateOperation, type DeleteOperation, type EffectsCreateInfo, EffectsItem, type EffectsItemOptions, type FrameCreateInfo, FrameItem, type FrameItemOptions, type FrameItemProperty, FrameLayoutMode, type GeneratorCreateInfo, GeneratorItem, type GeneratorItemOptions, type GeneratorItemProperty, type GizmoType, type GroupCreateInfo, GroupItem, type GroupItemOptions, type ItemCreateInfo, ItemOrderAction, type ItemPropertyMap, type Operation, type PageData, type PageProperty, SDK, type SDKEvents, type SDKInputParam, type SDKItem, type SDKItemOptions, SDKItemType, type SDKOptions, type SetItemPropertyParam, type SetSingleItemMultiplePropertiesParam, type SetSingleItemSinglePropertyParam, type SpriteCreateInfo, SpriteItem, type SpriteItemOptions, type SpriteItemProperty, type TextCreateInfo, TextItem, type TextItemOptions, type TextItemProperty, type UpdateOperation, Vector2, type VideoCreateInfo, VideoItem, type VideoItemOptions, type VideoItemProperty, type ViewParam, type ViewProperty, createSDKItem, isBaseItem, isEffectsItem, isFrameItem, isGeneratorItem, isGroupItem, isSpriteItem, isTextItem, isVideoItem };