@vvfx/sdk 0.0.0-alpha.9 → 0.0.0-alpha.91

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,6 +1,7 @@
1
- import { spec, Player } from '@galacean/effects';
2
- export { spec } from '@galacean/effects';
3
- import * as _galacean_effects_weapp from '@galacean/effects/weapp';
1
+ import * as _galacean_effects from '@galacean/effects';
2
+ import { spec, math, Player } from '@galacean/effects';
3
+ export { generateGUID, spec } from '@galacean/effects';
4
+ import { Point } from '@pixi/constants';
4
5
 
5
6
  type ViewItemTypedProperty = {
6
7
  [K in keyof PageFormTypeAndPropertyReference]: {
@@ -44,7 +45,349 @@ type SetItemPropertyValueParam = {
44
45
  propertyValue: PageFormTypeAndPropertyReference[T][N];
45
46
  };
46
47
  }[keyof PageFormTypeAndPropertyReference[T]];
47
- }[keyof PageFormTypeAndPropertyReference];
48
+ }[keyof PageFormTypeAndPropertyReference] | {
49
+ itemId: string;
50
+ type: spec.ItemType;
51
+ propertyName: 'position' | 'size';
52
+ propertyValue: spec.vec2 | spec.vec3;
53
+ };
54
+
55
+ /**
56
+ * @class 二维线段
57
+ */
58
+ declare class Line2 {
59
+ start: Vector2;
60
+ end: Vector2;
61
+ constructor(start?: Vector2, end?: Vector2);
62
+ /**
63
+ * 设置二维线段
64
+ * @param {Vector2} start 线段起点
65
+ * @param {Vector2} end 线段终点
66
+ * @returns {Line2} 二维线段
67
+ */
68
+ set(start: Vector2, end: Vector2): this;
69
+ /**
70
+ * 复制二维线段
71
+ * @param {Line2} line 复制对象
72
+ * @returns {Line2} 复制结果
73
+ */
74
+ copyFrom(line: Line2): this;
75
+ /**
76
+ * 二维线段求方向
77
+ * @returns {Vector2} 二维线段方向
78
+ */
79
+ direction(): Vector2;
80
+ /**
81
+ * 二维线段求中点
82
+ * @param {Vector2} [target=new Vector2()] 目标保存对象
83
+ * @returns {Vector2} 二维线段中点
84
+ */
85
+ getCenter(target?: Vector2): Vector2;
86
+ /**
87
+ * 二维线段向量值
88
+ * @param {Vector2} [target=new Vector2()] 目标保存对象
89
+ * @returns {Vector2} 二维线段向量值
90
+ */
91
+ delta(target?: Vector2): Vector2;
92
+ /**
93
+ * 二维线段欧式距离平方(应用于计算)
94
+ * @returns {number} 计算结果
95
+ */
96
+ distanceSq(): number;
97
+ /**
98
+ * 二维线段欧式距离
99
+ * @returns {number} 计算结果
100
+ */
101
+ distance(): number;
102
+ /**
103
+ * 求二维线段比例点
104
+ * @param {number} t 比例值
105
+ * @param {Vector2} target 目标保存对象
106
+ * @returns {Vector2} 比例点结果
107
+ */
108
+ at(t: number, target?: Vector2): Vector2;
109
+ /**
110
+ * 求点与线段的最短距离
111
+ * @param {Vector2} point 二维空间点
112
+ * @param {boolean} clampToLine 是否限制于线段内
113
+ * @returns {number} 距离结果
114
+ */
115
+ closestPointToPointParameter(point: Vector2, clampToLine: boolean): number;
116
+ /**
117
+ * 求点与线段的最近交点
118
+ * @param {Vector2} point 二维空间点
119
+ * @param {boolean} clampToLine 是否限制于线段内
120
+ * @param {Vector2} target 目标保存对象
121
+ * @returns {Vector2} 最近交点
122
+ */
123
+ closestPointToPoint(point: Vector2, clampToLine: boolean, target?: Vector2): Vector2;
124
+ /**
125
+ * 二维线段判等
126
+ * @param {Line2} line 二维线段
127
+ * @returns {boolean} 判等结果
128
+ */
129
+ equals(line: Line2): boolean;
130
+ /**
131
+ * 克隆二维线段
132
+ * @returns {Line2} 克隆结果
133
+ */
134
+ clone(): Line2;
135
+ /**
136
+ * 二维线段求长度
137
+ * @returns {number} 长度
138
+ */
139
+ length(): number;
140
+ /**
141
+ * 二维线段判断相交
142
+ * @param {Line2} other 二维线段
143
+ * @returns {boolean} 相交判断结果
144
+ */
145
+ crossWithLine(other: Line2): boolean;
146
+ }
147
+
148
+ declare class Vector2 extends math.Vector2 {
149
+ subtract(other: Vector2): this;
150
+ toViewCoordinate(width: number, height: number): this;
151
+ clone(): Vector2;
152
+ distanceTo(other: Vector2): number;
153
+ scaleByCenter(scalar: Vector2, anchor?: Vector2): this;
154
+ round(precision?: number): this;
155
+ /**
156
+ * 点到直线的最短距离
157
+ * @returns {{d: number, t: number}} d表示距离,t表示最近点在直线的比例
158
+ */
159
+ distanceToLine(line: Line2): {
160
+ d: number;
161
+ t: number;
162
+ };
163
+ /**
164
+ * 二维向量与x轴夹角
165
+ * @returns {number} 弧度值
166
+ */
167
+ angle(): number;
168
+ /**
169
+ * 二维点绕点旋转
170
+ * @param {Vec2} center 旋转中心
171
+ * @param {number} angle 旋转角度
172
+ * @returns {Vec2} 旋转结果
173
+ */
174
+ rotateAround(center: Vector2, angle: number): this;
175
+ }
176
+
177
+ /**
178
+ * @class 二维包围盒
179
+ */
180
+ declare class Box2 {
181
+ /**
182
+ * @member {Vector2[]} corners 二维包围盒角点
183
+ */
184
+ corners: Vector2[];
185
+ min: Vector2;
186
+ max: Vector2;
187
+ /**
188
+ * 构造函数,传入值为空时表示空包围盒
189
+ * @param {Vector2} [min=new Vector2(Infinity, Infinity)] 最小点
190
+ * @param {Vector2} [max=new Vector2(-Infinity, -Infinity)] 最大点
191
+ */
192
+ constructor(min?: Vector2, max?: Vector2);
193
+ /**
194
+ * 通过最大最小点设置二维包围盒
195
+ * @param {Vector2} min 最小点
196
+ * @param {Vector2} max 最大点
197
+ * @returns {Box2} 二维包围盒
198
+ */
199
+ set(min: Vector2, max: Vector2): this;
200
+ /**
201
+ * 通过角点设置二维包围盒
202
+ * @param {Vector2[]} vecArray 二维空间点数组
203
+ * @returns {Box2} 二维包围盒
204
+ */
205
+ setFromVec2Array(vecArray: Vector2[]): this;
206
+ /**
207
+ * 通过屏幕坐标点设置二维包围盒 - 点为屏幕坐标点,x正方向为右,y正方向为向上
208
+ * @param vecArray 屏幕坐标点
209
+ */
210
+ setFromVec2ArrayWithOutCorners(vecArray: Vector2[]): this;
211
+ /**
212
+ * 通过中心与大小设置二维包围盒
213
+ * @param {Vector2} center 二维中心点
214
+ * @param {Vector2} size 二维大小
215
+ * @returns {Box2} 二维包围盒
216
+ */
217
+ setFromCenterAndSize(center: Vector2, size: Vector2): this;
218
+ /**
219
+ * 克隆二维包围盒
220
+ * @returns {Box2} 克隆结果
221
+ */
222
+ clone(): Box2;
223
+ /**
224
+ * 复制二维包围盒
225
+ * @param {Box2} box 二维包围盒
226
+ * @returns {Box2} 复制结果
227
+ */
228
+ copyFrom(box: Box2): this;
229
+ /**
230
+ * 二维包围盒置空
231
+ * @returns {Box2} 置空结果
232
+ */
233
+ makeEmpty(): this;
234
+ /**
235
+ * 二维包围盒判空
236
+ * @returns {boolean} 判空结果
237
+ */
238
+ isEmpty(): boolean;
239
+ /**
240
+ * 获取二维包围盒角点
241
+ * @returns {Vector2[]} 二维包围盒角点
242
+ */
243
+ getCorners(): Vector2[];
244
+ /**
245
+ * 获取二维包围盒中心点
246
+ * @param {Vector2} [target=new Vector2()] 目标点(用以存放二维包围盒中心点)
247
+ * @returns {Vector2} 二维包围盒中心点
248
+ */
249
+ getCenter(target?: Vector2): Vector2;
250
+ /**
251
+ * 获取二维包围盒大小
252
+ * @param {Vector2} [target=new Vector2()] 目标向量(用以存放二维包围盒大小)
253
+ * @returns {Vector2} 二维包围盒大小
254
+ */
255
+ getSize(target?: Vector2): Vector2;
256
+ /**
257
+ * 通过二维空间点扩展二维包围盒
258
+ * @param {Vector2} point 二维空间点
259
+ * @returns {Box2} 扩展包围盒
260
+ */
261
+ expandByPoint(point: Vector2): this;
262
+ /**
263
+ * 通过向量扩展二维包围盒
264
+ * @param {Vector2} vector 二维向量
265
+ * @returns {Box2} 扩展结果
266
+ */
267
+ expandByVector(vector: Vector2): this;
268
+ /**
269
+ * 通过大小扩展二维包围盒
270
+ * @param {number} scalar 扩展大小
271
+ * @returns {Box2} 扩展结果
272
+ */
273
+ expandByScalar(scalar: number): this;
274
+ /**
275
+ * 判断二维包围盒是否包含二维空间点
276
+ * @param {Vector2} point 二维空间点
277
+ * @param {boolean} [isOrthogonal=true] 包围盒正交判断(默认为true)
278
+ * @returns {boolean} 点包含判断结果
279
+ */
280
+ containsPoint(point: Vector2, isOrthogonal?: boolean): boolean;
281
+ /**
282
+ * 判断二维包围盒包含关系(if this contains other)
283
+ * @param {Box2} box 其它包围盒
284
+ * @returns {boolean} 二维包围盒包含判断结果
285
+ */
286
+ containsBox(box: Box2): boolean;
287
+ /**
288
+ * 获取点以包围盒左上角顶点为原点的相对位置
289
+ * @param {Vector2} point 指定二维空间点
290
+ * @param {Vector2} [target=new Vector2()] 目标空间点
291
+ * @returns {Vector2} 计算结果空间点
292
+ */
293
+ getParameter(point: Vector2, target?: Vector2): Vector2;
294
+ /**
295
+ * 求点与二维包围盒的最近点
296
+ * @param {Vector2} point 二维空间点
297
+ * @param {Vector2} [target=new Vector2()] 结果点
298
+ * @returns {Vector2} 二维空间点
299
+ */
300
+ clampPoint(point: Vector2, target?: Vector2): Vector2;
301
+ /**
302
+ * 求点到二维包围盒的距离
303
+ * @param {Vector2} point 二维空间点
304
+ * @returns {number} 距离
305
+ */
306
+ distanceToPoint(point: Vector2): number;
307
+ /**
308
+ * 二维包围盒求交集
309
+ * @param {Box2} box 二维包围盒
310
+ * @returns {Box2} 求交结果
311
+ */
312
+ intersect(box: Box2): this;
313
+ /**
314
+ * 二维包围盒求并集
315
+ * @param {Box2} box 二维包围盒
316
+ * @returns {Box2} 求并结果
317
+ */
318
+ union(target: Box2 | Vector2): this;
319
+ /**
320
+ * 二维包围盒位移
321
+ * @param {Vector2} offset 位移向量
322
+ * @returns {Box2} 位移结果
323
+ */
324
+ translate(offset: Vector2): this;
325
+ scale(scalar: number | Vector2, anchor?: Vector2): this;
326
+ /**
327
+ * 二维包围盒判等
328
+ * @param {Box2} box 二维包围盒
329
+ * @returns {boolean} 判等结果
330
+ */
331
+ equals(box: Box2): boolean;
332
+ /**
333
+ * 判断二维包围盒相交关系(if this intersect other)
334
+ * @param {Box2} box 二维包围盒
335
+ * @param {boolean} [isOrthogonal=true] 正交判断(当前包围盒)
336
+ * @returns {boolean} 相交判断结果
337
+ */
338
+ intersectsBox(box: Box2, isOrthogonal?: boolean): boolean;
339
+ rotate(angle: number, center?: Vector2): this;
340
+ }
341
+
342
+ type CreateOperation = {
343
+ type: 'create';
344
+ newData: ItemCreateInfo[];
345
+ };
346
+ type DeleteOperation = {
347
+ type: 'delete';
348
+ oldData: ItemCreateInfo[];
349
+ };
350
+ type UpdateOperation = {
351
+ type: 'update';
352
+ newData: ItemCreateInfo[];
353
+ oldData: ItemCreateInfo[];
354
+ };
355
+ type Operation = CreateOperation | UpdateOperation | DeleteOperation;
356
+ declare class UndoRedo {
357
+ private index;
358
+ private operations;
359
+ get canUndo(): boolean;
360
+ get canRedo(): boolean;
361
+ oldData?: ItemCreateInfo[];
362
+ push(operation: Operation): void;
363
+ undo(): Operation | undefined;
364
+ redo(): Operation | undefined;
365
+ clear(): void;
366
+ }
367
+
368
+ declare const MEDIA_TYPE: {
369
+ readonly APNG: "APNG";
370
+ readonly MP4: "MP4";
371
+ readonly WebM: "WebM";
372
+ readonly Images: "Images";
373
+ readonly WebP: "WebP";
374
+ readonly GIF: "GIF";
375
+ readonly AlphaMaskVideo: "AlphaMaskVideo";
376
+ };
377
+ /**
378
+ * GIF 压缩参数
379
+ * 核心通过参数 flags + palettegen + paletteuse 实现
380
+ * highest: lanczos + max_colors=256 + dither=bayer
381
+ * high: bicubic + max_colors=200 + dither=bayer
382
+ * medium: bilinear + max_colors=64 + dither=bayer
383
+ * low: neighbor + max_colors=32 + dither=none
384
+ */
385
+ declare const GIF_QUALITY_TO_FFMPEG_ARGS: {
386
+ highest: string;
387
+ high: string;
388
+ medium: string;
389
+ low: string;
390
+ };
48
391
 
