@vvfx/sdk 0.1.19-alpha.36 → 0.1.19-alpha.38
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/LICENSE +22 -0
- package/dist/index.js +87037 -14
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +87141 -0
- package/dist/index.mjs.map +1 -0
- package/dist/src/config.d.ts +855 -0
- package/dist/src/exporter/config.d.ts +18 -0
- package/dist/src/exporter/const.d.ts +71 -0
- package/dist/src/exporter/export-media.d.ts +68 -0
- package/dist/src/exporter/exporter.d.ts +22 -0
- package/dist/src/exporter/index.d.ts +2 -0
- package/dist/src/exporter/types.d.ts +194 -0
- package/dist/src/exporter/utils.d.ts +22 -0
- package/dist/src/exporter/wav-audio.d.ts +27 -0
- package/dist/src/gesture-handler/gizmo/adsorption-gizmo.d.ts +68 -0
- package/dist/src/gesture-handler/gizmo/control-gizmo.d.ts +67 -0
- package/dist/src/gesture-handler/gizmo/gizmo.d.ts +59 -0
- package/dist/src/gesture-handler/gizmo/icon-gizmo.d.ts +44 -0
- package/dist/src/gesture-handler/gizmo/index.d.ts +6 -0
- package/dist/src/gesture-handler/gizmo/item-create-gizmo.d.ts +43 -0
- package/dist/src/gesture-handler/gizmo/loading-gizmo.d.ts +48 -0
- package/dist/src/gesture-handler/gizmo/mask-gizmo.d.ts +113 -0
- package/dist/src/gesture-handler/gizmo/picture-cut-gizmo.d.ts +94 -0
- package/dist/src/gesture-handler/gizmo/picture-expand-gizmo.d.ts +57 -0
- package/dist/src/gesture-handler/gizmo/preference-gizmo.d.ts +32 -0
- package/dist/src/gesture-handler/gizmo/selector-gizmo.d.ts +101 -0
- package/dist/src/gesture-handler/gizmo/sprite-text-edit-gizmo.d.ts +36 -0
- package/dist/src/gesture-handler/gizmo/text-gizmo.d.ts +128 -0
- package/dist/src/gesture-handler/gizmo/transform-gizmo.d.ts +233 -0
- package/dist/src/gesture-handler/gizmo/type.d.ts +402 -0
- package/dist/src/gesture-handler/index.d.ts +3 -0
- package/dist/src/gesture-handler/src/gesture-handler.d.ts +143 -0
- package/dist/src/gesture-handler/src/icons.d.ts +7 -0
- package/dist/src/gesture-handler/utils.d.ts +2 -0
- package/dist/src/html-overlay/document-runtime.d.ts +3 -0
- package/dist/src/html-overlay/document-transform.d.ts +7 -0
- package/dist/src/html-overlay/index.d.ts +1 -0
- package/dist/src/html-overlay/manager.d.ts +43 -0
- package/dist/src/html-overlay/mime-utils.d.ts +2 -0
- package/dist/src/html-overlay/path-utils.d.ts +8 -0
- package/dist/src/index.d.ts +14 -0
- package/dist/src/math/box2.d.ts +166 -0
- package/dist/src/math/circle.d.ts +82 -0
- package/dist/src/math/euler.d.ts +20 -0
- package/dist/src/math/index.d.ts +13 -0
- package/dist/src/math/line2.d.ts +93 -0
- package/dist/src/math/line3.d.ts +17 -0
- package/dist/src/math/matrix4.d.ts +28 -0
- package/dist/src/math/plane.d.ts +14 -0
- package/dist/src/math/quaternion.d.ts +3 -0
- package/dist/src/math/ray-caster.d.ts +10 -0
- package/dist/src/math/ray.d.ts +18 -0
- package/dist/src/math/type.d.ts +32 -0
- package/dist/src/math/utils.d.ts +19 -0
- package/dist/src/math/vector2.d.ts +30 -0
- package/dist/src/math/vector3.d.ts +29 -0
- package/dist/src/screen-shot/index.d.ts +1 -0
- package/dist/src/screen-shot/screen-shot.d.ts +35 -0
- package/dist/src/sdk-item/base-item.d.ts +126 -0
- package/dist/src/sdk-item/card-item.d.ts +57 -0
- package/dist/src/sdk-item/effects-item.d.ts +70 -0
- package/dist/src/sdk-item/frame-item.d.ts +112 -0
- package/dist/src/sdk-item/generator-item.d.ts +86 -0
- package/dist/src/sdk-item/group-item.d.ts +57 -0
- package/dist/src/sdk-item/index.d.ts +36 -0
- package/dist/src/sdk-item/sprite-item.d.ts +67 -0
- package/dist/src/sdk-item/text-item.d.ts +107 -0
- package/dist/src/sdk-item/types.d.ts +153 -0
- package/dist/src/sdk-item/video-item.d.ts +87 -0
- package/dist/src/sdk.d.ts +589 -0
- package/dist/src/service/UndoRedo.d.ts +48 -0
- package/dist/src/shared/index.d.ts +1 -0
- package/dist/src/shared/player.d.ts +9 -0
- package/dist/src/size-adapte/index.d.ts +1 -0
- package/dist/src/size-adapte/size-adapt.d.ts +28 -0
- package/dist/src/types.d.ts +1235 -0
- package/dist/src/utils/background-manager.d.ts +72 -0
- package/dist/src/utils/common-utils.d.ts +28 -0
- package/dist/src/utils/index.d.ts +8 -0
- package/dist/src/utils/interaction-utils.d.ts +60 -0
- package/dist/src/utils/json-data-utils.d.ts +165 -0
- package/dist/src/utils/layout-utils.d.ts +219 -0
- package/dist/src/utils/page-data-utils.d.ts +370 -0
- package/dist/src/utils/player-data-utils.d.ts +11 -0
- package/dist/src/utils/types.d.ts +114 -0
- package/dist/src/wireframe/common/box.d.ts +1 -0
- package/dist/src/wireframe/common/dashed-line.d.ts +1 -0
- package/dist/src/wireframe/common/line.d.ts +1 -0
- package/dist/src/wireframe/common/pixi-ext.d.ts +11 -0
- package/dist/src/wireframe/common/pixi.d.ts +18 -0
- package/dist/src/wireframe/index.d.ts +4 -0
- package/package.json +41 -23
- package/dist/index.cjs +0 -14
- package/dist/index.d.cts +0 -4891
- package/dist/index.d.ts +0 -4891
- package/dist/index.global.js +0 -333
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Vector3 } from './vector3';
|
|
2
|
+
export declare class Plane {
|
|
3
|
+
distance: number;
|
|
4
|
+
normal: Vector3;
|
|
5
|
+
constructor(distance?: number, normal?: Vector3);
|
|
6
|
+
static set(distance: number, normal: Vector3): Plane;
|
|
7
|
+
set(distance: number, normal: Vector3): this;
|
|
8
|
+
static copy(target: Plane): Plane;
|
|
9
|
+
copy(target: Plane): this;
|
|
10
|
+
static setFromNormalAndCoplanarPoint(point: Vector3, normal: Vector3): Plane;
|
|
11
|
+
setFromNormalAndCoplanarPoint(point: Vector3, normal: Vector3): this;
|
|
12
|
+
clone(): Plane;
|
|
13
|
+
distanceToPoint(point: Vector3): number;
|
|
14
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Plane } from './plane';
|
|
2
|
+
import { Ray } from './ray';
|
|
3
|
+
import type { RayCasterCamera, RayCastResult } from './type';
|
|
4
|
+
import type { Vector2 } from './vector2';
|
|
5
|
+
export declare class RayCaster {
|
|
6
|
+
ray: Ray;
|
|
7
|
+
constructor(ray?: Ray);
|
|
8
|
+
setFromCamera(coords: Vector2, camera: RayCasterCamera): this;
|
|
9
|
+
rayCastPlane(plane: Plane): RayCastResult | undefined;
|
|
10
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { math } from '../shared';
|
|
2
|
+
import type { Plane } from './plane';
|
|
3
|
+
import { Vector3 } from './vector3';
|
|
4
|
+
export declare class Ray extends math.Ray {
|
|
5
|
+
origin: Vector3;
|
|
6
|
+
direction: Vector3;
|
|
7
|
+
constructor(origin?: Vector3, direction?: Vector3);
|
|
8
|
+
clone(): Ray;
|
|
9
|
+
rayCastPlane(plane: Plane, _target: Vector3): number;
|
|
10
|
+
at(t: number): Vector3;
|
|
11
|
+
/**
|
|
12
|
+
* 射线到平面的距离
|
|
13
|
+
* 当两个向量都是单位向量的时候,从a投影到b的距离等于从b投影到a的距离
|
|
14
|
+
* @param plane 平面
|
|
15
|
+
* @returns 射线到平面的距离
|
|
16
|
+
*/
|
|
17
|
+
distanceToPlane(plane: Plane): number;
|
|
18
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Matrix4 } from './matrix4';
|
|
2
|
+
import type { Vector3 } from './vector3';
|
|
3
|
+
/**
|
|
4
|
+
* 射线碰撞相机参数
|
|
5
|
+
*/
|
|
6
|
+
export type RayCasterCamera = {
|
|
7
|
+
/**
|
|
8
|
+
* 位置
|
|
9
|
+
*/
|
|
10
|
+
position: Vector3;
|
|
11
|
+
/**
|
|
12
|
+
* 视图投影逆矩阵
|
|
13
|
+
*/
|
|
14
|
+
inverseViewProjectMatrix: Matrix4;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* 射线碰撞结果
|
|
18
|
+
*/
|
|
19
|
+
export type RayCastResult = {
|
|
20
|
+
/**
|
|
21
|
+
* 相交点
|
|
22
|
+
*/
|
|
23
|
+
point: Vector3;
|
|
24
|
+
/**
|
|
25
|
+
* 相交距离
|
|
26
|
+
*/
|
|
27
|
+
distance: number;
|
|
28
|
+
/**
|
|
29
|
+
* 相交构件ID
|
|
30
|
+
*/
|
|
31
|
+
id?: string;
|
|
32
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Box2 } from './box2';
|
|
2
|
+
import { Vector2 } from './vector2';
|
|
3
|
+
export declare function clamp(value: number, min: number, max: number): number;
|
|
4
|
+
/**
|
|
5
|
+
* @description 角度转弧度系数
|
|
6
|
+
*/
|
|
7
|
+
export declare const DEG2RAD: number;
|
|
8
|
+
/**
|
|
9
|
+
* @description 弧度转角度系数
|
|
10
|
+
*/
|
|
11
|
+
export declare const RAD2DEG: number;
|
|
12
|
+
export declare function getVector2Angle(vector: Vector2): number;
|
|
13
|
+
export declare function getAngleByVectors(vector1: Vector2, vector2: Vector2): number;
|
|
14
|
+
export declare function roundNumber(number: number, precision: number, method?: (x: number) => number): number;
|
|
15
|
+
export declare function getAbsMaxIndex(numbers: number[]): number;
|
|
16
|
+
export declare function isEqual(a: number, b: number): boolean;
|
|
17
|
+
export declare function isZero(v: number): boolean;
|
|
18
|
+
export declare function getBoxByNormalizeBox(origin: Box2, normalize: Box2): Box2;
|
|
19
|
+
export declare function getNormalizeBoxByBoxes(origin: Box2, current: Box2): Box2;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { math } from '../shared';
|
|
2
|
+
import { Line2 } from './line2';
|
|
3
|
+
export declare class Vector2 extends math.Vector2 {
|
|
4
|
+
subtract(other: Vector2): this;
|
|
5
|
+
toViewCoordinate(width: number, height: number): this;
|
|
6
|
+
clone(): Vector2;
|
|
7
|
+
distanceTo(other: Vector2): number;
|
|
8
|
+
scaleByCenter(scalar: Vector2, anchor?: Vector2): this;
|
|
9
|
+
round(precision?: number): this;
|
|
10
|
+
/**
|
|
11
|
+
* 点到直线的最短距离
|
|
12
|
+
* @returns {{d: number, t: number}} d表示距离,t表示最近点在直线的比例
|
|
13
|
+
*/
|
|
14
|
+
distanceToLine(line: Line2): {
|
|
15
|
+
d: number;
|
|
16
|
+
t: number;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* 二维向量与x轴夹角
|
|
20
|
+
* @returns {number} 弧度值
|
|
21
|
+
*/
|
|
22
|
+
angle(): number;
|
|
23
|
+
/**
|
|
24
|
+
* 二维点绕点旋转
|
|
25
|
+
* @param {Vec2} center 旋转中心
|
|
26
|
+
* @param {number} angle 旋转角度
|
|
27
|
+
* @returns {Vec2} 旋转结果
|
|
28
|
+
*/
|
|
29
|
+
rotateAround(center: Vector2, angle: number): this;
|
|
30
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { math } from '../shared';
|
|
2
|
+
import type { Euler } from './euler';
|
|
3
|
+
import type { Matrix4 } from './matrix4';
|
|
4
|
+
import { Quaternion } from './quaternion';
|
|
5
|
+
export declare class Vector3 extends math.Vector3 {
|
|
6
|
+
clone(): Vector3;
|
|
7
|
+
/**
|
|
8
|
+
* 由空间变换矩阵保存三维分量
|
|
9
|
+
* @param {Matrix4} m 四维矩阵
|
|
10
|
+
* @param {number} index 下标
|
|
11
|
+
* @returns {Vec3} 指定三维分量
|
|
12
|
+
*/
|
|
13
|
+
setFromMatrixColumn(m: Matrix4, index: number): this;
|
|
14
|
+
applyEuler(euler: Euler, _out?: Vector3): this;
|
|
15
|
+
/**
|
|
16
|
+
* 三维点根据四元数绕点的旋转
|
|
17
|
+
* @param {Quaternion} q 四元数
|
|
18
|
+
* @param {Vec3} [center=new Vec3()] 旋转中心
|
|
19
|
+
* @returns {Vec3} 旋转结果
|
|
20
|
+
*/
|
|
21
|
+
applyQuaternion(q: Quaternion, center?: Vector3): this;
|
|
22
|
+
/**
|
|
23
|
+
* 由空间变换矩阵保存三维偏移值
|
|
24
|
+
* @param {Matrix4} m 四维矩阵
|
|
25
|
+
* @returns {Vec3} 偏移值
|
|
26
|
+
*/
|
|
27
|
+
setFromMatrixPosition(m: Matrix4): this;
|
|
28
|
+
applyMatrix(matrix: Matrix4, center?: Vector3): this;
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './screen-shot';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { spec } from '../shared';
|
|
2
|
+
/**
|
|
3
|
+
* @description 截图工具
|
|
4
|
+
*/
|
|
5
|
+
export declare class ScreenShot {
|
|
6
|
+
/**
|
|
7
|
+
* @description 功能开关
|
|
8
|
+
*/
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* @description 截图播放器
|
|
12
|
+
*/
|
|
13
|
+
private _player;
|
|
14
|
+
/**
|
|
15
|
+
* @description 截图播放器容器
|
|
16
|
+
*/
|
|
17
|
+
private _container;
|
|
18
|
+
constructor();
|
|
19
|
+
/**
|
|
20
|
+
* @description 生成截图
|
|
21
|
+
* @param scene 场景数据
|
|
22
|
+
* @param resultSize 截图大小
|
|
23
|
+
* @param tick 截图时刻
|
|
24
|
+
* @param screenArea 截图范围【可选】 - [左上角x坐标, 左上角y坐标, 截图宽度, 截图高度]
|
|
25
|
+
* @returns 截图base64数据
|
|
26
|
+
*/
|
|
27
|
+
generate(scene: spec.JSONScene | string, containerSize: spec.vec2, resultSize: spec.vec2, tick: number, background?: spec.vec4): Promise<string | undefined>;
|
|
28
|
+
dispose(): void;
|
|
29
|
+
drawImageCover(ctx: CanvasRenderingContext2D, img: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, x: number, y: number, w: number, h: number, offsetX?: number, offsetY?: number, sourceRect?: {
|
|
30
|
+
left: number;
|
|
31
|
+
top: number;
|
|
32
|
+
width: number;
|
|
33
|
+
height: number;
|
|
34
|
+
}): void;
|
|
35
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import type { BaseItemProperty, ItemCreateInfo } from '../types';
|
|
2
|
+
import { spec } from '../shared';
|
|
3
|
+
import type { SDKItemOptions, SDKItemType } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* @description SDKItem 抽象基类
|
|
6
|
+
* @description 支持属性扩展,允许添加任意自定义属性
|
|
7
|
+
*/
|
|
8
|
+
export declare abstract class BaseItem {
|
|
9
|
+
/**
|
|
10
|
+
* @description 元素ID
|
|
11
|
+
*/
|
|
12
|
+
id: string;
|
|
13
|
+
/**
|
|
14
|
+
* @description 元素名称
|
|
15
|
+
*/
|
|
16
|
+
name: string;
|
|
17
|
+
/**
|
|
18
|
+
* @description 父节点ID
|
|
19
|
+
*/
|
|
20
|
+
parentId?: string;
|
|
21
|
+
/**
|
|
22
|
+
* @description 元素生命周期
|
|
23
|
+
*/
|
|
24
|
+
duration: number;
|
|
25
|
+
/**
|
|
26
|
+
* @description 元素生命周期延时
|
|
27
|
+
*/
|
|
28
|
+
delay: number;
|
|
29
|
+
/**
|
|
30
|
+
* @description 元素结束行为
|
|
31
|
+
*/
|
|
32
|
+
endBehavior: spec.EndBehavior;
|
|
33
|
+
/**
|
|
34
|
+
* @description 是否可见
|
|
35
|
+
*/
|
|
36
|
+
visible: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* @description 是否处于锁定状态
|
|
39
|
+
*/
|
|
40
|
+
isLocked: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* @description 核心数据是否支持编辑
|
|
43
|
+
*/
|
|
44
|
+
isCoreEditable: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* @description 扩展属性存储(与 property 同级)
|
|
47
|
+
*/
|
|
48
|
+
extension: Map<string, any>;
|
|
49
|
+
/**
|
|
50
|
+
* @description 元素类型(由子类实现)
|
|
51
|
+
* @description 支持 spec.ItemType 或扩展的 SDKItemType
|
|
52
|
+
*/
|
|
53
|
+
abstract readonly type: SDKItemType;
|
|
54
|
+
/**
|
|
55
|
+
* @description 元素属性(由子类实现)
|
|
56
|
+
*/
|
|
57
|
+
abstract readonly property: BaseItemProperty;
|
|
58
|
+
constructor(options: SDKItemOptions);
|
|
59
|
+
get pixelWidth(): number;
|
|
60
|
+
get pixelHeight(): number;
|
|
61
|
+
/**
|
|
62
|
+
* @description 设置扩展属性
|
|
63
|
+
* @param key 属性名
|
|
64
|
+
* @param value 属性值
|
|
65
|
+
*/
|
|
66
|
+
setExtension(key: string, value: any): void;
|
|
67
|
+
/**
|
|
68
|
+
* @description 获取扩展属性
|
|
69
|
+
* @param key 属性名
|
|
70
|
+
* @returns 属性值
|
|
71
|
+
*/
|
|
72
|
+
getExtension(key: string): any;
|
|
73
|
+
/**
|
|
74
|
+
* @description 检查是否存在指定扩展属性
|
|
75
|
+
* @param key 属性名
|
|
76
|
+
* @returns 是否存在
|
|
77
|
+
*/
|
|
78
|
+
hasExtension(key: string): boolean;
|
|
79
|
+
/**
|
|
80
|
+
* @description 删除扩展属性
|
|
81
|
+
* @param key 属性名
|
|
82
|
+
* @returns 是否删除成功
|
|
83
|
+
*/
|
|
84
|
+
deleteExtension(key: string): boolean;
|
|
85
|
+
/**
|
|
86
|
+
* @description 获取所有扩展属性的键名列表
|
|
87
|
+
* @returns 键名数组
|
|
88
|
+
*/
|
|
89
|
+
getExtensionKeys(): string[];
|
|
90
|
+
/**
|
|
91
|
+
* @description 获取所有扩展属性
|
|
92
|
+
* @returns 扩展属性对象
|
|
93
|
+
*/
|
|
94
|
+
getAllExtension(): Record<string, any>;
|
|
95
|
+
/**
|
|
96
|
+
* @description 批量设置扩展属性
|
|
97
|
+
* @param extensions 扩展属性对象
|
|
98
|
+
*/
|
|
99
|
+
setExtensions(extensions: Record<string, any>): void;
|
|
100
|
+
/**
|
|
101
|
+
* @description 清空所有扩展属性
|
|
102
|
+
*/
|
|
103
|
+
clearExtension(): void;
|
|
104
|
+
/**
|
|
105
|
+
* @description 转换为 CreateInfo(用于元素复制/导出)
|
|
106
|
+
* @param withParent 是否包含父节点ID
|
|
107
|
+
* @returns CreateInfo 对象
|
|
108
|
+
*/
|
|
109
|
+
abstract toCreateInfo(withParent?: boolean): ItemCreateInfo;
|
|
110
|
+
/**
|
|
111
|
+
* @description 克隆 SDKItem
|
|
112
|
+
* @returns 新的 SDKItem 实例
|
|
113
|
+
*/
|
|
114
|
+
abstract clone(): BaseItem;
|
|
115
|
+
/**
|
|
116
|
+
* @description 获取基础属性的 JSON 对象,转换为普通对象(用于序列化)
|
|
117
|
+
* @returns 普通对象
|
|
118
|
+
*/
|
|
119
|
+
toJSON(): Record<string, any>;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* @description 类型守卫函数:检查对象是否是 BaseItem
|
|
123
|
+
* @param obj 要检查的对象
|
|
124
|
+
* @returns 是否是 BaseItem 实例
|
|
125
|
+
*/
|
|
126
|
+
export declare function isBaseItem(obj: any): obj is BaseItem;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { CardItemProperty, CardCreateInfo, CardHTMLContent } from '../types';
|
|
2
|
+
import { SDKItemType, type CardItemOptions } from './types';
|
|
3
|
+
import { BaseItem } from './base-item';
|
|
4
|
+
/**
|
|
5
|
+
* @description 卡片元素 SDKItem 类
|
|
6
|
+
* @description 在 Player 中以 SpriteItem 形式渲染(透明占位,无图)
|
|
7
|
+
* @description 支持设置卡片类型(cardType)
|
|
8
|
+
*/
|
|
9
|
+
export declare class CardItem extends BaseItem {
|
|
10
|
+
/**
|
|
11
|
+
* @description 元素类型
|
|
12
|
+
*/
|
|
13
|
+
readonly type = SDKItemType.CARD;
|
|
14
|
+
/**
|
|
15
|
+
* @description 元素属性(包含 cardType)
|
|
16
|
+
*/
|
|
17
|
+
property: CardItemProperty;
|
|
18
|
+
constructor(options: CardItemOptions);
|
|
19
|
+
/**
|
|
20
|
+
* @description 卡片类型
|
|
21
|
+
*/
|
|
22
|
+
get cardType(): string;
|
|
23
|
+
set cardType(value: string);
|
|
24
|
+
/**
|
|
25
|
+
* @description HTML 覆盖层内容
|
|
26
|
+
*/
|
|
27
|
+
get htmlContent(): CardHTMLContent | undefined;
|
|
28
|
+
set htmlContent(value: CardHTMLContent | undefined);
|
|
29
|
+
/**
|
|
30
|
+
* @description 位置
|
|
31
|
+
*/
|
|
32
|
+
get position(): [number, number];
|
|
33
|
+
set position(value: [number, number]);
|
|
34
|
+
/**
|
|
35
|
+
* @description 宽度
|
|
36
|
+
*/
|
|
37
|
+
get width(): number;
|
|
38
|
+
set width(value: number);
|
|
39
|
+
/**
|
|
40
|
+
* @description 高度
|
|
41
|
+
*/
|
|
42
|
+
get height(): number;
|
|
43
|
+
set height(value: number);
|
|
44
|
+
/**
|
|
45
|
+
* @description 转换为 CardCreateInfo
|
|
46
|
+
* @param withParent 是否包含父节点ID
|
|
47
|
+
*/
|
|
48
|
+
toCreateInfo(withParent?: boolean): CardCreateInfo;
|
|
49
|
+
/**
|
|
50
|
+
* @description 克隆 SDKItem
|
|
51
|
+
*/
|
|
52
|
+
clone(): CardItem;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* @description 类型守卫:检查是否是 CardItem
|
|
56
|
+
*/
|
|
57
|
+
export declare function isCardItem(obj: any): obj is CardItem;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { EffectsCreateInfo, EffectsItemProperty } from '../types';
|
|
2
|
+
import { SDKItemType, EffectsItemOptions } from './types';
|
|
3
|
+
import { BaseItem } from './base-item';
|
|
4
|
+
/**
|
|
5
|
+
* @description 特效产物 元素 SDKItem 类
|
|
6
|
+
*/
|
|
7
|
+
export declare class EffectsItem extends BaseItem {
|
|
8
|
+
/**
|
|
9
|
+
* @description 元素类型(独立类型,不属于 spec.ItemType)
|
|
10
|
+
*/
|
|
11
|
+
readonly type = SDKItemType.EFFECTS;
|
|
12
|
+
/**
|
|
13
|
+
* @description 预合成元素ID
|
|
14
|
+
*/
|
|
15
|
+
subCompositionItemId: string;
|
|
16
|
+
/**
|
|
17
|
+
* @description 元素属性
|
|
18
|
+
*/
|
|
19
|
+
property: EffectsItemProperty;
|
|
20
|
+
constructor(options: EffectsItemOptions);
|
|
21
|
+
/**
|
|
22
|
+
* @description 特效资源地址
|
|
23
|
+
*/
|
|
24
|
+
get effects(): string;
|
|
25
|
+
set effects(value: string);
|
|
26
|
+
/**
|
|
27
|
+
* @description 位置
|
|
28
|
+
*/
|
|
29
|
+
get position(): [number, number];
|
|
30
|
+
set position(value: [number, number]);
|
|
31
|
+
/**
|
|
32
|
+
* @description 宽度
|
|
33
|
+
*/
|
|
34
|
+
get width(): number;
|
|
35
|
+
set width(value: number);
|
|
36
|
+
/**
|
|
37
|
+
* @description 高度
|
|
38
|
+
*/
|
|
39
|
+
get height(): number;
|
|
40
|
+
set height(value: number);
|
|
41
|
+
/**
|
|
42
|
+
* @description 旋转(二维旋转角度)
|
|
43
|
+
*/
|
|
44
|
+
get rotation(): number;
|
|
45
|
+
set rotation(value: number);
|
|
46
|
+
/**
|
|
47
|
+
* @description 完整旋转(包含 x, y, z)
|
|
48
|
+
*/
|
|
49
|
+
get fullRotation(): [number, number, number];
|
|
50
|
+
set fullRotation(value: [number, number, number]);
|
|
51
|
+
/**
|
|
52
|
+
* @description 是否正在编辑关键属性
|
|
53
|
+
* @deprecated 该属性即将废弃,使用 isCoreEditable 代替
|
|
54
|
+
*/
|
|
55
|
+
get keyPropertyEditing(): boolean;
|
|
56
|
+
set keyPropertyEditing(value: boolean);
|
|
57
|
+
/**
|
|
58
|
+
* @description 转换为 EffectsCreateInfo
|
|
59
|
+
* @param withParent 是否包含父节点ID
|
|
60
|
+
*/
|
|
61
|
+
toCreateInfo(withParent?: boolean): EffectsCreateInfo;
|
|
62
|
+
/**
|
|
63
|
+
* @description 克隆 SDKItem
|
|
64
|
+
*/
|
|
65
|
+
clone(): EffectsItem;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* @description 类型守卫:检查是否是 EffectsItem
|
|
69
|
+
*/
|
|
70
|
+
export declare function isEffectsItem(obj: any): obj is EffectsItem;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type { FrameCreateInfo, LayoutInfo } from '../types';
|
|
2
|
+
import { FrameItemProperty, FrameLayoutMode } from '../types';
|
|
3
|
+
import { SDKItemType, FrameItemOptions } from './types';
|
|
4
|
+
import { BaseItem } from './base-item';
|
|
5
|
+
/**
|
|
6
|
+
* @description 画板/框架元素 SDKItem 类
|
|
7
|
+
* @description 支持自动布局和自由布局两种模式
|
|
8
|
+
* @description 底层以 composition 形式渲染
|
|
9
|
+
*/
|
|
10
|
+
export declare class FrameItem extends BaseItem {
|
|
11
|
+
/**
|
|
12
|
+
* @description 元素类型
|
|
13
|
+
*/
|
|
14
|
+
readonly type = SDKItemType.FRAME;
|
|
15
|
+
/**
|
|
16
|
+
* @description 预合成元素ID
|
|
17
|
+
*/
|
|
18
|
+
subCompositionItemId: string;
|
|
19
|
+
/**
|
|
20
|
+
* @description 元素属性
|
|
21
|
+
*/
|
|
22
|
+
property: FrameItemProperty;
|
|
23
|
+
constructor(options: FrameItemOptions);
|
|
24
|
+
/**
|
|
25
|
+
* @description 子元素ID列表(只读)
|
|
26
|
+
*/
|
|
27
|
+
get children(): readonly string[];
|
|
28
|
+
/**
|
|
29
|
+
* @description 布局模式
|
|
30
|
+
*/
|
|
31
|
+
get layoutMode(): FrameLayoutMode;
|
|
32
|
+
set layoutMode(value: FrameLayoutMode);
|
|
33
|
+
/**
|
|
34
|
+
* @description 布局信息
|
|
35
|
+
*/
|
|
36
|
+
get layoutInfos(): Record<string, LayoutInfo> | undefined;
|
|
37
|
+
set layoutInfos(info: Record<string, LayoutInfo> | undefined);
|
|
38
|
+
/**
|
|
39
|
+
* @description 位置
|
|
40
|
+
*/
|
|
41
|
+
get position(): [number, number];
|
|
42
|
+
set position(value: [number, number]);
|
|
43
|
+
/**
|
|
44
|
+
* @description 宽度
|
|
45
|
+
*/
|
|
46
|
+
get width(): number;
|
|
47
|
+
set width(value: number);
|
|
48
|
+
/**
|
|
49
|
+
* @description 高度
|
|
50
|
+
*/
|
|
51
|
+
get height(): number;
|
|
52
|
+
set height(value: number);
|
|
53
|
+
/**
|
|
54
|
+
* @description 缩放
|
|
55
|
+
*/
|
|
56
|
+
get scale(): [number, number];
|
|
57
|
+
set scale(value: [number, number]);
|
|
58
|
+
/**
|
|
59
|
+
* @description 旋转(二维旋转角度)
|
|
60
|
+
*/
|
|
61
|
+
get rotation(): number;
|
|
62
|
+
set rotation(value: number);
|
|
63
|
+
/**
|
|
64
|
+
* @description 完整旋转(包含 x, y, z)
|
|
65
|
+
*/
|
|
66
|
+
get fullRotation(): [number, number, number];
|
|
67
|
+
set fullRotation(value: [number, number, number]);
|
|
68
|
+
/**
|
|
69
|
+
* @description 添加子元素
|
|
70
|
+
* @param itemId 子元素ID
|
|
71
|
+
* @returns 是否添加成功
|
|
72
|
+
*/
|
|
73
|
+
addChild(itemId: string): boolean;
|
|
74
|
+
/**
|
|
75
|
+
* @description 批量添加子元素
|
|
76
|
+
* @param itemIds 子元素ID列表
|
|
77
|
+
*/
|
|
78
|
+
addChildren(itemIds: string[]): void;
|
|
79
|
+
/**
|
|
80
|
+
* @description 移除子元素
|
|
81
|
+
* @param itemId 子元素ID
|
|
82
|
+
* @returns 是否移除成功
|
|
83
|
+
*/
|
|
84
|
+
removeChild(itemId: string): boolean;
|
|
85
|
+
/**
|
|
86
|
+
* @description 批量移除子元素
|
|
87
|
+
* @param itemIds 子元素ID列表
|
|
88
|
+
*/
|
|
89
|
+
removeChildren(itemIds: string[]): void;
|
|
90
|
+
/**
|
|
91
|
+
* @description 是否包含指定子元素
|
|
92
|
+
* @param itemId 子元素ID
|
|
93
|
+
*/
|
|
94
|
+
hasChild(itemId: string): boolean;
|
|
95
|
+
/**
|
|
96
|
+
* @description 清空所有子元素
|
|
97
|
+
*/
|
|
98
|
+
clearChildren(): void;
|
|
99
|
+
/**
|
|
100
|
+
* @description 转换为 FrameCreateInfo
|
|
101
|
+
* @param withParent 是否包含父节点ID
|
|
102
|
+
*/
|
|
103
|
+
toCreateInfo(withParent?: boolean): FrameCreateInfo;
|
|
104
|
+
/**
|
|
105
|
+
* @description 克隆 SDKItem
|
|
106
|
+
*/
|
|
107
|
+
clone(): FrameItem;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* @description 类型守卫:检查是否是 FrameItem
|
|
111
|
+
*/
|
|
112
|
+
export declare function isFrameItem(obj: any): obj is FrameItem;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { GeneratorItemProperty, GeneratorCreateInfo, VideoCreateInfo, SpriteCreateInfo } from '../types';
|
|
2
|
+
import { SDKItemType, GeneratorItemOptions } from './types';
|
|
3
|
+
import { BaseItem } from './base-item';
|
|
4
|
+
/**
|
|
5
|
+
* @description 资源生成器元素 SDKItem 类
|
|
6
|
+
* @description 支持 image 和 video 两种生成器类型
|
|
7
|
+
* @description 在 Player 中以透明 SpriteItem 形式渲染
|
|
8
|
+
* @description 支持属性扩展,可转换为 SpriteItem 或 VideoItem
|
|
9
|
+
*/
|
|
10
|
+
export declare class GeneratorItem extends BaseItem {
|
|
11
|
+
/**
|
|
12
|
+
* @description 元素类型(独立类型,不属于 spec.ItemType)
|
|
13
|
+
*/
|
|
14
|
+
readonly type = SDKItemType.GENERATOR;
|
|
15
|
+
/**
|
|
16
|
+
* @description 元素属性(包含 generatorType)
|
|
17
|
+
*/
|
|
18
|
+
property: GeneratorItemProperty;
|
|
19
|
+
constructor(options: GeneratorItemOptions);
|
|
20
|
+
/**
|
|
21
|
+
* @description 生成器类型
|
|
22
|
+
*/
|
|
23
|
+
get generatorType(): 'image' | 'video';
|
|
24
|
+
set generatorType(value: 'image' | 'video');
|
|
25
|
+
/**
|
|
26
|
+
* @description 图片地址(生成器返回空)
|
|
27
|
+
*/
|
|
28
|
+
get image(): string;
|
|
29
|
+
set image(_value: string);
|
|
30
|
+
/**
|
|
31
|
+
* @description 位置
|
|
32
|
+
*/
|
|
33
|
+
get position(): [number, number];
|
|
34
|
+
set position(value: [number, number]);
|
|
35
|
+
/**
|
|
36
|
+
* @description 宽度
|
|
37
|
+
*/
|
|
38
|
+
get width(): number;
|
|
39
|
+
set width(value: number);
|
|
40
|
+
/**
|
|
41
|
+
* @description 高度
|
|
42
|
+
*/
|
|
43
|
+
get height(): number;
|
|
44
|
+
set height(value: number);
|
|
45
|
+
/**
|
|
46
|
+
* @description 旋转(二维旋转角度)
|
|
47
|
+
*/
|
|
48
|
+
get rotation(): number;
|
|
49
|
+
set rotation(value: number);
|
|
50
|
+
/**
|
|
51
|
+
* @description 完整旋转(包含 x, y, z)
|
|
52
|
+
*/
|
|
53
|
+
get fullRotation(): [number, number, number];
|
|
54
|
+
set fullRotation(value: [number, number, number]);
|
|
55
|
+
/**
|
|
56
|
+
* @description 是否正在编辑关键属性
|
|
57
|
+
* @deprecated 该属性即将废弃,使用 isCoreEditable 代替
|
|
58
|
+
*/
|
|
59
|
+
get keyPropertyEditing(): boolean;
|
|
60
|
+
set keyPropertyEditing(value: boolean);
|
|
61
|
+
/**
|
|
62
|
+
* @description 转换为 GeneratorCreateInfo
|
|
63
|
+
* @param withParent 是否包含父节点ID
|
|
64
|
+
*/
|
|
65
|
+
toCreateInfo(withParent?: boolean): GeneratorCreateInfo;
|
|
66
|
+
/**
|
|
67
|
+
* @description 转换为 VideoCreateInfo(用于转换为视频元素)
|
|
68
|
+
* @param videoUrl 视频资源地址
|
|
69
|
+
* @param withParent 是否包含父节点ID
|
|
70
|
+
*/
|
|
71
|
+
toVideoCreateInfo(videoUrl: string, withParent?: boolean): VideoCreateInfo;
|
|
72
|
+
/**
|
|
73
|
+
* @description 转换为 SpriteCreateInfo(用于转换为图片元素)
|
|
74
|
+
* @param imageUrl 图片资源地址
|
|
75
|
+
* @param withParent 是否包含父节点ID
|
|
76
|
+
*/
|
|
77
|
+
toSpriteCreateInfo(imageUrl: string, withParent?: boolean): SpriteCreateInfo;
|
|
78
|
+
/**
|
|
79
|
+
* @description 克隆 SDKItem
|
|
80
|
+
*/
|
|
81
|
+
clone(): GeneratorItem;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* @description 类型守卫:检查是否是 GeneratorItem
|
|
85
|
+
*/
|
|
86
|
+
export declare function isGeneratorItem(obj: any): obj is GeneratorItem;
|