@vvfx/sdk 0.0.0-alpha.4 → 0.0.0-alpha.6
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 +28 -36
- package/dist/index.d.ts +28 -36
- package/dist/index.global.js +13 -13
- package/dist/index.js +1 -1
- package/package.json +12 -14
package/dist/index.d.cts
CHANGED
|
@@ -1,16 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { spec, Player } from '@galacean/effects';
|
|
2
2
|
export { spec } from '@galacean/effects';
|
|
3
3
|
import * as _galacean_effects_weapp from '@galacean/effects/weapp';
|
|
4
4
|
|
|
5
|
-
declare class Vector2 extends math.Vector2 {
|
|
6
|
-
subtract(other: Vector2): this;
|
|
7
|
-
toViewCoordinate(width: number, height: number): this;
|
|
8
|
-
clone(): Vector2;
|
|
9
|
-
distanceTo(other: Vector2): number;
|
|
10
|
-
scaleByCenter(scalar: Vector2, anchor?: Vector2): Vector2;
|
|
11
|
-
round(precision?: number): this;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
5
|
type ViewItemTypedProperty = {
|
|
15
6
|
[K in keyof PageFormTypeAndPropertyReference]: {
|
|
16
7
|
/**
|
|
@@ -109,7 +100,7 @@ type SDKInputParam = {
|
|
|
109
100
|
/**
|
|
110
101
|
* @description JSON地址
|
|
111
102
|
*/
|
|
112
|
-
scene: string;
|
|
103
|
+
scene: string | spec.JSONScene;
|
|
113
104
|
/**
|
|
114
105
|
* @description 视图参数
|
|
115
106
|
*/
|
|
@@ -185,6 +176,10 @@ type PageConfig = {
|
|
|
185
176
|
* @description 吸附开关
|
|
186
177
|
*/
|
|
187
178
|
adsorption: boolean;
|
|
179
|
+
/**
|
|
180
|
+
* @description 同步开关
|
|
181
|
+
*/
|
|
182
|
+
sync: boolean;
|
|
188
183
|
};
|
|
189
184
|
/**
|
|
190
185
|
* @description 页面属性
|
|
@@ -201,7 +196,7 @@ type PageProperty = {
|
|
|
201
196
|
/**
|
|
202
197
|
* @description 偏移值
|
|
203
198
|
*/
|
|
204
|
-
translation:
|
|
199
|
+
translation: [number, number];
|
|
205
200
|
/**
|
|
206
201
|
* @description 吸附开关
|
|
207
202
|
*/
|
|
@@ -222,25 +217,12 @@ type ViewParam = {
|
|
|
222
217
|
/**
|
|
223
218
|
* @description 出血区参数
|
|
224
219
|
*/
|
|
225
|
-
safeArea:
|
|
220
|
+
safeArea: [number, number, number, number];
|
|
226
221
|
/**
|
|
227
222
|
* @description 导出参数
|
|
228
223
|
*/
|
|
229
224
|
export: ExportParam;
|
|
230
225
|
};
|
|
231
|
-
/**
|
|
232
|
-
* @description 安全区数据
|
|
233
|
-
*/
|
|
234
|
-
type SafeAreaParam = {
|
|
235
|
-
/**
|
|
236
|
-
* @description 出血区大小 - [上, 下, 左, 右]
|
|
237
|
-
*/
|
|
238
|
-
size: [number, number, number, number];
|
|
239
|
-
/**
|
|
240
|
-
* @description 元素名称关键字
|
|
241
|
-
*/
|
|
242
|
-
keyWords: string[];
|
|
243
|
-
};
|
|
244
226
|
/**
|
|
245
227
|
* @description 导出参数
|
|
246
228
|
*/
|
|
@@ -277,7 +259,7 @@ type ViewProperty = {
|
|
|
277
259
|
/**
|
|
278
260
|
* @description 出血区数据
|
|
279
261
|
*/
|
|
280
|
-
safeArea:
|
|
262
|
+
safeArea: [number, number, number, number];
|
|
281
263
|
/**
|
|
282
264
|
* @description 视图场景数据
|
|
283
265
|
*/
|
|
@@ -290,6 +272,10 @@ type ViewProperty = {
|
|
|
290
272
|
* @description 导出参数
|
|
291
273
|
*/
|
|
292
274
|
export: ExportParam;
|
|
275
|
+
/**
|
|
276
|
+
* @description 忽略交互 - 仅供展示
|
|
277
|
+
*/
|
|
278
|
+
ignoreInteraction: boolean;
|
|
293
279
|
};
|
|
294
280
|
/**
|
|
295
281
|
* @description 页面活跃数据
|
|
@@ -352,6 +338,7 @@ type ExportStatus = typeof ExportStatusMap[keyof typeof ExportStatusMap];
|
|
|
352
338
|
type SDKEvents = {
|
|
353
339
|
'selectedItemChange': [id: string[]];
|
|
354
340
|
'preSelectedItemChange': [id: string | undefined];
|
|
341
|
+
'selectedViewChange': [id: number];
|
|
355
342
|
'pageDataChange': [pageData: PageData];
|
|
356
343
|
'zoomChange': [zoom: number];
|
|
357
344
|
'progress': [{
|
|
@@ -360,11 +347,12 @@ type SDKEvents = {
|
|
|
360
347
|
end: boolean;
|
|
361
348
|
paused: boolean;
|
|
362
349
|
}];
|
|
363
|
-
'exportingChange': [status: ExportStatus, progress?: number];
|
|
364
350
|
'itemPropertyChange': [{
|
|
365
351
|
id: string;
|
|
366
352
|
property: string;
|
|
367
353
|
}];
|
|
354
|
+
'exportProgress': [progress?: number];
|
|
355
|
+
'exportComplete': [success: boolean];
|
|
368
356
|
};
|
|
369
357
|
declare class SDK {
|
|
370
358
|
private _eventEmitter;
|
|
@@ -375,15 +363,15 @@ declare class SDK {
|
|
|
375
363
|
private _ExportVideo;
|
|
376
364
|
private _gestureHandler;
|
|
377
365
|
private _playerContainer;
|
|
378
|
-
private _isExportReady;
|
|
379
366
|
private _exportStatus;
|
|
367
|
+
private disposables;
|
|
380
368
|
player: Player;
|
|
381
369
|
constructor(container: HTMLElement);
|
|
382
370
|
get pageData(): PageData | undefined;
|
|
383
371
|
get exportStatus(): ExportStatus;
|
|
384
|
-
private get
|
|
372
|
+
private get exportOptions();
|
|
385
373
|
dispose(): void;
|
|
386
|
-
on: <E extends "progress" | "selectedItemChange" | "preSelectedItemChange" | "pageDataChange" | "zoomChange" | "
|
|
374
|
+
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;
|
|
387
375
|
private getInitParam;
|
|
388
376
|
private initSDK;
|
|
389
377
|
run(param: SDKInputParam): Promise<void>;
|
|
@@ -404,7 +392,7 @@ declare class SDK {
|
|
|
404
392
|
* @returns 元素属性值
|
|
405
393
|
*/
|
|
406
394
|
getItemPropertyValue<T extends keyof PageFormTypeAndPropertyReference, N extends keyof PageFormTypeAndPropertyReference[T]>(param: GetItemPropertyValueParam<T, N>): GetItemPropertyValueResult<T, N> | undefined;
|
|
407
|
-
setItemPropertyValue(param: SetItemPropertyValueParam): void
|
|
395
|
+
setItemPropertyValue(param: SetItemPropertyValueParam): Promise<void>;
|
|
408
396
|
generateScreenShot(id: number): Promise<string>;
|
|
409
397
|
/**
|
|
410
398
|
* @description 切换场景
|
|
@@ -425,7 +413,7 @@ declare class SDK {
|
|
|
425
413
|
* @description 设置播放进度
|
|
426
414
|
* @param progress 播放进度 0-100
|
|
427
415
|
*/
|
|
428
|
-
setPlayProgress(progress: number): void
|
|
416
|
+
setPlayProgress(progress: number): Promise<void>;
|
|
429
417
|
getViewItems(): ViewItem[];
|
|
430
418
|
setPlayState(playState: 'play' | 'pause'): void;
|
|
431
419
|
/**
|
|
@@ -436,12 +424,16 @@ declare class SDK {
|
|
|
436
424
|
id: number;
|
|
437
425
|
thumbnail: string;
|
|
438
426
|
}[];
|
|
427
|
+
private onExportProgress;
|
|
428
|
+
private onExportFinish;
|
|
429
|
+
private onExportError;
|
|
439
430
|
/**
|
|
440
|
-
* @description
|
|
441
|
-
* @returns 导出视频的 ArrayBuffer 数组
|
|
431
|
+
* @description 导出视频
|
|
442
432
|
*/
|
|
443
|
-
exportAllVideos():
|
|
433
|
+
exportAllVideos(): void;
|
|
444
434
|
cancelExportAllVideos(): void;
|
|
435
|
+
loadPageData(data: PageData): Promise<void>;
|
|
436
|
+
runByPageData(data: PageData): Promise<void>;
|
|
445
437
|
}
|
|
446
438
|
|
|
447
439
|
export { type ActiveData, type BaseFormProperty, type ExportStatus, ExportStatusMap, type PageData, type PageFormTypedProperty, type PageProperty, SDK, type SDKEvents, type SDKInputParam, type SpecificPageFormProps, type SpriteFormProperty, type TextFormProperty, type ViewItem, type ViewParam, type ViewProperty };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { spec, Player } from '@galacean/effects';
|
|
2
2
|
export { spec } from '@galacean/effects';
|
|
3
3
|
import * as _galacean_effects_weapp from '@galacean/effects/weapp';
|
|
4
4
|
|
|
5
|
-
declare class Vector2 extends math.Vector2 {
|
|
6
|
-
subtract(other: Vector2): this;
|
|
7
|
-
toViewCoordinate(width: number, height: number): this;
|
|
8
|
-
clone(): Vector2;
|
|
9
|
-
distanceTo(other: Vector2): number;
|
|
10
|
-
scaleByCenter(scalar: Vector2, anchor?: Vector2): Vector2;
|
|
11
|
-
round(precision?: number): this;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
5
|
type ViewItemTypedProperty = {
|
|
15
6
|
[K in keyof PageFormTypeAndPropertyReference]: {
|
|
16
7
|
/**
|
|
@@ -109,7 +100,7 @@ type SDKInputParam = {
|
|
|
109
100
|
/**
|
|
110
101
|
* @description JSON地址
|
|
111
102
|
*/
|
|
112
|
-
scene: string;
|
|
103
|
+
scene: string | spec.JSONScene;
|
|
113
104
|
/**
|
|
114
105
|
* @description 视图参数
|
|
115
106
|
*/
|
|
@@ -185,6 +176,10 @@ type PageConfig = {
|
|
|
185
176
|
* @description 吸附开关
|
|
186
177
|
*/
|
|
187
178
|
adsorption: boolean;
|
|
179
|
+
/**
|
|
180
|
+
* @description 同步开关
|
|
181
|
+
*/
|
|
182
|
+
sync: boolean;
|
|
188
183
|
};
|
|
189
184
|
/**
|
|
190
185
|
* @description 页面属性
|
|
@@ -201,7 +196,7 @@ type PageProperty = {
|
|
|
201
196
|
/**
|
|
202
197
|
* @description 偏移值
|
|
203
198
|
*/
|
|
204
|
-
translation:
|
|
199
|
+
translation: [number, number];
|
|
205
200
|
/**
|
|
206
201
|
* @description 吸附开关
|
|
207
202
|
*/
|
|
@@ -222,25 +217,12 @@ type ViewParam = {
|
|
|
222
217
|
/**
|
|
223
218
|
* @description 出血区参数
|
|
224
219
|
*/
|
|
225
|
-
safeArea:
|
|
220
|
+
safeArea: [number, number, number, number];
|
|
226
221
|
/**
|
|
227
222
|
* @description 导出参数
|
|
228
223
|
*/
|
|
229
224
|
export: ExportParam;
|
|
230
225
|
};
|
|
231
|
-
/**
|
|
232
|
-
* @description 安全区数据
|
|
233
|
-
*/
|
|
234
|
-
type SafeAreaParam = {
|
|
235
|
-
/**
|
|
236
|
-
* @description 出血区大小 - [上, 下, 左, 右]
|
|
237
|
-
*/
|
|
238
|
-
size: [number, number, number, number];
|
|
239
|
-
/**
|
|
240
|
-
* @description 元素名称关键字
|
|
241
|
-
*/
|
|
242
|
-
keyWords: string[];
|
|
243
|
-
};
|
|
244
226
|
/**
|
|
245
227
|
* @description 导出参数
|
|
246
228
|
*/
|
|
@@ -277,7 +259,7 @@ type ViewProperty = {
|
|
|
277
259
|
/**
|
|
278
260
|
* @description 出血区数据
|
|
279
261
|
*/
|
|
280
|
-
safeArea:
|
|
262
|
+
safeArea: [number, number, number, number];
|
|
281
263
|
/**
|
|
282
264
|
* @description 视图场景数据
|
|
283
265
|
*/
|
|
@@ -290,6 +272,10 @@ type ViewProperty = {
|
|
|
290
272
|
* @description 导出参数
|
|
291
273
|
*/
|
|
292
274
|
export: ExportParam;
|
|
275
|
+
/**
|
|
276
|
+
* @description 忽略交互 - 仅供展示
|
|
277
|
+
*/
|
|
278
|
+
ignoreInteraction: boolean;
|
|
293
279
|
};
|
|
294
280
|
/**
|
|
295
281
|
* @description 页面活跃数据
|
|
@@ -352,6 +338,7 @@ type ExportStatus = typeof ExportStatusMap[keyof typeof ExportStatusMap];
|
|
|
352
338
|
type SDKEvents = {
|
|
353
339
|
'selectedItemChange': [id: string[]];
|
|
354
340
|
'preSelectedItemChange': [id: string | undefined];
|
|
341
|
+
'selectedViewChange': [id: number];
|
|
355
342
|
'pageDataChange': [pageData: PageData];
|
|
356
343
|
'zoomChange': [zoom: number];
|
|
357
344
|
'progress': [{
|
|
@@ -360,11 +347,12 @@ type SDKEvents = {
|
|
|
360
347
|
end: boolean;
|
|
361
348
|
paused: boolean;
|
|
362
349
|
}];
|
|
363
|
-
'exportingChange': [status: ExportStatus, progress?: number];
|
|
364
350
|
'itemPropertyChange': [{
|
|
365
351
|
id: string;
|
|
366
352
|
property: string;
|
|
367
353
|
}];
|
|
354
|
+
'exportProgress': [progress?: number];
|
|
355
|
+
'exportComplete': [success: boolean];
|
|
368
356
|
};
|
|
369
357
|
declare class SDK {
|
|
370
358
|
private _eventEmitter;
|
|
@@ -375,15 +363,15 @@ declare class SDK {
|
|
|
375
363
|
private _ExportVideo;
|
|
376
364
|
private _gestureHandler;
|
|
377
365
|
private _playerContainer;
|
|
378
|
-
private _isExportReady;
|
|
379
366
|
private _exportStatus;
|
|
367
|
+
private disposables;
|
|
380
368
|
player: Player;
|
|
381
369
|
constructor(container: HTMLElement);
|
|
382
370
|
get pageData(): PageData | undefined;
|
|
383
371
|
get exportStatus(): ExportStatus;
|
|
384
|
-
private get
|
|
372
|
+
private get exportOptions();
|
|
385
373
|
dispose(): void;
|
|
386
|
-
on: <E extends "progress" | "selectedItemChange" | "preSelectedItemChange" | "pageDataChange" | "zoomChange" | "
|
|
374
|
+
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;
|
|
387
375
|
private getInitParam;
|
|
388
376
|
private initSDK;
|
|
389
377
|
run(param: SDKInputParam): Promise<void>;
|
|
@@ -404,7 +392,7 @@ declare class SDK {
|
|
|
404
392
|
* @returns 元素属性值
|
|
405
393
|
*/
|
|
406
394
|
getItemPropertyValue<T extends keyof PageFormTypeAndPropertyReference, N extends keyof PageFormTypeAndPropertyReference[T]>(param: GetItemPropertyValueParam<T, N>): GetItemPropertyValueResult<T, N> | undefined;
|
|
407
|
-
setItemPropertyValue(param: SetItemPropertyValueParam): void
|
|
395
|
+
setItemPropertyValue(param: SetItemPropertyValueParam): Promise<void>;
|
|
408
396
|
generateScreenShot(id: number): Promise<string>;
|
|
409
397
|
/**
|
|
410
398
|
* @description 切换场景
|
|
@@ -425,7 +413,7 @@ declare class SDK {
|
|
|
425
413
|
* @description 设置播放进度
|
|
426
414
|
* @param progress 播放进度 0-100
|
|
427
415
|
*/
|
|
428
|
-
setPlayProgress(progress: number): void
|
|
416
|
+
setPlayProgress(progress: number): Promise<void>;
|
|
429
417
|
getViewItems(): ViewItem[];
|
|
430
418
|
setPlayState(playState: 'play' | 'pause'): void;
|
|
431
419
|
/**
|
|
@@ -436,12 +424,16 @@ declare class SDK {
|
|
|
436
424
|
id: number;
|
|
437
425
|
thumbnail: string;
|
|
438
426
|
}[];
|
|
427
|
+
private onExportProgress;
|
|
428
|
+
private onExportFinish;
|
|
429
|
+
private onExportError;
|
|
439
430
|
/**
|
|
440
|
-
* @description
|
|
441
|
-
* @returns 导出视频的 ArrayBuffer 数组
|
|
431
|
+
* @description 导出视频
|
|
442
432
|
*/
|
|
443
|
-
exportAllVideos():
|
|
433
|
+
exportAllVideos(): void;
|
|
444
434
|
cancelExportAllVideos(): void;
|
|
435
|
+
loadPageData(data: PageData): Promise<void>;
|
|
436
|
+
runByPageData(data: PageData): Promise<void>;
|
|
445
437
|
}
|
|
446
438
|
|
|
447
439
|
export { type ActiveData, type BaseFormProperty, type ExportStatus, ExportStatusMap, type PageData, type PageFormTypedProperty, type PageProperty, SDK, type SDKEvents, type SDKInputParam, type SpecificPageFormProps, type SpriteFormProperty, type TextFormProperty, type ViewItem, type ViewParam, type ViewProperty };
|