49
392
  declare global {
50
393
  interface Window {
@@ -54,47 +397,1145 @@ declare global {
54
397
  createWebPCore: (config: any) => Promise<Img2WebPCore>;
55
398
  }
56
399
  }
57
- type FS = {
58
- writeFile: (path: string, data: Uint8Array | string) => void;
59
- readFile(path: string, opts: {
60
- encoding: 'binary';
61
- flags?: string | undefined;
62
- }): Uint8Array;
63
- readFile(path: string, opts: {
64
- encoding: 'utf8';
65
- flags?: string | undefined;
66
- }): string;
67
- readFile(path: string, opts?: {
68
- flags?: string | undefined;
69
- }): Uint8Array;
70
- unlink: (path: string) => void;
71
- quit: () => void;
72
- };
73
- type Pointer = number;
74
- type Img2WebPCore = {
75
- FS: FS;
76
- run: (...args: string[]) => number;
77
- cwrap: (ident: string, returnType: string, argTypes: string[]) => ((argc: number, argv: Pointer) => number);
78
- _malloc: (size: number) => Pointer;
79
- writeAsciiToMemory: (str: string, buffer: number, dontAddNull?: boolean) => void;
80
- setValue: (ptr: number, value: any, type: string, noSafe?: boolean) => void;
81
- };
400
+ type FileBuffer = ArrayBuffer | Uint8Array;
401
+ type MediaType = typeof MEDIA_TYPE[keyof typeof MEDIA_TYPE];
402
+ type FS = {
403
+ writeFile: (path: string, data: Uint8Array | string) => void;
404
+ readFile(path: string, opts: {
405
+ encoding: 'binary';
406
+ flags?: string | undefined;
407
+ }): Uint8Array;
408
+ readFile(path: string, opts: {
409
+ encoding: 'utf8';
410
+ flags?: string | undefined;
411
+ }): string;
412
+ readFile(path: string, opts?: {
413
+ flags?: string | undefined;
414
+ }): Uint8Array;
415
+ unlink: (path: string) => void;
416
+ quit: () => void;
417
+ };
418
+ type Pointer = number;
419
+ type Img2WebPCore = {
420
+ FS: FS;
421
+ run: (...args: string[]) => number;
422
+ cwrap: (ident: string, returnType: string, argTypes: string[]) => ((argc: number, argv: Pointer) => number);
423
+ _malloc: (size: number) => Pointer;
424
+ writeAsciiToMemory: (str: string, buffer: number, dontAddNull?: boolean) => void;
425
+ setValue: (ptr: number, value: any, type: string, noSafe?: boolean) => void;
426
+ };
427
+ type ExportMediaInitOptions = {
428
+ /**
429
+ * 导出类型
430
+ */
431
+ mediaType: MediaType;
432
+ /**
433
+ * 额外画布,导出透明视频时使用
434
+ */
435
+ extraCanvas?: HTMLCanvasElement | null;
436
+ /**
437
+ * 是否打印转码过程中的日志,仅在导出 MP4/AlphaMaskVideo 时有效, 默认 false
438
+ * 供开发调试使用
439
+ */
440
+ loggerInTranscoding?: boolean;
441
+ /**
442
+ * ffmpeg 转码是否开启多线程,默认 false,确保环境支持 SharedArrayBuffer
443
+ */
444
+ multiThreading?: boolean;
445
+ /**
446
+ * 是否输出 buffer,默认 false
447
+ */
448
+ isOutputBuffer?: boolean;
449
+ };
450
+ type MP4Config = {
451
+ /**
452
+ * @description MP4 导出时是否需要导出最后一帧 PNG
453
+ */
454
+ isExportLastFramePNG?: boolean;
455
+ };
456
+ type GifConfig = {
457
+ /**
458
+ * @description GIF 导出时的帧率
459
+ */
460
+ fps?: number;
461
+ /**
462
+ * @description GIF 导出时的缩放比例
463
+ * 默认 '-1:-1', 表示不缩放
464
+ * 例如 '100:-1', 表示宽度 100,高度自动
465
+ * 例如 '-1:100', 表示宽度自动,高度 100
466
+ */
467
+ scale?: string;
468
+ /**
469
+ * @description GIF 导出时的质量
470
+ * 默认 'highest'
471
+ * 可选 'highest', 'high', 'medium', 'low'
472
+ */
473
+ quality?: keyof typeof GIF_QUALITY_TO_FFMPEG_ARGS;
474
+ };
475
+ type ApngConfig = {
476
+ /**
477
+ * @description APNG 导出时的帧率
478
+ */
479
+ fps?: number;
480
+ /**
481
+ * @description APNG 导出时的缩放比例
482
+ * 默认 '-1:-1', 表示不缩放
483
+ * 例如 '100:-1', 表示宽度 100,高度自动
484
+ * 例如 '-1:100', 表示宽度自动,高度 100
485
+ */
486
+ scale?: string;
487
+ /**
488
+ * @description APNG 导出时的质量
489
+ * 默认 'highest'
490
+ * 可选 'highest', 'high', 'medium', 'low'
491
+ */
492
+ quality?: keyof typeof GIF_QUALITY_TO_FFMPEG_ARGS;
493
+ };
494
+ type ExportMediaItemOptions = {
495
+ /**
496
+ * 尺寸
497
+ */
498
+ size: [number, number];
499
+ /**
500
+ * 动效资源
501
+ */
502
+ scene: spec.JSONScene;
503
+ /**
504
+ * 视频时长,目前仅在导出 MP4 / AlphaMaskVideo 时有效,默认取动效资源时长
505
+ */
506
+ time?: number;
507
+ /**
508
+ * 是否生成音轨,默认 false,仅在导出 MP4 时有效
509
+ */
510
+ audioEnable?: boolean;
511
+ /**
512
+ * 帧率, 默认 30
513
+ */
514
+ fps?: number;
515
+ /**
516
+ * 是否循环,默认 true
517
+ */
518
+ loop?: boolean;
519
+ /**
520
+ * 视频背景颜色,默认 #000000
521
+ */
522
+ backgroundColor?: string;
523
+ /**
524
+ * 导出 MP4 时,设置的导出配置
525
+ */
526
+ mp4Config?: MP4Config;
527
+ /**
528
+ * 导出 GIF 时,设置的导出配置
529
+ */
530
+ gifConfig?: GifConfig;
531
+ /**
532
+ * 导出 APNG 时,设置的导出配置
533
+ */
534
+ apngConfig?: ApngConfig;
535
+ };
536
+
537
+ type SDKMode = 'editor' | 'template';
538
+ /**
539
+ * @description SDK功能配置
540
+ */
541
+ type SDKConfig = {
542
+ /**
543
+ * @description SDK编辑模式 - 模板编辑模式 | 编辑器模式
544
+ */
545
+ mode: SDKMode;
546
+ /**
547
+ * @description 页面功能配置
548
+ */
549
+ pageConfig: PageConfig$1;
550
+ /**
551
+ * @description 截图功能配置
552
+ */
553
+ screenShotConfig: ScreenShotConfig;
554
+ /**
555
+ * @description 导出视频功能配置
556
+ */
557
+ exportConfig: ExportConfig;
558
+ /**
559
+ * @description 尺寸自适应功能开关
560
+ */
561
+ sizeAdaptConfig: SizeAdaptConfig;
562
+ /**
563
+ * @description 辅助面板功能配置
564
+ */
565
+ gestureHandlerConfig: {
566
+ enabled: boolean;
567
+ adsorptionGizmoEnabled: boolean;
568
+ adsorptionGizmoConfig: AdsorptionGizmoConfig;
569
+ controlGizmoEnabled: boolean;
570
+ controlGizmoConfig: ControlGizmoConfig;
571
+ preferenceGizmoEnabled: boolean;
572
+ preferenceGizmoConfig: PreferenceGizmoConfig;
573
+ selectorGizmoEnabled: boolean;
574
+ selectorGizmoConfig: SelectorGizmoConfig;
575
+ transformGizmoEnabled: boolean;
576
+ transformGizmoConfig: TransformGizmoConfig;
577
+ pictureCutGizmoEnabled: boolean;
578
+ pictureCutGizmoConfig: PictureCutGizmoConfig;
579
+ pictureExpandGizmoEnabled: boolean;
580
+ pictureExpandGizmoConfig: PictureExpandGizmoConfig;
581
+ textGizmoEnbaled: boolean;
582
+ textGizmoConfig: TextGizmoConfig;
583
+ maskGizmoEnabled: boolean;
584
+ maskGizmoConfig: MaskGizmoConfig;
585
+ spriteTextEditGizmoEnabled: boolean;
586
+ spriteTextEditGizmoConfig: SpriteTextEditGizmoConfig;
587
+ };
588
+ };
589
+ /**
590
+ * @description 页面功能配置
591
+ */
592
+ type PageConfig$1 = {
593
+ /**
594
+ * @description 同步修改功能开关
595
+ */
596
+ asncMode: boolean;
597
+ /**
598
+ * @description 静态预览【视图只提供播放预览功能】功能开关
599
+ */
600
+ staticPreview: boolean;
601
+ /**
602
+ * @description 静态预览视图名称
603
+ */
604
+ staticPreviewName: string;
605
+ /**
606
+ * @description 需过滤的元素名称
607
+ */
608
+ filterItemNames: string[];
609
+ /**
610
+ * @description 成组操作元素显隐
611
+ */
612
+ groupVisible: boolean;
613
+ /**
614
+ * @description 缩放最大值
615
+ */
616
+ maxZoom: number;
617
+ /**
618
+ * @description 缩放最小值
619
+ */
620
+ minZoom: number;
621
+ };
622
+ /**
623
+ * @description 视频导出功能配置
624
+ */
625
+ type ExportConfig = {
626
+ enabled: boolean;
627
+ } & ExportMediaInitOptions;
628
+ /**
629
+ * @description 截图功能配置
630
+ */
631
+ type ScreenShotConfig = {
632
+ enabled: boolean;
633
+ };
634
+ /**
635
+ * @description 尺寸自适应功能配置
636
+ */
637
+ type SizeAdaptConfig = {
638
+ enabled: boolean;
639
+ };
640
+ /**
641
+ * @description 对齐吸附功能参数
642
+ */
643
+ type AdsorptionGizmoConfig = {
644
+ /**
645
+ * @description 对齐吸附线宽
646
+ */
647
+ lineWidth: number;
648
+ /**
649
+ * @description 对齐线颜色
650
+ */
651
+ lineColor: number;
652
+ /**
653
+ * @description 对齐吸附距离
654
+ */
655
+ distance: number;
656
+ };
657
+ /**
658
+ * @description 视图控制功能参数
659
+ */
660
+ type ControlGizmoConfig = {
661
+ /**
662
+ * @description 缩放步长
663
+ */
664
+ zoomStep: number;
665
+ };
666
+ /**
667
+ * @description 视口展示功能参数
668
+ */
669
+ type PreferenceGizmoConfig = {
670
+ /**
671
+ * @description 视口窗包围盒颜色
672
+ */
673
+ boxColor: number;
674
+ /**
675
+ * @description 视口窗包围盒宽度
676
+ */
677
+ boxWidth: number;
678
+ /**
679
+ * @description 视口区域外遮罩颜色
680
+ */
681
+ markColor: number;
682
+ /**
683
+ * @description 视口区域外遮罩透明度
684
+ */
685
+ markAlpha: number;
686
+ /**
687
+ * @description 出血区预览开关
688
+ */
689
+ safeAreaEnabled: boolean;
690
+ /**
691
+ * @description 出血区颜色
692
+ */
693
+ safeAreaBoxColor: number;
694
+ /**
695
+ * @description 出血区透明度
696
+ */
697
+ safeAreaBoxAlpha: number;
698
+ };
699
+ /**
700
+ * @description 选择功能参数
701
+ */
702
+ type SelectorGizmoConfig = {
703
+ /**
704
+ * @description 视频预选中时
705
+ */
706
+ videoPreSelectedPlay: boolean;
707
+ /**
708
+ * @description 预选框线宽
709
+ */
710
+ preSelectedWidth: number;
711
+ /**
712
+ * @description 预选框颜色
713
+ */
714
+ preSelectedColor: number;
715
+ /**
716
+ * @description 框选区域颜色
717
+ */
718
+ regionBoxColor: number;
719
+ /**
720
+ * @description 框选区域透明度
721
+ */
722
+ regionBoxAlpha: number;
723
+ /**
724
+ * @description 框选区域包围框颜色
725
+ */
726
+ regionWireframeColor: number;
727
+ /**
728
+ * @description 框选区域包围框透明度
729
+ */
730
+ regionWireframeAlpha: number;
731
+ /**
732
+ * @description 框选区域包围框宽度
733
+ */
734
+ regionWireframeWidth: number;
735
+ };
736
+ /**
737
+ * @description 变换功能参数
738
+ */
739
+ type TransformGizmoConfig = {
740
+ /**
741
+ * @description 变换交互框颜色
742
+ */
743
+ wireframeColor: number;
744
+ /**
745
+ * @description 变换交互框透明度
746
+ */
747
+ wireframeAlpha: number;
748
+ /**
749
+ * @description 变换交互框宽度
750
+ */
751
+ wireframeWidth: number;
752
+ /**
753
+ * @description 变换交互框角点填充色
754
+ */
755
+ cornerFillColor: number;
756
+ /**
757
+ * @description 变换交互框角点线框色
758
+ */
759
+ cornerLineColor: number;
760
+ /**
761
+ * @description 变换交互框角点线框宽度
762
+ */
763
+ cornerLineWidth: number;
764
+ /**
765
+ * @description 变换交互框角点线框透明度
766
+ */
767
+ cornerLineAlpha: number;
768
+ /**
769
+ * @description 交互框缩放圆半径
770
+ */
771
+ scaleCircleSize: number;
772
+ /**
773
+ * @description 交互框旋转圆半径
774
+ */
775
+ rotationCircleSize: number;
776
+ /**
777
+ * @description 图片Logo地址
778
+ */
779
+ pictureLogoUrl: string;
780
+ /**
781
+ * @description 空节点Logo地址
782
+ */
783
+ nullLogoUrl: string;
784
+ /**
785
+ * @description 文本Logo地址
786
+ */
787
+ textLogoUrl: string;
788
+ /**
789
+ * @description 视频Logo地址
790
+ */
791
+ videoLogoUrl: string;
792
+ /**
793
+ * @description 大小文字颜色
794
+ */
795
+ sizeTextColor: number;
796
+ /**
797
+ * @description 名称文字颜色
798
+ */
799
+ nameTextColor: number;
800
+ /**
801
+ * @description 选中信息展示
802
+ */
803
+ infoShowEnabled: boolean;
804
+ };
805
+ /**
806
+ * @description 图片裁切参数
807
+ */
808
+ type PictureCutGizmoConfig = {
809
+ /**
810
+ * @description 蒙版颜色
811
+ */
812
+ maskColor: number;
813
+ /**
814
+ * @description 蒙版透明度
815
+ */
816
+ maskAlpha: number;
817
+ /**
818
+ * @description 裁切包围盒线框宽度
819
+ */
820
+ cutBoxLineWidth: number;
821
+ /**
822
+ * @description 裁切包围盒线框颜色
823
+ */
824
+ cutBoxLineColor: number;
825
+ /**
826
+ * @description 裁切包围盒线框透明度
827
+ */
828
+ cutBoxLineAlpha: number;
829
+ /**
830
+ * @description 元素包围盒线框宽度
831
+ */
832
+ itemBoxLineWidth: number;
833
+ /**
834
+ * @description 元素包围盒线框颜色
835
+ */
836
+ itemBoxLineColor: number;
837
+ /**
838
+ * @description 元素包围盒线框透明度
839
+ */
840
+ itemBoxLineAlpha: number;
841
+ /**
842
+ * @description 裁切包围盒角度半径
843
+ */
844
+ cutBoxCornerRadius: number;
845
+ /**
846
+ * @description 裁切包围盒角点宽度
847
+ */
848
+ cutBoxCornerLineWidth: number;
849
+ /**
850
+ * @description 裁切包围盒角点颜色
851
+ */
852
+ cutBoxCornerLineColor: number;
853
+ /**
854
+ * @description 裁切包围盒角点透明度
855
+ */
856
+ cutBoxCornerLineAlpha: number;
857
+ /**
858
+ * @description 裁切包围盒角点填充色
859
+ */
860
+ cutBoxCornerFillColor: number;
861
+ /**
862
+ * @description 缩放判断距离
863
+ */
864
+ scaleInteractionDistance: number;
865
+ /**
866
+ * @description 单向缩放判断距离
867
+ */
868
+ directionScaleInteractionDistance: number;
869
+ };
870
+ /**
871
+ * @description 图片扩边参数
872
+ */
873
+ type PictureExpandGizmoConfig = {
874
+ /**
875
+ * @description 蒙版颜色
876
+ */
877
+ maskColor: number;
878
+ /**
879
+ * @description 蒙版透明度
880
+ */
881
+ maskAlpha: number;
882
+ /**
883
+ * @description 扩边包围盒线框宽度
884
+ */
885
+ expandBoxLineWidth: number;
886
+ /**
887
+ * @description 扩边包围盒线框颜色
888
+ */
889
+ expandBoxLineColor: number;
890
+ /**
891
+ * @description 扩边包围盒线框透明度
892
+ */
893
+ expandBoxLineAlpha: number;
894
+ /**
895
+ * @description 扩边包围盒角度半径
896
+ */
897
+ expandBoxCornerRadius: number;
898
+ /**
899
+ * @description 扩边包围盒角点宽度
900
+ */
901
+ expandBoxCornerLineWidth: number;
902
+ /**
903
+ * @description 扩边包围盒角点颜色
904
+ */
905
+ expandBoxCornerLineColor: number;
906
+ /**
907
+ * @description 扩边包围盒角点透明度
908
+ */
909
+ expandBoxCornerLineAlpha: number;
910
+ /**
911
+ * @description 扩边包围盒角点填充色
912
+ */
913
+ expandBoxCornerFillColor: number;
914
+ /**
915
+ * @description 缩放判断距离
916
+ */
917
+ scaleInteractionDistance: number;
918
+ /**
919
+ * @description 单向缩放判断距离
920
+ */
921
+ directionScaleInteractionDistance: number;
922
+ };
923
+ /**
924
+ * @description 文本交互控制器旋转交互模式
925
+ * 'corner': 角点旋转
926
+ * 'top-center': 顶部中心旋转
927
+ */
928
+ type TextGizmoRotateInteractMode = 'corner' | 'top-center';
929
+ /**
930
+ * @description 文本交互控制器参数
931
+ */
932
+ type TextGizmoConfig = {
933
+ /**
934
+ * @description 旋转交互模式
935
+ */
936
+ rotateInteractMode: TextGizmoRotateInteractMode;
937
+ /**
938
+ * @description 包围盒线宽
939
+ */
940
+ boxLineWidth: number;
941
+ /**
942
+ * @description 包围盒线色
943
+ */
944
+ boxLineColor: number;
945
+ /**
946
+ * @description 旋转交互点边长 - 用于 top-center 交互模式
947
+ */
948
+ rotationCornerWidth: number;
949
+ /**
950
+ * @description 旋转交互贴图地址
951
+ */
952
+ rotationCornerTexture: string;
953
+ /**
954
+ * @description 旋转交互点半径
955
+ */
956
+ rotationCornerRadius: number;
957
+ /**
958
+ * @description top-center 模式旋转交互距离
959
+ */
960
+ rotationTopCenterInteractionDistance: number;
961
+ /**
962
+ * @description 旋转交互点填充色
963
+ */
964
+ rotationCornerFillColor: number;
965
+ /**
966
+ * @description 旋转交互点描边宽度
967
+ */
968
+ rotationCornerStrokeWidth: number;
969
+ /**
970
+ * @description 旋转交互点描边颜色
971
+ */
972
+ rotationCornerStrokeColor: number;
973
+ /**
974
+ * @description Corner 模式旋转交互距离
975
+ */
976
+ rotationCornerInteractionDistance: number;
977
+ /**
978
+ * @description 缩放交互点半径
979
+ */
980
+ scaleCornerRadius: number;
981
+ /**
982
+ * @description 缩放交互点填充色
983
+ */
984
+ scaleCornerFillColor: number;
985
+ /**
986
+ * @description 缩放交互点描边宽度
987
+ */
988
+ scaleCornerStrokeWidth: number;
989
+ /**
990
+ * @description 缩放交互点描边颜色
991
+ */
992
+ scaleCornerStrokeColor: number;
993
+ /**
994
+ * @description 出发缩放交互的距离
995
+ */
996
+ scaleInteractionDistance: number;
997
+ };
998
+ /**
999
+ * @description 蒙版参数
1000
+ */
1001
+ type MaskGizmoConfig = {
1002
+ /**
1003
+ * @description 画笔大小
1004
+ */
1005
+ brushSize: number;
1006
+ /**
1007
+ * @description 笔刷颜色
1008
+ */
1009
+ brushColor: number;
1010
+ /**
1011
+ * @description 笔刷透明度
1012
+ */
1013
+ brushAlpha: number;
1014
+ /**
1015
+ * @description 蒙版颜色
1016
+ */
1017
+ maskColor: number;
1018
+ /**
1019
+ * @description 蒙版透明度
1020
+ */
1021
+ maskAlpha: number;
1022
+ /**
1023
+ * @description 元素包围盒线框宽度
1024
+ */
1025
+ boxLineWidth: number;
1026
+ /**
1027
+ * @description 元素包围盒线框颜色
1028
+ */
1029
+ boxLineColor: number;
1030
+ /**
1031
+ * @description 元素包围盒线框透明度
1032
+ */
1033
+ boxLineAlpha: number;
1034
+ };
1035
+ /**
1036
+ * @description 精准改字编辑参数
1037
+ */
1038
+ type SpriteTextEditGizmoConfig = {
1039
+ /**
1040
+ * @description 文案颜色
1041
+ */
1042
+ textColor: number;
1043
+ /**
1044
+ * @description 包围盒线框宽度
1045
+ */
1046
+ boxLineWidth: number;
1047
+ /**
1048
+ * @description 包围盒间隔线长度
1049
+ */
1050
+ dashLineDash: number;
1051
+ /**
1052
+ * @description 包围盒间隔线间隔
1053
+ */
1054
+ dashLineGap: number;
1055
+ /**
1056
+ * @description 预选中文案颜色
1057
+ */
1058
+ preSelectedTextColor: number;
1059
+ /**
1060
+ * @description 标记包围盒颜色
1061
+ */
1062
+ editBoxColor: number;
1063
+ /**
1064
+ * @description 编辑包围盒透明度
1065
+ */
1066
+ editBoxAlpha: number;
1067
+ /**
1068
+ * @description 编辑包围盒线框颜色
1069
+ */
1070
+ editBoxLineColor: number;
1071
+ /**
1072
+ * @description 编辑包围盒线框透明度
1073
+ */
1074
+ editBoxLineAlpha: number;
1075
+ /**
1076
+ * @description 已更改编辑包围盒颜色
1077
+ */
1078
+ hasChangedEditBoxColor: number;
1079
+ /**
1080
+ * @description 已更改编辑包围盒透明度
1081
+ */
1082
+ hasChangedEditBoxAlpha: number;
1083
+ /**
1084
+ * @description 已更改编辑包围盒线框颜色
1085
+ */
1086
+ hasChangedEditBoxLineColor: number;
1087
+ /**
1088
+ * @description 已更改编辑包围盒线框透明度
1089
+ */
1090
+ hasChangedEditBoxLineAlpha: number;
1091
+ /**
1092
+ * @description 编辑包围盒预选颜色
1093
+ */
1094
+ editBoxPreSelectedColor: number;
1095
+ /**
1096
+ * @description 编辑包围盒预选透明度
1097
+ */
1098
+ editBoxPreSelectedAlpha: number;
1099
+ /**
1100
+ * @description 编辑包围盒预选线框颜色
1101
+ */
1102
+ editBoxLinePreSelectedColor: number;
1103
+ /**
1104
+ * @description 编辑包围盒预选线框透明度
1105
+ */
1106
+ editBoxLinePreSelectedAlpha: number;
1107
+ /**
1108
+ * @description 已更改编辑包围盒预选颜色
1109
+ */
1110
+ hasChangedEditBoxPreSelectedColor: number;
1111
+ /**
1112
+ * @description 已更改编辑包围盒预选透明度
1113
+ */
1114
+ hasChangedEditBoxPreSelectedAlpha: number;
1115
+ /**
1116
+ * @description 已更改编辑包围盒线框颜色
1117
+ */
1118
+ hasChangedEditBoxLinePreSelectedColor: number;
1119
+ /**
1120
+ * @description 已更改编辑包围盒线框透明度
1121
+ */
1122
+ hasChangedEditBoxLinePreSelectedAlpha: number;
1123
+ /**
1124
+ * @description 选中状态标记包围盒颜色
1125
+ */
1126
+ editBoxSelectedColor: number;
1127
+ /**
1128
+ * @description 选中状态标记包围盒颜色
1129
+ */
1130
+ editBoxSelectedAlpha: number;
1131
+ };
1132
+
1133
+ /**
1134
+ * @description 精准改字功能初始化信息
1135
+ */
1136
+ type SpriteTextInitParam = {
1137
+ /**
1138
+ * @description 元素ID
1139
+ */
1140
+ id: string;
1141
+ /**
1142
+ * @description 改字信息
1143
+ */
1144
+ info: SpriteTextInitInfo[];
1145
+ };
1146
+ type SpriteTextInitInfo = {
1147
+ /**
1148
+ * @description 是否被修改过
1149
+ */
1150
+ hasChanged: boolean;
1151
+ /**
1152
+ * @description 文字内容
1153
+ */
1154
+ text: string;
1155
+ /**
1156
+ * @description 包围盒信息
1157
+ */
1158
+ box: [spec.vec2, spec.vec2, spec.vec2, spec.vec2];
1159
+ };
1160
+ type GizmoType = 'null' | 'selector' | 'transform' | 'control' | 'adsorption' | 'preference' | 'picture-cut' | 'text' | 'mask' | 'loading' | 'picture-expand' | 'sprite-text-edit';
1161
+
1162
+ declare module '@pixi/graphics' {
1163
+ interface Graphics {
1164
+ fillBox(box: Box2): void;
1165
+ drawBox(box: Box2): void;
1166
+ drawLine(line: Line2 | Point[]): void;
1167
+ drawDashLine(toX: number, toY: number, dash: number, gap: number): void;
1168
+ }
1169
+ }
1170
+
1171
+ type SDKEvents = {
1172
+ 'loadingItemChange': [id: string[]];
1173
+ 'selectedItemChange': [id: string[]];
1174
+ 'preSelectedItemChange': [id: string | undefined];
1175
+ 'selectedViewChange': [id: number];
1176
+ 'pageDataChange': [pageData: PageData];
1177
+ 'zoomChange': [zoom: number];
1178
+ 'progress': [{
1179
+ duration: number;
1180
+ time: number;
1181
+ end: boolean;
1182
+ paused: boolean;
1183
+ }];
1184
+ 'itemPropertyChange': [{
1185
+ id: string;
1186
+ property: string;
1187
+ }];
1188
+ 'exportProgress': [progress?: number];
1189
+ 'exportDone': [item: ExportMediaItemOptions | undefined, success: boolean, buffer?: FileBuffer];
1190
+ 'exportComplete': [success: boolean, taskInfos: ExportMediaItemOptions[], buffers?: FileBuffer[]];
1191
+ 'sdkConfigChange': [preSDKConfig: SDKConfig, curSDKConfig: SDKConfig];
1192
+ 'cutBoxChange': [box: Box2];
1193
+ 'expandBoxChange': [box: Box2];
1194
+ 'textInput': [{
1195
+ itemId: string;
1196
+ text: string;
1197
+ fontFamily: string;
1198
+ }];
1199
+ 'undoRedoChange': [Operation];
1200
+ 'viewportTransform': [{
1201
+ zoom: number;
1202
+ translation: [number, number];
1203
+ }];
1204
+ 'itemOnDragStart': [type: GizmoType];
1205
+ 'itemOnDrag': [type: GizmoType];
1206
+ 'itemOnDragEnd': [type: GizmoType];
1207
+ 'spriteTextClick': [{
1208
+ id: string;
1209
+ index: number;
1210
+ text: string;
1211
+ } | undefined];
1212
+ };
1213
+ declare class SDK {
1214
+ static config: SDKConfig;
1215
+ private _eventEmitter;
1216
+ private _pageData;
1217
+ private _screenShot;
1218
+ private _exporter?;
1219
+ private _pageDataUtils;
1220
+ private _sizeAdapt;
1221
+ private _gestureHandler;
1222
+ private disposables;
1223
+ private _isSwitchScene;
1224
+ private _undoRedo;
1225
+ player: Player;
1226
+ _container: HTMLElement;
1227
+ private _playerContainer;
1228
+ constructor(container: HTMLElement, mode?: SDKMode);
1229
+ get container(): HTMLElement;
1230
+ get pageData(): PageData | undefined;
1231
+ private get initExporterEnabled();
1232
+ get exportStatus(): string | undefined;
1233
+ get undoRedo(): UndoRedo;
1234
+ private get exportOptions();
1235
+ dispose(): void;
1236
+ on: <E extends "progress" | "loadingItemChange" | "selectedItemChange" | "preSelectedItemChange" | "selectedViewChange" | "pageDataChange" | "zoomChange" | "itemPropertyChange" | "exportProgress" | "exportDone" | "exportComplete" | "sdkConfigChange" | "cutBoxChange" | "expandBoxChange" | "textInput" | "undoRedoChange" | "viewportTransform" | "itemOnDragStart" | "itemOnDrag" | "itemOnDragEnd" | "spriteTextClick">(eventName: E, listener: _galacean_effects.EventEmitterListener<SDKEvents[E]>, options?: _galacean_effects.EventEmitterOptions) => () => void;
1237
+ setSDKMode(mode: SDKMode): void;
1238
+ private getInitParam;
1239
+ /**
1240
+ * 检测导出是否需要重新初始化
1241
+ * @param preExportVideoConfig
1242
+ * @param curExportVideoConfig
1243
+ */
1244
+ private checkExporter;
1245
+ private initExporter;
1246
+ private initSDK;
1247
+ run(param: SDKInputParam): Promise<void>;
1248
+ getPageData(): PageData;
1249
+ getActiveItems(): string[];
1250
+ setPreSelectedItem(id: string): void;
1251
+ getPreSelectedItem(): string;
1252
+ setSelectedItems(itemIds: string[]): void;
1253
+ /**
1254
+ * @description 获取目标元素的所有属性
1255
+ * @param param 元素ID、类型
1256
+ * @returns 元素属性
1257
+ */
1258
+ getItemProperty<T extends keyof PageFormTypeAndPropertyReference>(param: GetItemPropertyParam<T>): GetItemPropertyResult<T> | undefined;
1259
+ /**
1260
+ * @description 获取目标元素的指定属性
1261
+ * @param param 元素ID、类型、属性名
1262
+ * @returns 元素属性值
1263
+ */
1264
+ getItemPropertyValue<T extends keyof PageFormTypeAndPropertyReference, N extends keyof PageFormTypeAndPropertyReference[T]>(param: GetItemPropertyValueParam<T, N>): GetItemPropertyValueResult<T, N> | undefined;
1265
+ setItemPropertyValue(param: SetItemPropertyValueParam): Promise<void>;
1266
+ generateScreenShot(id: number, size?: [number, number], tick?: number, backgroundColor?: spec.vec4): Promise<string | undefined>;
1267
+ /**
1268
+ * @description 切换场景
1269
+ * @param index 场景索引
1270
+ */
1271
+ switchScene(index: number): Promise<void>;
1272
+ /**
1273
+ * @description 获取页面的 safeAreaPreview、zoom、adsorption、translation 值
1274
+ * @returns 页面的 safeAreaPreview、zoom、adsorption、translation 值
1275
+ */
1276
+ getPageConfig(): PageConfig;
1277
+ /**
1278
+ * 设置页面的 safeAreaPreview、zoom、adsorption 值
1279
+ * @param pageProperty 设置
1280
+ */
1281
+ setPageConfig(pageConfig: PageConfig): void;
1282
+ /**
1283
+ * @description 设置播放进度
1284
+ * @param progress 播放进度 0-100
1285
+ */
1286
+ setPlayProgress(progress: number): Promise<void>;
1287
+ getViewItems(): ViewItem[];
1288
+ setPlayState(playState: 'play' | 'pause'): Promise<void>;
1289
+ /**
1290
+ * @description 获取场景预览图
1291
+ * @returns 视图预览图
1292
+ */
1293
+ getViewThumbnail(): Promise<{
1294
+ id: number;
1295
+ thumbnail: string | undefined;
1296
+ }>[];
1297
+ /**
1298
+ * @description 获取视图JSON产物
1299
+ * @returns 当前所有视图JSON产物
1300
+ */
1301
+ getViewScene(): {
1302
+ id: number;
1303
+ thumbnail: spec.JSONScene;
1304
+ }[];
1305
+ private destroyCompositions;
1306
+ /**
1307
+ * @description 导出,支持导出媒体或其他,如MP4,未来支持 JSON 等;
1308
+ */
1309
+ onExport(): void;
1310
+ /**
1311
+ * @description 取消导出
1312
+ */
1313
+ cancelExport(): void;
1314
+ loadPageData(data: PageData): Promise<void>;
1315
+ runByPageData(data: PageData): Promise<void>;
1316
+ reloadPageDataByScene(scene: string | spec.JSONScene): Promise<void>;
1317
+ addViewParams(viewParams: ViewParam[]): Promise<void>;
1318
+ deleteViewParams(ids: number[]): Promise<void>;
1319
+ setExportParam(exportParam: Partial<ExportParam>, id?: number): void;
1320
+ /**
1321
+ * @description 设置视图缩放
1322
+ * @param zoom 缩放值
1323
+ * @param center 缩放中心
1324
+ * @param ignoreClamp 是否忽视约束
1325
+ */
1326
+ setPageZoom(zoom: number, center?: Vector2, ignoreClamp?: boolean): void;
1327
+ /**
1328
+ * @description 设置元素移动
1329
+ * @param targetTranslation 目标移动值
1330
+ */
1331
+ setPageMove(targetTranslation: Vector2): void;
1332
+ /**
1333
+ * @description 设置静态预览功能开关
1334
+ * @param enabled 功能开关
1335
+ */
1336
+ setStaticPreviewEnabled(enabled: boolean): void;
1337
+ /**
1338
+ * @description 设置静态预览视图名称
1339
+ * @param name 视图名称
1340
+ */
1341
+ setStaticPreviewName(name: string): void;
1342
+ /**
1343
+ * @description 设置同步修改功能开关
1344
+ * @param enabled 功能开关
1345
+ */
1346
+ setAsyncEnabled(enabled: boolean): void;
1347
+ /**
1348
+ * @description 设置 成组显影 开关
1349
+ */
1350
+ setGroupVisibleEnabled(enabled: boolean): void;
1351
+ /**
1352
+ * @description 新增过滤元素名称
1353
+ * @param itemNames 过滤元素名称
1354
+ */
1355
+ addFilterItemNames(itemNames: string[] | string): void;
1356
+ /**
1357
+ * @description 设置预览辅助层颜色
1358
+ * @param color 色值
1359
+ */
1360
+ setPreferenceBackgroundColor(color: [number, number, number, number]): void;
1361
+ /**
1362
+ * @description 设置出血区颜色
1363
+ * @param color 色值
1364
+ */
1365
+ setSafeAreaColor(color: [number, number, number, number]): void;
1366
+ /**
1367
+ * @description 设置 尺寸自适应拓展 功能开关
1368
+ * @param enabled 功能开关
1369
+ */
1370
+ setSizeAdaptEnabled(enabled: boolean): void;
1371
+ /**
1372
+ * @description 设置 截图 功能开关
1373
+ * @param enabled 功能开关
1374
+ */
1375
+ setScreenShotEnabled(enabled: boolean): void;
1376
+ /**
1377
+ * @description 设置导出功能初始化配置
1378
+ * @param exportConfig
1379
+ */
1380
+ setExportConfig(exportConfig: Partial<ExportConfig>): void;
1381
+ /**
1382
+ * @description 设置预选框参数
1383
+ * @param preSelectedColor 预选框颜色
1384
+ * @param preSelectedWidth 预选框线框宽度
1385
+ */
1386
+ setSelectorGizmoPreSelectConfig(preSelectedColor?: number, preSelectedWidth?: number): void;
1387
+ /**
1388
+ * @description 设置 变换控制器 交互框参数
1389
+ * @param config 参数
1390
+ */
1391
+ setTranformGizmoWireframeConfig(config: {
1392
+ wireframeColor?: number;
1393
+ wireframeAlpha?: number;
1394
+ wireframeWidth?: number;
1395
+ }): void;
1396
+ /**
1397
+ * @description 获取 SDK 配置参数
1398
+ * @returns SDK 配置参数
1399
+ */
1400
+ getSDKConfig(): SDKConfig;
1401
+ /**
1402
+ * @description 设置 SDK 配置参数
1403
+ * @param config SDK 配置参数
1404
+ */
1405
+ setSDKConfig(config: SDKConfig): void;
1406
+ /**
1407
+ * @description 设置SDK背景
1408
+ * @param type 背景类型
1409
+ * @param value 值
1410
+ */
1411
+ setSDKBackground(type: SDKBackgroundType, value?: string): void;
1412
+ /**
1413
+ * @description 创建图层元素
1414
+ * @param spriteInfo 图层元素信息
1415
+ */
1416
+ addSpriteItem(spriteInfo: SpriteCreateInfo, scene?: spec.JSONScene): Promise<string | undefined>;
1417
+ addVideoItem(videoInfo: VideoCreateInfo, scene?: spec.JSONScene): Promise<string | undefined>;
1418
+ openPictureCutGizmo(): void;
1419
+ closePictureCutGizmo(): void;
1420
+ getCutInfo(): {
1421
+ cutBox: Box2;
1422
+ itemBox: Box2;
1423
+ } | undefined;
1424
+ setCutBox(min: Vector2, max: Vector2): Box2 | undefined;
1425
+ openPictureExpandGizmo(): void;
1426
+ closePictureExpandGizmo(): void;
1427
+ getExpandInfo(): {
1428
+ expandBox: Box2;
1429
+ itemBox: Box2;
1430
+ } | undefined;
1431
+ setExpandBox(min: Vector2, max: Vector2): Box2 | undefined;
1432
+ openMaskGizmo(brushSize: number): void;
1433
+ clearMaskGizmo(): void;
1434
+ closeMaskGizmo(): void;
1435
+ getMask(): string | null | undefined;
1436
+ setMaskGizmoConfig(config: Partial<MaskGizmoConfig>): void;
1437
+ openLoadingGizmo(id: string, loadingBox?: Box2, clearResult?: boolean): void;
1438
+ closeLoadingGizmo(id: string): void;
1439
+ /**
1440
+ * @description 元素打组
1441
+ * @param children 子元素ID
1442
+ */
1443
+ groupItems(nullInfo: NullCreateInfo, scene?: spec.JSONScene): string | undefined;
1444
+ addTextItem(textInfo: TextCreateInfo, scene?: spec.JSONScene): Promise<string | undefined>;
1445
+ deleteItems(idInfo: string | string[]): void;
1446
+ getItemCreateInfo(idInfo: string | string[]): ItemCreateInfo[];
1447
+ createScreenShotSceneByIds(idInfo: string | string[], time?: number): Promise<string | undefined>;
1448
+ getChildrenIds(id: string): string[];
1449
+ /**
1450
+ * @description 更新元素在图层中的顺序
1451
+ * @param id 元素ID
1452
+ * @param action 排序操作:BringToFront(置于顶层)、SendToBack(置于底层)、BringForward(上移一层)、SendBackward(下移一层)
1453
+ */
1454
+ updateItemOrder(id: string, action: ItemOrderAction): void;
1455
+ /**
1456
+ * @description 导出JSON
1457
+ * @param idInfo 视图序号信息
1458
+ * @returns JSON数组
1459
+ */
1460
+ exportJSON(idInfo?: number | number[]): spec.JSONScene[];
1461
+ getViewBoxById(id: string): Box2;
1462
+ getViewItemById(id: string): ViewItem | undefined;
1463
+ getViewProperty(id: number): ViewProperty | undefined;
1464
+ pageMove(shift: [number, number]): void;
1465
+ pageZoom(shift: number, center?: [number, number]): void;
1466
+ /**
1467
+ * @description 设置视图缩放工具锁定缩放比例开关
1468
+ * @param state 缩放比例开关
1469
+ */
1470
+ setPictureCutGizmoLockScale(state: boolean): void;
1471
+ /**
1472
+ * @description 设置视图扩展工具锁定缩放比例开关
1473
+ * @param state 缩放比例开关
1474
+ */
1475
+ setPictureExpandGizmoLockScale(state: boolean): void;
1476
+ /**
1477
+ * @description 视图缩放函数
1478
+ * @param shiftParam 视图偏移值
1479
+ */
1480
+ viewportFit(shiftParam?: ViewportFitShiftParam, box?: Box2): void;
1481
+ /**
1482
+ * @description 获取元素包围盒
1483
+ * @param idInfo 元素Id
1484
+ * @returns 元素包围盒
1485
+ */
1486
+ getItemBoxById(idInfo: string): Box2;
1487
+ /**
1488
+ * @description 设置元素字体
1489
+ * @param id 元素Id
1490
+ * @param fontFamilyName 字体名称
1491
+ * @param url 字体地址
1492
+ */
1493
+ setItemFontFamily(id: string, fontFamilyName: string, url: string): Promise<void>;
1494
+ createSceneByCreateInfos(createInfos: ItemCreateInfo[], sceneInfo: SceneCreaetInfo): spec.JSONScene;
1495
+ changeItemPropertyByCreateInfo(createInfo: ItemCreateInfo | ItemCreateInfo[]): void;
1496
+ setTransformGizmoLockScale(state: boolean): void;
1497
+ getViewBoxByBox(box: Box2): Box2;
1498
+ openSpriteTextEditGizmo(initParam: SpriteTextInitParam[]): void;
1499
+ closeSpriteTextEditGizmo(): void;
1500
+ setSpriteTextSelectedIndex(id: string, index: number): void;
1501
+ setSpriteTextSelectedText(id: string, index: number, text: string): void;
1502
+ getBoundingBoxByItemCreateInfo(createInfo: ItemCreateInfo): Box2;
1503
+ getBoundingBoxByItemCreateInfos(createInfos: ItemCreateInfo[]): Box2;
1504
+ setSpriteTextChangedState(id: string, index: number, hasChanged: boolean): void;
1505
+ setSpriteTextEditState(id: string, index: number, isEditing: boolean): void;
1506
+ }
1507
+
1508
+ type SizeAdaptDirection = 'x' | 'y';
82
1509
 
83
1510
  type BaseFormProperty = {
84
- position: [number, number, number];
1511
+ position: [number, number];
85
1512
  rotation: [number, number, number];
86
- scale: [number, number, number];
1513
+ size: [number, number];
1514
+ visible: boolean;
87
1515
  keyPropertyEditing: boolean;
88
1516
  };
89
1517
  type SpriteFormProperty = BaseFormProperty & {
90
1518
  image: string;
91
1519
  };
92
1520
  type TextFormProperty = BaseFormProperty & {
93
- font: string;
94
- color: [number, number, number, number];
95
- weight: spec.TextWeight;
1521
+ fontFamily: string;
1522
+ textColor: [number, number, number, number];
1523
+ fontWeight: spec.TextWeight;
96
1524
  text: string;
97
- alignment: spec.TextAlignment;
1525
+ textAlign: spec.TextAlignment;
1526
+ fontSize: number;
1527
+ fontStyle: spec.FontStyle;
1528
+ textWidth: number;
1529
+ lineHeight: number;
1530
+ outlineColor?: spec.vec4;
1531
+ outlineWidth?: number;
1532
+ /**
1533
+ * @description 描边开关
1534
+ */
1535
+ outlineEnabled?: boolean;
1536
+ };
1537
+ type VideoFormProperty = BaseFormProperty & {
1538
+ video: string;
98
1539
  };
99
1540
  /**
100
1541
  * @description 页面表单类型和属性引用
@@ -118,7 +1559,7 @@ type PageFormTypeAndPropertyReference = {
118
1559
  [spec.ItemType.shape]: BaseFormProperty;
119
1560
  [spec.ItemType.postProcessVolume]: BaseFormProperty;
120
1561
  [spec.ItemType.node]: BaseFormProperty;
121
- [spec.ItemType.video]: BaseFormProperty;
1562
+ [spec.ItemType.video]: VideoFormProperty;
122
1563
  [spec.ItemType.audio]: BaseFormProperty;
123
1564
  [spec.ItemType.richtext]: TextFormProperty;
124
1565
  };
@@ -127,30 +1568,37 @@ type SpecificPageFormProps<T extends keyof PageFormTypeAndPropertyReference> = {
127
1568
  property: PageFormTypeAndPropertyReference[T];
128
1569
  onPropertyValueChange: <N extends keyof PageFormTypeAndPropertyReference[T]>(propertyName: N, propertyValue: PageFormTypeAndPropertyReference[T][N]) => void;
129
1570
  };
1571
+ type SDKOptions = {
1572
+ /** 导出视频时,是否开启转码日志 */
1573
+ loggerInExportVideoTranscoding?: boolean;
1574
+ };
1575
+ type SDKInputParam = SDKTemplateInputParam | SDKEditorInputParam;
130
1576
  /**
131
1577
  * @description SDK入参
132
1578
  */
