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