@vvfx/sdk 0.0.0-alpha.41 → 0.0.0-alpha.43
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 +687 -12
- package/dist/index.d.ts +687 -12
- package/dist/index.global.js +6 -6
- package/dist/index.js +1 -1
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _galacean_effects from '@galacean/effects';
|
|
2
|
-
import { spec, Player } from '@galacean/effects';
|
|
2
|
+
import { spec, math, Player } from '@galacean/effects';
|
|
3
3
|
export { generateGUID, spec } from '@galacean/effects';
|
|
4
4
|
|
|
5
5
|
type ViewItemTypedProperty = {
|
|
@@ -44,7 +44,299 @@ type SetItemPropertyValueParam = {
|
|
|
44
44
|
propertyValue: PageFormTypeAndPropertyReference[T][N];
|
|
45
45
|
};
|
|
46
46
|
}[keyof PageFormTypeAndPropertyReference[T]];
|
|
47
|
-
}[keyof PageFormTypeAndPropertyReference]
|
|
47
|
+
}[keyof PageFormTypeAndPropertyReference] | {
|
|
48
|
+
itemId: string;
|
|
49
|
+
type: spec.ItemType;
|
|
50
|
+
propertyName: 'position' | 'size';
|
|
51
|
+
propertyValue: spec.vec2 | spec.vec3;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @class 二维线段
|
|
56
|
+
*/
|
|
57
|
+
declare class Line2 {
|
|
58
|
+
start: Vector2;
|
|
59
|
+
end: Vector2;
|
|
60
|
+
constructor(start?: Vector2, end?: Vector2);
|
|
61
|
+
/**
|
|
62
|
+
* 设置二维线段
|
|
63
|
+
* @param {Vector2} start 线段起点
|
|
64
|
+
* @param {Vector2} end 线段终点
|
|
65
|
+
* @returns {Line2} 二维线段
|
|
66
|
+
*/
|
|
67
|
+
set(start: Vector2, end: Vector2): this;
|
|
68
|
+
/**
|
|
69
|
+
* 复制二维线段
|
|
70
|
+
* @param {Line2} line 复制对象
|
|
71
|
+
* @returns {Line2} 复制结果
|
|
72
|
+
*/
|
|
73
|
+
copyFrom(line: Line2): this;
|
|
74
|
+
/**
|
|
75
|
+
* 二维线段求方向
|
|
76
|
+
* @returns {Vector2} 二维线段方向
|
|
77
|
+
*/
|
|
78
|
+
direction(): Vector2;
|
|
79
|
+
/**
|
|
80
|
+
* 二维线段求中点
|
|
81
|
+
* @param {Vector2} [target=new Vector2()] 目标保存对象
|
|
82
|
+
* @returns {Vector2} 二维线段中点
|
|
83
|
+
*/
|
|
84
|
+
getCenter(target?: Vector2): Vector2;
|
|
85
|
+
/**
|
|
86
|
+
* 二维线段向量值
|
|
87
|
+
* @param {Vector2} [target=new Vector2()] 目标保存对象
|
|
88
|
+
* @returns {Vector2} 二维线段向量值
|
|
89
|
+
*/
|
|
90
|
+
delta(target?: Vector2): Vector2;
|
|
91
|
+
/**
|
|
92
|
+
* 二维线段欧式距离平方(应用于计算)
|
|
93
|
+
* @returns {number} 计算结果
|
|
94
|
+
*/
|
|
95
|
+
distanceSq(): number;
|
|
96
|
+
/**
|
|
97
|
+
* 二维线段欧式距离
|
|
98
|
+
* @returns {number} 计算结果
|
|
99
|
+
*/
|
|
100
|
+
distance(): number;
|
|
101
|
+
/**
|
|
102
|
+
* 求二维线段比例点
|
|
103
|
+
* @param {number} t 比例值
|
|
104
|
+
* @param {Vector2} target 目标保存对象
|
|
105
|
+
* @returns {Vector2} 比例点结果
|
|
106
|
+
*/
|
|
107
|
+
at(t: number, target?: Vector2): Vector2;
|
|
108
|
+
/**
|
|
109
|
+
* 求点与线段的最短距离
|
|
110
|
+
* @param {Vector2} point 二维空间点
|
|
111
|
+
* @param {boolean} clampToLine 是否限制于线段内
|
|
112
|
+
* @returns {number} 距离结果
|
|
113
|
+
*/
|
|
114
|
+
closestPointToPointParameter(point: Vector2, clampToLine: boolean): number;
|
|
115
|
+
/**
|
|
116
|
+
* 求点与线段的最近交点
|
|
117
|
+
* @param {Vector2} point 二维空间点
|
|
118
|
+
* @param {boolean} clampToLine 是否限制于线段内
|
|
119
|
+
* @param {Vector2} target 目标保存对象
|
|
120
|
+
* @returns {Vector2} 最近交点
|
|
121
|
+
*/
|
|
122
|
+
closestPointToPoint(point: Vector2, clampToLine: boolean, target?: Vector2): Vector2;
|
|
123
|
+
/**
|
|
124
|
+
* 二维线段判等
|
|
125
|
+
* @param {Line2} line 二维线段
|
|
126
|
+
* @returns {boolean} 判等结果
|
|
127
|
+
*/
|
|
128
|
+
equals(line: Line2): boolean;
|
|
129
|
+
/**
|
|
130
|
+
* 克隆二维线段
|
|
131
|
+
* @returns {Line2} 克隆结果
|
|
132
|
+
*/
|
|
133
|
+
clone(): Line2;
|
|
134
|
+
/**
|
|
135
|
+
* 二维线段求长度
|
|
136
|
+
* @returns {number} 长度
|
|
137
|
+
*/
|
|
138
|
+
length(): number;
|
|
139
|
+
/**
|
|
140
|
+
* 二维线段判断相交
|
|
141
|
+
* @param {Line2} other 二维线段
|
|
142
|
+
* @returns {boolean} 相交判断结果
|
|
143
|
+
*/
|
|
144
|
+
crossWithLine(other: Line2): boolean;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
declare class Vector2 extends math.Vector2 {
|
|
148
|
+
subtract(other: Vector2): this;
|
|
149
|
+
toViewCoordinate(width: number, height: number): this;
|
|
150
|
+
clone(): Vector2;
|
|
151
|
+
distanceTo(other: Vector2): number;
|
|
152
|
+
scaleByCenter(scalar: Vector2, anchor?: Vector2): Vector2;
|
|
153
|
+
round(precision?: number): this;
|
|
154
|
+
/**
|
|
155
|
+
* 点到直线的最短距离
|
|
156
|
+
* @returns {{d: number, t: number}} d表示距离,t表示最近点在直线的比例
|
|
157
|
+
*/
|
|
158
|
+
distanceToLine(line: Line2): {
|
|
159
|
+
d: number;
|
|
160
|
+
t: number;
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* 二维向量与x轴夹角
|
|
164
|
+
* @returns {number} 弧度值
|
|
165
|
+
*/
|
|
166
|
+
angle(): number;
|
|
167
|
+
/**
|
|
168
|
+
* 二维点绕点旋转
|
|
169
|
+
* @param {Vec2} center 旋转中心
|
|
170
|
+
* @param {number} angle 旋转角度
|
|
171
|
+
* @returns {Vec2} 旋转结果
|
|
172
|
+
*/
|
|
173
|
+
rotateAround(center: Vector2, angle: number): this;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* @class 二维包围盒
|
|
178
|
+
*/
|
|
179
|
+
declare class Box2 {
|
|
180
|
+
/**
|
|
181
|
+
* @member {Vector2[]} corners 二维包围盒角点
|
|
182
|
+
*/
|
|
183
|
+
corners: Vector2[];
|
|
184
|
+
min: Vector2;
|
|
185
|
+
max: Vector2;
|
|
186
|
+
/**
|
|
187
|
+
* 构造函数,传入值为空时表示空包围盒
|
|
188
|
+
* @param {Vector2} [min=new Vector2(Infinity, Infinity)] 最小点
|
|
189
|
+
* @param {Vector2} [max=new Vector2(-Infinity, -Infinity)] 最大点
|
|
190
|
+
*/
|
|
191
|
+
constructor(min?: Vector2, max?: Vector2);
|
|
192
|
+
/**
|
|
193
|
+
* 通过最大最小点设置二维包围盒
|
|
194
|
+
* @param {Vector2} min 最小点
|
|
195
|
+
* @param {Vector2} max 最大点
|
|
196
|
+
* @returns {Box2} 二维包围盒
|
|
197
|
+
*/
|
|
198
|
+
set(min: Vector2, max: Vector2): this;
|
|
199
|
+
/**
|
|
200
|
+
* 通过角点设置二维包围盒
|
|
201
|
+
* @param {Vector2[]} vecArray 二维空间点数组
|
|
202
|
+
* @returns {Box2} 二维包围盒
|
|
203
|
+
*/
|
|
204
|
+
setFromVec2Array(vecArray: Vector2[]): this;
|
|
205
|
+
/**
|
|
206
|
+
* 通过屏幕坐标点设置二维包围盒 - 点为屏幕坐标点,x正方向为右,y正方向为向上
|
|
207
|
+
* @param vecArray 屏幕坐标点
|
|
208
|
+
*/
|
|
209
|
+
setFromVec2ArrayWithOutCorners(vecArray: Vector2[]): this;
|
|
210
|
+
/**
|
|
211
|
+
* 通过中心与大小设置二维包围盒
|
|
212
|
+
* @param {Vector2} center 二维中心点
|
|
213
|
+
* @param {Vector2} size 二维大小
|
|
214
|
+
* @returns {Box2} 二维包围盒
|
|
215
|
+
*/
|
|
216
|
+
setFromCenterAndSize(center: Vector2, size: Vector2): this;
|
|
217
|
+
/**
|
|
218
|
+
* 克隆二维包围盒
|
|
219
|
+
* @returns {Box2} 克隆结果
|
|
220
|
+
*/
|
|
221
|
+
clone(): Box2;
|
|
222
|
+
/**
|
|
223
|
+
* 复制二维包围盒
|
|
224
|
+
* @param {Box2} box 二维包围盒
|
|
225
|
+
* @returns {Box2} 复制结果
|
|
226
|
+
*/
|
|
227
|
+
copyFrom(box: Box2): this;
|
|
228
|
+
/**
|
|
229
|
+
* 二维包围盒置空
|
|
230
|
+
* @returns {Box2} 置空结果
|
|
231
|
+
*/
|
|
232
|
+
makeEmpty(): this;
|
|
233
|
+
/**
|
|
234
|
+
* 二维包围盒判空
|
|
235
|
+
* @returns {boolean} 判空结果
|
|
236
|
+
*/
|
|
237
|
+
isEmpty(): boolean;
|
|
238
|
+
/**
|
|
239
|
+
* 获取二维包围盒角点
|
|
240
|
+
* @returns {Vector2[]} 二维包围盒角点
|
|
241
|
+
*/
|
|
242
|
+
getCorners(): Vector2[];
|
|
243
|
+
/**
|
|
244
|
+
* 获取二维包围盒中心点
|
|
245
|
+
* @param {Vector2} [target=new Vector2()] 目标点(用以存放二维包围盒中心点)
|
|
246
|
+
* @returns {Vector2} 二维包围盒中心点
|
|
247
|
+
*/
|
|
248
|
+
getCenter(target?: Vector2): Vector2;
|
|
249
|
+
/**
|
|
250
|
+
* 获取二维包围盒大小
|
|
251
|
+
* @param {Vector2} [target=new Vector2()] 目标向量(用以存放二维包围盒大小)
|
|
252
|
+
* @returns {Vector2} 二维包围盒大小
|
|
253
|
+
*/
|
|
254
|
+
getSize(target?: Vector2): Vector2;
|
|
255
|
+
/**
|
|
256
|
+
* 通过二维空间点扩展二维包围盒
|
|
257
|
+
* @param {Vector2} point 二维空间点
|
|
258
|
+
* @returns {Box2} 扩展包围盒
|
|
259
|
+
*/
|
|
260
|
+
expandByPoint(point: Vector2): this;
|
|
261
|
+
/**
|
|
262
|
+
* 通过向量扩展二维包围盒
|
|
263
|
+
* @param {Vector2} vector 二维向量
|
|
264
|
+
* @returns {Box2} 扩展结果
|
|
265
|
+
*/
|
|
266
|
+
expandByVector(vector: Vector2): this;
|
|
267
|
+
/**
|
|
268
|
+
* 通过大小扩展二维包围盒
|
|
269
|
+
* @param {number} scalar 扩展大小
|
|
270
|
+
* @returns {Box2} 扩展结果
|
|
271
|
+
*/
|
|
272
|
+
expandByScalar(scalar: number): this;
|
|
273
|
+
/**
|
|
274
|
+
* 判断二维包围盒是否包含二维空间点
|
|
275
|
+
* @param {Vector2} point 二维空间点
|
|
276
|
+
* @param {boolean} [isOrthogonal=true] 包围盒正交判断(默认为true)
|
|
277
|
+
* @returns {boolean} 点包含判断结果
|
|
278
|
+
*/
|
|
279
|
+
containsPoint(point: Vector2, isOrthogonal?: boolean): boolean;
|
|
280
|
+
/**
|
|
281
|
+
* 判断二维包围盒包含关系(if this contains other)
|
|
282
|
+
* @param {Box2} box 其它包围盒
|
|
283
|
+
* @returns {boolean} 二维包围盒包含判断结果
|
|
284
|
+
*/
|
|
285
|
+
containsBox(box: Box2): boolean;
|
|
286
|
+
/**
|
|
287
|
+
* 获取点以包围盒左上角顶点为原点的相对位置
|
|
288
|
+
* @param {Vector2} point 指定二维空间点
|
|
289
|
+
* @param {Vector2} [target=new Vector2()] 目标空间点
|
|
290
|
+
* @returns {Vector2} 计算结果空间点
|
|
291
|
+
*/
|
|
292
|
+
getParameter(point: Vector2, target?: Vector2): Vector2;
|
|
293
|
+
/**
|
|
294
|
+
* 求点与二维包围盒的最近点
|
|
295
|
+
* @param {Vector2} point 二维空间点
|
|
296
|
+
* @param {Vector2} [target=new Vector2()] 结果点
|
|
297
|
+
* @returns {Vector2} 二维空间点
|
|
298
|
+
*/
|
|
299
|
+
clampPoint(point: Vector2, target?: Vector2): Vector2;
|
|
300
|
+
/**
|
|
301
|
+
* 求点到二维包围盒的距离
|
|
302
|
+
* @param {Vector2} point 二维空间点
|
|
303
|
+
* @returns {number} 距离
|
|
304
|
+
*/
|
|
305
|
+
distanceToPoint(point: Vector2): number;
|
|
306
|
+
/**
|
|
307
|
+
* 二维包围盒求交集
|
|
308
|
+
* @param {Box2} box 二维包围盒
|
|
309
|
+
* @returns {Box2} 求交结果
|
|
310
|
+
*/
|
|
311
|
+
intersect(box: Box2): this;
|
|
312
|
+
/**
|
|
313
|
+
* 二维包围盒求并集
|
|
314
|
+
* @param {Box2} box 二维包围盒
|
|
315
|
+
* @returns {Box2} 求并结果
|
|
316
|
+
*/
|
|
317
|
+
union(box: Box2): this;
|
|
318
|
+
/**
|
|
319
|
+
* 二维包围盒位移
|
|
320
|
+
* @param {Vector2} offset 位移向量
|
|
321
|
+
* @returns {Box2} 位移结果
|
|
322
|
+
*/
|
|
323
|
+
translate(offset: Vector2): this;
|
|
324
|
+
scale(scalar: number, center?: Vector2): this;
|
|
325
|
+
/**
|
|
326
|
+
* 二维包围盒判等
|
|
327
|
+
* @param {Box2} box 二维包围盒
|
|
328
|
+
* @returns {boolean} 判等结果
|
|
329
|
+
*/
|
|
330
|
+
equals(box: Box2): boolean;
|
|
331
|
+
/**
|
|
332
|
+
* 判断二维包围盒相交关系(if this intersect other)
|
|
333
|
+
* @param {Box2} box 二维包围盒
|
|
334
|
+
* @param {boolean} [isOrthogonal=true] 正交判断(当前包围盒)
|
|
335
|
+
* @returns {boolean} 相交判断结果
|
|
336
|
+
*/
|
|
337
|
+
intersectsBox(box: Box2, isOrthogonal?: boolean): boolean;
|
|
338
|
+
rotate(angle: number, center?: Vector2): this;
|
|
339
|
+
}
|
|
48
340
|
|
|
49
341
|
declare const MEDIA_TYPE: {
|
|
50
342
|
readonly APNG: "APNG";
|
|
@@ -202,7 +494,7 @@ type ExportMediaItemOptions = {
|
|
|
202
494
|
apngConfig?: ApngConfig;
|
|
203
495
|
};
|
|
204
496
|
|
|
205
|
-
type SDKMode = '
|
|
497
|
+
type SDKMode = 'editor' | 'template';
|
|
206
498
|
/**
|
|
207
499
|
* @description SDK功能配置
|
|
208
500
|
*/
|
|
@@ -242,6 +534,14 @@ type SDKConfig = {
|
|
|
242
534
|
selectorGizmoConfig: SelectorGizmoConfig;
|
|
243
535
|
transformGizmoEnabled: boolean;
|
|
244
536
|
transformGizmoConfig: TransformGizmoConfig;
|
|
537
|
+
pictureCutGizmoEnabled: boolean;
|
|
538
|
+
pictureCutGizmoConfig: PictureCutGizmoConfig;
|
|
539
|
+
pictureExpandGizmoEnabled: boolean;
|
|
540
|
+
pictureExpandGizmoConfig: PictureExpandGizmoConfig;
|
|
541
|
+
textGizmoEnbaled: boolean;
|
|
542
|
+
textGizmoConfig: TextGizmoConfig;
|
|
543
|
+
maskGizmoEnabled: boolean;
|
|
544
|
+
maskGizmoConfig: MaskGizmoConfig;
|
|
245
545
|
};
|
|
246
546
|
};
|
|
247
547
|
/**
|
|
@@ -420,8 +720,201 @@ type TransformGizmoConfig = {
|
|
|
420
720
|
*/
|
|
421
721
|
rotationCircleSize: number;
|
|
422
722
|
};
|
|
723
|
+
/**
|
|
724
|
+
* @description 图片裁切参数
|
|
725
|
+
*/
|
|
726
|
+
type PictureCutGizmoConfig = {
|
|
727
|
+
/**
|
|
728
|
+
* @description 蒙版颜色
|
|
729
|
+
*/
|
|
730
|
+
maskColor: number;
|
|
731
|
+
/**
|
|
732
|
+
* @description 蒙版透明度
|
|
733
|
+
*/
|
|
734
|
+
maskAlpha: number;
|
|
735
|
+
/**
|
|
736
|
+
* @description 裁切包围盒线框宽度
|
|
737
|
+
*/
|
|
738
|
+
cutBoxLineWidth: number;
|
|
739
|
+
/**
|
|
740
|
+
* @description 裁切包围盒线框颜色
|
|
741
|
+
*/
|
|
742
|
+
cutBoxLineColor: number;
|
|
743
|
+
/**
|
|
744
|
+
* @description 裁切包围盒线框透明度
|
|
745
|
+
*/
|
|
746
|
+
cutBoxLineAlpha: number;
|
|
747
|
+
/**
|
|
748
|
+
* @description 元素包围盒线框宽度
|
|
749
|
+
*/
|
|
750
|
+
itemBoxLineWidth: number;
|
|
751
|
+
/**
|
|
752
|
+
* @description 元素包围盒线框颜色
|
|
753
|
+
*/
|
|
754
|
+
itemBoxLineColor: number;
|
|
755
|
+
/**
|
|
756
|
+
* @description 元素包围盒线框透明度
|
|
757
|
+
*/
|
|
758
|
+
itemBoxLineAlpha: number;
|
|
759
|
+
/**
|
|
760
|
+
* @description 裁切包围盒角度半径
|
|
761
|
+
*/
|
|
762
|
+
cutBoxCornerRadius: number;
|
|
763
|
+
/**
|
|
764
|
+
* @description 裁切包围盒角点宽度
|
|
765
|
+
*/
|
|
766
|
+
cutBoxCornerLineWidth: number;
|
|
767
|
+
/**
|
|
768
|
+
* @description 裁切包围盒角点颜色
|
|
769
|
+
*/
|
|
770
|
+
cutBoxCornerLineColor: number;
|
|
771
|
+
/**
|
|
772
|
+
* @description 裁切包围盒角点透明度
|
|
773
|
+
*/
|
|
774
|
+
cutBoxCornerLineAlpha: number;
|
|
775
|
+
/**
|
|
776
|
+
* @description 裁切包围盒角点填充色
|
|
777
|
+
*/
|
|
778
|
+
cutBoxCornerFillColor: number;
|
|
779
|
+
/**
|
|
780
|
+
* @description 缩放判断距离
|
|
781
|
+
*/
|
|
782
|
+
scaleInteractionDistance: number;
|
|
783
|
+
/**
|
|
784
|
+
* @description 单向缩放判断距离
|
|
785
|
+
*/
|
|
786
|
+
directionScaleInteractionDistance: number;
|
|
787
|
+
};
|
|
788
|
+
/**
|
|
789
|
+
* @description 图片扩边参数
|
|
790
|
+
*/
|
|
791
|
+
type PictureExpandGizmoConfig = {
|
|
792
|
+
/**
|
|
793
|
+
* @description 蒙版颜色
|
|
794
|
+
*/
|
|
795
|
+
maskColor: number;
|
|
796
|
+
/**
|
|
797
|
+
* @description 蒙版透明度
|
|
798
|
+
*/
|
|
799
|
+
maskAlpha: number;
|
|
800
|
+
/**
|
|
801
|
+
* @description 扩边包围盒线框宽度
|
|
802
|
+
*/
|
|
803
|
+
expandBoxLineWidth: number;
|
|
804
|
+
/**
|
|
805
|
+
* @description 扩边包围盒线框颜色
|
|
806
|
+
*/
|
|
807
|
+
expandBoxLineColor: number;
|
|
808
|
+
/**
|
|
809
|
+
* @description 扩边包围盒线框透明度
|
|
810
|
+
*/
|
|
811
|
+
expandBoxLineAlpha: number;
|
|
812
|
+
/**
|
|
813
|
+
* @description 扩边包围盒角度半径
|
|
814
|
+
*/
|
|
815
|
+
expandBoxCornerRadius: number;
|
|
816
|
+
/**
|
|
817
|
+
* @description 扩边包围盒角点宽度
|
|
818
|
+
*/
|
|
819
|
+
expandBoxCornerLineWidth: number;
|
|
820
|
+
/**
|
|
821
|
+
* @description 扩边包围盒角点颜色
|
|
822
|
+
*/
|
|
823
|
+
expandBoxCornerLineColor: number;
|
|
824
|
+
/**
|
|
825
|
+
* @description 扩边包围盒角点透明度
|
|
826
|
+
*/
|
|
827
|
+
expandBoxCornerLineAlpha: number;
|
|
828
|
+
/**
|
|
829
|
+
* @description 扩边包围盒角点填充色
|
|
830
|
+
*/
|
|
831
|
+
expandBoxCornerFillColor: number;
|
|
832
|
+
/**
|
|
833
|
+
* @description 缩放判断距离
|
|
834
|
+
*/
|
|
835
|
+
scaleInteractionDistance: number;
|
|
836
|
+
/**
|
|
837
|
+
* @description 单向缩放判断距离
|
|
838
|
+
*/
|
|
839
|
+
directionScaleInteractionDistance: number;
|
|
840
|
+
};
|
|
841
|
+
/**
|
|
842
|
+
* @description 文本交互控制器参数
|
|
843
|
+
*/
|
|
844
|
+
type TextGizmoConfig = {
|
|
845
|
+
/**
|
|
846
|
+
* @description 包围盒线宽
|
|
847
|
+
*/
|
|
848
|
+
boxLineWidth: number;
|
|
849
|
+
/**
|
|
850
|
+
* @description 包围盒线色
|
|
851
|
+
*/
|
|
852
|
+
boxLineColor: number;
|
|
853
|
+
/**
|
|
854
|
+
* @description 缩放交互点半径
|
|
855
|
+
*/
|
|
856
|
+
scaleCornerRadius: number;
|
|
857
|
+
/**
|
|
858
|
+
* @description 旋转交互点边长
|
|
859
|
+
*/
|
|
860
|
+
rotationCornerWidth: number;
|
|
861
|
+
/**
|
|
862
|
+
* @description 旋转交互贴图地址
|
|
863
|
+
*/
|
|
864
|
+
rotationCornerTexture: string;
|
|
865
|
+
/**
|
|
866
|
+
* @description 缩放交互点填充色
|
|
867
|
+
*/
|
|
868
|
+
scaleCornerFillColor: number;
|
|
869
|
+
/**
|
|
870
|
+
* @description 缩放交互点描边宽度
|
|
871
|
+
*/
|
|
872
|
+
scaleCornerStrokeWidth: number;
|
|
873
|
+
/**
|
|
874
|
+
* @description 缩放交互点描边颜色
|
|
875
|
+
*/
|
|
876
|
+
scaleCornerStrokeColor: number;
|
|
877
|
+
};
|
|
878
|
+
/**
|
|
879
|
+
* @description 蒙版参数
|
|
880
|
+
*/
|
|
881
|
+
type MaskGizmoConfig = {
|
|
882
|
+
/**
|
|
883
|
+
* @description 画笔大小
|
|
884
|
+
*/
|
|
885
|
+
brushSize: number;
|
|
886
|
+
/**
|
|
887
|
+
* @description 笔刷颜色
|
|
888
|
+
*/
|
|
889
|
+
brushColor: number;
|
|
890
|
+
/**
|
|
891
|
+
* @description 笔刷透明度
|
|
892
|
+
*/
|
|
893
|
+
brushAlpha: number;
|
|
894
|
+
/**
|
|
895
|
+
* @description 蒙版颜色
|
|
896
|
+
*/
|
|
897
|
+
maskColor: number;
|
|
898
|
+
/**
|
|
899
|
+
* @description 蒙版透明度
|
|
900
|
+
*/
|
|
901
|
+
maskAlpha: number;
|
|
902
|
+
/**
|
|
903
|
+
* @description 元素包围盒线框宽度
|
|
904
|
+
*/
|
|
905
|
+
boxLineWidth: number;
|
|
906
|
+
/**
|
|
907
|
+
* @description 元素包围盒线框颜色
|
|
908
|
+
*/
|
|
909
|
+
boxLineColor: number;
|
|
910
|
+
/**
|
|
911
|
+
* @description 元素包围盒线框透明度
|
|
912
|
+
*/
|
|
913
|
+
boxLineAlpha: number;
|
|
914
|
+
};
|
|
423
915
|
|
|
424
916
|
type SDKEvents = {
|
|
917
|
+
'loadingItemChange': [id: string[]];
|
|
425
918
|
'selectedItemChange': [id: string[]];
|
|
426
919
|
'preSelectedItemChange': [id: string | undefined];
|
|
427
920
|
'selectedViewChange': [id: number];
|
|
@@ -441,6 +934,12 @@ type SDKEvents = {
|
|
|
441
934
|
'exportDone': [item: ExportMediaItemOptions | undefined, success: boolean, buffer?: FileBuffer];
|
|
442
935
|
'exportComplete': [success: boolean, taskInfos: ExportMediaItemOptions[], buffers?: FileBuffer[]];
|
|
443
936
|
'sdkConfigChange': [preSDKConfig: SDKConfig, curSDKConfig: SDKConfig];
|
|
937
|
+
'cutBoxChange': [box: Box2];
|
|
938
|
+
'expandBoxChange': [box: Box2];
|
|
939
|
+
'textInput': [{
|
|
940
|
+
text: string;
|
|
941
|
+
fontFamily: string;
|
|
942
|
+
}];
|
|
444
943
|
};
|
|
445
944
|
declare class SDK {
|
|
446
945
|
static config: SDKConfig;
|
|
@@ -457,11 +956,12 @@ declare class SDK {
|
|
|
457
956
|
_container: HTMLElement;
|
|
458
957
|
private _playerContainer;
|
|
459
958
|
constructor(container: HTMLElement);
|
|
959
|
+
get container(): HTMLElement;
|
|
460
960
|
get pageData(): PageData | undefined;
|
|
461
961
|
get exportStatus(): string | undefined;
|
|
462
962
|
private get exportOptions();
|
|
463
963
|
dispose(): void;
|
|
464
|
-
on: <E extends "progress" | "selectedItemChange" | "preSelectedItemChange" | "selectedViewChange" | "pageDataChange" | "zoomChange" | "itemPropertyChange" | "exportProgress" | "exportDone" | "exportComplete" | "sdkConfigChange">(eventName: E, listener: _galacean_effects.EventEmitterListener<SDKEvents[E]>, options?: _galacean_effects.EventEmitterOptions) => () => void;
|
|
964
|
+
on: <E extends "progress" | "loadingItemChange" | "selectedItemChange" | "preSelectedItemChange" | "selectedViewChange" | "pageDataChange" | "zoomChange" | "itemPropertyChange" | "exportProgress" | "exportDone" | "exportComplete" | "sdkConfigChange" | "cutBoxChange" | "expandBoxChange" | "textInput">(eventName: E, listener: _galacean_effects.EventEmitterListener<SDKEvents[E]>, options?: _galacean_effects.EventEmitterOptions) => () => void;
|
|
465
965
|
private getInitParam;
|
|
466
966
|
/**
|
|
467
967
|
* 检测导出是否需要重新初始化
|
|
@@ -597,7 +1097,7 @@ declare class SDK {
|
|
|
597
1097
|
* @description 设置导出功能初始化配置
|
|
598
1098
|
* @param exportConfig
|
|
599
1099
|
*/
|
|
600
|
-
setExportConfig(exportConfig: ExportConfig): void;
|
|
1100
|
+
setExportConfig(exportConfig: Partial<ExportConfig>): void;
|
|
601
1101
|
/**
|
|
602
1102
|
* @description 设置预选框参数
|
|
603
1103
|
* @param preSelectedColor 预选框颜色
|
|
@@ -633,13 +1133,54 @@ declare class SDK {
|
|
|
633
1133
|
* @description 创建图层元素
|
|
634
1134
|
* @param spriteInfo 图层元素信息
|
|
635
1135
|
*/
|
|
636
|
-
addSpriteItem(spriteInfo: SpriteCreateInfo): Promise<
|
|
1136
|
+
addSpriteItem(spriteInfo: SpriteCreateInfo): Promise<string | undefined>;
|
|
1137
|
+
openPictureCutGizmo(): void;
|
|
1138
|
+
closePictureCutGizmo(): void;
|
|
1139
|
+
getCutInfo(): {
|
|
1140
|
+
cutBox: Box2;
|
|
1141
|
+
itemBox: Box2;
|
|
1142
|
+
} | undefined;
|
|
1143
|
+
setCutBox(min: Vector2, max: Vector2): Box2 | undefined;
|
|
1144
|
+
openPictureExpandGizmo(): void;
|
|
1145
|
+
closePictureExpandGizmo(): void;
|
|
1146
|
+
getExpandInfo(): {
|
|
1147
|
+
expandBox: Box2;
|
|
1148
|
+
itemBox: Box2;
|
|
1149
|
+
} | undefined;
|
|
1150
|
+
setExpandBox(min: Vector2, max: Vector2): Box2 | undefined;
|
|
1151
|
+
openMaskGizmo(brushSize: number): void;
|
|
1152
|
+
closeMaskGizmo(): void;
|
|
1153
|
+
getMask(): string | undefined;
|
|
1154
|
+
openLoadingGizmo(id: string): void;
|
|
1155
|
+
closeLoadingGizmo(id: string): void;
|
|
1156
|
+
/**
|
|
1157
|
+
* @description 元素打组
|
|
1158
|
+
* @param children 子元素ID
|
|
1159
|
+
*/
|
|
1160
|
+
groupItems(nullInfo: NullCreateInfo): string | undefined;
|
|
1161
|
+
addTextItem(textInfo: TextCreateInfo): Promise<void>;
|
|
1162
|
+
deleteItems(idInfo: string | string[]): void;
|
|
1163
|
+
getItemCreateInfo(idInfo: string | string[]): ItemCreateInfo[];
|
|
1164
|
+
createScreenShotSceneByIds(idInfo: string | string[], time?: number): Promise<string | undefined>;
|
|
1165
|
+
getChildrenIds(id: string): string[];
|
|
1166
|
+
/**
|
|
1167
|
+
* @description 更新元素在图层中的顺序
|
|
1168
|
+
* @param id 元素ID
|
|
1169
|
+
* @param action 排序操作:BringToFront(置于顶层)、SendToBack(置于底层)、BringForward(上移一层)、SendBackward(下移一层)
|
|
1170
|
+
*/
|
|
1171
|
+
updateItemOrder(id: string, action: ItemOrderAction): void;
|
|
1172
|
+
/**
|
|
1173
|
+
* @description 导出JSON
|
|
1174
|
+
* @param idInfo 视图序号信息
|
|
1175
|
+
* @returns JSON数组
|
|
1176
|
+
*/
|
|
1177
|
+
exportJSON(idInfo?: number | number[]): spec.JSONScene[];
|
|
637
1178
|
}
|
|
638
1179
|
|
|
639
1180
|
type SizeAdaptDirection = 'x' | 'y';
|
|
640
1181
|
|
|
641
1182
|
type BaseFormProperty = {
|
|
642
|
-
position: [number, number
|
|
1183
|
+
position: [number, number];
|
|
643
1184
|
rotation: [number, number, number];
|
|
644
1185
|
size: [number, number];
|
|
645
1186
|
visible: boolean;
|
|
@@ -649,11 +1190,17 @@ type SpriteFormProperty = BaseFormProperty & {
|
|
|
649
1190
|
image: string;
|
|
650
1191
|
};
|
|
651
1192
|
type TextFormProperty = BaseFormProperty & {
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
1193
|
+
fontFamily: string;
|
|
1194
|
+
textColor: [number, number, number, number];
|
|
1195
|
+
fontWeight: spec.TextWeight;
|
|
655
1196
|
text: string;
|
|
656
|
-
|
|
1197
|
+
textAlign: spec.TextAlignment;
|
|
1198
|
+
fontSize: number;
|
|
1199
|
+
fontStyle: spec.FontStyle;
|
|
1200
|
+
textWidth: number;
|
|
1201
|
+
lineHeight: number;
|
|
1202
|
+
outlineColor?: spec.vec4;
|
|
1203
|
+
outlineWidth?: number;
|
|
657
1204
|
};
|
|
658
1205
|
/**
|
|
659
1206
|
* @description 页面表单类型和属性引用
|
|
@@ -910,6 +1457,10 @@ type ActiveData = {
|
|
|
910
1457
|
* @description 预选中元素
|
|
911
1458
|
*/
|
|
912
1459
|
preSelectedItem?: string;
|
|
1460
|
+
/**
|
|
1461
|
+
* @description 执行中元素
|
|
1462
|
+
*/
|
|
1463
|
+
loadingItems?: string[];
|
|
913
1464
|
};
|
|
914
1465
|
/**
|
|
915
1466
|
* @description 视图元素
|
|
@@ -949,6 +1500,7 @@ type SDKBackgroundType = 'color' | 'image' | 'chess-board';
|
|
|
949
1500
|
* @description 图层创建信息
|
|
950
1501
|
*/
|
|
951
1502
|
type SpriteCreateInfo = {
|
|
1503
|
+
type: 'sprite';
|
|
952
1504
|
/**
|
|
953
1505
|
* @description 图层名称
|
|
954
1506
|
*/
|
|
@@ -957,6 +1509,10 @@ type SpriteCreateInfo = {
|
|
|
957
1509
|
* @description 元素id
|
|
958
1510
|
*/
|
|
959
1511
|
id?: string;
|
|
1512
|
+
/**
|
|
1513
|
+
* @description 父节点id
|
|
1514
|
+
*/
|
|
1515
|
+
parentId?: string;
|
|
960
1516
|
/**
|
|
961
1517
|
* @description 图片资源地址
|
|
962
1518
|
*/
|
|
@@ -978,5 +1534,124 @@ type SpriteCreateInfo = {
|
|
|
978
1534
|
*/
|
|
979
1535
|
position: spec.vec2;
|
|
980
1536
|
};
|
|
1537
|
+
/**
|
|
1538
|
+
* @description 空节点创建信息
|
|
1539
|
+
*/
|
|
1540
|
+
type NullCreateInfo = {
|
|
1541
|
+
type: 'null';
|
|
1542
|
+
/**
|
|
1543
|
+
* @description 元素id
|
|
1544
|
+
*/
|
|
1545
|
+
id?: string;
|
|
1546
|
+
/**
|
|
1547
|
+
* @description 父节点id
|
|
1548
|
+
*/
|
|
1549
|
+
parentId?: string;
|
|
1550
|
+
/**
|
|
1551
|
+
* @description 元素名称
|
|
1552
|
+
*/
|
|
1553
|
+
name?: string;
|
|
1554
|
+
/**
|
|
1555
|
+
* @description 空节点缩放
|
|
1556
|
+
*/
|
|
1557
|
+
scale?: spec.vec2;
|
|
1558
|
+
/**
|
|
1559
|
+
* @description 子元素id
|
|
1560
|
+
*/
|
|
1561
|
+
children: string[];
|
|
1562
|
+
/**
|
|
1563
|
+
* @description 空节点旋转
|
|
1564
|
+
*/
|
|
1565
|
+
rotation?: number;
|
|
1566
|
+
/**
|
|
1567
|
+
* @description 空节点位移
|
|
1568
|
+
*/
|
|
1569
|
+
position?: spec.vec2;
|
|
1570
|
+
};
|
|
1571
|
+
/**
|
|
1572
|
+
* @description 文本创建信息
|
|
1573
|
+
*/
|
|
1574
|
+
type TextCreateInfo = {
|
|
1575
|
+
type: 'text';
|
|
1576
|
+
/**
|
|
1577
|
+
* @description 元素id
|
|
1578
|
+
*/
|
|
1579
|
+
id?: string;
|
|
1580
|
+
/**
|
|
1581
|
+
* @description 父节点id
|
|
1582
|
+
*/
|
|
1583
|
+
parentId?: string;
|
|
1584
|
+
/**
|
|
1585
|
+
* @description 元素名称
|
|
1586
|
+
*/
|
|
1587
|
+
name?: string;
|
|
1588
|
+
/**
|
|
1589
|
+
* @description 单行高度
|
|
1590
|
+
*/
|
|
1591
|
+
lineHeight: number;
|
|
1592
|
+
/**
|
|
1593
|
+
* @description 文本高度
|
|
1594
|
+
*/
|
|
1595
|
+
textHeight?: number;
|
|
1596
|
+
/**
|
|
1597
|
+
* @description 宽度
|
|
1598
|
+
*/
|
|
1599
|
+
textWidth: number;
|
|
1600
|
+
/**
|
|
1601
|
+
* @description 字体名称
|
|
1602
|
+
*/
|
|
1603
|
+
fontFamily: string;
|
|
1604
|
+
/**
|
|
1605
|
+
* @description 文本位置
|
|
1606
|
+
*/
|
|
1607
|
+
position?: spec.vec2;
|
|
1608
|
+
/**
|
|
1609
|
+
* @description 文本旋转
|
|
1610
|
+
*/
|
|
1611
|
+
rotation?: number;
|
|
1612
|
+
/**
|
|
1613
|
+
* @description 文字大小
|
|
1614
|
+
*/
|
|
1615
|
+
fontSize: number;
|
|
1616
|
+
/**
|
|
1617
|
+
* @description 字重
|
|
1618
|
+
*/
|
|
1619
|
+
fontWeight?: spec.TextWeight;
|
|
1620
|
+
/**
|
|
1621
|
+
* @description 字体格式
|
|
1622
|
+
*/
|
|
1623
|
+
fontStyle?: spec.FontStyle;
|
|
1624
|
+
/**
|
|
1625
|
+
* @description 对齐方式
|
|
1626
|
+
*/
|
|
1627
|
+
textAlign?: spec.TextAlignment;
|
|
1628
|
+
/**
|
|
1629
|
+
* @description 文本信息
|
|
1630
|
+
*/
|
|
1631
|
+
text: string;
|
|
1632
|
+
/**
|
|
1633
|
+
* @description 填充色
|
|
1634
|
+
*/
|
|
1635
|
+
textColor: spec.vec4;
|
|
1636
|
+
/**
|
|
1637
|
+
* @description 描边色
|
|
1638
|
+
*/
|
|
1639
|
+
outlineColor?: spec.vec4;
|
|
1640
|
+
/**
|
|
1641
|
+
* @description 描边宽度
|
|
1642
|
+
*/
|
|
1643
|
+
outlineWidth?: number;
|
|
1644
|
+
/**
|
|
1645
|
+
* @description 字体文件地址
|
|
1646
|
+
*/
|
|
1647
|
+
url?: string;
|
|
1648
|
+
};
|
|
1649
|
+
type ItemCreateInfo = NullCreateInfo | SpriteCreateInfo | TextCreateInfo;
|
|
1650
|
+
declare enum ItemOrderAction {
|
|
1651
|
+
BringToFront = 0,
|
|
1652
|
+
SendToBack = 1,
|
|
1653
|
+
BringForward = 2,
|
|
1654
|
+
SendBackward = 3
|
|
1655
|
+
}
|
|
981
1656
|
|
|
982
|
-
export { type ActiveData, type BaseFormProperty, type PageData, type PageFormTypedProperty, type PageProperty, SDK, type SDKEvents, type SDKInputParam, type SDKOptions, type SpecificPageFormProps, type SpriteCreateInfo, type SpriteFormProperty, type TextFormProperty, type ViewItem, type ViewParam, type ViewProperty };
|
|
1657
|
+
export { type ActiveData, type BaseFormProperty, Box2, ItemOrderAction, type NullCreateInfo, type PageData, type PageFormTypedProperty, type PageProperty, SDK, type SDKEvents, type SDKInputParam, type SDKOptions, type SpecificPageFormProps, type SpriteCreateInfo, type SpriteFormProperty, type TextCreateInfo, type TextFormProperty, Vector2, type ViewItem, type ViewItemTypedProperty, type ViewParam, type ViewProperty };
|