133
- type SDKInputParam = {
1579
+ type SDKTemplateInputParam = {
134
1580
  /**
135
1581
  * @description JSON地址
136
1582
  */
137
1583
  scene: string | spec.JSONScene;
1584
+ /**
1585
+ * @description SDK模式 - 模板编辑模式
1586
+ */
1587
+ mode: 'template';
138
1588
  /**
139
1589
  * @description 视图参数
140
1590
  */
141
- viewParams: ViewParam[];
1591
+ viewParams?: ViewParam[];
142
1592
  /**
143
1593
  * @description 页面属性
144
1594
  */
145
1595
  options: PageOptions;
1596
+ };
1597
+ type SDKEditorInputParam = {
146
1598
  /**
147
- * @description 是否开启出血区强制变换
148
- */
149
- keepSafe?: boolean;
150
- /**
151
- * @description 是否开启静态预览功能 - 第一个合成仅支持播放,不可编辑
1599
+ * @description SDK模式 - 编辑器模式
152
1600
  */
153
- staticPreview?: boolean;
1601
+ mode: 'editor';
154
1602
  };
155
1603
  /**
156
1604
  * @description 页面属性
@@ -173,6 +1621,10 @@ type PageOptions = {
173
1621
  * @description 页面数据
174
1622
  */
175
1623
  type PageData = {
1624
+ /**
1625
+ * @description 基础场景数据
1626
+ */
1627
+ scene: spec.JSONScene;
176
1628
  /**
177
1629
  * @description 页面属性
178
1630
  */
@@ -218,6 +1670,10 @@ type PageConfig = {
218
1670
  * @description 同步开关
219
1671
  */
220
1672
  asyncMode: boolean;
1673
+ /**
1674
+ * @description 画布移动
1675
+ */
1676
+ translation: spec.vec2;
221
1677
  };
222
1678
  /**
223
1679
  * @description 页面属性
@@ -251,11 +1707,15 @@ type ViewParam = {
251
1707
  /**
252
1708
  * @description 页面尺寸
253
1709
  */
254
- size: [number, number];
1710
+ size?: [number, number];
255
1711
  /**
256
1712
  * @description 出血区参数
257
1713
  */
258
- safeArea: [number, number, number, number];
1714
+ safeArea?: [number, number, number, number];
1715
+ /**
1716
+ * @description 自适应方向 - 默认根据视图宽高决定
1717
+ */
1718
+ adaptionDirection?: SizeAdaptDirection;
259
1719
  /**
260
1720
  * @description 自定义出血区 - 用于展示
261
1721
  */
@@ -269,31 +1729,11 @@ type ViewParam = {
269
1729
  * @description 导出参数
270
1730
  */
271
1731
  type ExportParam = {
272
- /**
273
- * @description 导出视频时长
274
- */
275
- time: number;
276
- /**
277
- * @description 导出大小上限 - 单位kb
278
- */
279
- fileSizeLimit: number;
280
- /**
281
- * @description 是否开启音轨
282
- */
283
- audioEnable: boolean;
284
- /**
285
- * @description 视频fps - 默认 30
286
- */
287
- fps?: number;
288
- /**
289
- * @description 导出视频类型 - 预留参数
290
- */
291
- type?: string;
292
1732
  /**
293
1733
  * @description 视频名称
294
1734
  */
295
1735
  name?: string;
296
- };
1736
+ } & Omit<ExportMediaItemOptions, 'scene' | 'size'>;
297
1737
  /**
298
1738
  * @description 视图属性
299
1739
  */
@@ -318,10 +1758,6 @@ type ViewProperty = {
318
1758
  * @description 视图场景数据
319
1759
  */
320
1760
  scene: spec.JSONScene;
321
- /**
322
- * @description 预览图数据
323
- */
324
- thumbnail: string;
325
1761
  /**
326
1762
  * @description 导出参数
327
1763
  */
@@ -360,6 +1796,10 @@ type ActiveData = {
360
1796
  * @description 预选中元素
361
1797
  */
362
1798
  preSelectedItem?: string;
1799
+ /**
1800
+ * @description 执行中元素
1801
+ */
1802
+ loadingItems?: string[];
363
1803
  };
364
1804
  /**
365
1805
  * @description 视图元素
@@ -394,113 +1834,255 @@ type ViewItem = {
394
1834
  */
395
1835
  endBehavior: spec.EndBehavior;
396
1836
  } & ViewItemTypedProperty;
397
-
398
- declare const ExportStatusMap: {
399
- readonly DEFAULT: "default";
400
- readonly EXPORTING: "exporting";
401
- readonly SUCCESS: "success";
402
- readonly ERROR: "error";
1837
+ type SDKBackgroundType = 'color' | 'image' | 'chess-board';
1838
+ /**
1839
+ * @description 图层创建信息
1840
+ */
1841
+ type SpriteCreateInfo = {
1842
+ type: 'sprite';
1843
+ /**
1844
+ * @description 图层名称
1845
+ */
1846
+ name?: string;
1847
+ /**
1848
+ * @description 元素id
1849
+ */
1850
+ id?: string;
1851
+ /**
1852
+ * @description 父节点id
1853
+ */
1854
+ parentId?: string;
1855
+ /**
1856
+ * @description 图片资源地址
1857
+ */
1858
+ url: string;
1859
+ /**
1860
+ * @description 图层元素像素大小
1861
+ */
1862
+ size: spec.vec2;
1863
+ /**
1864
+ * @description 图层元素缩放
1865
+ */
1866
+ scale?: spec.vec2;
1867
+ /**
1868
+ * @description 图层元素旋转
1869
+ */
1870
+ rotation?: number;
1871
+ /**
1872
+ * @description 图层元素二维位置
1873
+ */
1874
+ position: spec.vec2;
403
1875
  };
404
- type ExportStatus = typeof ExportStatusMap[keyof typeof ExportStatusMap];
405
- type SDKEvents = {
406
- 'selectedItemChange': [id: string[]];
407
- 'preSelectedItemChange': [id: string | undefined];
408
- 'selectedViewChange': [id: number];
409
- 'pageDataChange': [pageData: PageData];
410
- 'zoomChange': [zoom: number];
411
- 'progress': [{
412
- duration: number;
413
- time: number;
414
- end: boolean;
415
- paused: boolean;
416
- }];
417
- 'itemPropertyChange': [{
418
- id: string;
419
- property: string;
420
- }];
421
- 'exportProgress': [progress?: number];
422
- 'exportComplete': [success: boolean];
1876
+ /**
1877
+ * @description 空节点创建信息
1878
+ */
1879
+ type NullCreateInfo = {
1880
+ type: 'null';
1881
+ /**
1882
+ * @description 元素id
1883
+ */
1884
+ id?: string;
1885
+ /**
1886
+ * @description 父节点id
1887
+ */
1888
+ parentId?: string;
1889
+ /**
1890
+ * @description 元素名称
1891
+ */
1892
+ name?: string;
1893
+ /**
1894
+ * @description 空节点缩放
1895
+ */
1896
+ scale?: spec.vec2;
1897
+ /**
1898
+ * @description 子元素id
1899
+ */
1900
+ children: string[];
1901
+ /**
1902
+ * @description 空节点旋转
1903
+ */
1904
+ rotation?: number;
1905
+ /**
1906
+ * @description 空节点位移
1907
+ */
1908
+ position?: spec.vec2;
423
1909
  };
424
- declare class SDK {
425
- private _eventEmitter;
426
- private _pageData;
427
- private _screenShotContainer;
428
- private _screenShotPlayer;
429
- private _SDKUtils;
430
- private _ExportVideo;
431
- private _gestureHandler;
432
- private _playerContainer;
433
- private _exportStatus;
434
- private disposables;
435
- player: Player;
436
- constructor(container: HTMLElement);
437
- get pageData(): PageData | undefined;
438
- get exportStatus(): ExportStatus;
439
- private get exportOptions();
440
- dispose(): void;
441
- on: <E extends "progress" | "selectedItemChange" | "preSelectedItemChange" | "selectedViewChange" | "pageDataChange" | "zoomChange" | "itemPropertyChange" | "exportProgress" | "exportComplete">(eventName: E, listener: _galacean_effects_weapp.EventEmitterListener<SDKEvents[E]>, options?: _galacean_effects_weapp.EventEmitterOptions) => () => void;
442
- private getInitParam;
443
- private initSDK;
444
- run(param: SDKInputParam): Promise<void>;
445
- getPageData(): PageData;
446
- getActiveItems(): string[];
447
- setPreSelectedItem(id: string): void;
448
- getPreSelectedItem(): string;
449
- setSelectedItems(itemIds: string[]): void;
1910
+ /**
1911
+ * @description 文本创建信息
1912
+ */
1913
+ type TextCreateInfo = {
1914
+ type: 'text';
450
1915
  /**
451
- * @description 获取目标元素的所有属性
452
- * @param param 元素ID、类型
453
- * @returns 元素属性
1916
+ * @description 元素id
454
1917
  */
455
- getItemProperty<T extends keyof PageFormTypeAndPropertyReference>(param: GetItemPropertyParam<T>): GetItemPropertyResult<T> | undefined;
1918
+ id?: string;
456
1919
  /**
457
- * @description 获取目标元素的指定属性
458
- * @param param 元素ID、类型、属性名
459
- * @returns 元素属性值
1920
+ * @description 父节点id
460
1921
  */
461
- getItemPropertyValue<T extends keyof PageFormTypeAndPropertyReference, N extends keyof PageFormTypeAndPropertyReference[T]>(param: GetItemPropertyValueParam<T, N>): GetItemPropertyValueResult<T, N> | undefined;
462
- setItemPropertyValue(param: SetItemPropertyValueParam): Promise<void>;
463
- generateScreenShot(id: number, size?: [number, number], tick?: number): Promise<string>;
1922
+ parentId?: string;
464
1923
  /**
465
- * @description 切换场景
466
- * @param index 场景索引
1924
+ * @description 元素名称
467
1925
  */
468
- switchScene(index: number): Promise<void>;
1926
+ name?: string;
469
1927
  /**
470
- * @description 获取页面的 safeAreaPreview、zoom、adsorption 值
471
- * @returns 页面的 safeAreaPreview、zoom、adsorption 值
1928
+ * @description 单行高度
472
1929
  */
473
- getConfig(): PageConfig;
1930
+ lineHeight: number;
474
1931
  /**
475
- * 设置页面的 safeAreaPreview、zoom、adsorption 值
476
- * @param pageProperty 设置
1932
+ * @description 文本高度
477
1933
  */
478
- setConfig(pageConfig: PageConfig): void;
1934
+ textHeight?: number;
479
1935
  /**
480
- * @description 设置播放进度
481
- * @param progress 播放进度 0-100
1936
+ * @description 宽度
482
1937
  */
483
- setPlayProgress(progress: number): Promise<void>;
484
- getViewItems(): ViewItem[];
485
- setPlayState(playState: 'play' | 'pause'): Promise<void>;
1938
+ textWidth: number;
486
1939
  /**
487
- * @description 获取场景预览图
488
- * @returns 视图预览图
1940
+ * @description 字体名称
489
1941
  */
490
- getViewThumbnail(): {
491
- id: number;
492
- thumbnail: string;
493
- }[];
494
- private onExportProgress;
495
- private onExportFinish;
496
- private onExportError;
1942
+ fontFamily: string;
497
1943
  /**
498
- * @description 导出视频
1944
+ * @description 文本位置
499
1945
  */
500
- exportAllVideos(): void;
501
- cancelExportAllVideos(): void;
502
- loadPageData(data: PageData): Promise<void>;
503
- runByPageData(data: PageData): Promise<void>;
1946
+ position?: spec.vec2;
1947
+ /**
1948
+ * @description 文本旋转
1949
+ */
1950
+ rotation?: number;
1951
+ /**
1952
+ * @description 文字大小
1953
+ */
1954
+ fontSize: number;
1955
+ /**
1956
+ * @description 字重
1957
+ */
1958
+ fontWeight?: spec.TextWeight;
1959
+ /**
1960
+ * @description 字体格式
1961
+ */
1962
+ fontStyle?: spec.FontStyle;
1963
+ /**
1964
+ * @description 对齐方式
1965
+ */
1966
+ textAlign?: spec.TextAlignment;
1967
+ /**
1968
+ * @description 文本信息
1969
+ */
1970
+ text: string;
1971
+ /**
1972
+ * @description 填充色
1973
+ */
1974
+ textColor: spec.vec4;
1975
+ /**
1976
+ * @description 描边色
1977
+ */
1978
+ outlineColor?: spec.vec4;
1979
+ /**
1980
+ * @description 描边宽度
1981
+ */
1982
+ outlineWidth?: number;
1983
+ /**
1984
+ * @description 描边开关
1985
+ */
1986
+ outlineEnabled?: boolean;
1987
+ /**
1988
+ * @description 字体文件地址
1989
+ */
1990
+ url?: string;
1991
+ };
1992
+ /**
1993
+ * @description 视频创建信息
1994
+ */
1995
+ type VideoCreateInfo = {
1996
+ type: 'video';
1997
+ /**
1998
+ * @description 视频名称
1999
+ */
2000
+ name?: string;
2001
+ /**
2002
+ * @description 元素id
2003
+ */
2004
+ id?: string;
2005
+ /**
2006
+ * @description 父节点id
2007
+ */
2008
+ parentId?: string;
2009
+ /**
2010
+ * @description 视频资源地址
2011
+ */
2012
+ url: string;
2013
+ /**
2014
+ * @description 视频元素像素大小
2015
+ */
2016
+ size: spec.vec2;
2017
+ /**
2018
+ * @description 视频元素缩放
2019
+ */
2020
+ scale?: spec.vec2;
2021
+ /**
2022
+ * @description 视频元素旋转
2023
+ */
2024
+ rotation?: number;
2025
+ /**
2026
+ * @description 视频元素二维位置
2027
+ */
2028
+ position: spec.vec2;
2029
+ /**
2030
+ * @description 是否静音
2031
+ */
2032
+ muted?: boolean;
2033
+ /**
2034
+ * @description 是否为透明视频
2035
+ */
2036
+ transparent?: boolean;
2037
+ /**
2038
+ * @description 播放速率
2039
+ */
2040
+ playbackRate?: number;
2041
+ /**
2042
+ * @description 音量
2043
+ */
2044
+ volume?: number;
2045
+ };
2046
+ type ItemCreateInfo = NullCreateInfo | SpriteCreateInfo | TextCreateInfo | VideoCreateInfo;
2047
+ /**
2048
+ * @description 场景创建信息
2049
+ */
2050
+ type SceneCreaetInfo = {
2051
+ /**
2052
+ * @description 场景名称
2053
+ */
2054
+ name: string;
2055
+ /**
2056
+ * @description 场景大小
2057
+ */
2058
+ size: spec.vec2;
2059
+ };
2060
+ declare enum ItemOrderAction {
2061
+ BringToFront = 0,
2062
+ SendToBack = 1,
2063
+ BringForward = 2,
2064
+ SendBackward = 3
504
2065
  }
2066
+ /**
2067
+ * @description 视图自适应偏移参数
2068
+ */
2069
+ type ViewportFitShiftParam = {
2070
+ /**
2071
+ * @description 左偏移
2072
+ */
2073
+ left?: number;
2074
+ /**
2075
+ * @description 右偏移
2076
+ */
2077
+ right?: number;
2078
+ /**
2079
+ * @description 上偏移
2080
+ */
2081
+ top?: number;
2082
+ /**
2083
+ * @description 下偏移
2084
+ */
2085
+ bottom?: number;
2086
+ };
505
2087
 
506
- export { type ActiveData, type BaseFormProperty, type ExportStatus, ExportStatusMap, type PageData, type PageFormTypedProperty, type PageProperty, SDK, type SDKEvents, type SDKInputParam, type SpecificPageFormProps, type SpriteFormProperty, type TextFormProperty, type ViewItem, type ViewParam, type ViewProperty };
2088
+ export { type ActiveData, type BaseFormProperty, Box2, type CreateOperation, type DeleteOperation, type GizmoType, type ItemCreateInfo, ItemOrderAction, type NullCreateInfo, type Operation, type PageData, type PageFormTypedProperty, type PageProperty, SDK, type SDKEvents, type SDKInputParam, type SDKOptions, type SetItemPropertyValueParam, type SpecificPageFormProps, type SpriteCreateInfo, type SpriteFormProperty, type TextCreateInfo, type TextFormProperty, type UpdateOperation, Vector2, type VideoCreateInfo, type ViewItem, type ViewItemTypedProperty, type ViewParam, type ViewProperty };