@vvfx/sdk 0.0.0-alpha.7 → 0.0.0-alpha.9
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 +70 -3
- package/dist/index.d.ts +70 -3
- package/dist/index.global.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -46,6 +46,40 @@ type SetItemPropertyValueParam = {
|
|
|
46
46
|
}[keyof PageFormTypeAndPropertyReference[T]];
|
|
47
47
|
}[keyof PageFormTypeAndPropertyReference];
|
|
48
48
|
|
|
49
|
+
declare global {
|
|
50
|
+
interface Window {
|
|
51
|
+
/**
|
|
52
|
+
* @description 创建 WebP Core 实例
|
|
53
|
+
*/
|
|
54
|
+
createWebPCore: (config: any) => Promise<Img2WebPCore>;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
type FS = {
|
|
58
|
+
writeFile: (path: string, data: Uint8Array | string) => void;
|
|
59
|
+
readFile(path: string, opts: {
|
|
60
|
+
encoding: 'binary';
|
|
61
|
+
flags?: string | undefined;
|
|
62
|
+
}): Uint8Array;
|
|
63
|
+
readFile(path: string, opts: {
|
|
64
|
+
encoding: 'utf8';
|
|
65
|
+
flags?: string | undefined;
|
|
66
|
+
}): string;
|
|
67
|
+
readFile(path: string, opts?: {
|
|
68
|
+
flags?: string | undefined;
|
|
69
|
+
}): Uint8Array;
|
|
70
|
+
unlink: (path: string) => void;
|
|
71
|
+
quit: () => void;
|
|
72
|
+
};
|
|
73
|
+
type Pointer = number;
|
|
74
|
+
type Img2WebPCore = {
|
|
75
|
+
FS: FS;
|
|
76
|
+
run: (...args: string[]) => number;
|
|
77
|
+
cwrap: (ident: string, returnType: string, argTypes: string[]) => ((argc: number, argv: Pointer) => number);
|
|
78
|
+
_malloc: (size: number) => Pointer;
|
|
79
|
+
writeAsciiToMemory: (str: string, buffer: number, dontAddNull?: boolean) => void;
|
|
80
|
+
setValue: (ptr: number, value: any, type: string, noSafe?: boolean) => void;
|
|
81
|
+
};
|
|
82
|
+
|
|
49
83
|
type BaseFormProperty = {
|
|
50
84
|
position: [number, number, number];
|
|
51
85
|
rotation: [number, number, number];
|
|
@@ -112,7 +146,11 @@ type SDKInputParam = {
|
|
|
112
146
|
/**
|
|
113
147
|
* @description 是否开启出血区强制变换
|
|
114
148
|
*/
|
|
115
|
-
keepSafe
|
|
149
|
+
keepSafe?: boolean;
|
|
150
|
+
/**
|
|
151
|
+
* @description 是否开启静态预览功能 - 第一个合成仅支持播放,不可编辑
|
|
152
|
+
*/
|
|
153
|
+
staticPreview?: boolean;
|
|
116
154
|
};
|
|
117
155
|
/**
|
|
118
156
|
* @description 页面属性
|
|
@@ -218,6 +256,10 @@ type ViewParam = {
|
|
|
218
256
|
* @description 出血区参数
|
|
219
257
|
*/
|
|
220
258
|
safeArea: [number, number, number, number];
|
|
259
|
+
/**
|
|
260
|
+
* @description 自定义出血区 - 用于展示
|
|
261
|
+
*/
|
|
262
|
+
previewSafeAreas?: PreviewSafeAreaParam[];
|
|
221
263
|
/**
|
|
222
264
|
* @description 导出参数
|
|
223
265
|
*/
|
|
@@ -239,10 +281,18 @@ type ExportParam = {
|
|
|
239
281
|
* @description 是否开启音轨
|
|
240
282
|
*/
|
|
241
283
|
audioEnable: boolean;
|
|
284
|
+
/**
|
|
285
|
+
* @description 视频fps - 默认 30
|
|
286
|
+
*/
|
|
287
|
+
fps?: number;
|
|
242
288
|
/**
|
|
243
289
|
* @description 导出视频类型 - 预留参数
|
|
244
290
|
*/
|
|
245
291
|
type?: string;
|
|
292
|
+
/**
|
|
293
|
+
* @description 视频名称
|
|
294
|
+
*/
|
|
295
|
+
name?: string;
|
|
246
296
|
};
|
|
247
297
|
/**
|
|
248
298
|
* @description 视图属性
|
|
@@ -260,6 +310,10 @@ type ViewProperty = {
|
|
|
260
310
|
* @description 出血区数据
|
|
261
311
|
*/
|
|
262
312
|
safeArea: [number, number, number, number];
|
|
313
|
+
/**
|
|
314
|
+
* @description 自定义出血区数据
|
|
315
|
+
*/
|
|
316
|
+
previewSafeAreas: PreviewSafeAreaParam[];
|
|
263
317
|
/**
|
|
264
318
|
* @description 视图场景数据
|
|
265
319
|
*/
|
|
@@ -277,6 +331,19 @@ type ViewProperty = {
|
|
|
277
331
|
*/
|
|
278
332
|
ignoreInteraction: boolean;
|
|
279
333
|
};
|
|
334
|
+
/**
|
|
335
|
+
* @description 自定义出血区数据
|
|
336
|
+
*/
|
|
337
|
+
type PreviewSafeAreaParam = {
|
|
338
|
+
/**
|
|
339
|
+
* @description 出血区包围盒 [left top width height]
|
|
340
|
+
*/
|
|
341
|
+
box: [number, number, number, number];
|
|
342
|
+
/**
|
|
343
|
+
* @description 出血区色块颜色 默认为 [255, 255, 255, 0.3]
|
|
344
|
+
*/
|
|
345
|
+
color?: [number, number, number, number];
|
|
346
|
+
};
|
|
280
347
|
/**
|
|
281
348
|
* @description 页面活跃数据
|
|
282
349
|
*/
|
|
@@ -393,7 +460,7 @@ declare class SDK {
|
|
|
393
460
|
*/
|
|
394
461
|
getItemPropertyValue<T extends keyof PageFormTypeAndPropertyReference, N extends keyof PageFormTypeAndPropertyReference[T]>(param: GetItemPropertyValueParam<T, N>): GetItemPropertyValueResult<T, N> | undefined;
|
|
395
462
|
setItemPropertyValue(param: SetItemPropertyValueParam): Promise<void>;
|
|
396
|
-
generateScreenShot(id: number): Promise<string>;
|
|
463
|
+
generateScreenShot(id: number, size?: [number, number], tick?: number): Promise<string>;
|
|
397
464
|
/**
|
|
398
465
|
* @description 切换场景
|
|
399
466
|
* @param index 场景索引
|
|
@@ -415,7 +482,7 @@ declare class SDK {
|
|
|
415
482
|
*/
|
|
416
483
|
setPlayProgress(progress: number): Promise<void>;
|
|
417
484
|
getViewItems(): ViewItem[];
|
|
418
|
-
setPlayState(playState: 'play' | 'pause'): void
|
|
485
|
+
setPlayState(playState: 'play' | 'pause'): Promise<void>;
|
|
419
486
|
/**
|
|
420
487
|
* @description 获取场景预览图
|
|
421
488
|
* @returns 视图预览图
|
package/dist/index.d.ts
CHANGED
|
@@ -46,6 +46,40 @@ type SetItemPropertyValueParam = {
|
|
|
46
46
|
}[keyof PageFormTypeAndPropertyReference[T]];
|
|
47
47
|
}[keyof PageFormTypeAndPropertyReference];
|
|
48
48
|
|
|
49
|
+
declare global {
|
|
50
|
+
interface Window {
|
|
51
|
+
/**
|
|
52
|
+
* @description 创建 WebP Core 实例
|
|
53
|
+
*/
|
|
54
|
+
createWebPCore: (config: any) => Promise<Img2WebPCore>;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
type FS = {
|
|
58
|
+
writeFile: (path: string, data: Uint8Array | string) => void;
|
|
59
|
+
readFile(path: string, opts: {
|
|
60
|
+
encoding: 'binary';
|
|
61
|
+
flags?: string | undefined;
|
|
62
|
+
}): Uint8Array;
|
|
63
|
+
readFile(path: string, opts: {
|
|
64
|
+
encoding: 'utf8';
|
|
65
|
+
flags?: string | undefined;
|
|
66
|
+
}): string;
|
|
67
|
+
readFile(path: string, opts?: {
|
|
68
|
+
flags?: string | undefined;
|
|
69
|
+
}): Uint8Array;
|
|
70
|
+
unlink: (path: string) => void;
|
|
71
|
+
quit: () => void;
|
|
72
|
+
};
|
|
73
|
+
type Pointer = number;
|
|
74
|
+
type Img2WebPCore = {
|
|
75
|
+
FS: FS;
|
|
76
|
+
run: (...args: string[]) => number;
|
|
77
|
+
cwrap: (ident: string, returnType: string, argTypes: string[]) => ((argc: number, argv: Pointer) => number);
|
|
78
|
+
_malloc: (size: number) => Pointer;
|
|
79
|
+
writeAsciiToMemory: (str: string, buffer: number, dontAddNull?: boolean) => void;
|
|
80
|
+
setValue: (ptr: number, value: any, type: string, noSafe?: boolean) => void;
|
|
81
|
+
};
|
|
82
|
+
|
|
49
83
|
type BaseFormProperty = {
|
|
50
84
|
position: [number, number, number];
|
|
51
85
|
rotation: [number, number, number];
|
|
@@ -112,7 +146,11 @@ type SDKInputParam = {
|
|
|
112
146
|
/**
|
|
113
147
|
* @description 是否开启出血区强制变换
|
|
114
148
|
*/
|
|
115
|
-
keepSafe
|
|
149
|
+
keepSafe?: boolean;
|
|
150
|
+
/**
|
|
151
|
+
* @description 是否开启静态预览功能 - 第一个合成仅支持播放,不可编辑
|
|
152
|
+
*/
|
|
153
|
+
staticPreview?: boolean;
|
|
116
154
|
};
|
|
117
155
|
/**
|
|
118
156
|
* @description 页面属性
|
|
@@ -218,6 +256,10 @@ type ViewParam = {
|
|
|
218
256
|
* @description 出血区参数
|
|
219
257
|
*/
|
|
220
258
|
safeArea: [number, number, number, number];
|
|
259
|
+
/**
|
|
260
|
+
* @description 自定义出血区 - 用于展示
|
|
261
|
+
*/
|
|
262
|
+
previewSafeAreas?: PreviewSafeAreaParam[];
|
|
221
263
|
/**
|
|
222
264
|
* @description 导出参数
|
|
223
265
|
*/
|
|
@@ -239,10 +281,18 @@ type ExportParam = {
|
|
|
239
281
|
* @description 是否开启音轨
|
|
240
282
|
*/
|
|
241
283
|
audioEnable: boolean;
|
|
284
|
+
/**
|
|
285
|
+
* @description 视频fps - 默认 30
|
|
286
|
+
*/
|
|
287
|
+
fps?: number;
|
|
242
288
|
/**
|
|
243
289
|
* @description 导出视频类型 - 预留参数
|
|
244
290
|
*/
|
|
245
291
|
type?: string;
|
|
292
|
+
/**
|
|
293
|
+
* @description 视频名称
|
|
294
|
+
*/
|
|
295
|
+
name?: string;
|
|
246
296
|
};
|
|
247
297
|
/**
|
|
248
298
|
* @description 视图属性
|
|
@@ -260,6 +310,10 @@ type ViewProperty = {
|
|
|
260
310
|
* @description 出血区数据
|
|
261
311
|
*/
|
|
262
312
|
safeArea: [number, number, number, number];
|
|
313
|
+
/**
|
|
314
|
+
* @description 自定义出血区数据
|
|
315
|
+
*/
|
|
316
|
+
previewSafeAreas: PreviewSafeAreaParam[];
|
|
263
317
|
/**
|
|
264
318
|
* @description 视图场景数据
|
|
265
319
|
*/
|
|
@@ -277,6 +331,19 @@ type ViewProperty = {
|
|
|
277
331
|
*/
|
|
278
332
|
ignoreInteraction: boolean;
|
|
279
333
|
};
|
|
334
|
+
/**
|
|
335
|
+
* @description 自定义出血区数据
|
|
336
|
+
*/
|
|
337
|
+
type PreviewSafeAreaParam = {
|
|
338
|
+
/**
|
|
339
|
+
* @description 出血区包围盒 [left top width height]
|
|
340
|
+
*/
|
|
341
|
+
box: [number, number, number, number];
|
|
342
|
+
/**
|
|
343
|
+
* @description 出血区色块颜色 默认为 [255, 255, 255, 0.3]
|
|
344
|
+
*/
|
|
345
|
+
color?: [number, number, number, number];
|
|
346
|
+
};
|
|
280
347
|
/**
|
|
281
348
|
* @description 页面活跃数据
|
|
282
349
|
*/
|
|
@@ -393,7 +460,7 @@ declare class SDK {
|
|
|
393
460
|
*/
|
|
394
461
|
getItemPropertyValue<T extends keyof PageFormTypeAndPropertyReference, N extends keyof PageFormTypeAndPropertyReference[T]>(param: GetItemPropertyValueParam<T, N>): GetItemPropertyValueResult<T, N> | undefined;
|
|
395
462
|
setItemPropertyValue(param: SetItemPropertyValueParam): Promise<void>;
|
|
396
|
-
generateScreenShot(id: number): Promise<string>;
|
|
463
|
+
generateScreenShot(id: number, size?: [number, number], tick?: number): Promise<string>;
|
|
397
464
|
/**
|
|
398
465
|
* @description 切换场景
|
|
399
466
|
* @param index 场景索引
|
|
@@ -415,7 +482,7 @@ declare class SDK {
|
|
|
415
482
|
*/
|
|
416
483
|
setPlayProgress(progress: number): Promise<void>;
|
|
417
484
|
getViewItems(): ViewItem[];
|
|
418
|
-
setPlayState(playState: 'play' | 'pause'): void
|
|
485
|
+
setPlayState(playState: 'play' | 'pause'): Promise<void>;
|
|
419
486
|
/**
|
|
420
487
|
* @description 获取场景预览图
|
|
421
488
|
* @returns 视图预览图
|