@vvfx/sdk 0.0.0-alpha.39 → 0.0.0-alpha.40

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.cts CHANGED
@@ -63,7 +63,7 @@ declare const MEDIA_TYPE: {
63
63
  * medium: bilinear + max_colors=64 + dither=bayer
64
64
  * low: neighbor + max_colors=32 + dither=none
65
65
  */
66
- declare const QUALITY_TO_FFMPEG_ARGS: {
66
+ declare const GIF_QUALITY_TO_FFMPEG_ARGS: {
67
67
  highest: string;
68
68
  high: string;
69
69
  medium: string;
@@ -145,7 +145,26 @@ type GifConfig = {
145
145
  * 默认 'highest'
146
146
  * 可选 'highest', 'high', 'medium', 'low'
147
147
  */
148
- quality?: keyof typeof QUALITY_TO_FFMPEG_ARGS;
148
+ quality?: keyof typeof GIF_QUALITY_TO_FFMPEG_ARGS;
149
+ };
150
+ type ApngConfig = {
151
+ /**
152
+ * @description APNG 导出时的帧率
153
+ */
154
+ fps?: number;
155
+ /**
156
+ * @description APNG 导出时的缩放比例
157
+ * 默认 '-1:-1', 表示不缩放
158
+ * 例如 '100:-1', 表示宽度 100,高度自动
159
+ * 例如 '-1:100', 表示宽度自动,高度 100
160
+ */
161
+ scale?: string;
162
+ /**
163
+ * @description APNG 导出时的质量
164
+ * 默认 'highest'
165
+ * 可选 'highest', 'high', 'medium', 'low'
166
+ */
167
+ quality?: keyof typeof GIF_QUALITY_TO_FFMPEG_ARGS;
149
168
  };
150
169
  type ExportMediaItemOptions = {
151
170
  /**
@@ -180,6 +199,7 @@ type ExportMediaItemOptions = {
180
199
  * 导出 GIF 时,设置的导出配置
181
200
  */
182
201
  gifConfig?: GifConfig;
202
+ apngConfig?: ApngConfig;
183
203
  };
184
204
 
185
205
  type SDKMode = 'product' | 'template';
@@ -603,6 +623,11 @@ declare class SDK {
603
623
  * @param value 值
604
624
  */
605
625
  setSDKBackground(type: SDKBackgroundType, value?: string): void;
626
+ /**
627
+ * @description 创建图层元素
628
+ * @param spriteInfo 图层元素信息
629
+ */
630
+ addSpriteItem(spriteInfo: SpriteCreateInfo): Promise<void>;
606
631
  }
607
632
 
608
633
  type SizeAdaptDirection = 'x' | 'y';
@@ -659,14 +684,19 @@ type SDKOptions = {
659
684
  /** 导出视频时,是否开启转码日志 */
660
685
  loggerInExportVideoTranscoding?: boolean;
661
686
  };
687
+ type SDKInputParam = SDKTemplateInputParam | SDKEditorInputParam;
662
688
  /**
663
689
  * @description SDK入参
664
690
  */
665
- type SDKInputParam = {
691
+ type SDKTemplateInputParam = {
666
692
  /**
667
693
  * @description JSON地址
668
694
  */
669
695
  scene: string | spec.JSONScene;
696
+ /**
697
+ * @description SDK模式 - 模板编辑模式
698
+ */
699
+ mode: 'template';
670
700
  /**
671
701
  * @description 视图参数
672
702
  */
@@ -676,6 +706,12 @@ type SDKInputParam = {
676
706
  */
677
707
  options: PageOptions;
678
708
  };
709
+ type SDKEditorInputParam = {
710
+ /**
711
+ * @description SDK模式 - 编辑器模式
712
+ */
713
+ mode: 'editor';
714
+ };
679
715
  /**
680
716
  * @description 页面属性
681
717
  */
@@ -907,5 +943,38 @@ type ViewItem = {
907
943
  endBehavior: spec.EndBehavior;
908
944
  } & ViewItemTypedProperty;
909
945
  type SDKBackgroundType = 'color' | 'image' | 'chess-board';
946
+ /**
947
+ * @description 图层创建信息
948
+ */
949
+ type SpriteCreateInfo = {
950
+ /**
951
+ * @description 图层名称
952
+ */
953
+ name?: string;
954
+ /**
955
+ * @description 元素id
956
+ */
957
+ id?: string;
958
+ /**
959
+ * @description 图片资源地址
960
+ */
961
+ url: string;
962
+ /**
963
+ * @description 图层元素像素大小
964
+ */
965
+ size: spec.vec2;
966
+ /**
967
+ * @description 图层元素缩放
968
+ */
969
+ scale?: spec.vec2;
970
+ /**
971
+ * @description 图层元素旋转
972
+ */
973
+ rotation?: number;
974
+ /**
975
+ * @description 图层元素二维位置
976
+ */
977
+ position: spec.vec2;
978
+ };
910
979
 
911
980
  export { type ActiveData, type BaseFormProperty, type PageData, type PageFormTypedProperty, type PageProperty, SDK, type SDKEvents, type SDKInputParam, type SDKOptions, type SpecificPageFormProps, type SpriteFormProperty, type TextFormProperty, type ViewItem, type ViewParam, type ViewProperty };
package/dist/index.d.ts CHANGED
@@ -63,7 +63,7 @@ declare const MEDIA_TYPE: {
63
63
  * medium: bilinear + max_colors=64 + dither=bayer
64
64
  * low: neighbor + max_colors=32 + dither=none
65
65
  */
66
- declare const QUALITY_TO_FFMPEG_ARGS: {
66
+ declare const GIF_QUALITY_TO_FFMPEG_ARGS: {
67
67
  highest: string;
68
68
  high: string;
69
69
  medium: string;
@@ -145,7 +145,26 @@ type GifConfig = {
145
145
  * 默认 'highest'
146
146
  * 可选 'highest', 'high', 'medium', 'low'
147
147
  */
148
- quality?: keyof typeof QUALITY_TO_FFMPEG_ARGS;
148
+ quality?: keyof typeof GIF_QUALITY_TO_FFMPEG_ARGS;
149
+ };
150
+ type ApngConfig = {
151
+ /**
152
+ * @description APNG 导出时的帧率
153
+ */
154
+ fps?: number;
155
+ /**
156
+ * @description APNG 导出时的缩放比例
157
+ * 默认 '-1:-1', 表示不缩放
158
+ * 例如 '100:-1', 表示宽度 100,高度自动
159
+ * 例如 '-1:100', 表示宽度自动,高度 100
160
+ */
161
+ scale?: string;
162
+ /**
163
+ * @description APNG 导出时的质量
164
+ * 默认 'highest'
165
+ * 可选 'highest', 'high', 'medium', 'low'
166
+ */
167
+ quality?: keyof typeof GIF_QUALITY_TO_FFMPEG_ARGS;
149
168
  };
150
169
  type ExportMediaItemOptions = {
151
170
  /**
@@ -180,6 +199,7 @@ type ExportMediaItemOptions = {
180
199
  * 导出 GIF 时,设置的导出配置
181
200
  */
182
201
  gifConfig?: GifConfig;
202
+ apngConfig?: ApngConfig;
183
203
  };
184
204
 
185
205
  type SDKMode = 'product' | 'template';
@@ -603,6 +623,11 @@ declare class SDK {
603
623
  * @param value 值
604
624
  */
605
625
  setSDKBackground(type: SDKBackgroundType, value?: string): void;
626
+ /**
627
+ * @description 创建图层元素
628
+ * @param spriteInfo 图层元素信息
629
+ */
630
+ addSpriteItem(spriteInfo: SpriteCreateInfo): Promise<void>;
606
631
  }
607
632
 
608
633
  type SizeAdaptDirection = 'x' | 'y';
@@ -659,14 +684,19 @@ type SDKOptions = {
659
684
  /** 导出视频时,是否开启转码日志 */
660
685
  loggerInExportVideoTranscoding?: boolean;
661
686
  };
687
+ type SDKInputParam = SDKTemplateInputParam | SDKEditorInputParam;
662
688
  /**
663
689
  * @description SDK入参
664
690
  */
665
- type SDKInputParam = {
691
+ type SDKTemplateInputParam = {
666
692
  /**
667
693
  * @description JSON地址
668
694
  */
669
695
  scene: string | spec.JSONScene;
696
+ /**
697
+ * @description SDK模式 - 模板编辑模式
698
+ */
699
+ mode: 'template';
670
700
  /**
671
701
  * @description 视图参数
672
702
  */
@@ -676,6 +706,12 @@ type SDKInputParam = {
676
706
  */
677
707
  options: PageOptions;
678
708
  };
709
+ type SDKEditorInputParam = {
710
+ /**
711
+ * @description SDK模式 - 编辑器模式
712
+ */
713
+ mode: 'editor';
714
+ };
679
715
  /**
680
716
  * @description 页面属性
681
717
  */
@@ -907,5 +943,38 @@ type ViewItem = {
907
943
  endBehavior: spec.EndBehavior;
908
944
  } & ViewItemTypedProperty;
909
945
  type SDKBackgroundType = 'color' | 'image' | 'chess-board';
946
+ /**
947
+ * @description 图层创建信息
948
+ */
949
+ type SpriteCreateInfo = {
950
+ /**
951
+ * @description 图层名称
952
+ */
953
+ name?: string;
954
+ /**
955
+ * @description 元素id
956
+ */
957
+ id?: string;
958
+ /**
959
+ * @description 图片资源地址
960
+ */
961
+ url: string;
962
+ /**
963
+ * @description 图层元素像素大小
964
+ */
965
+ size: spec.vec2;
966
+ /**
967
+ * @description 图层元素缩放
968
+ */
969
+ scale?: spec.vec2;
970
+ /**
971
+ * @description 图层元素旋转
972
+ */
973
+ rotation?: number;
974
+ /**
975
+ * @description 图层元素二维位置
976
+ */
977
+ position: spec.vec2;
978
+ };
910
979
 
911
980
  export { type ActiveData, type BaseFormProperty, type PageData, type PageFormTypedProperty, type PageProperty, SDK, type SDKEvents, type SDKInputParam, type SDKOptions, type SpecificPageFormProps, type SpriteFormProperty, type TextFormProperty, type ViewItem, type ViewParam, type ViewProperty };