@vvfx/sdk 0.1.19-alpha.0 → 0.1.19-alpha.1
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 +216 -14
- package/dist/index.d.ts +216 -14
- package/dist/index.global.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -107,6 +107,15 @@ type GeneratorItemOptions = SDKItemOptions & {
|
|
|
107
107
|
type EffectsItemOptions = SDKItemOptions & {
|
|
108
108
|
property?: Partial<EffectsItemProperty>;
|
|
109
109
|
};
|
|
110
|
+
/**
|
|
111
|
+
* @description Frame 画板元素 SDKItem 选项
|
|
112
|
+
*/
|
|
113
|
+
type FrameItemOptions = SDKItemOptions & {
|
|
114
|
+
/**
|
|
115
|
+
* @description 元素属性
|
|
116
|
+
*/
|
|
117
|
+
property?: Partial<FrameItemProperty>;
|
|
118
|
+
};
|
|
110
119
|
/**
|
|
111
120
|
* @description SDKItem 类型(独立于 spec.ItemType)
|
|
112
121
|
* @description 包含所有 SDK 层级的元素类型,包括虚拟类型如 generator
|
|
@@ -697,6 +706,106 @@ declare class EffectsItem extends BaseItem {
|
|
|
697
706
|
*/
|
|
698
707
|
declare function isEffectsItem(obj: any): obj is EffectsItem;
|
|
699
708
|
|
|
709
|
+
/**
|
|
710
|
+
* @description 画板/框架元素 SDKItem 类
|
|
711
|
+
* @description 支持自动布局和自由布局两种模式
|
|
712
|
+
* @description 底层以 composition 形式渲染
|
|
713
|
+
*/
|
|
714
|
+
declare class FrameItem extends BaseItem {
|
|
715
|
+
/**
|
|
716
|
+
* @description 元素类型
|
|
717
|
+
*/
|
|
718
|
+
readonly type = SDKItemType.FRAME;
|
|
719
|
+
/**
|
|
720
|
+
* @description 元素属性
|
|
721
|
+
*/
|
|
722
|
+
property: FrameItemProperty;
|
|
723
|
+
constructor(options: FrameItemOptions);
|
|
724
|
+
/**
|
|
725
|
+
* @description 子元素ID列表(只读)
|
|
726
|
+
*/
|
|
727
|
+
get children(): readonly string[];
|
|
728
|
+
/**
|
|
729
|
+
* @description 布局模式
|
|
730
|
+
*/
|
|
731
|
+
get layoutMode(): FrameLayoutMode;
|
|
732
|
+
set layoutMode(value: FrameLayoutMode);
|
|
733
|
+
/**
|
|
734
|
+
* @description 位置
|
|
735
|
+
*/
|
|
736
|
+
get position(): [number, number];
|
|
737
|
+
set position(value: [number, number]);
|
|
738
|
+
/**
|
|
739
|
+
* @description 宽度
|
|
740
|
+
*/
|
|
741
|
+
get width(): number;
|
|
742
|
+
set width(value: number);
|
|
743
|
+
/**
|
|
744
|
+
* @description 高度
|
|
745
|
+
*/
|
|
746
|
+
get height(): number;
|
|
747
|
+
set height(value: number);
|
|
748
|
+
/**
|
|
749
|
+
* @description 缩放
|
|
750
|
+
*/
|
|
751
|
+
get scale(): [number, number];
|
|
752
|
+
set scale(value: [number, number]);
|
|
753
|
+
/**
|
|
754
|
+
* @description 旋转(二维旋转角度)
|
|
755
|
+
*/
|
|
756
|
+
get rotation(): number;
|
|
757
|
+
set rotation(value: number);
|
|
758
|
+
/**
|
|
759
|
+
* @description 完整旋转(包含 x, y, z)
|
|
760
|
+
*/
|
|
761
|
+
get fullRotation(): [number, number, number];
|
|
762
|
+
set fullRotation(value: [number, number, number]);
|
|
763
|
+
/**
|
|
764
|
+
* @description 添加子元素
|
|
765
|
+
* @param itemId 子元素ID
|
|
766
|
+
* @returns 是否添加成功
|
|
767
|
+
*/
|
|
768
|
+
addChild(itemId: string): boolean;
|
|
769
|
+
/**
|
|
770
|
+
* @description 批量添加子元素
|
|
771
|
+
* @param itemIds 子元素ID列表
|
|
772
|
+
*/
|
|
773
|
+
addChildren(itemIds: string[]): void;
|
|
774
|
+
/**
|
|
775
|
+
* @description 移除子元素
|
|
776
|
+
* @param itemId 子元素ID
|
|
777
|
+
* @returns 是否移除成功
|
|
778
|
+
*/
|
|
779
|
+
removeChild(itemId: string): boolean;
|
|
780
|
+
/**
|
|
781
|
+
* @description 批量移除子元素
|
|
782
|
+
* @param itemIds 子元素ID列表
|
|
783
|
+
*/
|
|
784
|
+
removeChildren(itemIds: string[]): void;
|
|
785
|
+
/**
|
|
786
|
+
* @description 是否包含指定子元素
|
|
787
|
+
* @param itemId 子元素ID
|
|
788
|
+
*/
|
|
789
|
+
hasChild(itemId: string): boolean;
|
|
790
|
+
/**
|
|
791
|
+
* @description 清空所有子元素
|
|
792
|
+
*/
|
|
793
|
+
clearChildren(): void;
|
|
794
|
+
/**
|
|
795
|
+
* @description 转换为 FrameCreateInfo
|
|
796
|
+
* @param withParent 是否包含父节点ID
|
|
797
|
+
*/
|
|
798
|
+
toCreateInfo(withParent?: boolean): FrameCreateInfo;
|
|
799
|
+
/**
|
|
800
|
+
* @description 克隆 SDKItem
|
|
801
|
+
*/
|
|
802
|
+
clone(): FrameItem;
|
|
803
|
+
}
|
|
804
|
+
/**
|
|
805
|
+
* @description 类型守卫:检查是否是 FrameItem
|
|
806
|
+
*/
|
|
807
|
+
declare function isFrameItem(obj: any): obj is FrameItem;
|
|
808
|
+
|
|
700
809
|
/**
|
|
701
810
|
* @description 根据 item type 创建对应的 SDKItem 实例
|
|
702
811
|
* @param type 元素类型
|
|
@@ -708,7 +817,7 @@ declare function createSDKItem(type: spec.ItemType, options: SDKItemOptions): Ba
|
|
|
708
817
|
* @description SDKItem 类型联合
|
|
709
818
|
* @description 用于替换原来的 SDKItem type
|
|
710
819
|
*/
|
|
711
|
-
type SDKItem$1 = SpriteItem | TextItem | VideoItem | GroupItem | GeneratorItem | EffectsItem;
|
|
820
|
+
type SDKItem$1 = SpriteItem | TextItem | VideoItem | GroupItem | GeneratorItem | EffectsItem | FrameItem;
|
|
712
821
|
|
|
713
822
|
/**
|
|
714
823
|
* @class 二维线段
|
|
@@ -1243,6 +1352,26 @@ type GeneratorItemProperty = BaseItemProperty & {
|
|
|
1243
1352
|
type EffectsItemProperty = BaseItemProperty & {
|
|
1244
1353
|
effects: string;
|
|
1245
1354
|
};
|
|
1355
|
+
/**
|
|
1356
|
+
* @description Frame 画板元素布局模式
|
|
1357
|
+
*/
|
|
1358
|
+
declare enum FrameLayoutMode {
|
|
1359
|
+
AUTO = "auto",
|
|
1360
|
+
FREE = "free"
|
|
1361
|
+
}
|
|
1362
|
+
/**
|
|
1363
|
+
* @description Frame 画板元素属性
|
|
1364
|
+
*/
|
|
1365
|
+
type FrameItemProperty = BaseItemProperty & {
|
|
1366
|
+
/**
|
|
1367
|
+
* @description 布局模式: auto - 自动布局, free - 自由布局
|
|
1368
|
+
*/
|
|
1369
|
+
layoutMode: FrameLayoutMode;
|
|
1370
|
+
/**
|
|
1371
|
+
* @description 子元素ID数组
|
|
1372
|
+
*/
|
|
1373
|
+
children: string[];
|
|
1374
|
+
};
|
|
1246
1375
|
/**
|
|
1247
1376
|
* @description BaseItem 基础属性键名
|
|
1248
1377
|
*/
|
|
@@ -1269,7 +1398,7 @@ type ItemPropertyMap = {
|
|
|
1269
1398
|
[SDKItemType.GROUP]: GroupItemProperty;
|
|
1270
1399
|
[SDKItemType.GENERATOR]: GeneratorItemProperty;
|
|
1271
1400
|
[SDKItemType.EFFECTS]: EffectsItemProperty;
|
|
1272
|
-
[SDKItemType.FRAME]:
|
|
1401
|
+
[SDKItemType.FRAME]: FrameItemProperty;
|
|
1273
1402
|
};
|
|
1274
1403
|
/**
|
|
1275
1404
|
* @description 场景1:单个元素单个属性设置
|
|
@@ -1970,7 +2099,61 @@ type EffectsCreateInfo = {
|
|
|
1970
2099
|
*/
|
|
1971
2100
|
extension?: Record<string, any>;
|
|
1972
2101
|
};
|
|
1973
|
-
|
|
2102
|
+
/**
|
|
2103
|
+
* @description Frame 画板元素创建信息
|
|
2104
|
+
*/
|
|
2105
|
+
type FrameCreateInfo = {
|
|
2106
|
+
/**
|
|
2107
|
+
* @description 元素类型 - 画板
|
|
2108
|
+
*/
|
|
2109
|
+
type: SDKItemType.FRAME;
|
|
2110
|
+
/**
|
|
2111
|
+
* @description 元素名称
|
|
2112
|
+
*/
|
|
2113
|
+
name?: string;
|
|
2114
|
+
/**
|
|
2115
|
+
* @description 元素id
|
|
2116
|
+
*/
|
|
2117
|
+
id?: string;
|
|
2118
|
+
/**
|
|
2119
|
+
* @description 父元素id
|
|
2120
|
+
*/
|
|
2121
|
+
parentId?: string;
|
|
2122
|
+
/**
|
|
2123
|
+
* @description 元素属性
|
|
2124
|
+
*/
|
|
2125
|
+
property: {
|
|
2126
|
+
/**
|
|
2127
|
+
* @description 画板像素宽度
|
|
2128
|
+
*/
|
|
2129
|
+
width: number;
|
|
2130
|
+
/**
|
|
2131
|
+
* @description 画板像素高度
|
|
2132
|
+
*/
|
|
2133
|
+
height: number;
|
|
2134
|
+
/**
|
|
2135
|
+
* @description 画板位置
|
|
2136
|
+
*/
|
|
2137
|
+
position: [number, number];
|
|
2138
|
+
/**
|
|
2139
|
+
* @description 画板旋转 z | [x, y, z]
|
|
2140
|
+
*/
|
|
2141
|
+
rotation?: number | [number, number, number];
|
|
2142
|
+
/**
|
|
2143
|
+
* @description 画板缩放
|
|
2144
|
+
*/
|
|
2145
|
+
scale?: [number, number];
|
|
2146
|
+
/**
|
|
2147
|
+
* @description 布局模式: 'auto' | 'free'
|
|
2148
|
+
*/
|
|
2149
|
+
layoutMode?: FrameLayoutMode;
|
|
2150
|
+
};
|
|
2151
|
+
/**
|
|
2152
|
+
* @description 扩展属性
|
|
2153
|
+
*/
|
|
2154
|
+
extension?: Record<string, any>;
|
|
2155
|
+
};
|
|
2156
|
+
type ItemCreateInfo = GroupCreateInfo | SpriteCreateInfo | TextCreateInfo | VideoCreateInfo | GeneratorCreateInfo | EffectsCreateInfo | FrameCreateInfo;
|
|
1974
2157
|
/**
|
|
1975
2158
|
* @description 场景创建信息
|
|
1976
2159
|
*/
|
|
@@ -2707,7 +2890,26 @@ type VideoPlayGizmoConfig = {
|
|
|
2707
2890
|
height: number;
|
|
2708
2891
|
};
|
|
2709
2892
|
type ItemCreateGizmoConfig = {
|
|
2710
|
-
|
|
2893
|
+
/**
|
|
2894
|
+
* @description 边框颜色
|
|
2895
|
+
*/
|
|
2896
|
+
frameBorderColor: number;
|
|
2897
|
+
/**
|
|
2898
|
+
* @description 边框宽度
|
|
2899
|
+
*/
|
|
2900
|
+
frameBorderWidth: number;
|
|
2901
|
+
/**
|
|
2902
|
+
* @description 边框透明度
|
|
2903
|
+
*/
|
|
2904
|
+
frameBorderAlpha: number;
|
|
2905
|
+
/**
|
|
2906
|
+
* @description 填充颜色
|
|
2907
|
+
*/
|
|
2908
|
+
frameFillColor: number;
|
|
2909
|
+
/**
|
|
2910
|
+
* @description 填充透明度
|
|
2911
|
+
*/
|
|
2912
|
+
frameFillAlpha: number;
|
|
2711
2913
|
};
|
|
2712
2914
|
|
|
2713
2915
|
/**
|
|
@@ -2801,6 +3003,7 @@ type SDKEvents = {
|
|
|
2801
3003
|
'itemCreate': [{
|
|
2802
3004
|
type: ItemCreateType;
|
|
2803
3005
|
position: spec.vec2;
|
|
3006
|
+
id: string;
|
|
2804
3007
|
}];
|
|
2805
3008
|
'viewLost': [];
|
|
2806
3009
|
'viewRebuildFinish': [];
|
|
@@ -3078,21 +3281,14 @@ declare class SDK {
|
|
|
3078
3281
|
* @param extensions 扩展属性对象(支持同时设置多个)
|
|
3079
3282
|
* @returns 是否设置成功
|
|
3080
3283
|
*/
|
|
3081
|
-
|
|
3284
|
+
setItemExtension(id: string, extension: Record<string, any>): boolean;
|
|
3082
3285
|
/**
|
|
3083
3286
|
* @description 批量获取元素扩展属性
|
|
3084
3287
|
* @param id 元素ID
|
|
3085
3288
|
* @param keys 扩展属性名称列表(不传则返回所有扩展属性)
|
|
3086
3289
|
* @returns 扩展属性对象
|
|
3087
3290
|
*/
|
|
3088
|
-
|
|
3089
|
-
/**
|
|
3090
|
-
* @description 获取单个元素扩展属性
|
|
3091
|
-
* @param id 元素ID
|
|
3092
|
-
* @param key 扩展属性名称
|
|
3093
|
-
* @returns 扩展属性值
|
|
3094
|
-
*/
|
|
3095
|
-
getItemExtension(id: string, key: string): any;
|
|
3291
|
+
getItemExtension(id: string, keys?: string[]): Record<string, any> | undefined;
|
|
3096
3292
|
/**
|
|
3097
3293
|
* @description 删除元素扩展属性(支持批量删除)
|
|
3098
3294
|
* @param id 元素ID
|
|
@@ -3175,6 +3371,12 @@ declare class SDK {
|
|
|
3175
3371
|
* @param effectsInfo 动效创建信息
|
|
3176
3372
|
*/
|
|
3177
3373
|
addEffectsItem(effectsInfo: EffectsCreateInfo): Promise<string | undefined>;
|
|
3374
|
+
/**
|
|
3375
|
+
* @description 创建画板元素
|
|
3376
|
+
* @param createInfo 画板创建信息
|
|
3377
|
+
* @returns 画板元素ID
|
|
3378
|
+
*/
|
|
3379
|
+
addFrameItem(createInfo: FrameCreateInfo): string;
|
|
3178
3380
|
/**
|
|
3179
3381
|
* @description 设置生成器资源,将生成器转换为对应的元素
|
|
3180
3382
|
* @param id 生成器元素ID
|
|
@@ -3205,4 +3407,4 @@ declare class SDK {
|
|
|
3205
3407
|
setSafeAreaPreviewVisible(id: number, type: 'url' | 'color', visible: boolean): void;
|
|
3206
3408
|
}
|
|
3207
3409
|
|
|
3208
|
-
export { type ActiveData, BaseItem, type BaseItemProperty, type BaseItemPropertyKey, type BaseItemPropertyValueMap, Box2, type CreateOperation, type DeleteOperation, type EffectsCreateInfo, EffectsItem, type EffectsItemOptions, type GeneratorCreateInfo, GeneratorItem, type GeneratorItemOptions, type GeneratorItemProperty, type GizmoType, type GroupCreateInfo, GroupItem, type GroupItemOptions, type ItemCreateInfo, ItemOrderAction, type ItemPropertyMap, type Operation, type PageData, type PageProperty, SDK, type SDKEvents, type SDKInputParam, type SDKItem$1 as SDKItem, type SDKItemOptions, SDKItemType, type SDKOptions, type SetItemPropertyParam, type SetSingleItemMultiplePropertiesParam, type SetSingleItemSinglePropertyParam, type SpriteCreateInfo, SpriteItem, type SpriteItemOptions, type SpriteItemProperty, type TextCreateInfo, TextItem, type TextItemOptions, type TextItemProperty, type UpdateOperation, Vector2, type VideoCreateInfo, VideoItem, type VideoItemOptions, type VideoItemProperty, type ViewParam, type ViewProperty, createSDKItem, isBaseItem, isEffectsItem, isGeneratorItem, isGroupItem, isSpriteItem, isTextItem, isVideoItem };
|
|
3410
|
+
export { type ActiveData, BaseItem, type BaseItemProperty, type BaseItemPropertyKey, type BaseItemPropertyValueMap, Box2, type CreateOperation, type DeleteOperation, type EffectsCreateInfo, EffectsItem, type EffectsItemOptions, type FrameCreateInfo, FrameItem, type FrameItemOptions, type FrameItemProperty, FrameLayoutMode, type GeneratorCreateInfo, GeneratorItem, type GeneratorItemOptions, type GeneratorItemProperty, type GizmoType, type GroupCreateInfo, GroupItem, type GroupItemOptions, type ItemCreateInfo, ItemOrderAction, type ItemPropertyMap, type Operation, type PageData, type PageProperty, SDK, type SDKEvents, type SDKInputParam, type SDKItem$1 as SDKItem, type SDKItemOptions, SDKItemType, type SDKOptions, type SetItemPropertyParam, type SetSingleItemMultiplePropertiesParam, type SetSingleItemSinglePropertyParam, type SpriteCreateInfo, SpriteItem, type SpriteItemOptions, type SpriteItemProperty, type TextCreateInfo, TextItem, type TextItemOptions, type TextItemProperty, type UpdateOperation, Vector2, type VideoCreateInfo, VideoItem, type VideoItemOptions, type VideoItemProperty, type ViewParam, type ViewProperty, createSDKItem, isBaseItem, isEffectsItem, isFrameItem, isGeneratorItem, isGroupItem, isSpriteItem, isTextItem, isVideoItem };
|
package/dist/index.d.ts
CHANGED
|
@@ -107,6 +107,15 @@ type GeneratorItemOptions = SDKItemOptions & {
|
|
|
107
107
|
type EffectsItemOptions = SDKItemOptions & {
|
|
108
108
|
property?: Partial<EffectsItemProperty>;
|
|
109
109
|
};
|
|
110
|
+
/**
|
|
111
|
+
* @description Frame 画板元素 SDKItem 选项
|
|
112
|
+
*/
|
|
113
|
+
type FrameItemOptions = SDKItemOptions & {
|
|
114
|
+
/**
|
|
115
|
+
* @description 元素属性
|
|
116
|
+
*/
|
|
117
|
+
property?: Partial<FrameItemProperty>;
|
|
118
|
+
};
|
|
110
119
|
/**
|
|
111
120
|
* @description SDKItem 类型(独立于 spec.ItemType)
|
|
112
121
|
* @description 包含所有 SDK 层级的元素类型,包括虚拟类型如 generator
|
|
@@ -697,6 +706,106 @@ declare class EffectsItem extends BaseItem {
|
|
|
697
706
|
*/
|
|
698
707
|
declare function isEffectsItem(obj: any): obj is EffectsItem;
|
|
699
708
|
|
|
709
|
+
/**
|
|
710
|
+
* @description 画板/框架元素 SDKItem 类
|
|
711
|
+
* @description 支持自动布局和自由布局两种模式
|
|
712
|
+
* @description 底层以 composition 形式渲染
|
|
713
|
+
*/
|
|
714
|
+
declare class FrameItem extends BaseItem {
|
|
715
|
+
/**
|
|
716
|
+
* @description 元素类型
|
|
717
|
+
*/
|
|
718
|
+
readonly type = SDKItemType.FRAME;
|
|
719
|
+
/**
|
|
720
|
+
* @description 元素属性
|
|
721
|
+
*/
|
|
722
|
+
property: FrameItemProperty;
|
|
723
|
+
constructor(options: FrameItemOptions);
|
|
724
|
+
/**
|
|
725
|
+
* @description 子元素ID列表(只读)
|
|
726
|
+
*/
|
|
727
|
+
get children(): readonly string[];
|
|
728
|
+
/**
|
|
729
|
+
* @description 布局模式
|
|
730
|
+
*/
|
|
731
|
+
get layoutMode(): FrameLayoutMode;
|
|
732
|
+
set layoutMode(value: FrameLayoutMode);
|
|
733
|
+
/**
|
|
734
|
+
* @description 位置
|
|
735
|
+
*/
|
|
736
|
+
get position(): [number, number];
|
|
737
|
+
set position(value: [number, number]);
|
|
738
|
+
/**
|
|
739
|
+
* @description 宽度
|
|
740
|
+
*/
|
|
741
|
+
get width(): number;
|
|
742
|
+
set width(value: number);
|
|
743
|
+
/**
|
|
744
|
+
* @description 高度
|
|
745
|
+
*/
|
|
746
|
+
get height(): number;
|
|
747
|
+
set height(value: number);
|
|
748
|
+
/**
|
|
749
|
+
* @description 缩放
|
|
750
|
+
*/
|
|
751
|
+
get scale(): [number, number];
|
|
752
|
+
set scale(value: [number, number]);
|
|
753
|
+
/**
|
|
754
|
+
* @description 旋转(二维旋转角度)
|
|
755
|
+
*/
|
|
756
|
+
get rotation(): number;
|
|
757
|
+
set rotation(value: number);
|
|
758
|
+
/**
|
|
759
|
+
* @description 完整旋转(包含 x, y, z)
|
|
760
|
+
*/
|
|
761
|
+
get fullRotation(): [number, number, number];
|
|
762
|
+
set fullRotation(value: [number, number, number]);
|
|
763
|
+
/**
|
|
764
|
+
* @description 添加子元素
|
|
765
|
+
* @param itemId 子元素ID
|
|
766
|
+
* @returns 是否添加成功
|
|
767
|
+
*/
|
|
768
|
+
addChild(itemId: string): boolean;
|
|
769
|
+
/**
|
|
770
|
+
* @description 批量添加子元素
|
|
771
|
+
* @param itemIds 子元素ID列表
|
|
772
|
+
*/
|
|
773
|
+
addChildren(itemIds: string[]): void;
|
|
774
|
+
/**
|
|
775
|
+
* @description 移除子元素
|
|
776
|
+
* @param itemId 子元素ID
|
|
777
|
+
* @returns 是否移除成功
|
|
778
|
+
*/
|
|
779
|
+
removeChild(itemId: string): boolean;
|
|
780
|
+
/**
|
|
781
|
+
* @description 批量移除子元素
|
|
782
|
+
* @param itemIds 子元素ID列表
|
|
783
|
+
*/
|
|
784
|
+
removeChildren(itemIds: string[]): void;
|
|
785
|
+
/**
|
|
786
|
+
* @description 是否包含指定子元素
|
|
787
|
+
* @param itemId 子元素ID
|
|
788
|
+
*/
|
|
789
|
+
hasChild(itemId: string): boolean;
|
|
790
|
+
/**
|
|
791
|
+
* @description 清空所有子元素
|
|
792
|
+
*/
|
|
793
|
+
clearChildren(): void;
|
|
794
|
+
/**
|
|
795
|
+
* @description 转换为 FrameCreateInfo
|
|
796
|
+
* @param withParent 是否包含父节点ID
|
|
797
|
+
*/
|
|
798
|
+
toCreateInfo(withParent?: boolean): FrameCreateInfo;
|
|
799
|
+
/**
|
|
800
|
+
* @description 克隆 SDKItem
|
|
801
|
+
*/
|
|
802
|
+
clone(): FrameItem;
|
|
803
|
+
}
|
|
804
|
+
/**
|
|
805
|
+
* @description 类型守卫:检查是否是 FrameItem
|
|
806
|
+
*/
|
|
807
|
+
declare function isFrameItem(obj: any): obj is FrameItem;
|
|
808
|
+
|
|
700
809
|
/**
|
|
701
810
|
* @description 根据 item type 创建对应的 SDKItem 实例
|
|
702
811
|
* @param type 元素类型
|
|
@@ -708,7 +817,7 @@ declare function createSDKItem(type: spec.ItemType, options: SDKItemOptions): Ba
|
|
|
708
817
|
* @description SDKItem 类型联合
|
|
709
818
|
* @description 用于替换原来的 SDKItem type
|
|
710
819
|
*/
|
|
711
|
-
type SDKItem$1 = SpriteItem | TextItem | VideoItem | GroupItem | GeneratorItem | EffectsItem;
|
|
820
|
+
type SDKItem$1 = SpriteItem | TextItem | VideoItem | GroupItem | GeneratorItem | EffectsItem | FrameItem;
|
|
712
821
|
|
|
713
822
|
/**
|
|
714
823
|
* @class 二维线段
|
|
@@ -1243,6 +1352,26 @@ type GeneratorItemProperty = BaseItemProperty & {
|
|
|
1243
1352
|
type EffectsItemProperty = BaseItemProperty & {
|
|
1244
1353
|
effects: string;
|
|
1245
1354
|
};
|
|
1355
|
+
/**
|
|
1356
|
+
* @description Frame 画板元素布局模式
|
|
1357
|
+
*/
|
|
1358
|
+
declare enum FrameLayoutMode {
|
|
1359
|
+
AUTO = "auto",
|
|
1360
|
+
FREE = "free"
|
|
1361
|
+
}
|
|
1362
|
+
/**
|
|
1363
|
+
* @description Frame 画板元素属性
|
|
1364
|
+
*/
|
|
1365
|
+
type FrameItemProperty = BaseItemProperty & {
|
|
1366
|
+
/**
|
|
1367
|
+
* @description 布局模式: auto - 自动布局, free - 自由布局
|
|
1368
|
+
*/
|
|
1369
|
+
layoutMode: FrameLayoutMode;
|
|
1370
|
+
/**
|
|
1371
|
+
* @description 子元素ID数组
|
|
1372
|
+
*/
|
|
1373
|
+
children: string[];
|
|
1374
|
+
};
|
|
1246
1375
|
/**
|
|
1247
1376
|
* @description BaseItem 基础属性键名
|
|
1248
1377
|
*/
|
|
@@ -1269,7 +1398,7 @@ type ItemPropertyMap = {
|
|
|
1269
1398
|
[SDKItemType.GROUP]: GroupItemProperty;
|
|
1270
1399
|
[SDKItemType.GENERATOR]: GeneratorItemProperty;
|
|
1271
1400
|
[SDKItemType.EFFECTS]: EffectsItemProperty;
|
|
1272
|
-
[SDKItemType.FRAME]:
|
|
1401
|
+
[SDKItemType.FRAME]: FrameItemProperty;
|
|
1273
1402
|
};
|
|
1274
1403
|
/**
|
|
1275
1404
|
* @description 场景1:单个元素单个属性设置
|
|
@@ -1970,7 +2099,61 @@ type EffectsCreateInfo = {
|
|
|
1970
2099
|
*/
|
|
1971
2100
|
extension?: Record<string, any>;
|
|
1972
2101
|
};
|
|
1973
|
-
|
|
2102
|
+
/**
|
|
2103
|
+
* @description Frame 画板元素创建信息
|
|
2104
|
+
*/
|
|
2105
|
+
type FrameCreateInfo = {
|
|
2106
|
+
/**
|
|
2107
|
+
* @description 元素类型 - 画板
|
|
2108
|
+
*/
|
|
2109
|
+
type: SDKItemType.FRAME;
|
|
2110
|
+
/**
|
|
2111
|
+
* @description 元素名称
|
|
2112
|
+
*/
|
|
2113
|
+
name?: string;
|
|
2114
|
+
/**
|
|
2115
|
+
* @description 元素id
|
|
2116
|
+
*/
|
|
2117
|
+
id?: string;
|
|
2118
|
+
/**
|
|
2119
|
+
* @description 父元素id
|
|
2120
|
+
*/
|
|
2121
|
+
parentId?: string;
|
|
2122
|
+
/**
|
|
2123
|
+
* @description 元素属性
|
|
2124
|
+
*/
|
|
2125
|
+
property: {
|
|
2126
|
+
/**
|
|
2127
|
+
* @description 画板像素宽度
|
|
2128
|
+
*/
|
|
2129
|
+
width: number;
|
|
2130
|
+
/**
|
|
2131
|
+
* @description 画板像素高度
|
|
2132
|
+
*/
|
|
2133
|
+
height: number;
|
|
2134
|
+
/**
|
|
2135
|
+
* @description 画板位置
|
|
2136
|
+
*/
|
|
2137
|
+
position: [number, number];
|
|
2138
|
+
/**
|
|
2139
|
+
* @description 画板旋转 z | [x, y, z]
|
|
2140
|
+
*/
|
|
2141
|
+
rotation?: number | [number, number, number];
|
|
2142
|
+
/**
|
|
2143
|
+
* @description 画板缩放
|
|
2144
|
+
*/
|
|
2145
|
+
scale?: [number, number];
|
|
2146
|
+
/**
|
|
2147
|
+
* @description 布局模式: 'auto' | 'free'
|
|
2148
|
+
*/
|
|
2149
|
+
layoutMode?: FrameLayoutMode;
|
|
2150
|
+
};
|
|
2151
|
+
/**
|
|
2152
|
+
* @description 扩展属性
|
|
2153
|
+
*/
|
|
2154
|
+
extension?: Record<string, any>;
|
|
2155
|
+
};
|
|
2156
|
+
type ItemCreateInfo = GroupCreateInfo | SpriteCreateInfo | TextCreateInfo | VideoCreateInfo | GeneratorCreateInfo | EffectsCreateInfo | FrameCreateInfo;
|
|
1974
2157
|
/**
|
|
1975
2158
|
* @description 场景创建信息
|
|
1976
2159
|
*/
|
|
@@ -2707,7 +2890,26 @@ type VideoPlayGizmoConfig = {
|
|
|
2707
2890
|
height: number;
|
|
2708
2891
|
};
|
|
2709
2892
|
type ItemCreateGizmoConfig = {
|
|
2710
|
-
|
|
2893
|
+
/**
|
|
2894
|
+
* @description 边框颜色
|
|
2895
|
+
*/
|
|
2896
|
+
frameBorderColor: number;
|
|
2897
|
+
/**
|
|
2898
|
+
* @description 边框宽度
|
|
2899
|
+
*/
|
|
2900
|
+
frameBorderWidth: number;
|
|
2901
|
+
/**
|
|
2902
|
+
* @description 边框透明度
|
|
2903
|
+
*/
|
|
2904
|
+
frameBorderAlpha: number;
|
|
2905
|
+
/**
|
|
2906
|
+
* @description 填充颜色
|
|
2907
|
+
*/
|
|
2908
|
+
frameFillColor: number;
|
|
2909
|
+
/**
|
|
2910
|
+
* @description 填充透明度
|
|
2911
|
+
*/
|
|
2912
|
+
frameFillAlpha: number;
|
|
2711
2913
|
};
|
|
2712
2914
|
|
|
2713
2915
|
/**
|
|
@@ -2801,6 +3003,7 @@ type SDKEvents = {
|
|
|
2801
3003
|
'itemCreate': [{
|
|
2802
3004
|
type: ItemCreateType;
|
|
2803
3005
|
position: spec.vec2;
|
|
3006
|
+
id: string;
|
|
2804
3007
|
}];
|
|
2805
3008
|
'viewLost': [];
|
|
2806
3009
|
'viewRebuildFinish': [];
|
|
@@ -3078,21 +3281,14 @@ declare class SDK {
|
|
|
3078
3281
|
* @param extensions 扩展属性对象(支持同时设置多个)
|
|
3079
3282
|
* @returns 是否设置成功
|
|
3080
3283
|
*/
|
|
3081
|
-
|
|
3284
|
+
setItemExtension(id: string, extension: Record<string, any>): boolean;
|
|
3082
3285
|
/**
|
|
3083
3286
|
* @description 批量获取元素扩展属性
|
|
3084
3287
|
* @param id 元素ID
|
|
3085
3288
|
* @param keys 扩展属性名称列表(不传则返回所有扩展属性)
|
|
3086
3289
|
* @returns 扩展属性对象
|
|
3087
3290
|
*/
|
|
3088
|
-
|
|
3089
|
-
/**
|
|
3090
|
-
* @description 获取单个元素扩展属性
|
|
3091
|
-
* @param id 元素ID
|
|
3092
|
-
* @param key 扩展属性名称
|
|
3093
|
-
* @returns 扩展属性值
|
|
3094
|
-
*/
|
|
3095
|
-
getItemExtension(id: string, key: string): any;
|
|
3291
|
+
getItemExtension(id: string, keys?: string[]): Record<string, any> | undefined;
|
|
3096
3292
|
/**
|
|
3097
3293
|
* @description 删除元素扩展属性(支持批量删除)
|
|
3098
3294
|
* @param id 元素ID
|
|
@@ -3175,6 +3371,12 @@ declare class SDK {
|
|
|
3175
3371
|
* @param effectsInfo 动效创建信息
|
|
3176
3372
|
*/
|
|
3177
3373
|
addEffectsItem(effectsInfo: EffectsCreateInfo): Promise<string | undefined>;
|
|
3374
|
+
/**
|
|
3375
|
+
* @description 创建画板元素
|
|
3376
|
+
* @param createInfo 画板创建信息
|
|
3377
|
+
* @returns 画板元素ID
|
|
3378
|
+
*/
|
|
3379
|
+
addFrameItem(createInfo: FrameCreateInfo): string;
|
|
3178
3380
|
/**
|
|
3179
3381
|
* @description 设置生成器资源,将生成器转换为对应的元素
|
|
3180
3382
|
* @param id 生成器元素ID
|
|
@@ -3205,4 +3407,4 @@ declare class SDK {
|
|
|
3205
3407
|
setSafeAreaPreviewVisible(id: number, type: 'url' | 'color', visible: boolean): void;
|
|
3206
3408
|
}
|
|
3207
3409
|
|
|
3208
|
-
export { type ActiveData, BaseItem, type BaseItemProperty, type BaseItemPropertyKey, type BaseItemPropertyValueMap, Box2, type CreateOperation, type DeleteOperation, type EffectsCreateInfo, EffectsItem, type EffectsItemOptions, type GeneratorCreateInfo, GeneratorItem, type GeneratorItemOptions, type GeneratorItemProperty, type GizmoType, type GroupCreateInfo, GroupItem, type GroupItemOptions, type ItemCreateInfo, ItemOrderAction, type ItemPropertyMap, type Operation, type PageData, type PageProperty, SDK, type SDKEvents, type SDKInputParam, type SDKItem$1 as SDKItem, type SDKItemOptions, SDKItemType, type SDKOptions, type SetItemPropertyParam, type SetSingleItemMultiplePropertiesParam, type SetSingleItemSinglePropertyParam, type SpriteCreateInfo, SpriteItem, type SpriteItemOptions, type SpriteItemProperty, type TextCreateInfo, TextItem, type TextItemOptions, type TextItemProperty, type UpdateOperation, Vector2, type VideoCreateInfo, VideoItem, type VideoItemOptions, type VideoItemProperty, type ViewParam, type ViewProperty, createSDKItem, isBaseItem, isEffectsItem, isGeneratorItem, isGroupItem, isSpriteItem, isTextItem, isVideoItem };
|
|
3410
|
+
export { type ActiveData, BaseItem, type BaseItemProperty, type BaseItemPropertyKey, type BaseItemPropertyValueMap, Box2, type CreateOperation, type DeleteOperation, type EffectsCreateInfo, EffectsItem, type EffectsItemOptions, type FrameCreateInfo, FrameItem, type FrameItemOptions, type FrameItemProperty, FrameLayoutMode, type GeneratorCreateInfo, GeneratorItem, type GeneratorItemOptions, type GeneratorItemProperty, type GizmoType, type GroupCreateInfo, GroupItem, type GroupItemOptions, type ItemCreateInfo, ItemOrderAction, type ItemPropertyMap, type Operation, type PageData, type PageProperty, SDK, type SDKEvents, type SDKInputParam, type SDKItem$1 as SDKItem, type SDKItemOptions, SDKItemType, type SDKOptions, type SetItemPropertyParam, type SetSingleItemMultiplePropertiesParam, type SetSingleItemSinglePropertyParam, type SpriteCreateInfo, SpriteItem, type SpriteItemOptions, type SpriteItemProperty, type TextCreateInfo, TextItem, type TextItemOptions, type TextItemProperty, type UpdateOperation, Vector2, type VideoCreateInfo, VideoItem, type VideoItemOptions, type VideoItemProperty, type ViewParam, type ViewProperty, createSDKItem, isBaseItem, isEffectsItem, isFrameItem, isGeneratorItem, isGroupItem, isSpriteItem, isTextItem, isVideoItem };
|