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