@vvfx/sdk 0.0.0-alpha.4 → 0.0.0-alpha.5

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.d.ts CHANGED
@@ -1,16 +1,7 @@
1
- import { math, spec, Player } from '@galacean/effects';
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
  /**
@@ -201,7 +192,7 @@ type PageProperty = {
201
192
  /**
202
193
  * @description 偏移值
203
194
  */
204
- translation: Vector2;
195
+ translation: [number, number];
205
196
  /**
206
197
  * @description 吸附开关
207
198
  */
@@ -360,11 +351,12 @@ type SDKEvents = {
360
351
  end: boolean;
361
352
  paused: boolean;
362
353
  }];
363
- 'exportingChange': [status: ExportStatus, progress?: number];
364
354
  'itemPropertyChange': [{
365
355
  id: string;
366
356
  property: string;
367
357
  }];
358
+ 'exportProgress': [progress?: number];
359
+ 'exportComplete': [success: boolean];
368
360
  };
369
361
  declare class SDK {
370
362
  private _eventEmitter;
@@ -375,15 +367,15 @@ declare class SDK {
375
367
  private _ExportVideo;
376
368
  private _gestureHandler;
377
369
  private _playerContainer;
378
- private _isExportReady;
379
370
  private _exportStatus;
371
+ private disposables;
380
372
  player: Player;
381
373
  constructor(container: HTMLElement);
382
374
  get pageData(): PageData | undefined;
383
375
  get exportStatus(): ExportStatus;
384
- private get exportVideoCanceled();
376
+ private get exportOptions();
385
377
  dispose(): void;
386
- on: <E extends "progress" | "selectedItemChange" | "preSelectedItemChange" | "pageDataChange" | "zoomChange" | "exportingChange" | "itemPropertyChange">(eventName: E, listener: _galacean_effects_weapp.EventEmitterListener<SDKEvents[E]>, options?: _galacean_effects_weapp.EventEmitterOptions) => () => void;
378
+ on: <E extends "progress" | "selectedItemChange" | "preSelectedItemChange" | "pageDataChange" | "zoomChange" | "itemPropertyChange" | "exportProgress" | "exportComplete">(eventName: E, listener: _galacean_effects_weapp.EventEmitterListener<SDKEvents[E]>, options?: _galacean_effects_weapp.EventEmitterOptions) => () => void;
387
379
  private getInitParam;
388
380
  private initSDK;
389
381
  run(param: SDKInputParam): Promise<void>;
@@ -404,7 +396,7 @@ declare class SDK {
404
396
  * @returns 元素属性值
405
397
  */
406
398
  getItemPropertyValue<T extends keyof PageFormTypeAndPropertyReference, N extends keyof PageFormTypeAndPropertyReference[T]>(param: GetItemPropertyValueParam<T, N>): GetItemPropertyValueResult<T, N> | undefined;
407
- setItemPropertyValue(param: SetItemPropertyValueParam): void;
399
+ setItemPropertyValue(param: SetItemPropertyValueParam): Promise<void>;
408
400
  generateScreenShot(id: number): Promise<string>;
409
401
  /**
410
402
  * @description 切换场景
@@ -425,7 +417,7 @@ declare class SDK {
425
417
  * @description 设置播放进度
426
418
  * @param progress 播放进度 0-100
427
419
  */
428
- setPlayProgress(progress: number): void;
420
+ setPlayProgress(progress: number): Promise<void>;
429
421
  getViewItems(): ViewItem[];
430
422
  setPlayState(playState: 'play' | 'pause'): void;
431
423
  /**
@@ -436,12 +428,16 @@ declare class SDK {
436
428
  id: number;
437
429
  thumbnail: string;
438
430
  }[];
431
+ private onExportProgress;
432
+ private onExportFinish;
433
+ private onExportError;
439
434
  /**
440
- * @description 导出所有视频
441
- * @returns 导出视频的 ArrayBuffer 数组
435
+ * @description 导出视频
442
436
  */
443
- exportAllVideos(): Promise<void>;
437
+ exportAllVideos(): void;
444
438
  cancelExportAllVideos(): void;
439
+ loadPageData(data: PageData): Promise<void>;
440
+ runByPageData(data: PageData): Promise<void>;
445
441
  }
446
442
 
447
443
  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 };