@vvfx/sdk 0.1.18 → 0.1.19-alpha.1
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.cjs +1 -1
- package/dist/index.d.cts +1669 -1477
- package/dist/index.d.ts +1669 -1477
- package/dist/index.global.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -44,10 +44,14 @@ type SDKItemOptions = {
|
|
|
44
44
|
* @description 是否处于锁定状态
|
|
45
45
|
*/
|
|
46
46
|
isLocked?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* @description 关键属性是否可编辑
|
|
49
|
+
*/
|
|
50
|
+
isCoreEditable: boolean;
|
|
47
51
|
/**
|
|
48
52
|
* @description 扩展属性存储(属性名 -> 属性值)
|
|
49
53
|
*/
|
|
50
|
-
|
|
54
|
+
extension?: Record<string, any>;
|
|
51
55
|
/**
|
|
52
56
|
* @description 允许任意额外属性(用于兼容旧代码)
|
|
53
57
|
*/
|
|
@@ -103,6 +107,15 @@ type GeneratorItemOptions = SDKItemOptions & {
|
|
|
103
107
|
type EffectsItemOptions = SDKItemOptions & {
|
|
104
108
|
property?: Partial<EffectsItemProperty>;
|
|
105
109
|
};
|
|
110
|
+
/**
|
|
111
|
+
* @description Frame 画板元素 SDKItem 选项
|
|
112
|
+
*/
|
|
113
|
+
type FrameItemOptions = SDKItemOptions & {
|
|
114
|
+
/**
|
|
115
|
+
* @description 元素属性
|
|
116
|
+
*/
|
|
117
|
+
property?: Partial<FrameItemProperty>;
|
|
118
|
+
};
|
|
106
119
|
/**
|
|
107
120
|
* @description SDKItem 类型(独立于 spec.ItemType)
|
|
108
121
|
* @description 包含所有 SDK 层级的元素类型,包括虚拟类型如 generator
|
|
@@ -154,10 +167,11 @@ declare abstract class BaseItem {
|
|
|
154
167
|
* @description 是否处于锁定状态
|
|
155
168
|
*/
|
|
156
169
|
isLocked: boolean;
|
|
170
|
+
isCoreEditable: boolean;
|
|
157
171
|
/**
|
|
158
172
|
* @description 扩展属性存储(与 property 同级)
|
|
159
173
|
*/
|
|
160
|
-
private
|
|
174
|
+
private _extension;
|
|
161
175
|
/**
|
|
162
176
|
* @description 元素类型(由子类实现)
|
|
163
177
|
* @description 支持 spec.ItemType 或扩展的 SDKItemType
|
|
@@ -201,7 +215,7 @@ declare abstract class BaseItem {
|
|
|
201
215
|
* @description 获取所有扩展属性
|
|
202
216
|
* @returns 扩展属性对象
|
|
203
217
|
*/
|
|
204
|
-
|
|
218
|
+
getAllExtension(): Record<string, any>;
|
|
205
219
|
/**
|
|
206
220
|
* @description 批量设置扩展属性
|
|
207
221
|
* @param extensions 扩展属性对象
|
|
@@ -210,7 +224,7 @@ declare abstract class BaseItem {
|
|
|
210
224
|
/**
|
|
211
225
|
* @description 清空所有扩展属性
|
|
212
226
|
*/
|
|
213
|
-
|
|
227
|
+
clearExtension(): void;
|
|
214
228
|
/**
|
|
215
229
|
* @description 转换为 CreateInfo(用于元素复制/导出)
|
|
216
230
|
* @param withParent 是否包含父节点ID
|
|
@@ -259,11 +273,10 @@ declare class SpriteItem extends BaseItem {
|
|
|
259
273
|
*/
|
|
260
274
|
get position(): [number, number];
|
|
261
275
|
set position(value: [number, number]);
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
set size(value: [number, number]);
|
|
276
|
+
get width(): number;
|
|
277
|
+
set width(value: number);
|
|
278
|
+
get height(): number;
|
|
279
|
+
set height(value: number);
|
|
267
280
|
/**
|
|
268
281
|
* @description 旋转(二维旋转角度)
|
|
269
282
|
*/
|
|
@@ -276,6 +289,7 @@ declare class SpriteItem extends BaseItem {
|
|
|
276
289
|
set fullRotation(value: [number, number, number]);
|
|
277
290
|
/**
|
|
278
291
|
* @description 是否正在编辑关键属性
|
|
292
|
+
* @deprecated 该属性即将废弃,使用 isCoreEditable 代替
|
|
279
293
|
*/
|
|
280
294
|
get keyPropertyEditing(): boolean;
|
|
281
295
|
set keyPropertyEditing(value: boolean);
|
|
@@ -352,8 +366,8 @@ declare class TextItem extends BaseItem {
|
|
|
352
366
|
/**
|
|
353
367
|
* @description 文本宽度
|
|
354
368
|
*/
|
|
355
|
-
get
|
|
356
|
-
set
|
|
369
|
+
get width(): number;
|
|
370
|
+
set width(value: number);
|
|
357
371
|
/**
|
|
358
372
|
* @description 行高
|
|
359
373
|
*/
|
|
@@ -362,8 +376,8 @@ declare class TextItem extends BaseItem {
|
|
|
362
376
|
/**
|
|
363
377
|
* @description 文本高度
|
|
364
378
|
*/
|
|
365
|
-
get
|
|
366
|
-
set
|
|
379
|
+
get height(): number;
|
|
380
|
+
set height(value: number);
|
|
367
381
|
/**
|
|
368
382
|
* @description 描边颜色
|
|
369
383
|
*/
|
|
@@ -429,10 +443,15 @@ declare class VideoItem extends BaseItem {
|
|
|
429
443
|
get position(): [number, number];
|
|
430
444
|
set position(value: [number, number]);
|
|
431
445
|
/**
|
|
432
|
-
* @description
|
|
446
|
+
* @description 宽度
|
|
433
447
|
*/
|
|
434
|
-
get
|
|
435
|
-
set
|
|
448
|
+
get width(): number;
|
|
449
|
+
set width(value: number);
|
|
450
|
+
/**
|
|
451
|
+
* @description 高度
|
|
452
|
+
*/
|
|
453
|
+
get height(): number;
|
|
454
|
+
set height(value: number);
|
|
436
455
|
/**
|
|
437
456
|
* @description 旋转(二维旋转角度)
|
|
438
457
|
*/
|
|
@@ -445,6 +464,7 @@ declare class VideoItem extends BaseItem {
|
|
|
445
464
|
set fullRotation(value: [number, number, number]);
|
|
446
465
|
/**
|
|
447
466
|
* @description 是否正在编辑关键属性
|
|
467
|
+
* @deprecated 该属性即将废弃,使用 isCoreEditable 代替
|
|
448
468
|
*/
|
|
449
469
|
get keyPropertyEditing(): boolean;
|
|
450
470
|
set keyPropertyEditing(value: boolean);
|
|
@@ -502,11 +522,6 @@ declare class GroupItem extends BaseItem {
|
|
|
502
522
|
*/
|
|
503
523
|
get position(): [number, number];
|
|
504
524
|
set position(value: [number, number]);
|
|
505
|
-
/**
|
|
506
|
-
* @description 大小
|
|
507
|
-
*/
|
|
508
|
-
get size(): [number, number];
|
|
509
|
-
set size(value: [number, number]);
|
|
510
525
|
/**
|
|
511
526
|
* @description 大小
|
|
512
527
|
*/
|
|
@@ -524,6 +539,7 @@ declare class GroupItem extends BaseItem {
|
|
|
524
539
|
set fullRotation(value: [number, number, number]);
|
|
525
540
|
/**
|
|
526
541
|
* @description 是否正在编辑关键属性
|
|
542
|
+
* @deprecated 该属性即将废弃,使用 isCoreEditable 代替
|
|
527
543
|
*/
|
|
528
544
|
get keyPropertyEditing(): boolean;
|
|
529
545
|
set keyPropertyEditing(value: boolean);
|
|
@@ -574,10 +590,15 @@ declare class GeneratorItem extends BaseItem {
|
|
|
574
590
|
get position(): [number, number];
|
|
575
591
|
set position(value: [number, number]);
|
|
576
592
|
/**
|
|
577
|
-
* @description
|
|
593
|
+
* @description 宽度
|
|
594
|
+
*/
|
|
595
|
+
get width(): number;
|
|
596
|
+
set width(value: number);
|
|
597
|
+
/**
|
|
598
|
+
* @description 高度
|
|
578
599
|
*/
|
|
579
|
-
get
|
|
580
|
-
set
|
|
600
|
+
get height(): number;
|
|
601
|
+
set height(value: number);
|
|
581
602
|
/**
|
|
582
603
|
* @description 旋转(二维旋转角度)
|
|
583
604
|
*/
|
|
@@ -590,6 +611,7 @@ declare class GeneratorItem extends BaseItem {
|
|
|
590
611
|
set fullRotation(value: [number, number, number]);
|
|
591
612
|
/**
|
|
592
613
|
* @description 是否正在编辑关键属性
|
|
614
|
+
* @deprecated 该属性即将废弃,使用 isCoreEditable 代替
|
|
593
615
|
*/
|
|
594
616
|
get keyPropertyEditing(): boolean;
|
|
595
617
|
set keyPropertyEditing(value: boolean);
|
|
@@ -644,10 +666,15 @@ declare class EffectsItem extends BaseItem {
|
|
|
644
666
|
get position(): [number, number];
|
|
645
667
|
set position(value: [number, number]);
|
|
646
668
|
/**
|
|
647
|
-
* @description
|
|
669
|
+
* @description 宽度
|
|
670
|
+
*/
|
|
671
|
+
get width(): number;
|
|
672
|
+
set width(value: number);
|
|
673
|
+
/**
|
|
674
|
+
* @description 高度
|
|
648
675
|
*/
|
|
649
|
-
get
|
|
650
|
-
set
|
|
676
|
+
get height(): number;
|
|
677
|
+
set height(value: number);
|
|
651
678
|
/**
|
|
652
679
|
* @description 旋转(二维旋转角度)
|
|
653
680
|
*/
|
|
@@ -660,6 +687,7 @@ declare class EffectsItem extends BaseItem {
|
|
|
660
687
|
set fullRotation(value: [number, number, number]);
|
|
661
688
|
/**
|
|
662
689
|
* @description 是否正在编辑关键属性
|
|
690
|
+
* @deprecated 该属性即将废弃,使用 isCoreEditable 代替
|
|
663
691
|
*/
|
|
664
692
|
get keyPropertyEditing(): boolean;
|
|
665
693
|
set keyPropertyEditing(value: boolean);
|
|
@@ -678,6 +706,106 @@ declare class EffectsItem extends BaseItem {
|
|
|
678
706
|
*/
|
|
679
707
|
declare function isEffectsItem(obj: any): obj is EffectsItem;
|
|
680
708
|
|
|
709
|
+
/**
|
|
710
|
+
* @description 画板/框架元素 SDKItem 类
|
|
711
|
+
* @description 支持自动布局和自由布局两种模式
|
|
712
|
+
* @description 底层以 composition 形式渲染
|
|
713
|
+
*/
|
|
714
|
+
declare class FrameItem extends BaseItem {
|
|
715
|
+
/**
|
|
716
|
+
* @description 元素类型
|
|
717
|
+
*/
|
|
718
|
+
readonly type = SDKItemType.FRAME;
|
|
719
|
+
/**
|
|
720
|
+
* @description 元素属性
|
|
721
|
+
*/
|
|
722
|
+
property: FrameItemProperty;
|
|
723
|
+
constructor(options: FrameItemOptions);
|
|
724
|
+
/**
|
|
725
|
+
* @description 子元素ID列表(只读)
|
|
726
|
+
*/
|
|
727
|
+
get children(): readonly string[];
|
|
728
|
+
/**
|
|
729
|
+
* @description 布局模式
|
|
730
|
+
*/
|
|
731
|
+
get layoutMode(): FrameLayoutMode;
|
|
732
|
+
set layoutMode(value: FrameLayoutMode);
|
|
733
|
+
/**
|
|
734
|
+
* @description 位置
|
|
735
|
+
*/
|
|
736
|
+
get position(): [number, number];
|
|
737
|
+
set position(value: [number, number]);
|
|
738
|
+
/**
|
|
739
|
+
* @description 宽度
|
|
740
|
+
*/
|
|
741
|
+
get width(): number;
|
|
742
|
+
set width(value: number);
|
|
743
|
+
/**
|
|
744
|
+
* @description 高度
|
|
745
|
+
*/
|
|
746
|
+
get height(): number;
|
|
747
|
+
set height(value: number);
|
|
748
|
+
/**
|
|
749
|
+
* @description 缩放
|
|
750
|
+
*/
|
|
751
|
+
get scale(): [number, number];
|
|
752
|
+
set scale(value: [number, number]);
|
|
753
|
+
/**
|
|
754
|
+
* @description 旋转(二维旋转角度)
|
|
755
|
+
*/
|
|
756
|
+
get rotation(): number;
|
|
757
|
+
set rotation(value: number);
|
|
758
|
+
/**
|
|
759
|
+
* @description 完整旋转(包含 x, y, z)
|
|
760
|
+
*/
|
|
761
|
+
get fullRotation(): [number, number, number];
|
|
762
|
+
set fullRotation(value: [number, number, number]);
|
|
763
|
+
/**
|
|
764
|
+
* @description 添加子元素
|
|
765
|
+
* @param itemId 子元素ID
|
|
766
|
+
* @returns 是否添加成功
|
|
767
|
+
*/
|
|
768
|
+
addChild(itemId: string): boolean;
|
|
769
|
+
/**
|
|
770
|
+
* @description 批量添加子元素
|
|
771
|
+
* @param itemIds 子元素ID列表
|
|
772
|
+
*/
|
|
773
|
+
addChildren(itemIds: string[]): void;
|
|
774
|
+
/**
|
|
775
|
+
* @description 移除子元素
|
|
776
|
+
* @param itemId 子元素ID
|
|
777
|
+
* @returns 是否移除成功
|
|
778
|
+
*/
|
|
779
|
+
removeChild(itemId: string): boolean;
|
|
780
|
+
/**
|
|
781
|
+
* @description 批量移除子元素
|
|
782
|
+
* @param itemIds 子元素ID列表
|
|
783
|
+
*/
|
|
784
|
+
removeChildren(itemIds: string[]): void;
|
|
785
|
+
/**
|
|
786
|
+
* @description 是否包含指定子元素
|
|
787
|
+
* @param itemId 子元素ID
|
|
788
|
+
*/
|
|
789
|
+
hasChild(itemId: string): boolean;
|
|
790
|
+
/**
|
|
791
|
+
* @description 清空所有子元素
|
|
792
|
+
*/
|
|
793
|
+
clearChildren(): void;
|
|
794
|
+
/**
|
|
795
|
+
* @description 转换为 FrameCreateInfo
|
|
796
|
+
* @param withParent 是否包含父节点ID
|
|
797
|
+
*/
|
|
798
|
+
toCreateInfo(withParent?: boolean): FrameCreateInfo;
|
|
799
|
+
/**
|
|
800
|
+
* @description 克隆 SDKItem
|
|
801
|
+
*/
|
|
802
|
+
clone(): FrameItem;
|
|
803
|
+
}
|
|
804
|
+
/**
|
|
805
|
+
* @description 类型守卫:检查是否是 FrameItem
|
|
806
|
+
*/
|
|
807
|
+
declare function isFrameItem(obj: any): obj is FrameItem;
|
|
808
|
+
|
|
681
809
|
/**
|
|
682
810
|
* @description 根据 item type 创建对应的 SDKItem 实例
|
|
683
811
|
* @param type 元素类型
|
|
@@ -689,56 +817,7 @@ declare function createSDKItem(type: spec.ItemType, options: SDKItemOptions): Ba
|
|
|
689
817
|
* @description SDKItem 类型联合
|
|
690
818
|
* @description 用于替换原来的 SDKItem type
|
|
691
819
|
*/
|
|
692
|
-
type SDKItem$1 = SpriteItem | TextItem | VideoItem | GroupItem | GeneratorItem | EffectsItem;
|
|
693
|
-
|
|
694
|
-
type ViewItemTypedProperty = {
|
|
695
|
-
[K in keyof PageFormTypeAndPropertyReference]: {
|
|
696
|
-
/**
|
|
697
|
-
* @description 元素类型
|
|
698
|
-
*/
|
|
699
|
-
type: K;
|
|
700
|
-
/**
|
|
701
|
-
* @description 元素属性
|
|
702
|
-
*/
|
|
703
|
-
property: PageFormTypeAndPropertyReference[K];
|
|
704
|
-
};
|
|
705
|
-
}[keyof PageFormTypeAndPropertyReference];
|
|
706
|
-
type PageFormTypedProperty = {
|
|
707
|
-
[K in keyof PageFormTypeAndPropertyReference]: {
|
|
708
|
-
type: K;
|
|
709
|
-
property: PageFormTypeAndPropertyReference[K];
|
|
710
|
-
onPropertyValueChange: <N extends keyof PageFormTypeAndPropertyReference[K]>(propertyName: N, propertyValue: PageFormTypeAndPropertyReference[K][N]) => void;
|
|
711
|
-
};
|
|
712
|
-
}[keyof PageFormTypeAndPropertyReference];
|
|
713
|
-
type GetItemPropertyValueParam<T extends keyof PageFormTypeAndPropertyReference, N extends keyof PageFormTypeAndPropertyReference[T]> = {
|
|
714
|
-
itemId: string;
|
|
715
|
-
type: T;
|
|
716
|
-
propertyName: N;
|
|
717
|
-
};
|
|
718
|
-
type GetItemPropertyValueResult<T extends keyof PageFormTypeAndPropertyReference, N extends keyof PageFormTypeAndPropertyReference[T]> = PageFormTypeAndPropertyReference[T][N];
|
|
719
|
-
type GetItemPropertyParam<T extends keyof PageFormTypeAndPropertyReference> = {
|
|
720
|
-
itemId: string;
|
|
721
|
-
type: T;
|
|
722
|
-
};
|
|
723
|
-
type GetItemPropertyResult<T extends keyof PageFormTypeAndPropertyReference> = {
|
|
724
|
-
type: T;
|
|
725
|
-
property: PageFormTypeAndPropertyReference[T];
|
|
726
|
-
};
|
|
727
|
-
type SetItemPropertyValueParam = {
|
|
728
|
-
[T in keyof PageFormTypeAndPropertyReference]: {
|
|
729
|
-
[N in keyof PageFormTypeAndPropertyReference[T]]: {
|
|
730
|
-
itemId: string;
|
|
731
|
-
type: T;
|
|
732
|
-
propertyName: N;
|
|
733
|
-
propertyValue: PageFormTypeAndPropertyReference[T][N];
|
|
734
|
-
};
|
|
735
|
-
}[keyof PageFormTypeAndPropertyReference[T]];
|
|
736
|
-
}[keyof PageFormTypeAndPropertyReference] | {
|
|
737
|
-
itemId: string;
|
|
738
|
-
type: SDKItemType | spec.ItemType;
|
|
739
|
-
propertyName: 'position' | 'size';
|
|
740
|
-
propertyValue: spec.vec2 | spec.vec3;
|
|
741
|
-
};
|
|
820
|
+
type SDKItem$1 = SpriteItem | TextItem | VideoItem | GroupItem | GeneratorItem | EffectsItem | FrameItem;
|
|
742
821
|
|
|
743
822
|
/**
|
|
744
823
|
* @class 二维线段
|
|
@@ -1027,31 +1106,7 @@ declare class Box2 {
|
|
|
1027
1106
|
rotate(angle: number, center?: Vector2): this;
|
|
1028
1107
|
}
|
|
1029
1108
|
|
|
1030
|
-
type
|
|
1031
|
-
type: 'create';
|
|
1032
|
-
newData: ItemCreateInfo[];
|
|
1033
|
-
};
|
|
1034
|
-
type DeleteOperation = {
|
|
1035
|
-
type: 'delete';
|
|
1036
|
-
oldData: ItemCreateInfo[];
|
|
1037
|
-
};
|
|
1038
|
-
type UpdateOperation = {
|
|
1039
|
-
type: 'update';
|
|
1040
|
-
newData: ItemCreateInfo[];
|
|
1041
|
-
oldData: ItemCreateInfo[];
|
|
1042
|
-
};
|
|
1043
|
-
type Operation = CreateOperation | UpdateOperation | DeleteOperation;
|
|
1044
|
-
declare class UndoRedo {
|
|
1045
|
-
private index;
|
|
1046
|
-
private operations;
|
|
1047
|
-
get canUndo(): boolean;
|
|
1048
|
-
get canRedo(): boolean;
|
|
1049
|
-
oldData?: ItemCreateInfo[];
|
|
1050
|
-
push(operation: Operation): void;
|
|
1051
|
-
undo(): Operation | undefined;
|
|
1052
|
-
redo(): Operation | undefined;
|
|
1053
|
-
clear(): void;
|
|
1054
|
-
}
|
|
1109
|
+
type SizeAdaptDirection = 'x' | 'y';
|
|
1055
1110
|
|
|
1056
1111
|
declare const MEDIA_TYPE: {
|
|
1057
1112
|
readonly APNG: "APNG";
|
|
@@ -1236,1983 +1291,2120 @@ type ExportParams = ExportItemParams[];
|
|
|
1236
1291
|
type Buffers = FileBuffer[] | undefined;
|
|
1237
1292
|
type Extras = (FileBuffer | null)[] | null | undefined;
|
|
1238
1293
|
|
|
1239
|
-
type
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1294
|
+
type BaseItemProperty = {
|
|
1295
|
+
position: [number, number];
|
|
1296
|
+
rotation: [number, number, number];
|
|
1297
|
+
scale: [number, number];
|
|
1298
|
+
width: number;
|
|
1299
|
+
height: number;
|
|
1300
|
+
};
|
|
1301
|
+
type SpriteItemProperty = BaseItemProperty & {
|
|
1302
|
+
image: string;
|
|
1303
|
+
};
|
|
1304
|
+
type GroupItemProperty = BaseItemProperty & {
|
|
1305
|
+
children: string[];
|
|
1306
|
+
};
|
|
1307
|
+
type TextItemProperty = BaseItemProperty & {
|
|
1308
|
+
fontFamily: string;
|
|
1309
|
+
color: [number, number, number, number];
|
|
1310
|
+
fontWeight: spec.TextWeight;
|
|
1311
|
+
text: string;
|
|
1312
|
+
textAlign: spec.TextAlignment;
|
|
1313
|
+
fontSize: number;
|
|
1314
|
+
fontStyle: spec.FontStyle;
|
|
1315
|
+
lineHeight: number;
|
|
1316
|
+
outlineColor?: spec.vec4;
|
|
1317
|
+
outlineWidth?: number;
|
|
1252
1318
|
/**
|
|
1253
|
-
* @description
|
|
1319
|
+
* @description 描边开关
|
|
1254
1320
|
*/
|
|
1255
|
-
|
|
1321
|
+
outlineEnabled?: boolean;
|
|
1322
|
+
fontUrl?: string;
|
|
1323
|
+
};
|
|
1324
|
+
type VideoItemProperty = BaseItemProperty & {
|
|
1325
|
+
video: string;
|
|
1256
1326
|
/**
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1327
|
+
* @description 是否静音
|
|
1328
|
+
*/
|
|
1329
|
+
muted?: boolean;
|
|
1260
1330
|
/**
|
|
1261
|
-
* @description
|
|
1331
|
+
* @description 是否为透明视频
|
|
1262
1332
|
*/
|
|
1263
|
-
|
|
1333
|
+
transparent?: boolean;
|
|
1264
1334
|
/**
|
|
1265
|
-
* @description
|
|
1335
|
+
* @description 播放速率
|
|
1266
1336
|
*/
|
|
1267
|
-
|
|
1337
|
+
playbackRate?: number;
|
|
1268
1338
|
/**
|
|
1269
|
-
* @description
|
|
1339
|
+
* @description 音量
|
|
1270
1340
|
*/
|
|
1271
|
-
|
|
1272
|
-
enabled: boolean;
|
|
1273
|
-
adsorptionGizmoEnabled: boolean;
|
|
1274
|
-
adsorptionGizmoConfig: AdsorptionGizmoConfig;
|
|
1275
|
-
controlGizmoEnabled: boolean;
|
|
1276
|
-
controlGizmoConfig: ControlGizmoConfig;
|
|
1277
|
-
preferenceGizmoEnabled: boolean;
|
|
1278
|
-
preferenceGizmoConfig: PreferenceGizmoConfig;
|
|
1279
|
-
selectorGizmoEnabled: boolean;
|
|
1280
|
-
selectorGizmoConfig: SelectorGizmoConfig;
|
|
1281
|
-
transformGizmoEnabled: boolean;
|
|
1282
|
-
transformGizmoConfig: TransformGizmoConfig;
|
|
1283
|
-
pictureCutGizmoEnabled: boolean;
|
|
1284
|
-
pictureCutGizmoConfig: PictureCutGizmoConfig;
|
|
1285
|
-
pictureExpandGizmoEnabled: boolean;
|
|
1286
|
-
pictureExpandGizmoConfig: PictureExpandGizmoConfig;
|
|
1287
|
-
textGizmoEnbaled: boolean;
|
|
1288
|
-
textGizmoConfig: TextGizmoConfig;
|
|
1289
|
-
maskGizmoEnabled: boolean;
|
|
1290
|
-
maskGizmoConfig: MaskGizmoConfig;
|
|
1291
|
-
spriteTextEditGizmoEnabled: boolean;
|
|
1292
|
-
spriteTextEditGizmoConfig: SpriteTextEditGizmoConfig;
|
|
1293
|
-
videoPlayGizmoEnabled: boolean;
|
|
1294
|
-
videoPlayGizmoConfig: VideoPlayGizmoConfig;
|
|
1295
|
-
itemCreateGizmoEnabled: boolean;
|
|
1296
|
-
itemCreateGizmoConfig: ItemCreateGizmoConfig;
|
|
1297
|
-
};
|
|
1341
|
+
volume?: number;
|
|
1298
1342
|
};
|
|
1299
1343
|
/**
|
|
1300
|
-
* @description
|
|
1344
|
+
* @description Generator 表单属性
|
|
1301
1345
|
*/
|
|
1302
|
-
type
|
|
1303
|
-
/**
|
|
1304
|
-
* @description 同步修改功能开关
|
|
1305
|
-
*/
|
|
1306
|
-
asncMode: boolean;
|
|
1307
|
-
/**
|
|
1308
|
-
* @description 静态预览【视图只提供播放预览功能】功能开关
|
|
1309
|
-
*/
|
|
1310
|
-
staticPreview: boolean;
|
|
1311
|
-
/**
|
|
1312
|
-
* @description 静态预览视图名称
|
|
1313
|
-
*/
|
|
1314
|
-
staticPreviewName: string;
|
|
1315
|
-
/**
|
|
1316
|
-
* @description 需过滤的元素名称
|
|
1317
|
-
*/
|
|
1318
|
-
filterItemNames: string[];
|
|
1346
|
+
type GeneratorItemProperty = BaseItemProperty & {
|
|
1319
1347
|
/**
|
|
1320
|
-
* @description
|
|
1348
|
+
* @description 生成器类型
|
|
1321
1349
|
*/
|
|
1322
|
-
|
|
1350
|
+
generatorType: 'image' | 'video';
|
|
1351
|
+
};
|
|
1352
|
+
type EffectsItemProperty = BaseItemProperty & {
|
|
1353
|
+
effects: string;
|
|
1354
|
+
};
|
|
1355
|
+
/**
|
|
1356
|
+
* @description Frame 画板元素布局模式
|
|
1357
|
+
*/
|
|
1358
|
+
declare enum FrameLayoutMode {
|
|
1359
|
+
AUTO = "auto",
|
|
1360
|
+
FREE = "free"
|
|
1361
|
+
}
|
|
1362
|
+
/**
|
|
1363
|
+
* @description Frame 画板元素属性
|
|
1364
|
+
*/
|
|
1365
|
+
type FrameItemProperty = BaseItemProperty & {
|
|
1323
1366
|
/**
|
|
1324
|
-
* @description
|
|
1367
|
+
* @description 布局模式: auto - 自动布局, free - 自由布局
|
|
1325
1368
|
*/
|
|
1326
|
-
|
|
1369
|
+
layoutMode: FrameLayoutMode;
|
|
1327
1370
|
/**
|
|
1328
|
-
* @description
|
|
1371
|
+
* @description 子元素ID数组
|
|
1329
1372
|
*/
|
|
1330
|
-
|
|
1373
|
+
children: string[];
|
|
1331
1374
|
};
|
|
1332
1375
|
/**
|
|
1333
|
-
* @description
|
|
1376
|
+
* @description BaseItem 基础属性键名
|
|
1334
1377
|
*/
|
|
1335
|
-
type
|
|
1336
|
-
enabled: boolean;
|
|
1337
|
-
loadingTextureUrl: string;
|
|
1338
|
-
};
|
|
1378
|
+
type BaseItemPropertyKey = 'name' | 'duration' | 'delay' | 'endBehavior' | 'visible' | 'isLocked' | 'parentId';
|
|
1339
1379
|
/**
|
|
1340
|
-
* @description
|
|
1380
|
+
* @description BaseItem 基础属性值类型映射
|
|
1341
1381
|
*/
|
|
1342
|
-
type
|
|
1343
|
-
|
|
1344
|
-
|
|
1382
|
+
type BaseItemPropertyValueMap = {
|
|
1383
|
+
name: string;
|
|
1384
|
+
duration: number;
|
|
1385
|
+
delay: number;
|
|
1386
|
+
endBehavior: spec.EndBehavior;
|
|
1387
|
+
visible: boolean;
|
|
1388
|
+
isLocked: boolean;
|
|
1389
|
+
parentId?: string;
|
|
1390
|
+
};
|
|
1345
1391
|
/**
|
|
1346
|
-
* @description
|
|
1392
|
+
* @description Item 类型与 Property 类型的映射
|
|
1347
1393
|
*/
|
|
1348
|
-
type
|
|
1349
|
-
|
|
1394
|
+
type ItemPropertyMap = {
|
|
1395
|
+
[SDKItemType.SPRITE]: SpriteItemProperty;
|
|
1396
|
+
[SDKItemType.TEXT]: TextItemProperty;
|
|
1397
|
+
[SDKItemType.VIDEO]: VideoItemProperty;
|
|
1398
|
+
[SDKItemType.GROUP]: GroupItemProperty;
|
|
1399
|
+
[SDKItemType.GENERATOR]: GeneratorItemProperty;
|
|
1400
|
+
[SDKItemType.EFFECTS]: EffectsItemProperty;
|
|
1401
|
+
[SDKItemType.FRAME]: FrameItemProperty;
|
|
1350
1402
|
};
|
|
1351
1403
|
/**
|
|
1352
|
-
* @description
|
|
1404
|
+
* @description 场景1:单个元素单个属性设置
|
|
1405
|
+
* 支持设置 BaseItem 基础属性或具体 Item 类型的 property 属性
|
|
1353
1406
|
*/
|
|
1354
|
-
type
|
|
1355
|
-
|
|
1407
|
+
type SetSingleItemSinglePropertyParam<T extends SDKItemType = SDKItemType> = {
|
|
1408
|
+
itemId: string;
|
|
1409
|
+
type: T;
|
|
1410
|
+
propertyName: BaseItemPropertyKey;
|
|
1411
|
+
propertyValue: BaseItemPropertyValueMap[BaseItemPropertyKey];
|
|
1412
|
+
} | {
|
|
1413
|
+
itemId: string;
|
|
1414
|
+
type: T;
|
|
1415
|
+
propertyName: keyof ItemPropertyMap[T];
|
|
1416
|
+
propertyValue: ItemPropertyMap[T][keyof ItemPropertyMap[T]];
|
|
1356
1417
|
};
|
|
1357
1418
|
/**
|
|
1358
|
-
* @description
|
|
1419
|
+
* @description 场景2:单个元素多个属性设置
|
|
1420
|
+
* 同时设置多个 BaseItem 属性或 property 属性
|
|
1359
1421
|
*/
|
|
1360
|
-
type
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
lineWidth: number;
|
|
1365
|
-
/**
|
|
1366
|
-
* @description 对齐线颜色
|
|
1367
|
-
*/
|
|
1368
|
-
lineColor: number;
|
|
1369
|
-
/**
|
|
1370
|
-
* @description 对齐吸附距离
|
|
1371
|
-
*/
|
|
1372
|
-
distance: number;
|
|
1422
|
+
type SetSingleItemMultiplePropertiesParam<T extends SDKItemType = SDKItemType> = {
|
|
1423
|
+
itemId: string;
|
|
1424
|
+
type: T;
|
|
1425
|
+
property: Partial<Record<BaseItemPropertyKey, BaseItemPropertyValueMap[BaseItemPropertyKey]>> & Partial<Record<keyof ItemPropertyMap[T], ItemPropertyMap[T][keyof ItemPropertyMap[T]]>>;
|
|
1373
1426
|
};
|
|
1374
1427
|
/**
|
|
1375
|
-
* @description
|
|
1428
|
+
* @description 设置元素属性的统一参数类型
|
|
1429
|
+
* 支持两种场景:单元素单属性、单元素多属性
|
|
1376
1430
|
*/
|
|
1377
|
-
type
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
zoomStep: number;
|
|
1431
|
+
type SetItemPropertyParam<T extends SDKItemType = SDKItemType> = SetSingleItemSinglePropertyParam<T> | SetSingleItemMultiplePropertiesParam<T>;
|
|
1432
|
+
type SDKOptions = {
|
|
1433
|
+
/** 导出视频时,是否开启转码日志 */
|
|
1434
|
+
loggerInExportVideoTranscoding?: boolean;
|
|
1382
1435
|
};
|
|
1436
|
+
type SDKInputParam = SDKTemplateInputParam | SDKEditorInputParam;
|
|
1383
1437
|
/**
|
|
1384
|
-
* @description
|
|
1438
|
+
* @description SDK入参
|
|
1385
1439
|
*/
|
|
1386
|
-
type
|
|
1440
|
+
type SDKTemplateInputParam = {
|
|
1387
1441
|
/**
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1442
|
+
* @description JSON地址
|
|
1443
|
+
*/
|
|
1444
|
+
scene: string | spec.JSONScene;
|
|
1391
1445
|
/**
|
|
1392
|
-
* @description
|
|
1446
|
+
* @description SDK模式 - 模板编辑模式
|
|
1393
1447
|
*/
|
|
1394
|
-
|
|
1448
|
+
mode: 'template';
|
|
1395
1449
|
/**
|
|
1396
|
-
* @description
|
|
1450
|
+
* @description 视图参数
|
|
1397
1451
|
*/
|
|
1398
|
-
|
|
1452
|
+
viewParams?: ViewParam[];
|
|
1399
1453
|
/**
|
|
1400
|
-
* @description
|
|
1454
|
+
* @description 页面属性
|
|
1401
1455
|
*/
|
|
1402
|
-
|
|
1456
|
+
options: PageOptions;
|
|
1457
|
+
};
|
|
1458
|
+
type SDKEditorInputParam = {
|
|
1403
1459
|
/**
|
|
1404
|
-
* @description
|
|
1460
|
+
* @description SDK模式 - 编辑器模式
|
|
1405
1461
|
*/
|
|
1406
|
-
|
|
1462
|
+
mode: 'editor';
|
|
1463
|
+
};
|
|
1464
|
+
/**
|
|
1465
|
+
* @description 页面属性
|
|
1466
|
+
*/
|
|
1467
|
+
type PageOptions = {
|
|
1407
1468
|
/**
|
|
1408
|
-
* @description
|
|
1469
|
+
* @description 同步模式开关
|
|
1409
1470
|
*/
|
|
1410
|
-
|
|
1471
|
+
asyncMode: boolean;
|
|
1411
1472
|
/**
|
|
1412
|
-
* @description
|
|
1473
|
+
* @description 安全区展示开关
|
|
1413
1474
|
*/
|
|
1414
|
-
|
|
1475
|
+
safeAreaPreview: boolean;
|
|
1476
|
+
/**
|
|
1477
|
+
* @description 吸附开关
|
|
1478
|
+
*/
|
|
1479
|
+
adsorption: boolean;
|
|
1415
1480
|
};
|
|
1416
1481
|
/**
|
|
1417
|
-
* @description
|
|
1482
|
+
* @description 页面数据
|
|
1418
1483
|
*/
|
|
1419
|
-
type
|
|
1420
|
-
/**
|
|
1421
|
-
* @description 视频预选中时
|
|
1422
|
-
*/
|
|
1423
|
-
videoPreSelectedPlay: boolean;
|
|
1484
|
+
type PageData = {
|
|
1424
1485
|
/**
|
|
1425
|
-
* @description
|
|
1486
|
+
* @description 基础场景数据
|
|
1426
1487
|
*/
|
|
1427
|
-
|
|
1488
|
+
scene: spec.JSONScene;
|
|
1428
1489
|
/**
|
|
1429
|
-
* @description
|
|
1490
|
+
* @description 页面属性
|
|
1430
1491
|
*/
|
|
1431
|
-
|
|
1492
|
+
property: PageProperty;
|
|
1432
1493
|
/**
|
|
1433
|
-
* @description
|
|
1494
|
+
* @description 视图属性
|
|
1434
1495
|
*/
|
|
1435
|
-
|
|
1496
|
+
viewProperties: ViewProperty[];
|
|
1436
1497
|
/**
|
|
1437
|
-
* @description
|
|
1498
|
+
* @description 活跃数据
|
|
1438
1499
|
*/
|
|
1439
|
-
|
|
1500
|
+
activeData: ActiveData;
|
|
1440
1501
|
/**
|
|
1441
|
-
* @description
|
|
1502
|
+
* @description 元素数据
|
|
1442
1503
|
*/
|
|
1443
|
-
|
|
1504
|
+
items: SDKItem[];
|
|
1444
1505
|
/**
|
|
1445
|
-
* @description
|
|
1506
|
+
* @description 视图当前时间
|
|
1446
1507
|
*/
|
|
1447
|
-
|
|
1508
|
+
time: number;
|
|
1448
1509
|
/**
|
|
1449
|
-
* @description
|
|
1510
|
+
* @description 是否处于播放态
|
|
1450
1511
|
*/
|
|
1451
|
-
|
|
1512
|
+
playing: boolean;
|
|
1452
1513
|
};
|
|
1453
1514
|
/**
|
|
1454
|
-
* @description
|
|
1515
|
+
* @description 页面配置
|
|
1455
1516
|
*/
|
|
1456
|
-
type
|
|
1457
|
-
/**
|
|
1458
|
-
* @description 变换交互框颜色
|
|
1459
|
-
*/
|
|
1460
|
-
wireframeColor: number;
|
|
1517
|
+
type PageConfig$1 = {
|
|
1461
1518
|
/**
|
|
1462
|
-
* @description
|
|
1519
|
+
* @description 出血区域展示开关
|
|
1463
1520
|
*/
|
|
1464
|
-
|
|
1521
|
+
safeAreaPreview: boolean;
|
|
1465
1522
|
/**
|
|
1466
|
-
* @description
|
|
1523
|
+
* @description 缩放值
|
|
1467
1524
|
*/
|
|
1468
|
-
|
|
1525
|
+
zoom: number;
|
|
1469
1526
|
/**
|
|
1470
|
-
* @description
|
|
1527
|
+
* @description 吸附开关
|
|
1471
1528
|
*/
|
|
1472
|
-
|
|
1529
|
+
adsorption: boolean;
|
|
1473
1530
|
/**
|
|
1474
|
-
* @description
|
|
1531
|
+
* @description 同步开关
|
|
1475
1532
|
*/
|
|
1476
|
-
|
|
1533
|
+
asyncMode: boolean;
|
|
1477
1534
|
/**
|
|
1478
|
-
* @description
|
|
1535
|
+
* @description 画布移动
|
|
1479
1536
|
*/
|
|
1480
|
-
|
|
1537
|
+
translation: spec.vec2;
|
|
1538
|
+
};
|
|
1539
|
+
/**
|
|
1540
|
+
* @description 页面属性
|
|
1541
|
+
*/
|
|
1542
|
+
type PageProperty = {
|
|
1481
1543
|
/**
|
|
1482
|
-
* @description
|
|
1544
|
+
* @description 出血区域展示开关
|
|
1483
1545
|
*/
|
|
1484
|
-
|
|
1546
|
+
safeAreaPreview: boolean;
|
|
1485
1547
|
/**
|
|
1486
|
-
* @description
|
|
1548
|
+
* @description 缩放值
|
|
1487
1549
|
*/
|
|
1488
|
-
|
|
1550
|
+
zoom: number;
|
|
1489
1551
|
/**
|
|
1490
|
-
* @description
|
|
1552
|
+
* @description 偏移值
|
|
1491
1553
|
*/
|
|
1492
|
-
|
|
1554
|
+
translation: [number, number];
|
|
1493
1555
|
/**
|
|
1494
|
-
* @description
|
|
1556
|
+
* @description 吸附开关
|
|
1495
1557
|
*/
|
|
1496
|
-
|
|
1558
|
+
adsorption: boolean;
|
|
1497
1559
|
/**
|
|
1498
|
-
* @description
|
|
1560
|
+
* @description 同步开关
|
|
1499
1561
|
*/
|
|
1500
|
-
|
|
1562
|
+
asyncMode: boolean;
|
|
1563
|
+
};
|
|
1564
|
+
/**
|
|
1565
|
+
* @description 视图创建参数
|
|
1566
|
+
*/
|
|
1567
|
+
type ViewParam = {
|
|
1501
1568
|
/**
|
|
1502
|
-
* @description
|
|
1569
|
+
* @description 页面尺寸
|
|
1503
1570
|
*/
|
|
1504
|
-
|
|
1571
|
+
size?: [number, number];
|
|
1505
1572
|
/**
|
|
1506
|
-
* @description
|
|
1573
|
+
* @description 出血区参数
|
|
1507
1574
|
*/
|
|
1508
|
-
|
|
1575
|
+
safeArea?: [number, number, number, number];
|
|
1509
1576
|
/**
|
|
1510
|
-
* @description
|
|
1577
|
+
* @description 自适应方向 - 默认根据视图宽高决定
|
|
1511
1578
|
*/
|
|
1512
|
-
|
|
1579
|
+
adaptionDirection?: SizeAdaptDirection;
|
|
1513
1580
|
/**
|
|
1514
|
-
* @description
|
|
1581
|
+
* @description 自定义出血区 - 用于展示
|
|
1515
1582
|
*/
|
|
1516
|
-
|
|
1583
|
+
previewSafeAreas?: PreviewSafeAreaParam[];
|
|
1517
1584
|
/**
|
|
1518
|
-
* @description
|
|
1585
|
+
* @description 导出参数
|
|
1519
1586
|
*/
|
|
1520
|
-
|
|
1587
|
+
export: ExportParam;
|
|
1521
1588
|
};
|
|
1522
1589
|
/**
|
|
1523
|
-
* @description
|
|
1590
|
+
* @description 导出参数
|
|
1524
1591
|
*/
|
|
1525
|
-
type
|
|
1592
|
+
type ExportParam = {
|
|
1526
1593
|
/**
|
|
1527
|
-
* @description
|
|
1594
|
+
* @description 视频名称
|
|
1528
1595
|
*/
|
|
1529
|
-
|
|
1596
|
+
name?: string;
|
|
1597
|
+
} & Omit<ExportMediaItemOptions, 'scene' | 'size'>;
|
|
1598
|
+
/**
|
|
1599
|
+
* @description 视图属性
|
|
1600
|
+
*/
|
|
1601
|
+
type ViewProperty = {
|
|
1530
1602
|
/**
|
|
1531
|
-
* @description
|
|
1603
|
+
* @description 视图ID
|
|
1532
1604
|
*/
|
|
1533
|
-
|
|
1605
|
+
id: number;
|
|
1534
1606
|
/**
|
|
1535
|
-
* @description
|
|
1607
|
+
* @description 视图宽高
|
|
1536
1608
|
*/
|
|
1537
|
-
|
|
1609
|
+
size: [number, number];
|
|
1538
1610
|
/**
|
|
1539
|
-
* @description
|
|
1611
|
+
* @description 出血区数据
|
|
1540
1612
|
*/
|
|
1541
|
-
|
|
1613
|
+
safeArea: [number, number, number, number];
|
|
1542
1614
|
/**
|
|
1543
|
-
* @description
|
|
1615
|
+
* @description 自定义出血区数据
|
|
1544
1616
|
*/
|
|
1545
|
-
|
|
1617
|
+
previewSafeAreas: PreviewSafeAreaParam[];
|
|
1546
1618
|
/**
|
|
1547
|
-
* @description
|
|
1619
|
+
* @description 视图场景数据
|
|
1548
1620
|
*/
|
|
1549
|
-
|
|
1621
|
+
scene: spec.JSONScene;
|
|
1550
1622
|
/**
|
|
1551
|
-
* @description
|
|
1623
|
+
* @description 导出参数
|
|
1552
1624
|
*/
|
|
1553
|
-
|
|
1625
|
+
export: ExportParam;
|
|
1554
1626
|
/**
|
|
1555
|
-
* @description
|
|
1627
|
+
* @description 忽略交互 - 仅供展示
|
|
1556
1628
|
*/
|
|
1557
|
-
|
|
1629
|
+
ignoreInteraction: boolean;
|
|
1630
|
+
};
|
|
1631
|
+
/**
|
|
1632
|
+
* @description 自定义出血区数据
|
|
1633
|
+
*/
|
|
1634
|
+
type PreviewSafeAreaParam = {
|
|
1558
1635
|
/**
|
|
1559
|
-
* @description
|
|
1636
|
+
* @description 出血区包围盒 [left top width height]
|
|
1560
1637
|
*/
|
|
1561
|
-
|
|
1638
|
+
box: [number, number, number, number];
|
|
1562
1639
|
/**
|
|
1563
|
-
* @description
|
|
1640
|
+
* @description 出血区色块颜色 默认为 [255, 255, 255, 0.3]
|
|
1564
1641
|
*/
|
|
1565
|
-
|
|
1642
|
+
color?: [number, number, number, number];
|
|
1566
1643
|
/**
|
|
1567
|
-
* @description
|
|
1644
|
+
* @description 出血区图像
|
|
1568
1645
|
*/
|
|
1569
|
-
|
|
1646
|
+
url?: string;
|
|
1570
1647
|
/**
|
|
1571
|
-
* @description
|
|
1648
|
+
* @description 出血区是否可见
|
|
1572
1649
|
*/
|
|
1573
|
-
|
|
1650
|
+
visible?: boolean;
|
|
1651
|
+
};
|
|
1652
|
+
/**
|
|
1653
|
+
* @description 页面活跃数据
|
|
1654
|
+
*/
|
|
1655
|
+
type ActiveData = {
|
|
1574
1656
|
/**
|
|
1575
|
-
* @description
|
|
1657
|
+
* @description 视图ID
|
|
1576
1658
|
*/
|
|
1577
|
-
|
|
1659
|
+
view?: number;
|
|
1578
1660
|
/**
|
|
1579
|
-
* @description
|
|
1661
|
+
* @description 选中元素
|
|
1580
1662
|
*/
|
|
1581
|
-
|
|
1663
|
+
selectedItems: string[];
|
|
1582
1664
|
/**
|
|
1583
|
-
* @description
|
|
1665
|
+
* @description 预选中元素
|
|
1584
1666
|
*/
|
|
1585
|
-
|
|
1667
|
+
preSelectedItem?: string;
|
|
1586
1668
|
/**
|
|
1587
|
-
* @description
|
|
1669
|
+
* @description 执行中元素
|
|
1588
1670
|
*/
|
|
1589
|
-
|
|
1671
|
+
loadingItems?: string[];
|
|
1672
|
+
};
|
|
1673
|
+
/**
|
|
1674
|
+
* @description 视图元素
|
|
1675
|
+
* @description 注意:SDKItem 现在已从类实现中导入,见 view-item/index.ts
|
|
1676
|
+
* @description SDKItem 现在是类实例而非普通对象,支持属性扩展
|
|
1677
|
+
* @description 保持类型兼容性:新 SDKItem 类拥有与旧类型相同的属性
|
|
1678
|
+
*/
|
|
1679
|
+
type SDKItem = SDKItem$1;
|
|
1680
|
+
type SDKBackgroundType = 'color' | 'image' | 'chess-board' | 'dot-board';
|
|
1681
|
+
/**
|
|
1682
|
+
* @description 图层创建信息
|
|
1683
|
+
*/
|
|
1684
|
+
type SpriteCreateInfo = {
|
|
1685
|
+
type: SDKItemType.SPRITE;
|
|
1590
1686
|
/**
|
|
1591
|
-
* @description
|
|
1687
|
+
* @description 图层名称
|
|
1592
1688
|
*/
|
|
1593
|
-
|
|
1689
|
+
name?: string;
|
|
1594
1690
|
/**
|
|
1595
|
-
* @description
|
|
1691
|
+
* @description 元素id
|
|
1596
1692
|
*/
|
|
1597
|
-
|
|
1693
|
+
id?: string;
|
|
1598
1694
|
/**
|
|
1599
|
-
* @description
|
|
1695
|
+
* @description 父节点id
|
|
1600
1696
|
*/
|
|
1601
|
-
|
|
1697
|
+
parentId?: string;
|
|
1698
|
+
/**
|
|
1699
|
+
* @description 扩展属性
|
|
1700
|
+
*/
|
|
1701
|
+
extension?: Record<string, any>;
|
|
1702
|
+
/**
|
|
1703
|
+
* @description 元素属性
|
|
1704
|
+
*/
|
|
1705
|
+
property: {
|
|
1706
|
+
/**
|
|
1707
|
+
* @description 图片资源地址 | 数据
|
|
1708
|
+
*/
|
|
1709
|
+
image: string;
|
|
1710
|
+
/**
|
|
1711
|
+
* @description 图层像素宽度
|
|
1712
|
+
*/
|
|
1713
|
+
width: number;
|
|
1714
|
+
/**
|
|
1715
|
+
* @description 图层像素高度
|
|
1716
|
+
*/
|
|
1717
|
+
height: number;
|
|
1718
|
+
/**
|
|
1719
|
+
* @description 元素位置
|
|
1720
|
+
*/
|
|
1721
|
+
position: [number, number];
|
|
1722
|
+
/**
|
|
1723
|
+
* @description 元素旋转 z | [x, y, z]
|
|
1724
|
+
*/
|
|
1725
|
+
rotation?: number | [number, number, number];
|
|
1726
|
+
/**
|
|
1727
|
+
* @description 元素缩放
|
|
1728
|
+
*/
|
|
1729
|
+
scale?: [number, number];
|
|
1730
|
+
};
|
|
1602
1731
|
};
|
|
1603
1732
|
/**
|
|
1604
|
-
* @description
|
|
1733
|
+
* @description 空节点创建信息
|
|
1605
1734
|
*/
|
|
1606
|
-
type
|
|
1735
|
+
type GroupCreateInfo = {
|
|
1736
|
+
type: SDKItemType.GROUP;
|
|
1607
1737
|
/**
|
|
1608
|
-
* @description
|
|
1738
|
+
* @description 元素id
|
|
1609
1739
|
*/
|
|
1610
|
-
|
|
1740
|
+
id?: string;
|
|
1611
1741
|
/**
|
|
1612
|
-
* @description
|
|
1742
|
+
* @description 父节点id
|
|
1613
1743
|
*/
|
|
1614
|
-
|
|
1744
|
+
parentId?: string;
|
|
1615
1745
|
/**
|
|
1616
|
-
* @description
|
|
1746
|
+
* @description 元素名称
|
|
1617
1747
|
*/
|
|
1618
|
-
|
|
1748
|
+
name?: string;
|
|
1619
1749
|
/**
|
|
1620
|
-
* @description
|
|
1750
|
+
* @description 扩展属性
|
|
1621
1751
|
*/
|
|
1622
|
-
|
|
1752
|
+
extension?: Record<string, any>;
|
|
1623
1753
|
/**
|
|
1624
|
-
* @description
|
|
1754
|
+
* @description 元素属性
|
|
1625
1755
|
*/
|
|
1626
|
-
|
|
1756
|
+
property: {
|
|
1757
|
+
/**
|
|
1758
|
+
* @description 元素位置
|
|
1759
|
+
*/
|
|
1760
|
+
position?: [number, number];
|
|
1761
|
+
/**
|
|
1762
|
+
* @description 元素旋转 z | [x, y, z]
|
|
1763
|
+
*/
|
|
1764
|
+
rotation?: number | [number, number, number];
|
|
1765
|
+
/**
|
|
1766
|
+
* @description 元素缩放
|
|
1767
|
+
*/
|
|
1768
|
+
scale?: [number, number];
|
|
1769
|
+
/**
|
|
1770
|
+
* @description 子元素id
|
|
1771
|
+
*/
|
|
1772
|
+
children: string[];
|
|
1773
|
+
};
|
|
1774
|
+
};
|
|
1775
|
+
/**
|
|
1776
|
+
* @description 文本创建信息
|
|
1777
|
+
*/
|
|
1778
|
+
type TextCreateInfo = {
|
|
1779
|
+
type: SDKItemType.TEXT;
|
|
1627
1780
|
/**
|
|
1628
|
-
* @description
|
|
1781
|
+
* @description 元素id
|
|
1629
1782
|
*/
|
|
1630
|
-
|
|
1783
|
+
id?: string;
|
|
1631
1784
|
/**
|
|
1632
|
-
* @description
|
|
1785
|
+
* @description 父节点id
|
|
1633
1786
|
*/
|
|
1634
|
-
|
|
1787
|
+
parentId?: string;
|
|
1635
1788
|
/**
|
|
1636
|
-
* @description
|
|
1789
|
+
* @description 元素名称
|
|
1637
1790
|
*/
|
|
1638
|
-
|
|
1791
|
+
name?: string;
|
|
1639
1792
|
/**
|
|
1640
|
-
* @description
|
|
1793
|
+
* @description 扩展属性
|
|
1641
1794
|
*/
|
|
1642
|
-
|
|
1795
|
+
extension?: Record<string, any>;
|
|
1643
1796
|
/**
|
|
1644
|
-
* @description
|
|
1797
|
+
* @description 元素属性
|
|
1645
1798
|
*/
|
|
1646
|
-
|
|
1799
|
+
property: {
|
|
1800
|
+
/**
|
|
1801
|
+
* @description 文本宽度
|
|
1802
|
+
*/
|
|
1803
|
+
width: number;
|
|
1804
|
+
/**
|
|
1805
|
+
* @description 文本高度
|
|
1806
|
+
*/
|
|
1807
|
+
height?: number;
|
|
1808
|
+
/**
|
|
1809
|
+
* @description 元素位置
|
|
1810
|
+
*/
|
|
1811
|
+
position: [number, number];
|
|
1812
|
+
/**
|
|
1813
|
+
* @description 元素旋转 z | [x, y, z]
|
|
1814
|
+
*/
|
|
1815
|
+
rotation?: number | [number, number, number];
|
|
1816
|
+
/**
|
|
1817
|
+
* @description 元素缩放
|
|
1818
|
+
*/
|
|
1819
|
+
scale?: [number, number];
|
|
1820
|
+
/**
|
|
1821
|
+
* @description 单行高度
|
|
1822
|
+
*/
|
|
1823
|
+
lineHeight: number;
|
|
1824
|
+
/**
|
|
1825
|
+
* @description 字体名称
|
|
1826
|
+
*/
|
|
1827
|
+
fontFamily: string;
|
|
1828
|
+
/**
|
|
1829
|
+
* @description 文字大小
|
|
1830
|
+
*/
|
|
1831
|
+
fontSize: number;
|
|
1832
|
+
/**
|
|
1833
|
+
* @description 字重
|
|
1834
|
+
*/
|
|
1835
|
+
fontWeight?: spec.TextWeight;
|
|
1836
|
+
/**
|
|
1837
|
+
* @description 字体格式
|
|
1838
|
+
*/
|
|
1839
|
+
fontStyle?: spec.FontStyle;
|
|
1840
|
+
/**
|
|
1841
|
+
* @description 对齐方式
|
|
1842
|
+
*/
|
|
1843
|
+
textAlign?: spec.TextAlignment;
|
|
1844
|
+
/**
|
|
1845
|
+
* @description 文本信息
|
|
1846
|
+
*/
|
|
1847
|
+
text: string;
|
|
1848
|
+
/**
|
|
1849
|
+
* @description 填充色
|
|
1850
|
+
*/
|
|
1851
|
+
color: spec.vec4;
|
|
1852
|
+
/**
|
|
1853
|
+
* @description 描边色
|
|
1854
|
+
*/
|
|
1855
|
+
outlineColor?: spec.vec4;
|
|
1856
|
+
/**
|
|
1857
|
+
* @description 描边宽度
|
|
1858
|
+
*/
|
|
1859
|
+
outlineWidth?: number;
|
|
1860
|
+
/**
|
|
1861
|
+
* @description 描边开关
|
|
1862
|
+
*/
|
|
1863
|
+
outlineEnabled?: boolean;
|
|
1864
|
+
/**
|
|
1865
|
+
* @description 字体文件地址
|
|
1866
|
+
*/
|
|
1867
|
+
fontUrl?: string;
|
|
1868
|
+
};
|
|
1869
|
+
};
|
|
1870
|
+
/**
|
|
1871
|
+
* @description 视频创建信息
|
|
1872
|
+
*/
|
|
1873
|
+
type VideoCreateInfo = {
|
|
1874
|
+
type: SDKItemType.VIDEO;
|
|
1647
1875
|
/**
|
|
1648
|
-
* @description
|
|
1876
|
+
* @description 视频名称
|
|
1649
1877
|
*/
|
|
1650
|
-
|
|
1878
|
+
name?: string;
|
|
1651
1879
|
/**
|
|
1652
|
-
* @description
|
|
1880
|
+
* @description 元素id
|
|
1653
1881
|
*/
|
|
1654
|
-
|
|
1882
|
+
id?: string;
|
|
1655
1883
|
/**
|
|
1656
|
-
* @description
|
|
1884
|
+
* @description 父节点id
|
|
1657
1885
|
*/
|
|
1658
|
-
|
|
1886
|
+
parentId?: string;
|
|
1659
1887
|
/**
|
|
1660
|
-
* @description
|
|
1888
|
+
* @description 扩展属性
|
|
1661
1889
|
*/
|
|
1662
|
-
|
|
1890
|
+
extension?: Record<string, any>;
|
|
1663
1891
|
/**
|
|
1664
|
-
* @description
|
|
1892
|
+
* @description 元素属性
|
|
1665
1893
|
*/
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1894
|
+
property: {
|
|
1895
|
+
/**
|
|
1896
|
+
* @description 视频资源地址 | 数据
|
|
1897
|
+
*/
|
|
1898
|
+
video: string;
|
|
1899
|
+
/**
|
|
1900
|
+
* @description 视频元素像素宽度
|
|
1901
|
+
*/
|
|
1902
|
+
width: number;
|
|
1903
|
+
/**
|
|
1904
|
+
* @description 视频元素像素高度
|
|
1905
|
+
*/
|
|
1906
|
+
height: number;
|
|
1907
|
+
/**
|
|
1908
|
+
* @description 视频元素位置
|
|
1909
|
+
*/
|
|
1910
|
+
position: [number, number];
|
|
1911
|
+
/**
|
|
1912
|
+
* @description 视频元素旋转 z | [x, y, z]
|
|
1913
|
+
*/
|
|
1914
|
+
rotation?: number | [number, number, number];
|
|
1915
|
+
/**
|
|
1916
|
+
* @description 视频元素缩放
|
|
1917
|
+
*/
|
|
1918
|
+
scale?: [number, number];
|
|
1919
|
+
/**
|
|
1920
|
+
* @description 是否静音
|
|
1921
|
+
*/
|
|
1922
|
+
muted?: boolean;
|
|
1923
|
+
/**
|
|
1924
|
+
* @description 是否为透明视频
|
|
1925
|
+
*/
|
|
1926
|
+
transparent?: boolean;
|
|
1927
|
+
/**
|
|
1928
|
+
* @description 播放速率
|
|
1929
|
+
*/
|
|
1930
|
+
playbackRate?: number;
|
|
1931
|
+
/**
|
|
1932
|
+
* @description 音量
|
|
1933
|
+
*/
|
|
1934
|
+
volume?: number;
|
|
1935
|
+
};
|
|
1671
1936
|
};
|
|
1672
1937
|
/**
|
|
1673
|
-
* @description
|
|
1674
|
-
* 'corner': 角点旋转
|
|
1675
|
-
* 'top-center': 顶部中心旋转
|
|
1938
|
+
* @description 生成器类型
|
|
1676
1939
|
*/
|
|
1677
|
-
type
|
|
1940
|
+
type GeneratorType = 'image' | 'video';
|
|
1678
1941
|
/**
|
|
1679
|
-
* @description
|
|
1942
|
+
* @description 生成器创建信息
|
|
1680
1943
|
*/
|
|
1681
|
-
type
|
|
1682
|
-
/**
|
|
1683
|
-
* @description 旋转交互模式
|
|
1684
|
-
*/
|
|
1685
|
-
rotateInteractMode: TextGizmoRotateInteractMode;
|
|
1686
|
-
/**
|
|
1687
|
-
* @description 包围盒线宽
|
|
1688
|
-
*/
|
|
1689
|
-
boxLineWidth: number;
|
|
1690
|
-
/**
|
|
1691
|
-
* @description 包围盒线色
|
|
1692
|
-
*/
|
|
1693
|
-
boxLineColor: number;
|
|
1694
|
-
/**
|
|
1695
|
-
* @description 旋转交互点边长 - 用于 top-center 交互模式
|
|
1696
|
-
*/
|
|
1697
|
-
rotationCornerWidth: number;
|
|
1698
|
-
/**
|
|
1699
|
-
* @description 旋转交互贴图地址
|
|
1700
|
-
*/
|
|
1701
|
-
rotationCornerTexture: string;
|
|
1702
|
-
/**
|
|
1703
|
-
* @description 旋转交互点半径
|
|
1704
|
-
*/
|
|
1705
|
-
rotationCornerRadius: number;
|
|
1706
|
-
/**
|
|
1707
|
-
* @description top-center 模式旋转交互距离
|
|
1708
|
-
*/
|
|
1709
|
-
rotationTopCenterInteractionDistance: number;
|
|
1944
|
+
type GeneratorCreateInfo = {
|
|
1710
1945
|
/**
|
|
1711
|
-
* @description
|
|
1946
|
+
* @description 元素类型 - 生成器
|
|
1712
1947
|
*/
|
|
1713
|
-
|
|
1948
|
+
type: SDKItemType.GENERATOR;
|
|
1714
1949
|
/**
|
|
1715
|
-
* @description
|
|
1950
|
+
* @description 元素名称
|
|
1716
1951
|
*/
|
|
1717
|
-
|
|
1952
|
+
name?: string;
|
|
1718
1953
|
/**
|
|
1719
|
-
* @description
|
|
1954
|
+
* @description 元素id
|
|
1720
1955
|
*/
|
|
1721
|
-
|
|
1956
|
+
id?: string;
|
|
1722
1957
|
/**
|
|
1723
|
-
* @description
|
|
1958
|
+
* @description 父元素id
|
|
1724
1959
|
*/
|
|
1725
|
-
|
|
1960
|
+
parentId?: string;
|
|
1726
1961
|
/**
|
|
1727
|
-
* @description
|
|
1962
|
+
* @description 扩展属性
|
|
1728
1963
|
*/
|
|
1729
|
-
|
|
1964
|
+
extension?: Record<string, any>;
|
|
1730
1965
|
/**
|
|
1731
|
-
* @description
|
|
1966
|
+
* @description 元素属性
|
|
1732
1967
|
*/
|
|
1733
|
-
|
|
1968
|
+
property: {
|
|
1969
|
+
/**
|
|
1970
|
+
* @description 生成器类型
|
|
1971
|
+
*/
|
|
1972
|
+
generatorType: GeneratorType;
|
|
1973
|
+
/**
|
|
1974
|
+
* @description 生成器元素像素宽度
|
|
1975
|
+
*/
|
|
1976
|
+
width: number;
|
|
1977
|
+
/**
|
|
1978
|
+
* @description 生成器元素像素高度
|
|
1979
|
+
*/
|
|
1980
|
+
height: number;
|
|
1981
|
+
/**
|
|
1982
|
+
* @description 生成器元素位置
|
|
1983
|
+
*/
|
|
1984
|
+
position: [number, number];
|
|
1985
|
+
/**
|
|
1986
|
+
* @description 生成器元素旋转 z | [x, y, z]
|
|
1987
|
+
*/
|
|
1988
|
+
rotation?: number | [number, number, number];
|
|
1989
|
+
/**
|
|
1990
|
+
* @description 生成器元素缩放
|
|
1991
|
+
*/
|
|
1992
|
+
scale?: [number, number];
|
|
1993
|
+
};
|
|
1994
|
+
};
|
|
1995
|
+
/**
|
|
1996
|
+
* @description 图片生成器资源信息
|
|
1997
|
+
*/
|
|
1998
|
+
type SpriteGeneratorResource = {
|
|
1734
1999
|
/**
|
|
1735
|
-
* @description
|
|
2000
|
+
* @description 资源地址
|
|
1736
2001
|
*/
|
|
1737
|
-
|
|
2002
|
+
url: string;
|
|
1738
2003
|
/**
|
|
1739
|
-
* @description
|
|
2004
|
+
* @description 资源尺寸
|
|
1740
2005
|
*/
|
|
1741
|
-
|
|
2006
|
+
size?: spec.vec2;
|
|
1742
2007
|
/**
|
|
1743
|
-
* @description
|
|
2008
|
+
* @description 目标生成器元素 ID(必填)
|
|
1744
2009
|
*/
|
|
1745
|
-
|
|
2010
|
+
itemId: string;
|
|
1746
2011
|
/**
|
|
1747
|
-
* @description
|
|
2012
|
+
* @description 扩展属性
|
|
1748
2013
|
*/
|
|
1749
|
-
|
|
2014
|
+
extension?: Record<string, any>;
|
|
1750
2015
|
};
|
|
1751
2016
|
/**
|
|
1752
|
-
* @description
|
|
2017
|
+
* @description 视频生成器资源信息
|
|
1753
2018
|
*/
|
|
1754
|
-
type
|
|
2019
|
+
type VideoGeneratorResource = {
|
|
1755
2020
|
/**
|
|
1756
|
-
* @description
|
|
2021
|
+
* @description 资源地址
|
|
1757
2022
|
*/
|
|
1758
|
-
|
|
2023
|
+
url: string;
|
|
1759
2024
|
/**
|
|
1760
|
-
* @description
|
|
2025
|
+
* @description 资源尺寸
|
|
1761
2026
|
*/
|
|
1762
|
-
|
|
2027
|
+
size?: spec.vec2;
|
|
1763
2028
|
/**
|
|
1764
|
-
* @description
|
|
2029
|
+
* @description 是否静音(仅用于视频)
|
|
1765
2030
|
*/
|
|
1766
|
-
|
|
2031
|
+
muted?: boolean;
|
|
1767
2032
|
/**
|
|
1768
|
-
* @description
|
|
2033
|
+
* @description 是否为透明视频(仅用于视频)
|
|
1769
2034
|
*/
|
|
1770
|
-
|
|
2035
|
+
transparent?: boolean;
|
|
1771
2036
|
/**
|
|
1772
|
-
* @description
|
|
2037
|
+
* @description 播放速率(仅用于视频)
|
|
1773
2038
|
*/
|
|
1774
|
-
|
|
2039
|
+
playbackRate?: number;
|
|
1775
2040
|
/**
|
|
1776
|
-
* @description
|
|
2041
|
+
* @description 音量(仅用于视频)
|
|
1777
2042
|
*/
|
|
1778
|
-
|
|
2043
|
+
volume?: number;
|
|
1779
2044
|
/**
|
|
1780
|
-
* @description
|
|
2045
|
+
* @description 目标生成器元素 ID(必填)
|
|
1781
2046
|
*/
|
|
1782
|
-
|
|
2047
|
+
itemId: string;
|
|
1783
2048
|
/**
|
|
1784
|
-
* @description
|
|
2049
|
+
* @description 扩展属性
|
|
1785
2050
|
*/
|
|
1786
|
-
|
|
2051
|
+
extension?: Record<string, any>;
|
|
1787
2052
|
};
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
*/
|
|
1791
|
-
type SpriteTextEditGizmoConfig = {
|
|
2053
|
+
type GeneratorResource = SpriteGeneratorResource | VideoGeneratorResource;
|
|
2054
|
+
type EffectsCreateInfo = {
|
|
1792
2055
|
/**
|
|
1793
|
-
* @description
|
|
2056
|
+
* @description 元素类型 - 特效
|
|
1794
2057
|
*/
|
|
1795
|
-
|
|
2058
|
+
type: SDKItemType.EFFECTS;
|
|
1796
2059
|
/**
|
|
1797
|
-
* @description
|
|
2060
|
+
* @description 元素名称
|
|
1798
2061
|
*/
|
|
1799
|
-
|
|
2062
|
+
name?: string;
|
|
1800
2063
|
/**
|
|
1801
|
-
* @description
|
|
2064
|
+
* @description 元素id
|
|
1802
2065
|
*/
|
|
1803
|
-
|
|
2066
|
+
id?: string;
|
|
1804
2067
|
/**
|
|
1805
|
-
* @description
|
|
2068
|
+
* @description 父元素id
|
|
1806
2069
|
*/
|
|
1807
|
-
|
|
2070
|
+
parentId?: string;
|
|
2071
|
+
property: {
|
|
2072
|
+
/**
|
|
2073
|
+
* @description 动效像素宽度
|
|
2074
|
+
*/
|
|
2075
|
+
width?: number;
|
|
2076
|
+
/**
|
|
2077
|
+
* @description 动效像素高度
|
|
2078
|
+
*/
|
|
2079
|
+
height?: number;
|
|
2080
|
+
/**
|
|
2081
|
+
* @description 生成器位置
|
|
2082
|
+
*/
|
|
2083
|
+
position: spec.vec2;
|
|
2084
|
+
/**
|
|
2085
|
+
* @description 旋转角度
|
|
2086
|
+
*/
|
|
2087
|
+
rotation?: number | [number, number, number];
|
|
2088
|
+
/**
|
|
2089
|
+
* @description 缩放
|
|
2090
|
+
*/
|
|
2091
|
+
scale?: spec.vec2;
|
|
2092
|
+
/**
|
|
2093
|
+
* @description 动效资源地址
|
|
2094
|
+
*/
|
|
2095
|
+
effects: string | spec.JSONScene;
|
|
2096
|
+
};
|
|
1808
2097
|
/**
|
|
1809
|
-
* @description
|
|
2098
|
+
* @description 扩展属性
|
|
1810
2099
|
*/
|
|
1811
|
-
|
|
2100
|
+
extension?: Record<string, any>;
|
|
2101
|
+
};
|
|
2102
|
+
/**
|
|
2103
|
+
* @description Frame 画板元素创建信息
|
|
2104
|
+
*/
|
|
2105
|
+
type FrameCreateInfo = {
|
|
1812
2106
|
/**
|
|
1813
|
-
* @description
|
|
2107
|
+
* @description 元素类型 - 画板
|
|
1814
2108
|
*/
|
|
1815
|
-
|
|
2109
|
+
type: SDKItemType.FRAME;
|
|
1816
2110
|
/**
|
|
1817
|
-
* @description
|
|
2111
|
+
* @description 元素名称
|
|
1818
2112
|
*/
|
|
1819
|
-
|
|
2113
|
+
name?: string;
|
|
1820
2114
|
/**
|
|
1821
|
-
* @description
|
|
2115
|
+
* @description 元素id
|
|
1822
2116
|
*/
|
|
1823
|
-
|
|
2117
|
+
id?: string;
|
|
1824
2118
|
/**
|
|
1825
|
-
* @description
|
|
2119
|
+
* @description 父元素id
|
|
1826
2120
|
*/
|
|
1827
|
-
|
|
2121
|
+
parentId?: string;
|
|
1828
2122
|
/**
|
|
1829
|
-
* @description
|
|
2123
|
+
* @description 元素属性
|
|
1830
2124
|
*/
|
|
1831
|
-
|
|
2125
|
+
property: {
|
|
2126
|
+
/**
|
|
2127
|
+
* @description 画板像素宽度
|
|
2128
|
+
*/
|
|
2129
|
+
width: number;
|
|
2130
|
+
/**
|
|
2131
|
+
* @description 画板像素高度
|
|
2132
|
+
*/
|
|
2133
|
+
height: number;
|
|
2134
|
+
/**
|
|
2135
|
+
* @description 画板位置
|
|
2136
|
+
*/
|
|
2137
|
+
position: [number, number];
|
|
2138
|
+
/**
|
|
2139
|
+
* @description 画板旋转 z | [x, y, z]
|
|
2140
|
+
*/
|
|
2141
|
+
rotation?: number | [number, number, number];
|
|
2142
|
+
/**
|
|
2143
|
+
* @description 画板缩放
|
|
2144
|
+
*/
|
|
2145
|
+
scale?: [number, number];
|
|
2146
|
+
/**
|
|
2147
|
+
* @description 布局模式: 'auto' | 'free'
|
|
2148
|
+
*/
|
|
2149
|
+
layoutMode?: FrameLayoutMode;
|
|
2150
|
+
};
|
|
1832
2151
|
/**
|
|
1833
|
-
* @description
|
|
2152
|
+
* @description 扩展属性
|
|
1834
2153
|
*/
|
|
1835
|
-
|
|
2154
|
+
extension?: Record<string, any>;
|
|
2155
|
+
};
|
|
2156
|
+
type ItemCreateInfo = GroupCreateInfo | SpriteCreateInfo | TextCreateInfo | VideoCreateInfo | GeneratorCreateInfo | EffectsCreateInfo | FrameCreateInfo;
|
|
2157
|
+
/**
|
|
2158
|
+
* @description 场景创建信息
|
|
2159
|
+
*/
|
|
2160
|
+
type SceneCreaetInfo = {
|
|
1836
2161
|
/**
|
|
1837
|
-
* @description
|
|
2162
|
+
* @description 场景名称
|
|
1838
2163
|
*/
|
|
1839
|
-
|
|
2164
|
+
name: string;
|
|
1840
2165
|
/**
|
|
1841
|
-
* @description
|
|
2166
|
+
* @description 场景大小
|
|
1842
2167
|
*/
|
|
1843
|
-
|
|
2168
|
+
size: spec.vec2;
|
|
2169
|
+
};
|
|
2170
|
+
declare enum ItemOrderAction {
|
|
2171
|
+
BringToFront = 0,
|
|
2172
|
+
SendToBack = 1,
|
|
2173
|
+
BringForward = 2,
|
|
2174
|
+
SendBackward = 3
|
|
2175
|
+
}
|
|
2176
|
+
/**
|
|
2177
|
+
* @description 视图自适应偏移参数
|
|
2178
|
+
*/
|
|
2179
|
+
type ViewportFitShiftParam = {
|
|
1844
2180
|
/**
|
|
1845
|
-
* @description
|
|
2181
|
+
* @description 左偏移
|
|
1846
2182
|
*/
|
|
1847
|
-
|
|
2183
|
+
left?: number;
|
|
1848
2184
|
/**
|
|
1849
|
-
* @description
|
|
2185
|
+
* @description 右偏移
|
|
1850
2186
|
*/
|
|
1851
|
-
|
|
2187
|
+
right?: number;
|
|
1852
2188
|
/**
|
|
1853
|
-
* @description
|
|
2189
|
+
* @description 上偏移
|
|
1854
2190
|
*/
|
|
1855
|
-
|
|
2191
|
+
top?: number;
|
|
1856
2192
|
/**
|
|
1857
|
-
* @description
|
|
2193
|
+
* @description 下偏移
|
|
1858
2194
|
*/
|
|
1859
|
-
|
|
2195
|
+
bottom?: number;
|
|
2196
|
+
};
|
|
2197
|
+
|
|
2198
|
+
type CreateOperation = {
|
|
2199
|
+
type: 'create';
|
|
2200
|
+
newData: ItemCreateInfo[];
|
|
2201
|
+
};
|
|
2202
|
+
type DeleteOperation = {
|
|
2203
|
+
type: 'delete';
|
|
2204
|
+
oldData: ItemCreateInfo[];
|
|
2205
|
+
};
|
|
2206
|
+
type UpdateOperation = {
|
|
2207
|
+
type: 'update';
|
|
2208
|
+
newData: ItemCreateInfo[];
|
|
2209
|
+
oldData: ItemCreateInfo[];
|
|
2210
|
+
};
|
|
2211
|
+
type Operation = CreateOperation | UpdateOperation | DeleteOperation;
|
|
2212
|
+
declare class UndoRedo {
|
|
2213
|
+
private index;
|
|
2214
|
+
private operations;
|
|
2215
|
+
get canUndo(): boolean;
|
|
2216
|
+
get canRedo(): boolean;
|
|
2217
|
+
oldData?: ItemCreateInfo[];
|
|
2218
|
+
push(operation: Operation): void;
|
|
2219
|
+
undo(): Operation | undefined;
|
|
2220
|
+
redo(): Operation | undefined;
|
|
2221
|
+
clear(): void;
|
|
2222
|
+
}
|
|
2223
|
+
|
|
2224
|
+
type SDKMode = 'editor' | 'template';
|
|
2225
|
+
/**
|
|
2226
|
+
* @description SDK功能配置
|
|
2227
|
+
*/
|
|
2228
|
+
type SDKConfig = {
|
|
1860
2229
|
/**
|
|
1861
|
-
* @description
|
|
2230
|
+
* @description SDK编辑模式 - 模板编辑模式 | 编辑器模式
|
|
1862
2231
|
*/
|
|
1863
|
-
|
|
2232
|
+
mode: SDKMode;
|
|
1864
2233
|
/**
|
|
1865
|
-
* @description
|
|
2234
|
+
* @description 页面功能配置
|
|
1866
2235
|
*/
|
|
1867
|
-
|
|
2236
|
+
pageConfig: PageConfig;
|
|
1868
2237
|
/**
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
2238
|
+
* @description 异步加载功能配置
|
|
2239
|
+
*/
|
|
2240
|
+
asyncLoadConfig: AsyncLoadConfig;
|
|
1872
2241
|
/**
|
|
1873
|
-
* @description
|
|
2242
|
+
* @description 截图功能配置
|
|
1874
2243
|
*/
|
|
1875
|
-
|
|
2244
|
+
screenShotConfig: ScreenShotConfig;
|
|
1876
2245
|
/**
|
|
1877
|
-
* @description
|
|
2246
|
+
* @description 导出视频功能配置
|
|
1878
2247
|
*/
|
|
1879
|
-
|
|
2248
|
+
exportConfig: ExportConfig;
|
|
1880
2249
|
/**
|
|
1881
|
-
* @description
|
|
2250
|
+
* @description 尺寸自适应功能开关
|
|
1882
2251
|
*/
|
|
1883
|
-
|
|
2252
|
+
sizeAdaptConfig: SizeAdaptConfig;
|
|
2253
|
+
/**
|
|
2254
|
+
* @description 辅助面板功能配置
|
|
2255
|
+
*/
|
|
2256
|
+
gestureHandlerConfig: {
|
|
2257
|
+
enabled: boolean;
|
|
2258
|
+
adsorptionGizmoEnabled: boolean;
|
|
2259
|
+
adsorptionGizmoConfig: AdsorptionGizmoConfig;
|
|
2260
|
+
controlGizmoEnabled: boolean;
|
|
2261
|
+
controlGizmoConfig: ControlGizmoConfig;
|
|
2262
|
+
preferenceGizmoEnabled: boolean;
|
|
2263
|
+
preferenceGizmoConfig: PreferenceGizmoConfig;
|
|
2264
|
+
selectorGizmoEnabled: boolean;
|
|
2265
|
+
selectorGizmoConfig: SelectorGizmoConfig;
|
|
2266
|
+
transformGizmoEnabled: boolean;
|
|
2267
|
+
transformGizmoConfig: TransformGizmoConfig;
|
|
2268
|
+
pictureCutGizmoEnabled: boolean;
|
|
2269
|
+
pictureCutGizmoConfig: PictureCutGizmoConfig;
|
|
2270
|
+
pictureExpandGizmoEnabled: boolean;
|
|
2271
|
+
pictureExpandGizmoConfig: PictureExpandGizmoConfig;
|
|
2272
|
+
textGizmoEnbaled: boolean;
|
|
2273
|
+
textGizmoConfig: TextGizmoConfig;
|
|
2274
|
+
maskGizmoEnabled: boolean;
|
|
2275
|
+
maskGizmoConfig: MaskGizmoConfig;
|
|
2276
|
+
spriteTextEditGizmoEnabled: boolean;
|
|
2277
|
+
spriteTextEditGizmoConfig: SpriteTextEditGizmoConfig;
|
|
2278
|
+
videoPlayGizmoEnabled: boolean;
|
|
2279
|
+
videoPlayGizmoConfig: VideoPlayGizmoConfig;
|
|
2280
|
+
itemCreateGizmoEnabled: boolean;
|
|
2281
|
+
itemCreateGizmoConfig: ItemCreateGizmoConfig;
|
|
2282
|
+
};
|
|
1884
2283
|
};
|
|
1885
|
-
|
|
2284
|
+
/**
|
|
2285
|
+
* @description 页面功能配置
|
|
2286
|
+
*/
|
|
2287
|
+
type PageConfig = {
|
|
1886
2288
|
/**
|
|
1887
|
-
* @description
|
|
2289
|
+
* @description 同步修改功能开关
|
|
1888
2290
|
*/
|
|
1889
|
-
|
|
2291
|
+
asncMode: boolean;
|
|
1890
2292
|
/**
|
|
1891
|
-
* @description
|
|
2293
|
+
* @description 静态预览【视图只提供播放预览功能】功能开关
|
|
1892
2294
|
*/
|
|
1893
|
-
|
|
2295
|
+
staticPreview: boolean;
|
|
1894
2296
|
/**
|
|
1895
|
-
* @description
|
|
2297
|
+
* @description 静态预览视图名称
|
|
1896
2298
|
*/
|
|
1897
|
-
|
|
2299
|
+
staticPreviewName: string;
|
|
1898
2300
|
/**
|
|
1899
|
-
* @description
|
|
2301
|
+
* @description 需过滤的元素名称
|
|
1900
2302
|
*/
|
|
1901
|
-
|
|
2303
|
+
filterItemNames: string[];
|
|
1902
2304
|
/**
|
|
1903
|
-
* @description
|
|
2305
|
+
* @description 成组操作元素显隐
|
|
1904
2306
|
*/
|
|
1905
|
-
|
|
2307
|
+
groupVisible: boolean;
|
|
2308
|
+
/**
|
|
2309
|
+
* @description 缩放最大值
|
|
2310
|
+
*/
|
|
2311
|
+
maxZoom: number;
|
|
2312
|
+
/**
|
|
2313
|
+
* @description 缩放最小值
|
|
2314
|
+
*/
|
|
2315
|
+
minZoom: number;
|
|
1906
2316
|
};
|
|
1907
|
-
|
|
1908
|
-
|
|
2317
|
+
/**
|
|
2318
|
+
* @description 异步加载配置
|
|
2319
|
+
*/
|
|
2320
|
+
type AsyncLoadConfig = {
|
|
2321
|
+
enabled: boolean;
|
|
2322
|
+
loadingTextureUrl: string;
|
|
1909
2323
|
};
|
|
1910
|
-
|
|
1911
2324
|
/**
|
|
1912
|
-
* @description
|
|
2325
|
+
* @description 视频导出功能配置
|
|
1913
2326
|
*/
|
|
1914
|
-
type
|
|
2327
|
+
type ExportConfig = {
|
|
2328
|
+
enabled: boolean;
|
|
2329
|
+
} & ExportMediaInitOptions;
|
|
2330
|
+
/**
|
|
2331
|
+
* @description 截图功能配置
|
|
2332
|
+
*/
|
|
2333
|
+
type ScreenShotConfig = {
|
|
2334
|
+
enabled: boolean;
|
|
2335
|
+
};
|
|
2336
|
+
/**
|
|
2337
|
+
* @description 尺寸自适应功能配置
|
|
2338
|
+
*/
|
|
2339
|
+
type SizeAdaptConfig = {
|
|
2340
|
+
enabled: boolean;
|
|
2341
|
+
};
|
|
2342
|
+
/**
|
|
2343
|
+
* @description 对齐吸附功能参数
|
|
2344
|
+
*/
|
|
2345
|
+
type AdsorptionGizmoConfig = {
|
|
1915
2346
|
/**
|
|
1916
|
-
|
|
2347
|
+
* @description 对齐吸附线宽
|
|
2348
|
+
*/
|
|
2349
|
+
lineWidth: number;
|
|
2350
|
+
/**
|
|
2351
|
+
* @description 对齐线颜色
|
|
1917
2352
|
*/
|
|
1918
|
-
|
|
2353
|
+
lineColor: number;
|
|
1919
2354
|
/**
|
|
1920
|
-
* @description
|
|
2355
|
+
* @description 对齐吸附距离
|
|
1921
2356
|
*/
|
|
1922
|
-
|
|
2357
|
+
distance: number;
|
|
1923
2358
|
};
|
|
1924
|
-
|
|
2359
|
+
/**
|
|
2360
|
+
* @description 视图控制功能参数
|
|
2361
|
+
*/
|
|
2362
|
+
type ControlGizmoConfig = {
|
|
1925
2363
|
/**
|
|
1926
|
-
* @description
|
|
2364
|
+
* @description 缩放步长
|
|
1927
2365
|
*/
|
|
1928
|
-
|
|
2366
|
+
zoomStep: number;
|
|
2367
|
+
};
|
|
2368
|
+
/**
|
|
2369
|
+
* @description 视口展示功能参数
|
|
2370
|
+
*/
|
|
2371
|
+
type PreferenceGizmoConfig = {
|
|
1929
2372
|
/**
|
|
1930
|
-
|
|
2373
|
+
* @description 视口窗包围盒颜色
|
|
2374
|
+
*/
|
|
2375
|
+
boxColor: number;
|
|
2376
|
+
/**
|
|
2377
|
+
* @description 视口窗包围盒宽度
|
|
1931
2378
|
*/
|
|
1932
|
-
|
|
2379
|
+
boxWidth: number;
|
|
1933
2380
|
/**
|
|
1934
|
-
* @description
|
|
2381
|
+
* @description 视口区域外遮罩颜色
|
|
1935
2382
|
*/
|
|
1936
|
-
|
|
1937
|
-
};
|
|
1938
|
-
type ItemCreateType = 'none' | 'text' | 'video-generator' | 'sprite-generator' | 'frame';
|
|
1939
|
-
type GizmoType = 'null' | 'selector' | 'transform' | 'control' | 'adsorption' | 'preference' | 'picture-cut' | 'text' | 'mask' | 'loading' | 'picture-expand' | 'sprite-text-edit' | 'video-play' | 'item-create';
|
|
1940
|
-
type GestureHandlerInteractType = 'select' | 'hand';
|
|
1941
|
-
|
|
1942
|
-
declare module '@pixi/graphics' {
|
|
1943
|
-
interface Graphics {
|
|
1944
|
-
fillBox(box: Box2): void;
|
|
1945
|
-
drawBox(box: Box2): void;
|
|
1946
|
-
drawLine(line: Line2 | Point[]): void;
|
|
1947
|
-
drawDashLine(toX: number, toY: number, dash: number, gap: number): void;
|
|
1948
|
-
}
|
|
1949
|
-
}
|
|
1950
|
-
|
|
1951
|
-
type AlignType = 'left' | 'right' | 'horizontal-center' | 'top' | 'bottom' | 'vertical-center';
|
|
1952
|
-
type DistributeType = 'vertical-spacing' | 'horizontal-spacing';
|
|
1953
|
-
|
|
1954
|
-
type SDKEvents = {
|
|
1955
|
-
'loadingItemChange': [id: string[]];
|
|
1956
|
-
'selectedItemChange': [id: string[]];
|
|
1957
|
-
'preSelectedItemChange': [id: string | undefined];
|
|
1958
|
-
'selectedViewChange': [id: number];
|
|
1959
|
-
'pageDataChange': [pageData: PageData];
|
|
1960
|
-
'zoomChange': [zoom: number];
|
|
1961
|
-
'progress': [{
|
|
1962
|
-
duration: number;
|
|
1963
|
-
time: number;
|
|
1964
|
-
end: boolean;
|
|
1965
|
-
paused: boolean;
|
|
1966
|
-
}];
|
|
1967
|
-
'itemPropertyChange': [{
|
|
1968
|
-
id: string;
|
|
1969
|
-
property: string;
|
|
1970
|
-
}];
|
|
1971
|
-
'exportProgress': [progress?: number];
|
|
1972
|
-
'exportDone': [item: ExportItemParams | undefined, success: boolean, buffer?: FileBuffer];
|
|
1973
|
-
'exportComplete': [success: boolean, taskInfos: ExportParams, buffers: Buffers, extras: Extras];
|
|
1974
|
-
'sdkConfigChange': [preSDKConfig: SDKConfig, curSDKConfig: SDKConfig];
|
|
1975
|
-
'cutBoxChange': [box: Box2];
|
|
1976
|
-
'expandBoxChange': [box: Box2];
|
|
1977
|
-
'textInput': [{
|
|
1978
|
-
itemId: string;
|
|
1979
|
-
text: string;
|
|
1980
|
-
fontFamily: string;
|
|
1981
|
-
}];
|
|
1982
|
-
'undoRedoChange': [Operation];
|
|
1983
|
-
'viewportTransform': [{
|
|
1984
|
-
zoom: number;
|
|
1985
|
-
translation: [number, number];
|
|
1986
|
-
}];
|
|
1987
|
-
'itemOnDragStart': [type: GizmoType];
|
|
1988
|
-
'itemOnDrag': [type: GizmoType];
|
|
1989
|
-
'itemOnDragEnd': [type: GizmoType];
|
|
1990
|
-
'spriteTextClick': [{
|
|
1991
|
-
id: string;
|
|
1992
|
-
index: number;
|
|
1993
|
-
text: string;
|
|
1994
|
-
} | undefined];
|
|
1995
|
-
'videoPlay': [{
|
|
1996
|
-
id: string;
|
|
1997
|
-
time: number;
|
|
1998
|
-
}];
|
|
1999
|
-
'itemCreate': [{
|
|
2000
|
-
type: ItemCreateType;
|
|
2001
|
-
position: spec.vec2;
|
|
2002
|
-
}];
|
|
2003
|
-
'viewLost': [];
|
|
2004
|
-
'viewRebuildFinish': [];
|
|
2005
|
-
};
|
|
2006
|
-
declare class SDK {
|
|
2007
|
-
static config: SDKConfig;
|
|
2008
|
-
private _eventEmitter;
|
|
2009
|
-
private _pageData;
|
|
2010
|
-
private _screenShot;
|
|
2011
|
-
private _exporter?;
|
|
2012
|
-
private _pageDataUtils;
|
|
2013
|
-
private _sizeAdapt;
|
|
2014
|
-
private _gestureHandler;
|
|
2015
|
-
private disposables;
|
|
2016
|
-
private _isSwitchScene;
|
|
2017
|
-
private _undoRedo;
|
|
2018
|
-
player: Player;
|
|
2019
|
-
_container: HTMLElement;
|
|
2020
|
-
private _playerContainer;
|
|
2021
|
-
constructor(container: HTMLElement, mode?: SDKMode);
|
|
2022
|
-
get container(): HTMLElement;
|
|
2023
|
-
get pageData(): PageData | undefined;
|
|
2024
|
-
private get initExporterEnabled();
|
|
2025
|
-
get exportStatus(): string | undefined;
|
|
2026
|
-
get undoRedo(): UndoRedo;
|
|
2027
|
-
private get exportOptions();
|
|
2028
|
-
dispose(): void;
|
|
2029
|
-
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;
|
|
2030
|
-
initPlayer(mode: SDKMode): void;
|
|
2031
|
-
setSDKMode(mode: SDKMode): void;
|
|
2032
|
-
private getInitParam;
|
|
2033
|
-
private initExporter;
|
|
2034
|
-
private initSDK;
|
|
2035
|
-
run(param: SDKInputParam): Promise<void>;
|
|
2036
|
-
getActiveItems(): string[];
|
|
2037
|
-
setPreSelectedItem(id: string): void;
|
|
2038
|
-
getPreSelectedItem(): string;
|
|
2039
|
-
setSelectedItems(itemIds: string[]): void;
|
|
2383
|
+
markColor: number;
|
|
2040
2384
|
/**
|
|
2041
|
-
* @description
|
|
2042
|
-
* @param param 元素ID、类型
|
|
2043
|
-
* @returns 元素属性
|
|
2385
|
+
* @description 视口区域外遮罩透明度
|
|
2044
2386
|
*/
|
|
2045
|
-
|
|
2387
|
+
markAlpha: number;
|
|
2046
2388
|
/**
|
|
2047
|
-
* @description
|
|
2048
|
-
* @param param 元素ID、类型、属性名
|
|
2049
|
-
* @returns 元素属性值
|
|
2389
|
+
* @description 出血区预览开关
|
|
2050
2390
|
*/
|
|
2051
|
-
|
|
2052
|
-
setItemPropertyValue(param: SetItemPropertyValueParam): Promise<void>;
|
|
2053
|
-
generateScreenShot(id: number, size?: [number, number], tick?: number, backgroundColor?: spec.vec4): Promise<string | undefined>;
|
|
2391
|
+
safeAreaEnabled: boolean;
|
|
2054
2392
|
/**
|
|
2055
|
-
* @description
|
|
2056
|
-
* @param index 场景索引
|
|
2393
|
+
* @description 出血区颜色
|
|
2057
2394
|
*/
|
|
2058
|
-
|
|
2395
|
+
safeAreaBoxColor: number;
|
|
2059
2396
|
/**
|
|
2060
|
-
* @description
|
|
2061
|
-
* @returns 页面的 safeAreaPreview、zoom、adsorption、translation 值
|
|
2397
|
+
* @description 出血区透明度
|
|
2062
2398
|
*/
|
|
2063
|
-
|
|
2399
|
+
safeAreaBoxAlpha: number;
|
|
2400
|
+
};
|
|
2401
|
+
/**
|
|
2402
|
+
* @description 选择功能参数
|
|
2403
|
+
*/
|
|
2404
|
+
type SelectorGizmoConfig = {
|
|
2064
2405
|
/**
|
|
2065
|
-
*
|
|
2066
|
-
* @param pageProperty 设置
|
|
2406
|
+
* @description 视频预选中时
|
|
2067
2407
|
*/
|
|
2068
|
-
|
|
2408
|
+
videoPreSelectedPlay: boolean;
|
|
2069
2409
|
/**
|
|
2070
|
-
* @description
|
|
2071
|
-
* @param progress 播放进度 0-100
|
|
2410
|
+
* @description 预选框线宽
|
|
2072
2411
|
*/
|
|
2073
|
-
|
|
2412
|
+
preSelectedWidth: number;
|
|
2074
2413
|
/**
|
|
2075
|
-
* @description
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
* */
|
|
2079
|
-
getSDKItem(id: string): SDKItem$1 | undefined;
|
|
2414
|
+
* @description 预选框颜色
|
|
2415
|
+
*/
|
|
2416
|
+
preSelectedColor: number;
|
|
2080
2417
|
/**
|
|
2081
|
-
* @description
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
* */
|
|
2085
|
-
getSDKItems(ids?: string[]): SDKItem$1[];
|
|
2086
|
-
setPlayState(playState: 'play' | 'pause'): Promise<void>;
|
|
2418
|
+
* @description 框选区域颜色
|
|
2419
|
+
*/
|
|
2420
|
+
regionBoxColor: number;
|
|
2087
2421
|
/**
|
|
2088
|
-
* @description
|
|
2089
|
-
* @returns 视图预览图
|
|
2422
|
+
* @description 框选区域透明度
|
|
2090
2423
|
*/
|
|
2091
|
-
|
|
2092
|
-
id: number;
|
|
2093
|
-
thumbnail: string | undefined;
|
|
2094
|
-
}>[];
|
|
2424
|
+
regionBoxAlpha: number;
|
|
2095
2425
|
/**
|
|
2096
|
-
* @description
|
|
2097
|
-
* @returns 当前所有视图JSON产物
|
|
2426
|
+
* @description 框选区域包围框颜色
|
|
2098
2427
|
*/
|
|
2099
|
-
|
|
2100
|
-
id: number;
|
|
2101
|
-
thumbnail: spec.JSONScene;
|
|
2102
|
-
}[];
|
|
2103
|
-
private destroyCompositions;
|
|
2428
|
+
regionWireframeColor: number;
|
|
2104
2429
|
/**
|
|
2105
|
-
* @description
|
|
2430
|
+
* @description 框选区域包围框透明度
|
|
2106
2431
|
*/
|
|
2107
|
-
|
|
2432
|
+
regionWireframeAlpha: number;
|
|
2108
2433
|
/**
|
|
2109
|
-
* @description
|
|
2110
|
-
* 支持导出媒体或其他,如MP4,未来支持 JSON 等;
|
|
2434
|
+
* @description 框选区域包围框宽度
|
|
2111
2435
|
*/
|
|
2112
|
-
|
|
2436
|
+
regionWireframeWidth: number;
|
|
2437
|
+
};
|
|
2438
|
+
/**
|
|
2439
|
+
* @description 变换功能参数
|
|
2440
|
+
*/
|
|
2441
|
+
type TransformGizmoConfig = {
|
|
2113
2442
|
/**
|
|
2114
|
-
* @description
|
|
2443
|
+
* @description 变换交互框颜色
|
|
2115
2444
|
*/
|
|
2116
|
-
|
|
2117
|
-
loadPageData(data: PageData): Promise<void>;
|
|
2118
|
-
runByPageData(data: PageData): Promise<void>;
|
|
2119
|
-
reloadPageDataByScene(scene: string | spec.JSONScene): Promise<void>;
|
|
2445
|
+
wireframeColor: number;
|
|
2120
2446
|
/**
|
|
2121
|
-
* @description
|
|
2122
|
-
* @param viewParams 视图参数
|
|
2123
|
-
* @param scene 场景数据 - 无输入时为默认场景数据
|
|
2447
|
+
* @description 变换交互框透明度
|
|
2124
2448
|
*/
|
|
2125
|
-
|
|
2126
|
-
deleteViewParams(ids: number[]): Promise<void>;
|
|
2127
|
-
setExportParam(exportParam: Partial<ExportParam>, id?: number): void;
|
|
2449
|
+
wireframeAlpha: number;
|
|
2128
2450
|
/**
|
|
2129
|
-
* @description
|
|
2130
|
-
* @param zoom 缩放值
|
|
2131
|
-
* @param center 缩放中心
|
|
2132
|
-
* @param ignoreClamp 是否忽视约束
|
|
2451
|
+
* @description 变换交互框宽度
|
|
2133
2452
|
*/
|
|
2134
|
-
|
|
2453
|
+
wireframeWidth: number;
|
|
2135
2454
|
/**
|
|
2136
|
-
* @description
|
|
2137
|
-
* @param targetTranslation 目标移动值
|
|
2455
|
+
* @description 变换交互框角点填充色
|
|
2138
2456
|
*/
|
|
2139
|
-
|
|
2457
|
+
cornerFillColor: number;
|
|
2140
2458
|
/**
|
|
2141
|
-
* @description
|
|
2142
|
-
* @param enabled 功能开关
|
|
2459
|
+
* @description 变换交互框角点线框色
|
|
2143
2460
|
*/
|
|
2144
|
-
|
|
2461
|
+
cornerLineColor: number;
|
|
2145
2462
|
/**
|
|
2146
|
-
* @description
|
|
2147
|
-
* @param name 视图名称
|
|
2463
|
+
* @description 变换交互框角点线框宽度
|
|
2148
2464
|
*/
|
|
2149
|
-
|
|
2465
|
+
cornerLineWidth: number;
|
|
2150
2466
|
/**
|
|
2151
|
-
* @description
|
|
2152
|
-
* @param enabled 功能开关
|
|
2467
|
+
* @description 变换交互框角点线框透明度
|
|
2153
2468
|
*/
|
|
2154
|
-
|
|
2469
|
+
cornerLineAlpha: number;
|
|
2155
2470
|
/**
|
|
2156
|
-
* @description
|
|
2471
|
+
* @description 交互框缩放圆半径
|
|
2157
2472
|
*/
|
|
2158
|
-
|
|
2473
|
+
scaleCircleSize: number;
|
|
2159
2474
|
/**
|
|
2160
|
-
* @description
|
|
2161
|
-
* @param itemNames 过滤元素名称
|
|
2475
|
+
* @description 交互框旋转圆半径
|
|
2162
2476
|
*/
|
|
2163
|
-
|
|
2477
|
+
rotationCircleSize: number;
|
|
2164
2478
|
/**
|
|
2165
|
-
* @description
|
|
2166
|
-
* @param color 色值
|
|
2479
|
+
* @description 图片Logo地址
|
|
2167
2480
|
*/
|
|
2168
|
-
|
|
2481
|
+
pictureLogoUrl: string;
|
|
2169
2482
|
/**
|
|
2170
|
-
* @description
|
|
2171
|
-
* @param color 色值
|
|
2483
|
+
* @description 空节点Logo地址
|
|
2172
2484
|
*/
|
|
2173
|
-
|
|
2485
|
+
groupLogoUrl: string;
|
|
2174
2486
|
/**
|
|
2175
|
-
* @description
|
|
2176
|
-
* @param enabled 功能开关
|
|
2487
|
+
* @description 文本Logo地址
|
|
2177
2488
|
*/
|
|
2178
|
-
|
|
2489
|
+
textLogoUrl: string;
|
|
2179
2490
|
/**
|
|
2180
|
-
* @description
|
|
2181
|
-
* @param enabled 功能开关
|
|
2491
|
+
* @description 视频Logo地址
|
|
2182
2492
|
*/
|
|
2183
|
-
|
|
2493
|
+
videoLogoUrl: string;
|
|
2184
2494
|
/**
|
|
2185
|
-
* @description
|
|
2186
|
-
* @param exportConfig
|
|
2495
|
+
* @description 大小文字颜色
|
|
2187
2496
|
*/
|
|
2188
|
-
|
|
2497
|
+
sizeTextColor: number;
|
|
2189
2498
|
/**
|
|
2190
|
-
* @description
|
|
2191
|
-
* @param preSelectedColor 预选框颜色
|
|
2192
|
-
* @param preSelectedWidth 预选框线框宽度
|
|
2499
|
+
* @description 名称文字颜色
|
|
2193
2500
|
*/
|
|
2194
|
-
|
|
2501
|
+
nameTextColor: number;
|
|
2195
2502
|
/**
|
|
2196
|
-
* @description
|
|
2197
|
-
* @param config 参数
|
|
2503
|
+
* @description 选中信息展示
|
|
2198
2504
|
*/
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2505
|
+
infoShowEnabled: boolean;
|
|
2506
|
+
};
|
|
2507
|
+
/**
|
|
2508
|
+
* @description 图片裁切参数
|
|
2509
|
+
*/
|
|
2510
|
+
type PictureCutGizmoConfig = {
|
|
2204
2511
|
/**
|
|
2205
|
-
* @description
|
|
2206
|
-
* @returns SDK 配置参数
|
|
2512
|
+
* @description 蒙版颜色
|
|
2207
2513
|
*/
|
|
2208
|
-
|
|
2514
|
+
maskColor: number;
|
|
2209
2515
|
/**
|
|
2210
|
-
* @description
|
|
2211
|
-
* @param config SDK 配置参数
|
|
2516
|
+
* @description 蒙版透明度
|
|
2212
2517
|
*/
|
|
2213
|
-
|
|
2518
|
+
maskAlpha: number;
|
|
2214
2519
|
/**
|
|
2215
|
-
* @description
|
|
2216
|
-
* @param type 背景类型
|
|
2217
|
-
* @param value 值
|
|
2520
|
+
* @description 裁切包围盒线框宽度
|
|
2218
2521
|
*/
|
|
2219
|
-
|
|
2522
|
+
cutBoxLineWidth: number;
|
|
2220
2523
|
/**
|
|
2221
|
-
* @description
|
|
2222
|
-
* @param spriteInfo 图层元素信息
|
|
2524
|
+
* @description 裁切包围盒线框颜色
|
|
2223
2525
|
*/
|
|
2224
|
-
|
|
2225
|
-
addVideoItem(videoInfo: VideoCreateInfo, scene?: spec.JSONScene): Promise<string>;
|
|
2226
|
-
openPictureCutGizmo(): void;
|
|
2227
|
-
closePictureCutGizmo(): void;
|
|
2228
|
-
getCutInfo(): {
|
|
2229
|
-
cutBox: Box2;
|
|
2230
|
-
itemBox: Box2;
|
|
2231
|
-
} | undefined;
|
|
2232
|
-
setCutBox(min: Vector2, max: Vector2): Box2 | undefined;
|
|
2233
|
-
openPictureExpandGizmo(): void;
|
|
2234
|
-
closePictureExpandGizmo(): void;
|
|
2235
|
-
getExpandInfo(): {
|
|
2236
|
-
expandBox: Box2;
|
|
2237
|
-
itemBox: Box2;
|
|
2238
|
-
} | undefined;
|
|
2239
|
-
setExpandBox(min: Vector2, max: Vector2): Box2 | undefined;
|
|
2240
|
-
openMaskGizmo(brushSize: number): void;
|
|
2241
|
-
clearMaskGizmo(): void;
|
|
2242
|
-
closeMaskGizmo(): void;
|
|
2243
|
-
getMask(): string | null | undefined;
|
|
2244
|
-
setMaskGizmoConfig(config: Partial<MaskGizmoConfig>): void;
|
|
2245
|
-
openLoadingGizmo(id: string, loadingBox?: Box2, clearResult?: boolean): void;
|
|
2246
|
-
closeLoadingGizmo(id: string): void;
|
|
2526
|
+
cutBoxLineColor: number;
|
|
2247
2527
|
/**
|
|
2248
|
-
* @description
|
|
2249
|
-
* @param children 子元素ID
|
|
2528
|
+
* @description 裁切包围盒线框透明度
|
|
2250
2529
|
*/
|
|
2251
|
-
|
|
2252
|
-
addTextItem(textInfo: TextCreateInfo, scene?: spec.JSONScene): Promise<string | undefined>;
|
|
2253
|
-
addItemByCreateInfos(createInfos: ItemCreateInfo[], asyncMode?: boolean): Promise<string[]>;
|
|
2254
|
-
deleteItems(idInfo: string | string[]): void;
|
|
2255
|
-
getItemCreateInfo(id: string): ItemCreateInfo | undefined;
|
|
2256
|
-
getItemCreateInfos(ids?: string[]): ItemCreateInfo[];
|
|
2257
|
-
createScreenShotSceneByIds(idInfo: string | string[], time?: number): Promise<string | undefined>;
|
|
2258
|
-
getChildrenIds(id: string): string[];
|
|
2530
|
+
cutBoxLineAlpha: number;
|
|
2259
2531
|
/**
|
|
2260
|
-
* @description
|
|
2261
|
-
* @param id 元素ID
|
|
2262
|
-
* @param action 排序操作:BringToFront(置于顶层)、SendToBack(置于底层)、BringForward(上移一层)、SendBackward(下移一层)
|
|
2532
|
+
* @description 元素包围盒线框宽度
|
|
2263
2533
|
*/
|
|
2264
|
-
|
|
2534
|
+
itemBoxLineWidth: number;
|
|
2265
2535
|
/**
|
|
2266
|
-
* @description
|
|
2267
|
-
* @param idInfo 视图序号信息
|
|
2268
|
-
* @returns JSON数组
|
|
2536
|
+
* @description 元素包围盒线框颜色
|
|
2269
2537
|
*/
|
|
2270
|
-
|
|
2271
|
-
getViewBoxById(id: string): Box2;
|
|
2538
|
+
itemBoxLineColor: number;
|
|
2272
2539
|
/**
|
|
2273
|
-
* @description
|
|
2274
|
-
* @param id 元素ID
|
|
2275
|
-
* @param extensions 扩展属性对象(支持同时设置多个)
|
|
2276
|
-
* @returns 是否设置成功
|
|
2540
|
+
* @description 元素包围盒线框透明度
|
|
2277
2541
|
*/
|
|
2278
|
-
|
|
2542
|
+
itemBoxLineAlpha: number;
|
|
2279
2543
|
/**
|
|
2280
|
-
* @description
|
|
2281
|
-
* @param id 元素ID
|
|
2282
|
-
* @param keys 扩展属性名称列表(不传则返回所有扩展属性)
|
|
2283
|
-
* @returns 扩展属性对象
|
|
2544
|
+
* @description 裁切包围盒角度半径
|
|
2284
2545
|
*/
|
|
2285
|
-
|
|
2546
|
+
cutBoxCornerRadius: number;
|
|
2286
2547
|
/**
|
|
2287
|
-
* @description
|
|
2288
|
-
* @param id 元素ID
|
|
2289
|
-
* @param key 扩展属性名称
|
|
2290
|
-
* @returns 扩展属性值
|
|
2548
|
+
* @description 裁切包围盒角点宽度
|
|
2291
2549
|
*/
|
|
2292
|
-
|
|
2550
|
+
cutBoxCornerLineWidth: number;
|
|
2293
2551
|
/**
|
|
2294
|
-
* @description
|
|
2295
|
-
* @param id 元素ID
|
|
2296
|
-
* @param keys 扩展属性名称列表
|
|
2297
|
-
* @returns 是否删除成功
|
|
2552
|
+
* @description 裁切包围盒角点颜色
|
|
2298
2553
|
*/
|
|
2299
|
-
|
|
2554
|
+
cutBoxCornerLineColor: number;
|
|
2300
2555
|
/**
|
|
2301
|
-
* @description
|
|
2302
|
-
* @param id 元素ID
|
|
2303
|
-
* @param key 扩展属性名称
|
|
2304
|
-
* @returns 是否存在
|
|
2556
|
+
* @description 裁切包围盒角点透明度
|
|
2305
2557
|
*/
|
|
2306
|
-
|
|
2558
|
+
cutBoxCornerLineAlpha: number;
|
|
2307
2559
|
/**
|
|
2308
|
-
* @description
|
|
2309
|
-
* @param id 元素ID
|
|
2310
|
-
* @returns 键名数组
|
|
2560
|
+
* @description 裁切包围盒角点填充色
|
|
2311
2561
|
*/
|
|
2312
|
-
|
|
2313
|
-
getViewProperty(id: number): ViewProperty | undefined;
|
|
2314
|
-
pageMove(shift: [number, number]): void;
|
|
2315
|
-
pageZoom(shift: number, center?: [number, number]): void;
|
|
2562
|
+
cutBoxCornerFillColor: number;
|
|
2316
2563
|
/**
|
|
2317
|
-
* @description
|
|
2318
|
-
* @param state 缩放比例开关
|
|
2564
|
+
* @description 缩放判断距离
|
|
2319
2565
|
*/
|
|
2320
|
-
|
|
2566
|
+
scaleInteractionDistance: number;
|
|
2321
2567
|
/**
|
|
2322
|
-
* @description
|
|
2323
|
-
* @param state 缩放比例开关
|
|
2568
|
+
* @description 单向缩放判断距离
|
|
2324
2569
|
*/
|
|
2325
|
-
|
|
2570
|
+
directionScaleInteractionDistance: number;
|
|
2326
2571
|
/**
|
|
2327
|
-
* @description
|
|
2328
|
-
* @param shiftParam 视图偏移值
|
|
2572
|
+
* @description 网格线数量
|
|
2329
2573
|
*/
|
|
2330
|
-
|
|
2574
|
+
gridCount: number;
|
|
2331
2575
|
/**
|
|
2332
|
-
* @description
|
|
2333
|
-
* @param idInfo 元素Id
|
|
2334
|
-
* @returns 元素包围盒
|
|
2576
|
+
* @description 网格线颜色
|
|
2335
2577
|
*/
|
|
2336
|
-
|
|
2578
|
+
gridLineColor: number;
|
|
2337
2579
|
/**
|
|
2338
|
-
* @description
|
|
2339
|
-
* @param id 元素Id
|
|
2340
|
-
* @param fontFamilyName 字体名称
|
|
2341
|
-
* @param url 字体地址
|
|
2580
|
+
* @description 网格线宽度
|
|
2342
2581
|
*/
|
|
2343
|
-
|
|
2344
|
-
createSceneByCreateInfos(createInfos: ItemCreateInfo[], sceneInfo: SceneCreaetInfo): spec.JSONScene;
|
|
2345
|
-
setSpriteSize(id: string, size: spec.vec2): void;
|
|
2346
|
-
setItemPropertyByCreateInfo(createInfo: ItemCreateInfo | ItemCreateInfo[]): void;
|
|
2347
|
-
setTransformGizmoLockScale(state: boolean): void;
|
|
2348
|
-
getViewBoxByBox(box: Box2): Box2;
|
|
2349
|
-
openSpriteTextEditGizmo(initParam: SpriteTextInitParam[]): void;
|
|
2350
|
-
closeSpriteTextEditGizmo(): void;
|
|
2351
|
-
setSpriteTextSelectedIndex(id: string, index: number): void;
|
|
2352
|
-
setSpriteTextSelectedText(id: string, index: number, text: string): void;
|
|
2353
|
-
getBoundingBoxByItemCreateInfo(createInfo: ItemCreateInfo): Box2;
|
|
2354
|
-
getBoundingBoxByItemCreateInfos(createInfos: ItemCreateInfo[]): Box2;
|
|
2355
|
-
setSpriteTextChangedState(id: string, index: number, hasChanged: boolean): void;
|
|
2356
|
-
setSpriteTextEditState(id: string, index: number, isEditing: boolean): void;
|
|
2357
|
-
getVideoItemPlayTime(id: string): number;
|
|
2358
|
-
setVideoItemPlayTime(id: string, time: number): void;
|
|
2359
|
-
getPixelPositionByViewPosition(viewPosition: Vector2): Vector2;
|
|
2360
|
-
hitTest(x: number, y: number): string[] | undefined;
|
|
2361
|
-
setInteractType(type: GestureHandlerInteractType): void;
|
|
2362
|
-
makeItemAlign(type: AlignType, ids?: string[]): void;
|
|
2363
|
-
makeItemDistribute(type: DistributeType, ids?: string[]): void;
|
|
2582
|
+
gridLineWidth: number;
|
|
2364
2583
|
/**
|
|
2365
|
-
* @description
|
|
2366
|
-
* @param createInfo 生成器创建信息
|
|
2367
|
-
* @returns 生成器元素ID
|
|
2584
|
+
* @description 网格线透明度
|
|
2368
2585
|
*/
|
|
2369
|
-
|
|
2586
|
+
gridLineAlpha: number;
|
|
2587
|
+
};
|
|
2588
|
+
/**
|
|
2589
|
+
* @description 图片扩边参数
|
|
2590
|
+
*/
|
|
2591
|
+
type PictureExpandGizmoConfig = {
|
|
2370
2592
|
/**
|
|
2371
|
-
* @description
|
|
2372
|
-
* @param effectsInfo 动效创建信息
|
|
2593
|
+
* @description 蒙版颜色
|
|
2373
2594
|
*/
|
|
2374
|
-
|
|
2595
|
+
maskColor: number;
|
|
2375
2596
|
/**
|
|
2376
|
-
* @description
|
|
2377
|
-
* @param id 生成器元素ID
|
|
2378
|
-
* @param resourceUrl 资源地址
|
|
2379
|
-
* @returns 新的元素ID
|
|
2597
|
+
* @description 蒙版透明度
|
|
2380
2598
|
*/
|
|
2381
|
-
|
|
2599
|
+
maskAlpha: number;
|
|
2382
2600
|
/**
|
|
2383
|
-
* @description
|
|
2384
|
-
* @param resource 生成器资源信息
|
|
2601
|
+
* @description 扩边包围盒线框宽度
|
|
2385
2602
|
*/
|
|
2386
|
-
|
|
2603
|
+
expandBoxLineWidth: number;
|
|
2387
2604
|
/**
|
|
2388
|
-
* @description
|
|
2389
|
-
* @param resource 视频生成器资源信息
|
|
2605
|
+
* @description 扩边包围盒线框颜色
|
|
2390
2606
|
*/
|
|
2391
|
-
|
|
2607
|
+
expandBoxLineColor: number;
|
|
2392
2608
|
/**
|
|
2393
|
-
* @description
|
|
2394
|
-
* @param resource 图层生成器资源信息
|
|
2609
|
+
* @description 扩边包围盒线框透明度
|
|
2395
2610
|
*/
|
|
2396
|
-
|
|
2397
|
-
setItemLockState(id: string, state: boolean): void;
|
|
2398
|
-
getItemLockState(id: string): void;
|
|
2399
|
-
openItemCreateGizmo(type: ItemCreateType): void;
|
|
2400
|
-
closeItemCreateGizmo(): void;
|
|
2401
|
-
}
|
|
2402
|
-
|
|
2403
|
-
type SizeAdaptDirection = 'x' | 'y';
|
|
2404
|
-
|
|
2405
|
-
type BaseItemProperty = {
|
|
2406
|
-
position: [number, number];
|
|
2407
|
-
rotation: [number, number, number];
|
|
2408
|
-
size: [number, number];
|
|
2409
|
-
scale: [number, number];
|
|
2410
|
-
visible?: boolean;
|
|
2411
|
-
keyPropertyEditing: boolean;
|
|
2412
|
-
};
|
|
2413
|
-
type SpriteItemProperty = BaseItemProperty & {
|
|
2414
|
-
image: string;
|
|
2415
|
-
};
|
|
2416
|
-
type GroupItemProperty = BaseItemProperty & {
|
|
2417
|
-
children: string[];
|
|
2418
|
-
};
|
|
2419
|
-
type TextItemProperty = BaseItemProperty & {
|
|
2420
|
-
fontFamily: string;
|
|
2421
|
-
color: [number, number, number, number];
|
|
2422
|
-
fontWeight: spec.TextWeight;
|
|
2423
|
-
text: string;
|
|
2424
|
-
textAlign: spec.TextAlignment;
|
|
2425
|
-
fontSize: number;
|
|
2426
|
-
fontStyle: spec.FontStyle;
|
|
2427
|
-
textWidth: number;
|
|
2428
|
-
lineHeight: number;
|
|
2429
|
-
textHeight: number;
|
|
2430
|
-
outlineColor?: spec.vec4;
|
|
2431
|
-
outlineWidth?: number;
|
|
2611
|
+
expandBoxLineAlpha: number;
|
|
2432
2612
|
/**
|
|
2433
|
-
* @description
|
|
2613
|
+
* @description 扩边包围盒角度半径
|
|
2434
2614
|
*/
|
|
2435
|
-
|
|
2436
|
-
fontUrl?: string;
|
|
2437
|
-
};
|
|
2438
|
-
type VideoItemProperty = BaseItemProperty & {
|
|
2439
|
-
video: string;
|
|
2440
|
-
/**
|
|
2441
|
-
* @description 是否静音
|
|
2442
|
-
*/
|
|
2443
|
-
muted?: boolean;
|
|
2615
|
+
expandBoxCornerRadius: number;
|
|
2444
2616
|
/**
|
|
2445
|
-
* @description
|
|
2617
|
+
* @description 扩边包围盒角点宽度
|
|
2446
2618
|
*/
|
|
2447
|
-
|
|
2619
|
+
expandBoxCornerLineWidth: number;
|
|
2448
2620
|
/**
|
|
2449
|
-
* @description
|
|
2621
|
+
* @description 扩边包围盒角点颜色
|
|
2450
2622
|
*/
|
|
2451
|
-
|
|
2623
|
+
expandBoxCornerLineColor: number;
|
|
2452
2624
|
/**
|
|
2453
|
-
* @description
|
|
2625
|
+
* @description 扩边包围盒角点透明度
|
|
2454
2626
|
*/
|
|
2455
|
-
|
|
2456
|
-
};
|
|
2457
|
-
/**
|
|
2458
|
-
* @description Generator 表单属性
|
|
2459
|
-
*/
|
|
2460
|
-
type GeneratorItemProperty = BaseItemProperty & {
|
|
2627
|
+
expandBoxCornerLineAlpha: number;
|
|
2461
2628
|
/**
|
|
2462
|
-
* @description
|
|
2629
|
+
* @description 扩边包围盒角点填充色
|
|
2463
2630
|
*/
|
|
2464
|
-
|
|
2465
|
-
};
|
|
2466
|
-
type EffectsItemProperty = BaseItemProperty & {
|
|
2467
|
-
effects: string;
|
|
2468
|
-
};
|
|
2469
|
-
/**
|
|
2470
|
-
* @description 页面表单类型和属性引用
|
|
2471
|
-
*/
|
|
2472
|
-
type PageFormTypeAndPropertyReference = {
|
|
2473
|
-
[spec.ItemType.base]: BaseItemProperty;
|
|
2474
|
-
[spec.ItemType.sprite]: SpriteItemProperty;
|
|
2475
|
-
[spec.ItemType.null]: BaseItemProperty;
|
|
2476
|
-
[SDKItemType.SPRITE]: SpriteItemProperty;
|
|
2477
|
-
[SDKItemType.TEXT]: TextItemProperty;
|
|
2478
|
-
[SDKItemType.VIDEO]: VideoItemProperty;
|
|
2479
|
-
[SDKItemType.GROUP]: GroupItemProperty;
|
|
2480
|
-
[SDKItemType.GENERATOR]: GeneratorItemProperty;
|
|
2481
|
-
[SDKItemType.EFFECTS]: EffectsItemProperty;
|
|
2482
|
-
[SDKItemType.FRAME]: BaseItemProperty;
|
|
2483
|
-
[spec.ItemType.interact]: BaseItemProperty;
|
|
2484
|
-
[spec.ItemType.plugin]: BaseItemProperty;
|
|
2485
|
-
[spec.ItemType.camera]: BaseItemProperty;
|
|
2486
|
-
[spec.ItemType.composition]: BaseItemProperty;
|
|
2487
|
-
[spec.ItemType.spine]: BaseItemProperty;
|
|
2488
|
-
[spec.ItemType.mesh]: BaseItemProperty;
|
|
2489
|
-
[spec.ItemType.tree]: BaseItemProperty;
|
|
2490
|
-
[spec.ItemType.text]: TextItemProperty;
|
|
2491
|
-
[spec.ItemType.light]: BaseItemProperty;
|
|
2492
|
-
[spec.ItemType.skybox]: BaseItemProperty;
|
|
2493
|
-
[spec.ItemType.effect]: BaseItemProperty;
|
|
2494
|
-
[spec.ItemType.shape]: BaseItemProperty;
|
|
2495
|
-
[spec.ItemType.postProcessVolume]: BaseItemProperty;
|
|
2496
|
-
[spec.ItemType.node]: BaseItemProperty;
|
|
2497
|
-
[spec.ItemType.video]: VideoItemProperty;
|
|
2498
|
-
[spec.ItemType.audio]: BaseItemProperty;
|
|
2499
|
-
[spec.ItemType.richtext]: TextItemProperty;
|
|
2500
|
-
};
|
|
2501
|
-
type SpecificPageFormProps<T extends keyof PageFormTypeAndPropertyReference> = {
|
|
2502
|
-
type: T;
|
|
2503
|
-
property: PageFormTypeAndPropertyReference[T];
|
|
2504
|
-
onPropertyValueChange: <N extends keyof PageFormTypeAndPropertyReference[T]>(propertyName: N, propertyValue: PageFormTypeAndPropertyReference[T][N]) => void;
|
|
2505
|
-
};
|
|
2506
|
-
type SDKOptions = {
|
|
2507
|
-
/** 导出视频时,是否开启转码日志 */
|
|
2508
|
-
loggerInExportVideoTranscoding?: boolean;
|
|
2509
|
-
};
|
|
2510
|
-
type SDKInputParam = SDKTemplateInputParam | SDKEditorInputParam;
|
|
2511
|
-
/**
|
|
2512
|
-
* @description SDK入参
|
|
2513
|
-
*/
|
|
2514
|
-
type SDKTemplateInputParam = {
|
|
2631
|
+
expandBoxCornerFillColor: number;
|
|
2515
2632
|
/**
|
|
2516
|
-
* @description
|
|
2633
|
+
* @description 缩放判断距离
|
|
2517
2634
|
*/
|
|
2518
|
-
|
|
2635
|
+
scaleInteractionDistance: number;
|
|
2519
2636
|
/**
|
|
2520
|
-
* @description
|
|
2637
|
+
* @description 单向缩放判断距离
|
|
2521
2638
|
*/
|
|
2522
|
-
|
|
2639
|
+
directionScaleInteractionDistance: number;
|
|
2523
2640
|
/**
|
|
2524
|
-
* @description
|
|
2641
|
+
* @description 网格线数量
|
|
2525
2642
|
*/
|
|
2526
|
-
|
|
2643
|
+
gridCount: number;
|
|
2527
2644
|
/**
|
|
2528
|
-
* @description
|
|
2645
|
+
* @description 网格线颜色
|
|
2529
2646
|
*/
|
|
2530
|
-
|
|
2531
|
-
};
|
|
2532
|
-
type SDKEditorInputParam = {
|
|
2647
|
+
gridLineColor: number;
|
|
2533
2648
|
/**
|
|
2534
|
-
* @description
|
|
2649
|
+
* @description 网格线宽度
|
|
2535
2650
|
*/
|
|
2536
|
-
|
|
2651
|
+
gridLineWidth: number;
|
|
2652
|
+
/**
|
|
2653
|
+
* @description 网格线透明度
|
|
2654
|
+
*/
|
|
2655
|
+
gridLineAlpha: number;
|
|
2537
2656
|
};
|
|
2538
2657
|
/**
|
|
2539
|
-
* @description
|
|
2658
|
+
* @description 文本交互控制器旋转交互模式
|
|
2659
|
+
* 'corner': 角点旋转
|
|
2660
|
+
* 'top-center': 顶部中心旋转
|
|
2540
2661
|
*/
|
|
2541
|
-
type
|
|
2662
|
+
type TextGizmoRotateInteractMode = 'corner' | 'top-center';
|
|
2663
|
+
/**
|
|
2664
|
+
* @description 文本交互控制器参数
|
|
2665
|
+
*/
|
|
2666
|
+
type TextGizmoConfig = {
|
|
2542
2667
|
/**
|
|
2543
|
-
* @description
|
|
2668
|
+
* @description 旋转交互模式
|
|
2544
2669
|
*/
|
|
2545
|
-
|
|
2670
|
+
rotateInteractMode: TextGizmoRotateInteractMode;
|
|
2546
2671
|
/**
|
|
2547
|
-
* @description
|
|
2672
|
+
* @description 包围盒线宽
|
|
2548
2673
|
*/
|
|
2549
|
-
|
|
2674
|
+
boxLineWidth: number;
|
|
2550
2675
|
/**
|
|
2551
|
-
* @description
|
|
2676
|
+
* @description 包围盒线色
|
|
2552
2677
|
*/
|
|
2553
|
-
|
|
2554
|
-
};
|
|
2555
|
-
/**
|
|
2556
|
-
* @description 页面数据
|
|
2557
|
-
*/
|
|
2558
|
-
type PageData = {
|
|
2678
|
+
boxLineColor: number;
|
|
2559
2679
|
/**
|
|
2560
|
-
* @description
|
|
2680
|
+
* @description 旋转交互点边长 - 用于 top-center 交互模式
|
|
2561
2681
|
*/
|
|
2562
|
-
|
|
2682
|
+
rotationCornerWidth: number;
|
|
2563
2683
|
/**
|
|
2564
|
-
* @description
|
|
2684
|
+
* @description 旋转交互贴图地址
|
|
2565
2685
|
*/
|
|
2566
|
-
|
|
2686
|
+
rotationCornerTexture: string;
|
|
2567
2687
|
/**
|
|
2568
|
-
* @description
|
|
2688
|
+
* @description 旋转交互点半径
|
|
2569
2689
|
*/
|
|
2570
|
-
|
|
2690
|
+
rotationCornerRadius: number;
|
|
2571
2691
|
/**
|
|
2572
|
-
* @description
|
|
2692
|
+
* @description top-center 模式旋转交互距离
|
|
2573
2693
|
*/
|
|
2574
|
-
|
|
2694
|
+
rotationTopCenterInteractionDistance: number;
|
|
2575
2695
|
/**
|
|
2576
|
-
* @description
|
|
2696
|
+
* @description 旋转交互点填充色
|
|
2577
2697
|
*/
|
|
2578
|
-
|
|
2698
|
+
rotationCornerFillColor: number;
|
|
2579
2699
|
/**
|
|
2580
|
-
* @description
|
|
2700
|
+
* @description 旋转交互点描边宽度
|
|
2581
2701
|
*/
|
|
2582
|
-
|
|
2702
|
+
rotationCornerStrokeWidth: number;
|
|
2583
2703
|
/**
|
|
2584
|
-
* @description
|
|
2704
|
+
* @description 旋转交互点描边颜色
|
|
2585
2705
|
*/
|
|
2586
|
-
|
|
2587
|
-
};
|
|
2588
|
-
/**
|
|
2589
|
-
* @description 页面配置
|
|
2590
|
-
*/
|
|
2591
|
-
type PageConfig = {
|
|
2706
|
+
rotationCornerStrokeColor: number;
|
|
2592
2707
|
/**
|
|
2593
|
-
* @description
|
|
2708
|
+
* @description Corner 模式旋转交互距离
|
|
2594
2709
|
*/
|
|
2595
|
-
|
|
2710
|
+
rotationCornerInteractionDistance: number;
|
|
2596
2711
|
/**
|
|
2597
|
-
* @description
|
|
2712
|
+
* @description 缩放交互点半径
|
|
2598
2713
|
*/
|
|
2599
|
-
|
|
2714
|
+
scaleCornerRadius: number;
|
|
2600
2715
|
/**
|
|
2601
|
-
* @description
|
|
2716
|
+
* @description 缩放交互点填充色
|
|
2602
2717
|
*/
|
|
2603
|
-
|
|
2718
|
+
scaleCornerFillColor: number;
|
|
2604
2719
|
/**
|
|
2605
|
-
* @description
|
|
2720
|
+
* @description 缩放交互点描边宽度
|
|
2606
2721
|
*/
|
|
2607
|
-
|
|
2722
|
+
scaleCornerStrokeWidth: number;
|
|
2608
2723
|
/**
|
|
2609
|
-
* @description
|
|
2724
|
+
* @description 缩放交互点描边颜色
|
|
2610
2725
|
*/
|
|
2611
|
-
|
|
2612
|
-
};
|
|
2613
|
-
/**
|
|
2614
|
-
* @description 页面属性
|
|
2615
|
-
*/
|
|
2616
|
-
type PageProperty = {
|
|
2726
|
+
scaleCornerStrokeColor: number;
|
|
2617
2727
|
/**
|
|
2618
|
-
* @description
|
|
2728
|
+
* @description 触发缩放交互的距离
|
|
2619
2729
|
*/
|
|
2620
|
-
|
|
2730
|
+
scaleInteractionDistance: number;
|
|
2621
2731
|
/**
|
|
2622
|
-
* @description
|
|
2732
|
+
* @description 触发边缩放交互的距离
|
|
2623
2733
|
*/
|
|
2624
|
-
|
|
2734
|
+
widthScaleInteractionDistance: number;
|
|
2735
|
+
};
|
|
2736
|
+
/**
|
|
2737
|
+
* @description 蒙版参数
|
|
2738
|
+
*/
|
|
2739
|
+
type MaskGizmoConfig = {
|
|
2625
2740
|
/**
|
|
2626
|
-
* @description
|
|
2741
|
+
* @description 画笔大小
|
|
2627
2742
|
*/
|
|
2628
|
-
|
|
2743
|
+
brushSize: number;
|
|
2629
2744
|
/**
|
|
2630
|
-
* @description
|
|
2745
|
+
* @description 笔刷颜色
|
|
2631
2746
|
*/
|
|
2632
|
-
|
|
2747
|
+
brushColor: number;
|
|
2633
2748
|
/**
|
|
2634
|
-
* @description
|
|
2749
|
+
* @description 笔刷透明度
|
|
2635
2750
|
*/
|
|
2636
|
-
|
|
2637
|
-
};
|
|
2638
|
-
/**
|
|
2639
|
-
* @description 视图创建参数
|
|
2640
|
-
*/
|
|
2641
|
-
type ViewParam = {
|
|
2751
|
+
brushAlpha: number;
|
|
2642
2752
|
/**
|
|
2643
|
-
* @description
|
|
2753
|
+
* @description 蒙版颜色
|
|
2644
2754
|
*/
|
|
2645
|
-
|
|
2755
|
+
maskColor: number;
|
|
2646
2756
|
/**
|
|
2647
|
-
* @description
|
|
2757
|
+
* @description 蒙版透明度
|
|
2648
2758
|
*/
|
|
2649
|
-
|
|
2759
|
+
maskAlpha: number;
|
|
2650
2760
|
/**
|
|
2651
|
-
* @description
|
|
2761
|
+
* @description 元素包围盒线框宽度
|
|
2652
2762
|
*/
|
|
2653
|
-
|
|
2763
|
+
boxLineWidth: number;
|
|
2654
2764
|
/**
|
|
2655
|
-
* @description
|
|
2765
|
+
* @description 元素包围盒线框颜色
|
|
2656
2766
|
*/
|
|
2657
|
-
|
|
2767
|
+
boxLineColor: number;
|
|
2658
2768
|
/**
|
|
2659
|
-
* @description
|
|
2769
|
+
* @description 元素包围盒线框透明度
|
|
2660
2770
|
*/
|
|
2661
|
-
|
|
2771
|
+
boxLineAlpha: number;
|
|
2662
2772
|
};
|
|
2663
2773
|
/**
|
|
2664
|
-
* @description
|
|
2774
|
+
* @description 精准改字编辑参数
|
|
2665
2775
|
*/
|
|
2666
|
-
type
|
|
2776
|
+
type SpriteTextEditGizmoConfig = {
|
|
2667
2777
|
/**
|
|
2668
|
-
* @description
|
|
2778
|
+
* @description 文案颜色
|
|
2669
2779
|
*/
|
|
2670
|
-
|
|
2671
|
-
} & Omit<ExportMediaItemOptions, 'scene' | 'size'>;
|
|
2672
|
-
/**
|
|
2673
|
-
* @description 视图属性
|
|
2674
|
-
*/
|
|
2675
|
-
type ViewProperty = {
|
|
2780
|
+
textColor: number;
|
|
2676
2781
|
/**
|
|
2677
|
-
* @description
|
|
2782
|
+
* @description 包围盒线框宽度
|
|
2678
2783
|
*/
|
|
2679
|
-
|
|
2784
|
+
boxLineWidth: number;
|
|
2680
2785
|
/**
|
|
2681
|
-
* @description
|
|
2786
|
+
* @description 包围盒间隔线长度
|
|
2682
2787
|
*/
|
|
2683
|
-
|
|
2788
|
+
dashLineDash: number;
|
|
2684
2789
|
/**
|
|
2685
|
-
* @description
|
|
2790
|
+
* @description 包围盒间隔线间隔
|
|
2686
2791
|
*/
|
|
2687
|
-
|
|
2792
|
+
dashLineGap: number;
|
|
2688
2793
|
/**
|
|
2689
|
-
* @description
|
|
2794
|
+
* @description 预选中文案颜色
|
|
2690
2795
|
*/
|
|
2691
|
-
|
|
2796
|
+
preSelectedTextColor: number;
|
|
2692
2797
|
/**
|
|
2693
|
-
* @description
|
|
2798
|
+
* @description 标记包围盒颜色
|
|
2694
2799
|
*/
|
|
2695
|
-
|
|
2800
|
+
editBoxColor: number;
|
|
2696
2801
|
/**
|
|
2697
|
-
* @description
|
|
2802
|
+
* @description 编辑包围盒透明度
|
|
2698
2803
|
*/
|
|
2699
|
-
|
|
2804
|
+
editBoxAlpha: number;
|
|
2700
2805
|
/**
|
|
2701
|
-
* @description
|
|
2806
|
+
* @description 编辑包围盒线框颜色
|
|
2702
2807
|
*/
|
|
2703
|
-
|
|
2704
|
-
};
|
|
2705
|
-
/**
|
|
2706
|
-
* @description 自定义出血区数据
|
|
2707
|
-
*/
|
|
2708
|
-
type PreviewSafeAreaParam = {
|
|
2808
|
+
editBoxLineColor: number;
|
|
2709
2809
|
/**
|
|
2710
|
-
* @description
|
|
2810
|
+
* @description 编辑包围盒线框透明度
|
|
2711
2811
|
*/
|
|
2712
|
-
|
|
2812
|
+
editBoxLineAlpha: number;
|
|
2713
2813
|
/**
|
|
2714
|
-
* @description
|
|
2814
|
+
* @description 已更改编辑包围盒颜色
|
|
2715
2815
|
*/
|
|
2716
|
-
|
|
2816
|
+
hasChangedEditBoxColor: number;
|
|
2717
2817
|
/**
|
|
2718
|
-
* @description
|
|
2818
|
+
* @description 已更改编辑包围盒透明度
|
|
2719
2819
|
*/
|
|
2720
|
-
|
|
2820
|
+
hasChangedEditBoxAlpha: number;
|
|
2721
2821
|
/**
|
|
2722
|
-
* @description
|
|
2822
|
+
* @description 已更改编辑包围盒线框颜色
|
|
2723
2823
|
*/
|
|
2724
|
-
|
|
2725
|
-
};
|
|
2726
|
-
/**
|
|
2727
|
-
* @description 页面活跃数据
|
|
2728
|
-
*/
|
|
2729
|
-
type ActiveData = {
|
|
2824
|
+
hasChangedEditBoxLineColor: number;
|
|
2730
2825
|
/**
|
|
2731
|
-
* @description
|
|
2826
|
+
* @description 已更改编辑包围盒线框透明度
|
|
2732
2827
|
*/
|
|
2733
|
-
|
|
2828
|
+
hasChangedEditBoxLineAlpha: number;
|
|
2734
2829
|
/**
|
|
2735
|
-
* @description
|
|
2830
|
+
* @description 编辑包围盒预选颜色
|
|
2736
2831
|
*/
|
|
2737
|
-
|
|
2832
|
+
editBoxPreSelectedColor: number;
|
|
2738
2833
|
/**
|
|
2739
|
-
* @description
|
|
2834
|
+
* @description 编辑包围盒预选透明度
|
|
2740
2835
|
*/
|
|
2741
|
-
|
|
2836
|
+
editBoxPreSelectedAlpha: number;
|
|
2742
2837
|
/**
|
|
2743
|
-
* @description
|
|
2838
|
+
* @description 编辑包围盒预选线框颜色
|
|
2744
2839
|
*/
|
|
2745
|
-
|
|
2746
|
-
};
|
|
2747
|
-
/**
|
|
2748
|
-
* @description 视图元素
|
|
2749
|
-
* @description 注意:SDKItem 现在已从类实现中导入,见 view-item/index.ts
|
|
2750
|
-
* @description SDKItem 现在是类实例而非普通对象,支持属性扩展
|
|
2751
|
-
* @description 保持类型兼容性:新 SDKItem 类拥有与旧类型相同的属性
|
|
2752
|
-
*/
|
|
2753
|
-
type SDKItem = SDKItem$1;
|
|
2754
|
-
type SDKBackgroundType = 'color' | 'image' | 'chess-board' | 'dot-board';
|
|
2755
|
-
/**
|
|
2756
|
-
* @description 图层创建信息
|
|
2757
|
-
*/
|
|
2758
|
-
type SpriteCreateInfo = {
|
|
2759
|
-
type: SDKItemType.SPRITE;
|
|
2840
|
+
editBoxLinePreSelectedColor: number;
|
|
2760
2841
|
/**
|
|
2761
|
-
* @description
|
|
2842
|
+
* @description 编辑包围盒预选线框透明度
|
|
2762
2843
|
*/
|
|
2763
|
-
|
|
2844
|
+
editBoxLinePreSelectedAlpha: number;
|
|
2764
2845
|
/**
|
|
2765
|
-
* @description
|
|
2846
|
+
* @description 已更改编辑包围盒预选颜色
|
|
2766
2847
|
*/
|
|
2767
|
-
|
|
2848
|
+
hasChangedEditBoxPreSelectedColor: number;
|
|
2768
2849
|
/**
|
|
2769
|
-
* @description
|
|
2850
|
+
* @description 已更改编辑包围盒预选透明度
|
|
2770
2851
|
*/
|
|
2771
|
-
|
|
2852
|
+
hasChangedEditBoxPreSelectedAlpha: number;
|
|
2772
2853
|
/**
|
|
2773
|
-
|
|
2854
|
+
* @description 已更改编辑包围盒线框颜色
|
|
2855
|
+
*/
|
|
2856
|
+
hasChangedEditBoxLinePreSelectedColor: number;
|
|
2857
|
+
/**
|
|
2858
|
+
* @description 已更改编辑包围盒线框透明度
|
|
2774
2859
|
*/
|
|
2775
|
-
|
|
2860
|
+
hasChangedEditBoxLinePreSelectedAlpha: number;
|
|
2776
2861
|
/**
|
|
2777
|
-
* @description
|
|
2862
|
+
* @description 选中状态标记包围盒颜色
|
|
2778
2863
|
*/
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
/**
|
|
2785
|
-
* @description 图层像素宽度
|
|
2786
|
-
*/
|
|
2787
|
-
width: number;
|
|
2788
|
-
/**
|
|
2789
|
-
* @description 图层像素高度
|
|
2790
|
-
*/
|
|
2791
|
-
height: number;
|
|
2792
|
-
/**
|
|
2793
|
-
* @description 元素位置
|
|
2794
|
-
*/
|
|
2795
|
-
position: [number, number];
|
|
2796
|
-
/**
|
|
2797
|
-
* @description 元素旋转 z | [x, y, z]
|
|
2798
|
-
*/
|
|
2799
|
-
rotation?: number | [number, number, number];
|
|
2800
|
-
/**
|
|
2801
|
-
* @description 元素缩放
|
|
2802
|
-
*/
|
|
2803
|
-
scale?: [number, number];
|
|
2804
|
-
};
|
|
2864
|
+
editBoxSelectedColor: number;
|
|
2865
|
+
/**
|
|
2866
|
+
* @description 选中状态标记包围盒颜色
|
|
2867
|
+
*/
|
|
2868
|
+
editBoxSelectedAlpha: number;
|
|
2805
2869
|
};
|
|
2806
|
-
|
|
2807
|
-
* @description 空节点创建信息
|
|
2808
|
-
*/
|
|
2809
|
-
type GroupCreateInfo = {
|
|
2810
|
-
type: SDKItemType.GROUP;
|
|
2870
|
+
type VideoPlayGizmoConfig = {
|
|
2811
2871
|
/**
|
|
2812
|
-
* @description
|
|
2872
|
+
* @description 自动展示
|
|
2813
2873
|
*/
|
|
2814
|
-
|
|
2874
|
+
autoShow: boolean;
|
|
2815
2875
|
/**
|
|
2816
|
-
* @description
|
|
2876
|
+
* @description 图标地址
|
|
2817
2877
|
*/
|
|
2818
|
-
|
|
2878
|
+
logoUrl: string;
|
|
2819
2879
|
/**
|
|
2820
|
-
* @description
|
|
2880
|
+
* @description 距离右下角偏移值
|
|
2821
2881
|
*/
|
|
2822
|
-
|
|
2882
|
+
logoShift: [number, number];
|
|
2823
2883
|
/**
|
|
2824
|
-
* @description
|
|
2884
|
+
* @description 宽
|
|
2825
2885
|
*/
|
|
2826
|
-
|
|
2886
|
+
width: number;
|
|
2827
2887
|
/**
|
|
2828
|
-
* @description
|
|
2888
|
+
* @description 高
|
|
2829
2889
|
*/
|
|
2830
|
-
|
|
2831
|
-
/**
|
|
2832
|
-
* @description 元素位置
|
|
2833
|
-
*/
|
|
2834
|
-
position?: [number, number];
|
|
2835
|
-
/**
|
|
2836
|
-
* @description 元素旋转 z | [x, y, z]
|
|
2837
|
-
*/
|
|
2838
|
-
rotation?: number | [number, number, number];
|
|
2839
|
-
/**
|
|
2840
|
-
* @description 元素缩放
|
|
2841
|
-
*/
|
|
2842
|
-
scale?: [number, number];
|
|
2843
|
-
/**
|
|
2844
|
-
* @description 子元素id
|
|
2845
|
-
*/
|
|
2846
|
-
children: string[];
|
|
2847
|
-
};
|
|
2890
|
+
height: number;
|
|
2848
2891
|
};
|
|
2849
|
-
|
|
2850
|
-
* @description 文本创建信息
|
|
2851
|
-
*/
|
|
2852
|
-
type TextCreateInfo = {
|
|
2853
|
-
type: SDKItemType.TEXT;
|
|
2892
|
+
type ItemCreateGizmoConfig = {
|
|
2854
2893
|
/**
|
|
2855
|
-
* @description
|
|
2894
|
+
* @description 边框颜色
|
|
2856
2895
|
*/
|
|
2857
|
-
|
|
2896
|
+
frameBorderColor: number;
|
|
2858
2897
|
/**
|
|
2859
|
-
* @description
|
|
2898
|
+
* @description 边框宽度
|
|
2860
2899
|
*/
|
|
2861
|
-
|
|
2900
|
+
frameBorderWidth: number;
|
|
2862
2901
|
/**
|
|
2863
|
-
* @description
|
|
2902
|
+
* @description 边框透明度
|
|
2864
2903
|
*/
|
|
2865
|
-
|
|
2904
|
+
frameBorderAlpha: number;
|
|
2866
2905
|
/**
|
|
2867
|
-
* @description
|
|
2906
|
+
* @description 填充颜色
|
|
2868
2907
|
*/
|
|
2869
|
-
|
|
2908
|
+
frameFillColor: number;
|
|
2870
2909
|
/**
|
|
2871
|
-
* @description
|
|
2910
|
+
* @description 填充透明度
|
|
2872
2911
|
*/
|
|
2873
|
-
|
|
2874
|
-
/**
|
|
2875
|
-
* @description 文本宽度
|
|
2876
|
-
*/
|
|
2877
|
-
width: number;
|
|
2878
|
-
/**
|
|
2879
|
-
* @description 文本高度
|
|
2880
|
-
*/
|
|
2881
|
-
height?: number;
|
|
2882
|
-
/**
|
|
2883
|
-
* @description 元素位置
|
|
2884
|
-
*/
|
|
2885
|
-
position: [number, number];
|
|
2886
|
-
/**
|
|
2887
|
-
* @description 元素旋转 z | [x, y, z]
|
|
2888
|
-
*/
|
|
2889
|
-
rotation?: number | [number, number, number];
|
|
2890
|
-
/**
|
|
2891
|
-
* @description 元素缩放
|
|
2892
|
-
*/
|
|
2893
|
-
scale?: [number, number];
|
|
2894
|
-
/**
|
|
2895
|
-
* @description 单行高度
|
|
2896
|
-
*/
|
|
2897
|
-
lineHeight: number;
|
|
2898
|
-
/**
|
|
2899
|
-
* @description 字体名称
|
|
2900
|
-
*/
|
|
2901
|
-
fontFamily: string;
|
|
2902
|
-
/**
|
|
2903
|
-
* @description 文字大小
|
|
2904
|
-
*/
|
|
2905
|
-
fontSize: number;
|
|
2906
|
-
/**
|
|
2907
|
-
* @description 字重
|
|
2908
|
-
*/
|
|
2909
|
-
fontWeight?: spec.TextWeight;
|
|
2910
|
-
/**
|
|
2911
|
-
* @description 字体格式
|
|
2912
|
-
*/
|
|
2913
|
-
fontStyle?: spec.FontStyle;
|
|
2914
|
-
/**
|
|
2915
|
-
* @description 对齐方式
|
|
2916
|
-
*/
|
|
2917
|
-
textAlign?: spec.TextAlignment;
|
|
2918
|
-
/**
|
|
2919
|
-
* @description 文本信息
|
|
2920
|
-
*/
|
|
2921
|
-
text: string;
|
|
2922
|
-
/**
|
|
2923
|
-
* @description 填充色
|
|
2924
|
-
*/
|
|
2925
|
-
color: spec.vec4;
|
|
2926
|
-
/**
|
|
2927
|
-
* @description 描边色
|
|
2928
|
-
*/
|
|
2929
|
-
outlineColor?: spec.vec4;
|
|
2930
|
-
/**
|
|
2931
|
-
* @description 描边宽度
|
|
2932
|
-
*/
|
|
2933
|
-
outlineWidth?: number;
|
|
2934
|
-
/**
|
|
2935
|
-
* @description 描边开关
|
|
2936
|
-
*/
|
|
2937
|
-
outlineEnabled?: boolean;
|
|
2938
|
-
/**
|
|
2939
|
-
* @description 字体文件地址
|
|
2940
|
-
*/
|
|
2941
|
-
fontUrl?: string;
|
|
2942
|
-
};
|
|
2912
|
+
frameFillAlpha: number;
|
|
2943
2913
|
};
|
|
2914
|
+
|
|
2944
2915
|
/**
|
|
2945
|
-
* @description
|
|
2916
|
+
* @description 精准改字功能初始化信息
|
|
2946
2917
|
*/
|
|
2947
|
-
type
|
|
2948
|
-
type: SDKItemType.VIDEO;
|
|
2918
|
+
type SpriteTextInitParam = {
|
|
2949
2919
|
/**
|
|
2950
|
-
* @description
|
|
2920
|
+
* @description 元素ID
|
|
2951
2921
|
*/
|
|
2952
|
-
|
|
2922
|
+
id: string;
|
|
2953
2923
|
/**
|
|
2954
|
-
* @description
|
|
2924
|
+
* @description 改字信息
|
|
2955
2925
|
*/
|
|
2956
|
-
|
|
2926
|
+
info: SpriteTextInitInfo[];
|
|
2927
|
+
};
|
|
2928
|
+
type SpriteTextInitInfo = {
|
|
2957
2929
|
/**
|
|
2958
|
-
* @description
|
|
2930
|
+
* @description 是否被修改过
|
|
2959
2931
|
*/
|
|
2960
|
-
|
|
2932
|
+
hasChanged: boolean;
|
|
2961
2933
|
/**
|
|
2962
|
-
* @description
|
|
2934
|
+
* @description 文字内容
|
|
2963
2935
|
*/
|
|
2964
|
-
|
|
2936
|
+
text: string;
|
|
2965
2937
|
/**
|
|
2966
|
-
* @description
|
|
2938
|
+
* @description 包围盒信息
|
|
2967
2939
|
*/
|
|
2968
|
-
|
|
2969
|
-
/**
|
|
2970
|
-
* @description 视频资源地址 | 数据
|
|
2971
|
-
*/
|
|
2972
|
-
video: string;
|
|
2973
|
-
/**
|
|
2974
|
-
* @description 视频元素像素宽度
|
|
2975
|
-
*/
|
|
2976
|
-
width: number;
|
|
2977
|
-
/**
|
|
2978
|
-
* @description 视频元素像素高度
|
|
2979
|
-
*/
|
|
2980
|
-
height: number;
|
|
2981
|
-
/**
|
|
2982
|
-
* @description 视频元素位置
|
|
2983
|
-
*/
|
|
2984
|
-
position: [number, number];
|
|
2985
|
-
/**
|
|
2986
|
-
* @description 视频元素旋转 z | [x, y, z]
|
|
2987
|
-
*/
|
|
2988
|
-
rotation?: number | [number, number, number];
|
|
2989
|
-
/**
|
|
2990
|
-
* @description 视频元素缩放
|
|
2991
|
-
*/
|
|
2992
|
-
scale?: [number, number];
|
|
2993
|
-
/**
|
|
2994
|
-
* @description 是否静音
|
|
2995
|
-
*/
|
|
2996
|
-
muted?: boolean;
|
|
2997
|
-
/**
|
|
2998
|
-
* @description 是否为透明视频
|
|
2999
|
-
*/
|
|
3000
|
-
transparent?: boolean;
|
|
3001
|
-
/**
|
|
3002
|
-
* @description 播放速率
|
|
3003
|
-
*/
|
|
3004
|
-
playbackRate?: number;
|
|
3005
|
-
/**
|
|
3006
|
-
* @description 音量
|
|
3007
|
-
*/
|
|
3008
|
-
volume?: number;
|
|
3009
|
-
};
|
|
2940
|
+
box: [spec.vec2, spec.vec2, spec.vec2, spec.vec2];
|
|
3010
2941
|
};
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
2942
|
+
type ItemCreateType = 'none' | 'text' | 'video-generator' | 'sprite-generator' | 'frame';
|
|
2943
|
+
type GizmoType = 'null' | 'selector' | 'transform' | 'control' | 'adsorption' | 'preference' | 'picture-cut' | 'text' | 'mask' | 'loading' | 'picture-expand' | 'sprite-text-edit' | 'video-play' | 'item-create';
|
|
2944
|
+
type GestureHandlerInteractType = 'select' | 'hand';
|
|
2945
|
+
|
|
2946
|
+
type AlignType = 'left' | 'right' | 'horizontal-center' | 'top' | 'bottom' | 'vertical-center';
|
|
2947
|
+
type DistributeType = 'vertical-spacing' | 'horizontal-spacing';
|
|
2948
|
+
|
|
2949
|
+
declare module '@pixi/graphics' {
|
|
2950
|
+
interface Graphics {
|
|
2951
|
+
fillBox(box: Box2): void;
|
|
2952
|
+
drawBox(box: Box2): void;
|
|
2953
|
+
drawLine(line: Line2 | Point[]): void;
|
|
2954
|
+
drawDashLine(toX: number, toY: number, dash: number, gap: number): void;
|
|
2955
|
+
}
|
|
2956
|
+
}
|
|
2957
|
+
|
|
2958
|
+
type SDKEvents = {
|
|
2959
|
+
'loadingItemChange': [id: string[]];
|
|
2960
|
+
'selectedItemChange': [id: string[]];
|
|
2961
|
+
'preSelectedItemChange': [id: string | undefined];
|
|
2962
|
+
'selectedViewChange': [id: number];
|
|
2963
|
+
'pageDataChange': [pageData: PageData];
|
|
2964
|
+
'zoomChange': [zoom: number];
|
|
2965
|
+
'progress': [{
|
|
2966
|
+
duration: number;
|
|
2967
|
+
time: number;
|
|
2968
|
+
end: boolean;
|
|
2969
|
+
paused: boolean;
|
|
2970
|
+
}];
|
|
2971
|
+
'itemPropertyChange': [{
|
|
2972
|
+
id: string;
|
|
2973
|
+
property: string;
|
|
2974
|
+
}];
|
|
2975
|
+
'exportProgress': [progress?: number];
|
|
2976
|
+
'exportDone': [item: ExportItemParams | undefined, success: boolean, buffer?: FileBuffer];
|
|
2977
|
+
'exportComplete': [success: boolean, taskInfos: ExportParams, buffers: Buffers, extras: Extras];
|
|
2978
|
+
'sdkConfigChange': [preSDKConfig: SDKConfig, curSDKConfig: SDKConfig];
|
|
2979
|
+
'cutBoxChange': [box: Box2];
|
|
2980
|
+
'expandBoxChange': [box: Box2];
|
|
2981
|
+
'textInput': [{
|
|
2982
|
+
itemId: string;
|
|
2983
|
+
text: string;
|
|
2984
|
+
fontFamily: string;
|
|
2985
|
+
}];
|
|
2986
|
+
'undoRedoChange': [Operation];
|
|
2987
|
+
'viewportTransform': [{
|
|
2988
|
+
zoom: number;
|
|
2989
|
+
translation: [number, number];
|
|
2990
|
+
}];
|
|
2991
|
+
'itemOnDragStart': [type: GizmoType];
|
|
2992
|
+
'itemOnDrag': [type: GizmoType];
|
|
2993
|
+
'itemOnDragEnd': [type: GizmoType];
|
|
2994
|
+
'spriteTextClick': [{
|
|
2995
|
+
id: string;
|
|
2996
|
+
index: number;
|
|
2997
|
+
text: string;
|
|
2998
|
+
} | undefined];
|
|
2999
|
+
'videoPlay': [{
|
|
3000
|
+
id: string;
|
|
3001
|
+
time: number;
|
|
3002
|
+
}];
|
|
3003
|
+
'itemCreate': [{
|
|
3004
|
+
type: ItemCreateType;
|
|
3005
|
+
position: spec.vec2;
|
|
3006
|
+
id: string;
|
|
3007
|
+
}];
|
|
3008
|
+
'viewLost': [];
|
|
3009
|
+
'viewRebuildFinish': [];
|
|
3010
|
+
};
|
|
3011
|
+
declare class SDK {
|
|
3012
|
+
static config: SDKConfig;
|
|
3013
|
+
private _eventEmitter;
|
|
3014
|
+
private _pageData;
|
|
3015
|
+
private _screenShot;
|
|
3016
|
+
private _exporter?;
|
|
3017
|
+
private _pageDataUtils;
|
|
3018
|
+
private _sizeAdapt;
|
|
3019
|
+
private _gestureHandler;
|
|
3020
|
+
private disposables;
|
|
3021
|
+
private _isSwitchScene;
|
|
3022
|
+
private _undoRedo;
|
|
3023
|
+
player: Player;
|
|
3024
|
+
_container: HTMLElement;
|
|
3025
|
+
private _playerContainer;
|
|
3026
|
+
constructor(container: HTMLElement, mode?: SDKMode);
|
|
3027
|
+
get container(): HTMLElement;
|
|
3028
|
+
get pageData(): PageData | undefined;
|
|
3029
|
+
private get initExporterEnabled();
|
|
3030
|
+
get exportStatus(): string | undefined;
|
|
3031
|
+
get undoRedo(): UndoRedo;
|
|
3032
|
+
private get exportOptions();
|
|
3033
|
+
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;
|
|
3035
|
+
initPlayer(mode: SDKMode): void;
|
|
3036
|
+
setSDKMode(mode: SDKMode): void;
|
|
3037
|
+
private getInitParam;
|
|
3038
|
+
private initExporter;
|
|
3039
|
+
private initSDK;
|
|
3040
|
+
run(param: SDKInputParam): Promise<void>;
|
|
3041
|
+
getActiveItems(): string[];
|
|
3042
|
+
setPreSelectedItem(id: string): void;
|
|
3043
|
+
getPreSelectedItem(): string;
|
|
3044
|
+
setSelectedItems(itemIds: string[]): void;
|
|
3019
3045
|
/**
|
|
3020
|
-
* @description
|
|
3046
|
+
* @description 设置元素属性(支持单个元素的单/多属性设置)
|
|
3047
|
+
* @param param 设置参数,支持两种场景:
|
|
3048
|
+
* 1. 单个元素单个属性: { itemId, type, propertyName, propertyValue }
|
|
3049
|
+
* 2. 单个元素多个属性: { itemId, type, property }
|
|
3021
3050
|
*/
|
|
3022
|
-
|
|
3051
|
+
setItemProperty<T extends SDKItemType>(param: SetItemPropertyParam<T>): Promise<void>;
|
|
3052
|
+
generateScreenShot(id: number, size?: [number, number], tick?: number, backgroundColor?: spec.vec4): Promise<string | undefined>;
|
|
3023
3053
|
/**
|
|
3024
|
-
* @description
|
|
3054
|
+
* @description 切换场景
|
|
3055
|
+
* @param index 场景索引
|
|
3025
3056
|
*/
|
|
3026
|
-
|
|
3057
|
+
switchScene(index: number): Promise<void>;
|
|
3027
3058
|
/**
|
|
3028
|
-
* @description
|
|
3059
|
+
* @description 获取页面的 safeAreaPreview、zoom、adsorption、translation 值
|
|
3060
|
+
* @returns 页面的 safeAreaPreview、zoom、adsorption、translation 值
|
|
3029
3061
|
*/
|
|
3030
|
-
|
|
3062
|
+
getPageConfig(): PageConfig$1;
|
|
3031
3063
|
/**
|
|
3032
|
-
*
|
|
3064
|
+
* 设置页面的 safeAreaPreview、zoom、adsorption 值
|
|
3065
|
+
* @param pageProperty 设置
|
|
3033
3066
|
*/
|
|
3034
|
-
|
|
3067
|
+
setPageConfig(pageConfig: PageConfig$1): void;
|
|
3035
3068
|
/**
|
|
3036
|
-
* @description
|
|
3069
|
+
* @description 设置播放进度
|
|
3070
|
+
* @param progress 播放进度 0-100
|
|
3037
3071
|
*/
|
|
3038
|
-
|
|
3072
|
+
setPlayProgress(progress: number): Promise<void>;
|
|
3039
3073
|
/**
|
|
3040
|
-
* @description
|
|
3074
|
+
* @description 获取元素
|
|
3075
|
+
* @param id 元素ID
|
|
3076
|
+
* @returns 元素
|
|
3077
|
+
* */
|
|
3078
|
+
getSDKItem(id: string): SDKItem$1 | undefined;
|
|
3079
|
+
/**
|
|
3080
|
+
* @description 获取元素数组
|
|
3081
|
+
* @param id 元素ID数组
|
|
3082
|
+
* @returns 元素数组
|
|
3083
|
+
* */
|
|
3084
|
+
getSDKItems(ids?: string[]): SDKItem$1[];
|
|
3085
|
+
setPlayState(playState: 'play' | 'pause'): Promise<void>;
|
|
3086
|
+
/**
|
|
3087
|
+
* @description 获取场景预览图
|
|
3088
|
+
* @returns 视图预览图
|
|
3041
3089
|
*/
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3090
|
+
getViewThumbnail(): Promise<{
|
|
3091
|
+
id: number;
|
|
3092
|
+
thumbnail: string | undefined;
|
|
3093
|
+
}>[];
|
|
3094
|
+
/**
|
|
3095
|
+
* @description 获取视图JSON产物
|
|
3096
|
+
* @returns 当前所有视图JSON产物
|
|
3097
|
+
*/
|
|
3098
|
+
getViewScene(): {
|
|
3099
|
+
id: number;
|
|
3100
|
+
thumbnail: spec.JSONScene;
|
|
3101
|
+
}[];
|
|
3102
|
+
private destroyCompositions;
|
|
3103
|
+
/**
|
|
3104
|
+
* @description 以媒体格式 buffer 下载
|
|
3105
|
+
*/
|
|
3106
|
+
downloadByMediaBuffersOfExporter(params: ExportMediaItemDownloadInfo[], buffers: Buffers, extras: Extras): void;
|
|
3107
|
+
/**
|
|
3108
|
+
* @description 导出
|
|
3109
|
+
* 支持导出媒体或其他,如MP4,未来支持 JSON 等;
|
|
3110
|
+
*/
|
|
3111
|
+
onExport(): void;
|
|
3112
|
+
/**
|
|
3113
|
+
* @description 取消导出
|
|
3114
|
+
*/
|
|
3115
|
+
cancelExport(): void;
|
|
3116
|
+
loadPageData(data: PageData): Promise<void>;
|
|
3117
|
+
runByPageData(data: PageData): Promise<void>;
|
|
3118
|
+
reloadPageDataByScene(scene: string | spec.JSONScene): Promise<void>;
|
|
3119
|
+
/**
|
|
3120
|
+
* @description 新增视图数据
|
|
3121
|
+
* @param viewParams 视图参数
|
|
3122
|
+
* @param scene 场景数据 - 无输入时为默认场景数据
|
|
3123
|
+
*/
|
|
3124
|
+
addViewParams(viewParams: ViewParam[], scene?: spec.JSONScene): Promise<void>;
|
|
3125
|
+
deleteViewParams(ids: number[]): Promise<void>;
|
|
3126
|
+
setExportParam(exportParam: Partial<ExportParam>, id?: number): void;
|
|
3127
|
+
/**
|
|
3128
|
+
* @description 设置视图缩放
|
|
3129
|
+
* @param zoom 缩放值
|
|
3130
|
+
* @param center 缩放中心
|
|
3131
|
+
* @param ignoreClamp 是否忽视约束
|
|
3132
|
+
*/
|
|
3133
|
+
setPageZoom(zoom: number, center?: Vector2, ignoreClamp?: boolean): void;
|
|
3134
|
+
/**
|
|
3135
|
+
* @description 设置元素移动
|
|
3136
|
+
* @param targetTranslation 目标移动值
|
|
3137
|
+
*/
|
|
3138
|
+
setPageMove(targetTranslation: Vector2): void;
|
|
3139
|
+
/**
|
|
3140
|
+
* @description 设置静态预览功能开关
|
|
3141
|
+
* @param enabled 功能开关
|
|
3142
|
+
*/
|
|
3143
|
+
setStaticPreviewEnabled(enabled: boolean): void;
|
|
3144
|
+
/**
|
|
3145
|
+
* @description 设置静态预览视图名称
|
|
3146
|
+
* @param name 视图名称
|
|
3147
|
+
*/
|
|
3148
|
+
setStaticPreviewName(name: string): void;
|
|
3149
|
+
/**
|
|
3150
|
+
* @description 设置同步修改功能开关
|
|
3151
|
+
* @param enabled 功能开关
|
|
3152
|
+
*/
|
|
3153
|
+
setAsyncEnabled(enabled: boolean): void;
|
|
3154
|
+
/**
|
|
3155
|
+
* @description 设置 成组显影 开关
|
|
3156
|
+
*/
|
|
3157
|
+
setGroupVisibleEnabled(enabled: boolean): void;
|
|
3158
|
+
/**
|
|
3159
|
+
* @description 新增过滤元素名称
|
|
3160
|
+
* @param itemNames 过滤元素名称
|
|
3161
|
+
*/
|
|
3162
|
+
addFilterItemNames(itemNames: string[] | string): void;
|
|
3163
|
+
/**
|
|
3164
|
+
* @description 设置预览辅助层颜色
|
|
3165
|
+
* @param color 色值
|
|
3166
|
+
*/
|
|
3167
|
+
setPreferenceBackgroundColor(color: [number, number, number, number]): void;
|
|
3168
|
+
/**
|
|
3169
|
+
* @description 设置出血区颜色
|
|
3170
|
+
* @param color 色值
|
|
3171
|
+
*/
|
|
3172
|
+
setSafeAreaColor(color: [number, number, number, number]): void;
|
|
3173
|
+
/**
|
|
3174
|
+
* @description 设置 尺寸自适应拓展 功能开关
|
|
3175
|
+
* @param enabled 功能开关
|
|
3176
|
+
*/
|
|
3177
|
+
setSizeAdaptEnabled(enabled: boolean): void;
|
|
3178
|
+
/**
|
|
3179
|
+
* @description 设置 截图 功能开关
|
|
3180
|
+
* @param enabled 功能开关
|
|
3181
|
+
*/
|
|
3182
|
+
setScreenShotEnabled(enabled: boolean): void;
|
|
3183
|
+
/**
|
|
3184
|
+
* @description 设置导出功能初始化配置
|
|
3185
|
+
* @param exportConfig
|
|
3186
|
+
*/
|
|
3187
|
+
setExportConfig(exportConfig: Partial<ExportConfig>): void;
|
|
3073
3188
|
/**
|
|
3074
|
-
* @description
|
|
3189
|
+
* @description 设置预选框参数
|
|
3190
|
+
* @param preSelectedColor 预选框颜色
|
|
3191
|
+
* @param preSelectedWidth 预选框线框宽度
|
|
3075
3192
|
*/
|
|
3076
|
-
|
|
3193
|
+
setSelectorGizmoPreSelectConfig(preSelectedColor?: number, preSelectedWidth?: number): void;
|
|
3077
3194
|
/**
|
|
3078
|
-
* @description
|
|
3195
|
+
* @description 设置 变换控制器 交互框参数
|
|
3196
|
+
* @param config 参数
|
|
3079
3197
|
*/
|
|
3080
|
-
|
|
3198
|
+
setTranformGizmoWireframeConfig(config: {
|
|
3199
|
+
wireframeColor?: number;
|
|
3200
|
+
wireframeAlpha?: number;
|
|
3201
|
+
wireframeWidth?: number;
|
|
3202
|
+
}): void;
|
|
3081
3203
|
/**
|
|
3082
|
-
* @description
|
|
3204
|
+
* @description 获取 SDK 配置参数
|
|
3205
|
+
* @returns SDK 配置参数
|
|
3083
3206
|
*/
|
|
3084
|
-
|
|
3207
|
+
getSDKConfig(): SDKConfig;
|
|
3085
3208
|
/**
|
|
3086
|
-
* @description
|
|
3209
|
+
* @description 设置 SDK 配置参数
|
|
3210
|
+
* @param config SDK 配置参数
|
|
3087
3211
|
*/
|
|
3088
|
-
|
|
3089
|
-
};
|
|
3090
|
-
/**
|
|
3091
|
-
* @description 视频生成器资源信息
|
|
3092
|
-
*/
|
|
3093
|
-
type VideoGeneratorResource = {
|
|
3212
|
+
setSDKConfig(config: SDKConfig): void;
|
|
3094
3213
|
/**
|
|
3095
|
-
* @description
|
|
3214
|
+
* @description 设置SDK背景
|
|
3215
|
+
* @param type 背景类型
|
|
3216
|
+
* @param value 值
|
|
3096
3217
|
*/
|
|
3097
|
-
|
|
3218
|
+
setSDKBackground(type: SDKBackgroundType, value?: string): void;
|
|
3098
3219
|
/**
|
|
3099
|
-
* @description
|
|
3220
|
+
* @description 创建图层元素
|
|
3221
|
+
* @param spriteInfo 图层元素信息
|
|
3100
3222
|
*/
|
|
3101
|
-
|
|
3223
|
+
addSpriteItem(spriteInfo: SpriteCreateInfo, scene?: spec.JSONScene): Promise<string>;
|
|
3224
|
+
addVideoItem(videoInfo: VideoCreateInfo, scene?: spec.JSONScene): Promise<string>;
|
|
3225
|
+
openPictureCutGizmo(): void;
|
|
3226
|
+
closePictureCutGizmo(): void;
|
|
3227
|
+
getCutInfo(): {
|
|
3228
|
+
cutBox: Box2;
|
|
3229
|
+
itemBox: Box2;
|
|
3230
|
+
} | undefined;
|
|
3231
|
+
setCutBox(min: Vector2, max: Vector2): Box2 | undefined;
|
|
3232
|
+
openPictureExpandGizmo(): void;
|
|
3233
|
+
closePictureExpandGizmo(): void;
|
|
3234
|
+
getExpandInfo(): {
|
|
3235
|
+
expandBox: Box2;
|
|
3236
|
+
itemBox: Box2;
|
|
3237
|
+
} | undefined;
|
|
3238
|
+
setExpandBox(min: Vector2, max: Vector2): Box2 | undefined;
|
|
3239
|
+
openMaskGizmo(brushSize: number): void;
|
|
3240
|
+
clearMaskGizmo(): void;
|
|
3241
|
+
closeMaskGizmo(): void;
|
|
3242
|
+
getMask(): string | null | undefined;
|
|
3243
|
+
setMaskGizmoConfig(config: Partial<MaskGizmoConfig>): void;
|
|
3102
3244
|
/**
|
|
3103
|
-
* @description
|
|
3245
|
+
* @description 设置蒙版工具模式
|
|
3246
|
+
* @param mode 模式类型:'paint' 表示涂抹,'erase' 表示擦除
|
|
3104
3247
|
*/
|
|
3105
|
-
|
|
3248
|
+
setMaskGizmoMode(mode: 'paint' | 'erase'): void;
|
|
3249
|
+
openLoadingGizmo(id: string, loadingBox?: Box2, clearResult?: boolean): void;
|
|
3250
|
+
closeLoadingGizmo(id: string): void;
|
|
3106
3251
|
/**
|
|
3107
|
-
* @description
|
|
3252
|
+
* @description 元素打组
|
|
3253
|
+
* @param children 子元素ID
|
|
3108
3254
|
*/
|
|
3109
|
-
|
|
3255
|
+
groupItems(groupInfo: GroupCreateInfo, scene?: spec.JSONScene): string | undefined;
|
|
3256
|
+
setItemParent(id: string, parentId: string): void;
|
|
3257
|
+
deleteItemParent(id: string, parentId: string): void;
|
|
3258
|
+
addTextItem(textInfo: TextCreateInfo, scene?: spec.JSONScene): Promise<string | undefined>;
|
|
3259
|
+
addItemByCreateInfos(createInfos: ItemCreateInfo[], asyncMode?: boolean): Promise<string[]>;
|
|
3260
|
+
deleteItems(idInfo: string | string[]): void;
|
|
3261
|
+
getItemCreateInfo(id: string): ItemCreateInfo | undefined;
|
|
3262
|
+
getItemCreateInfos(ids?: string[]): ItemCreateInfo[];
|
|
3263
|
+
createScreenShotSceneByIds(idInfo: string | string[], time?: number): Promise<string | undefined>;
|
|
3264
|
+
getChildrenIds(id: string): string[];
|
|
3110
3265
|
/**
|
|
3111
|
-
* @description
|
|
3266
|
+
* @description 更新元素在图层中的顺序
|
|
3267
|
+
* @param id 元素ID
|
|
3268
|
+
* @param action 排序操作:BringToFront(置于顶层)、SendToBack(置于底层)、BringForward(上移一层)、SendBackward(下移一层)
|
|
3112
3269
|
*/
|
|
3113
|
-
|
|
3270
|
+
updateItemOrder(id: string, action: ItemOrderAction): void;
|
|
3114
3271
|
/**
|
|
3115
|
-
* @description
|
|
3272
|
+
* @description 导出JSON
|
|
3273
|
+
* @param idInfo 视图序号信息
|
|
3274
|
+
* @returns JSON数组
|
|
3116
3275
|
*/
|
|
3117
|
-
|
|
3276
|
+
exportJSON(idInfo?: number | number[]): spec.JSONScene[];
|
|
3277
|
+
getViewBoxById(id: string): Box2;
|
|
3118
3278
|
/**
|
|
3119
|
-
* @description
|
|
3279
|
+
* @description 批量设置元素扩展属性
|
|
3280
|
+
* @param id 元素ID
|
|
3281
|
+
* @param extensions 扩展属性对象(支持同时设置多个)
|
|
3282
|
+
* @returns 是否设置成功
|
|
3120
3283
|
*/
|
|
3121
|
-
|
|
3284
|
+
setItemExtension(id: string, extension: Record<string, any>): boolean;
|
|
3122
3285
|
/**
|
|
3123
|
-
* @description
|
|
3286
|
+
* @description 批量获取元素扩展属性
|
|
3287
|
+
* @param id 元素ID
|
|
3288
|
+
* @param keys 扩展属性名称列表(不传则返回所有扩展属性)
|
|
3289
|
+
* @returns 扩展属性对象
|
|
3124
3290
|
*/
|
|
3125
|
-
|
|
3126
|
-
};
|
|
3127
|
-
type GeneratorResource = SpriteGeneratorResource | VideoGeneratorResource;
|
|
3128
|
-
type EffectsCreateInfo = {
|
|
3291
|
+
getItemExtension(id: string, keys?: string[]): Record<string, any> | undefined;
|
|
3129
3292
|
/**
|
|
3130
|
-
* @description
|
|
3293
|
+
* @description 删除元素扩展属性(支持批量删除)
|
|
3294
|
+
* @param id 元素ID
|
|
3295
|
+
* @param keys 扩展属性名称列表
|
|
3296
|
+
* @returns 是否删除成功
|
|
3131
3297
|
*/
|
|
3132
|
-
|
|
3298
|
+
deleteItemExtensions(id: string, keys: string[]): boolean;
|
|
3133
3299
|
/**
|
|
3134
|
-
* @description
|
|
3300
|
+
* @description 检查元素是否有指定扩展属性
|
|
3301
|
+
* @param id 元素ID
|
|
3302
|
+
* @param key 扩展属性名称
|
|
3303
|
+
* @returns 是否存在
|
|
3135
3304
|
*/
|
|
3136
|
-
|
|
3305
|
+
hasItemExtension(id: string, key: string): boolean;
|
|
3137
3306
|
/**
|
|
3138
|
-
* @description
|
|
3307
|
+
* @description 获取元素所有扩展属性的键名列表
|
|
3308
|
+
* @param id 元素ID
|
|
3309
|
+
* @returns 键名数组
|
|
3139
3310
|
*/
|
|
3140
|
-
id
|
|
3311
|
+
getItemExtensionKeys(id: string): string[] | undefined;
|
|
3312
|
+
getViewProperty(id: number): ViewProperty | undefined;
|
|
3313
|
+
pageMove(shift: [number, number]): void;
|
|
3314
|
+
pageZoom(shift: number, center?: [number, number]): void;
|
|
3141
3315
|
/**
|
|
3142
|
-
* @description
|
|
3316
|
+
* @description 设置视图缩放工具锁定缩放比例开关
|
|
3317
|
+
* @param state 缩放比例开关
|
|
3143
3318
|
*/
|
|
3144
|
-
|
|
3145
|
-
property: {
|
|
3146
|
-
/**
|
|
3147
|
-
* @description 动效像素宽度
|
|
3148
|
-
*/
|
|
3149
|
-
width?: number;
|
|
3150
|
-
/**
|
|
3151
|
-
* @description 动效像素高度
|
|
3152
|
-
*/
|
|
3153
|
-
height?: number;
|
|
3154
|
-
/**
|
|
3155
|
-
* @description 生成器位置
|
|
3156
|
-
*/
|
|
3157
|
-
position: spec.vec2;
|
|
3158
|
-
/**
|
|
3159
|
-
* @description 旋转角度
|
|
3160
|
-
*/
|
|
3161
|
-
rotation?: number | [number, number, number];
|
|
3162
|
-
/**
|
|
3163
|
-
* @description 缩放
|
|
3164
|
-
*/
|
|
3165
|
-
scale?: spec.vec2;
|
|
3166
|
-
/**
|
|
3167
|
-
* @description 动效资源地址
|
|
3168
|
-
*/
|
|
3169
|
-
effects: string | spec.JSONScene;
|
|
3170
|
-
};
|
|
3319
|
+
setPictureCutGizmoLockScale(state: boolean): void;
|
|
3171
3320
|
/**
|
|
3172
|
-
* @description
|
|
3321
|
+
* @description 设置视图扩展工具锁定缩放比例开关
|
|
3322
|
+
* @param state 缩放比例开关
|
|
3173
3323
|
*/
|
|
3174
|
-
|
|
3175
|
-
};
|
|
3176
|
-
type ItemCreateInfo = GroupCreateInfo | SpriteCreateInfo | TextCreateInfo | VideoCreateInfo | GeneratorCreateInfo | EffectsCreateInfo;
|
|
3177
|
-
/**
|
|
3178
|
-
* @description 场景创建信息
|
|
3179
|
-
*/
|
|
3180
|
-
type SceneCreaetInfo = {
|
|
3324
|
+
setPictureExpandGizmoLockScale(state: boolean): void;
|
|
3181
3325
|
/**
|
|
3182
|
-
* @description
|
|
3326
|
+
* @description 视图缩放函数
|
|
3327
|
+
* @param shiftParam 视图偏移值
|
|
3183
3328
|
*/
|
|
3184
|
-
|
|
3329
|
+
viewportFit(shiftParam?: ViewportFitShiftParam, box?: Box2): void;
|
|
3185
3330
|
/**
|
|
3186
|
-
* @description
|
|
3331
|
+
* @description 获取元素包围盒
|
|
3332
|
+
* @param idInfo 元素Id
|
|
3333
|
+
* @returns 元素包围盒
|
|
3187
3334
|
*/
|
|
3188
|
-
|
|
3189
|
-
};
|
|
3190
|
-
declare enum ItemOrderAction {
|
|
3191
|
-
BringToFront = 0,
|
|
3192
|
-
SendToBack = 1,
|
|
3193
|
-
BringForward = 2,
|
|
3194
|
-
SendBackward = 3
|
|
3195
|
-
}
|
|
3196
|
-
/**
|
|
3197
|
-
* @description 视图自适应偏移参数
|
|
3198
|
-
*/
|
|
3199
|
-
type ViewportFitShiftParam = {
|
|
3335
|
+
getItemBoxById(idInfo: string): Box2;
|
|
3200
3336
|
/**
|
|
3201
|
-
* @description
|
|
3337
|
+
* @description 设置元素字体
|
|
3338
|
+
* @param id 元素Id
|
|
3339
|
+
* @param fontFamilyName 字体名称
|
|
3340
|
+
* @param url 字体地址
|
|
3202
3341
|
*/
|
|
3203
|
-
|
|
3342
|
+
setItemFontFamily(id: string, fontFamilyName: string, url: string): Promise<void>;
|
|
3343
|
+
createSceneByCreateInfos(createInfos: ItemCreateInfo[], sceneInfo: SceneCreaetInfo): spec.JSONScene;
|
|
3344
|
+
setSpriteSize(id: string, size: spec.vec2): void;
|
|
3345
|
+
setItemPropertyByCreateInfo(createInfo: ItemCreateInfo | ItemCreateInfo[]): void;
|
|
3346
|
+
setTransformGizmoLockScale(state: boolean): void;
|
|
3347
|
+
getViewBoxByBox(box: Box2): Box2;
|
|
3348
|
+
openSpriteTextEditGizmo(initParam: SpriteTextInitParam[]): void;
|
|
3349
|
+
closeSpriteTextEditGizmo(): void;
|
|
3350
|
+
setSpriteTextSelectedIndex(id: string, index: number): void;
|
|
3351
|
+
setSpriteTextSelectedText(id: string, index: number, text: string): void;
|
|
3352
|
+
getBoundingBoxByItemCreateInfo(createInfo: ItemCreateInfo): Box2;
|
|
3353
|
+
getBoundingBoxByItemCreateInfos(createInfos: ItemCreateInfo[]): Box2;
|
|
3354
|
+
setSpriteTextChangedState(id: string, index: number, hasChanged: boolean): void;
|
|
3355
|
+
setSpriteTextEditState(id: string, index: number, isEditing: boolean): void;
|
|
3356
|
+
getVideoItemPlayTime(id: string): number;
|
|
3357
|
+
setVideoItemPlayTime(id: string, time: number): void;
|
|
3358
|
+
getPixelPositionByViewPosition(viewPosition: Vector2): Vector2;
|
|
3359
|
+
hitTest(x: number, y: number): string[] | undefined;
|
|
3360
|
+
setInteractType(type: GestureHandlerInteractType): void;
|
|
3361
|
+
makeItemAlign(type: AlignType, ids?: string[]): void;
|
|
3362
|
+
makeItemDistribute(type: DistributeType, ids?: string[]): void;
|
|
3204
3363
|
/**
|
|
3205
|
-
* @description
|
|
3364
|
+
* @description 创建生成器元素
|
|
3365
|
+
* @param createInfo 生成器创建信息
|
|
3366
|
+
* @returns 生成器元素ID
|
|
3206
3367
|
*/
|
|
3207
|
-
|
|
3368
|
+
addGeneratorItem(createInfo: GeneratorCreateInfo): string;
|
|
3208
3369
|
/**
|
|
3209
|
-
* @description
|
|
3370
|
+
* @description 创建动效元素(仅限调试使用)
|
|
3371
|
+
* @param effectsInfo 动效创建信息
|
|
3210
3372
|
*/
|
|
3211
|
-
|
|
3373
|
+
addEffectsItem(effectsInfo: EffectsCreateInfo): Promise<string | undefined>;
|
|
3212
3374
|
/**
|
|
3213
|
-
* @description
|
|
3375
|
+
* @description 创建画板元素
|
|
3376
|
+
* @param createInfo 画板创建信息
|
|
3377
|
+
* @returns 画板元素ID
|
|
3214
3378
|
*/
|
|
3215
|
-
|
|
3216
|
-
|
|
3379
|
+
addFrameItem(createInfo: FrameCreateInfo): string;
|
|
3380
|
+
/**
|
|
3381
|
+
* @description 设置生成器资源,将生成器转换为对应的元素
|
|
3382
|
+
* @param id 生成器元素ID
|
|
3383
|
+
* @param resourceUrl 资源地址
|
|
3384
|
+
* @returns 新的元素ID
|
|
3385
|
+
*/
|
|
3386
|
+
setGeneratorResource(id: string, resourceUrl: string): Promise<string>;
|
|
3387
|
+
/**
|
|
3388
|
+
* @description 设置生成器资源(使用 GeneratorResource 对象)
|
|
3389
|
+
* @param resource 生成器资源信息
|
|
3390
|
+
*/
|
|
3391
|
+
setGeneratorResourceFromObject(resource: GeneratorResource): void;
|
|
3392
|
+
/**
|
|
3393
|
+
* @description 设置视频生成器资源
|
|
3394
|
+
* @param resource 视频生成器资源信息
|
|
3395
|
+
*/
|
|
3396
|
+
setVideoGeneratorResource(resource: VideoGeneratorResource): Promise<string>;
|
|
3397
|
+
/**
|
|
3398
|
+
* @description 设置图层生成器资源
|
|
3399
|
+
* @param resource 图层生成器资源信息
|
|
3400
|
+
*/
|
|
3401
|
+
setSpriteGeneratorResource(resource: SpriteGeneratorResource): Promise<string>;
|
|
3402
|
+
setItemLockState(id: string, state: boolean): void;
|
|
3403
|
+
getItemLockState(id: string): void;
|
|
3404
|
+
openItemCreateGizmo(type: ItemCreateType): void;
|
|
3405
|
+
closeItemCreateGizmo(): void;
|
|
3406
|
+
setItemName(id: string, name: string): void;
|
|
3407
|
+
setSafeAreaPreviewVisible(id: number, type: 'url' | 'color', visible: boolean): void;
|
|
3408
|
+
}
|
|
3217
3409
|
|
|
3218
|
-
export { type ActiveData, BaseItem, type BaseItemProperty, Box2, type CreateOperation, type DeleteOperation, type EffectsCreateInfo, EffectsItem, type EffectsItemOptions, type GeneratorCreateInfo, GeneratorItem, type GeneratorItemOptions, type GeneratorItemProperty, type GizmoType, type GroupCreateInfo, GroupItem, type GroupItemOptions, type ItemCreateInfo, ItemOrderAction, type
|
|
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 };
|