@galacean/effects-specification 2.1.0-beta.0 → 2.2.0-alpha.0
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/es/animation-clip-data.d.ts +1 -1
- package/es/assets.d.ts +95 -0
- package/es/assets.js +18 -0
- package/es/binary.d.ts +2 -1
- package/es/buitin-object-guid.d.ts +1 -0
- package/es/buitin-object-guid.js +1 -0
- package/es/components/component-data.d.ts +7 -0
- package/es/components/component-data.js +1 -0
- package/es/components/index.d.ts +2 -0
- package/es/components/index.js +2 -0
- package/es/components/post-process-volume-data.d.ts +38 -0
- package/es/components/post-process-volume-data.js +1 -0
- package/es/composition.d.ts +0 -4
- package/es/constants.d.ts +6 -0
- package/es/constants.js +6 -0
- package/es/curve-data/color-curve-data.d.ts +7 -0
- package/es/curve-data/color-curve-data.js +1 -0
- package/es/curve-data/index.d.ts +2 -0
- package/es/curve-data/index.js +2 -0
- package/es/curve-data/vector-curve-datas.d.ts +16 -0
- package/es/curve-data/vector-curve-datas.js +1 -0
- package/es/data-type.d.ts +50 -0
- package/es/data-type.js +55 -0
- package/es/effects-object-data.d.ts +6 -0
- package/es/effects-object-data.js +1 -0
- package/es/effects-package-data.d.ts +9 -0
- package/es/effects-package-data.js +1 -0
- package/es/{components.d.ts → geometry-data.d.ts} +1 -95
- package/es/{components.js → geometry-data.js} +0 -39
- package/es/index.d.ts +17 -2
- package/es/index.js +17 -2
- package/es/item/audio-item.d.ts +46 -0
- package/es/item/audio-item.js +1 -0
- package/es/item/base-item.d.ts +3 -10
- package/es/item/effect-item.d.ts +6 -0
- package/es/item/interact-item.d.ts +1 -5
- package/es/item/model/light.d.ts +6 -1
- package/es/item/model/render.d.ts +5 -1
- package/es/item/model/render.js +4 -0
- package/es/item/model/skybox.d.ts +4 -11
- package/es/item/model/tree.d.ts +12 -12
- package/es/item/particle-item.d.ts +3 -68
- package/es/item/particle-shape.d.ts +12 -12
- package/es/item/rich-text-item.d.ts +35 -0
- package/es/item/rich-text-item.js +1 -0
- package/es/item/spine-item.d.ts +7 -2
- package/es/item/sprite-item.d.ts +1 -43
- package/es/item/text-item.d.ts +35 -64
- package/es/item/video-item.d.ts +82 -0
- package/es/item/video-item.js +1 -0
- package/es/item.d.ts +4 -1
- package/es/material-data.d.ts +21 -0
- package/es/material-data.js +1 -0
- package/es/math/color-data.d.ts +6 -0
- package/es/math/color-data.js +1 -0
- package/es/math/index.d.ts +2 -0
- package/es/math/index.js +2 -0
- package/es/math/vector-data.d.ts +15 -0
- package/es/math/vector-data.js +1 -0
- package/es/number-expression.d.ts +18 -1
- package/es/number-expression.js +8 -0
- package/es/render-settings.d.ts +4 -0
- package/es/render-settings.js +1 -0
- package/es/scene.d.ts +33 -8
- package/es/scene.js +5 -1
- package/es/shader-data.d.ts +6 -0
- package/es/shader-data.js +1 -0
- package/es/shape/custom-shape-data.d.ts +68 -0
- package/es/shape/custom-shape-data.js +1 -0
- package/es/shape/ellipse-data.d.ts +28 -0
- package/es/shape/ellipse-data.js +1 -0
- package/es/shape/index.d.ts +9 -0
- package/es/shape/index.js +9 -0
- package/es/shape/polygon-data.d.ts +28 -0
- package/es/shape/polygon-data.js +1 -0
- package/es/shape/rectangle-data.d.ts +28 -0
- package/es/shape/rectangle-data.js +1 -0
- package/es/shape/shape-component-data.d.ts +16 -0
- package/es/shape/shape-component-data.js +1 -0
- package/es/shape/shape-fill-param.d.ts +10 -0
- package/es/shape/shape-fill-param.js +1 -0
- package/es/shape/shape-primitive-type.d.ts +25 -0
- package/es/shape/shape-primitive-type.js +26 -0
- package/es/shape/shape-stroke-param.d.ts +26 -0
- package/es/shape/shape-stroke-param.js +8 -0
- package/es/shape/star-data.d.ts +36 -0
- package/es/shape/star-data.js +1 -0
- package/es/texture.d.ts +48 -0
- package/es/texture.js +1 -0
- package/es/timeline/playables/sprite-color-playable-asset-data.d.ts +2 -1
- package/es/timeline/playables/transform-playable-asset-data.d.ts +2 -1
- package/es/timeline/timeline-asset-data.d.ts +3 -1
- package/es/timeline/track/track-asset-data.d.ts +2 -1
- package/es/type.d.ts +25 -16
- package/es/type.js +33 -13
- package/es/vfx-item-data.d.ts +2 -1
- package/package.json +13 -12
- package/es/image.d.ts +0 -123
- package/es/image.js +0 -9
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { ComponentData, DataPath } from '../components';
|
|
2
|
+
import type { RGBAColorValue } from '../number-expression';
|
|
3
|
+
import type { SizeOverLifetime, RotationOverLifetime, PositionOverLifetime, ColorOverLifetime, InteractBehavior, RendererOptions, ItemType } from '../type';
|
|
4
|
+
import type { BaseItem, EndBehavior } from './base-item';
|
|
5
|
+
/**
|
|
6
|
+
* 视频元素
|
|
7
|
+
*/
|
|
8
|
+
export interface VideoItem extends BaseItem {
|
|
9
|
+
/**
|
|
10
|
+
* 元素类型(指定为 video)
|
|
11
|
+
*/
|
|
12
|
+
type: ItemType.video;
|
|
13
|
+
/**
|
|
14
|
+
* 视频元素渲染信息
|
|
15
|
+
*/
|
|
16
|
+
content: VideoComponentData;
|
|
17
|
+
endBehavior: EndBehavior;
|
|
18
|
+
}
|
|
19
|
+
export interface VideoContentOptions {
|
|
20
|
+
/**
|
|
21
|
+
* 元素基础颜色
|
|
22
|
+
* @default [255,255,255,255]
|
|
23
|
+
*/
|
|
24
|
+
startColor?: RGBAColorValue;
|
|
25
|
+
/**
|
|
26
|
+
* 视频链接,索引到 scene 中的 videos 数组
|
|
27
|
+
*/
|
|
28
|
+
video: DataPath;
|
|
29
|
+
/**
|
|
30
|
+
* 视频播放速度
|
|
31
|
+
* @default 1
|
|
32
|
+
*/
|
|
33
|
+
playbackRate?: number;
|
|
34
|
+
/**
|
|
35
|
+
* 是否静音播放
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
muted?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* 视频音量大小
|
|
41
|
+
* @default 1
|
|
42
|
+
*/
|
|
43
|
+
volume?: number;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* 视频组件属性
|
|
47
|
+
*/
|
|
48
|
+
export interface VideoComponentData extends ComponentData {
|
|
49
|
+
/**
|
|
50
|
+
* 视频元素基础属性
|
|
51
|
+
*/
|
|
52
|
+
options: VideoContentOptions;
|
|
53
|
+
/**
|
|
54
|
+
* 视频元素材质渲染属性
|
|
55
|
+
*/
|
|
56
|
+
renderer: RendererOptions;
|
|
57
|
+
/**
|
|
58
|
+
* 视频元素大小变化属性
|
|
59
|
+
*/
|
|
60
|
+
sizeOverLifetime?: SizeOverLifetime;
|
|
61
|
+
/**
|
|
62
|
+
* 视频元素旋转变化属性
|
|
63
|
+
*/
|
|
64
|
+
rotationOverLifetime?: RotationOverLifetime;
|
|
65
|
+
/**
|
|
66
|
+
* 视频元素位置变化属性
|
|
67
|
+
*/
|
|
68
|
+
positionOverLifetime?: PositionOverLifetime;
|
|
69
|
+
/**
|
|
70
|
+
* 视频元素色彩变化属性
|
|
71
|
+
*/
|
|
72
|
+
colorOverLifetime?: ColorOverLifetime;
|
|
73
|
+
/**
|
|
74
|
+
* 视频元素交互
|
|
75
|
+
*/
|
|
76
|
+
interaction?: {
|
|
77
|
+
/**
|
|
78
|
+
* 交互行为
|
|
79
|
+
*/
|
|
80
|
+
behavior: InteractBehavior;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/es/item.d.ts
CHANGED
|
@@ -8,7 +8,10 @@ import type { ModelCameraItem, ModelLightItem, ModelMeshItem, ModelSkyboxItem, M
|
|
|
8
8
|
import type { CameraItem } from './item/camera-item';
|
|
9
9
|
import type { CompositionItem } from './item/composition-item';
|
|
10
10
|
import type { TextItem } from './item/text-item';
|
|
11
|
+
import type { VideoItem } from './item/video-item';
|
|
12
|
+
import type { AudioItem } from './item/audio-item';
|
|
13
|
+
import type { RichTextItem } from './item/rich-text-item';
|
|
11
14
|
/**
|
|
12
15
|
* Item 基类,无对应元素
|
|
13
16
|
*/
|
|
14
|
-
export type Item = SpriteItem | ParticleItem | NullItem | PluginItem | InteractItem | CameraItem | TextItem | ModelMeshItem<'json'> | ModelSkyboxItem<'json'> | ModelTreeItem<'json'> | ModelLightItem | ModelCameraItem | SpineItem | CompositionItem | ModelMeshItem<'studio'> | ModelSkyboxItem<'studio'> | ModelTreeItem<'studio'>;
|
|
17
|
+
export type Item = SpriteItem | ParticleItem | NullItem | PluginItem | InteractItem | CameraItem | TextItem | RichTextItem | VideoItem | AudioItem | ModelMeshItem<'json'> | ModelSkyboxItem<'json'> | ModelTreeItem<'json'> | ModelLightItem | ModelCameraItem | SpineItem | CompositionItem | ModelMeshItem<'studio'> | ModelSkyboxItem<'studio'> | ModelTreeItem<'studio'>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { DataPath } from './components';
|
|
2
|
+
import type { EffectsObjectData } from './effects-object-data';
|
|
3
|
+
import type { Vector4Data, ColorData, Vector2Data } from './math';
|
|
4
|
+
export interface MaterialTextureProperty {
|
|
5
|
+
texture: DataPath;
|
|
6
|
+
offset?: Vector2Data;
|
|
7
|
+
scale?: Vector2Data;
|
|
8
|
+
}
|
|
9
|
+
export interface MaterialData extends EffectsObjectData {
|
|
10
|
+
shader: DataPath;
|
|
11
|
+
blending?: boolean;
|
|
12
|
+
zWrite?: boolean;
|
|
13
|
+
zTest?: boolean;
|
|
14
|
+
stringTags: Record<string, string>;
|
|
15
|
+
macros: string[];
|
|
16
|
+
ints: Record<string, number>;
|
|
17
|
+
floats: Record<string, number>;
|
|
18
|
+
vector4s: Record<string, Vector4Data>;
|
|
19
|
+
colors: Record<string, ColorData>;
|
|
20
|
+
textures: Record<string, MaterialTextureProperty>;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/es/math/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ColorCurveData, Vector4CurveData } from './curve-data';
|
|
1
2
|
/*********************************************/
|
|
2
3
|
/*********************************************/
|
|
3
4
|
export declare enum ValueType {
|
|
@@ -72,7 +73,15 @@ export declare enum ValueType {
|
|
|
72
73
|
/**
|
|
73
74
|
* 贝塞尔曲线四元数
|
|
74
75
|
*/
|
|
75
|
-
BEZIER_CURVE_QUAT = 23
|
|
76
|
+
BEZIER_CURVE_QUAT = 23,
|
|
77
|
+
/**
|
|
78
|
+
* 颜色曲线
|
|
79
|
+
*/
|
|
80
|
+
COLOR_CURVE = 24,
|
|
81
|
+
/**
|
|
82
|
+
* Vector4 曲线
|
|
83
|
+
*/
|
|
84
|
+
VECTOR4_CURVE = 25
|
|
76
85
|
}
|
|
77
86
|
export type vec2 = [x: number, y: number];
|
|
78
87
|
export type vec3 = [x: number, y: number, z: number];
|
|
@@ -263,6 +272,14 @@ export type BezierCurvePath = [type: ValueType.BEZIER_CURVE_PATH, value: BezierC
|
|
|
263
272
|
* 贝塞尔曲线路径关键帧
|
|
264
273
|
*/
|
|
265
274
|
export type BezierCurveQuat = [type: ValueType.BEZIER_CURVE_QUAT, value: BezierCurveQuatValue];
|
|
275
|
+
/**
|
|
276
|
+
* 颜色贝塞尔曲线
|
|
277
|
+
*/
|
|
278
|
+
export type ColorCurveValue = [type: ValueType.COLOR_CURVE, value: ColorCurveData];
|
|
279
|
+
/**
|
|
280
|
+
* Vector4 贝塞尔曲线
|
|
281
|
+
*/
|
|
282
|
+
export type Vector4CurveValue = [type: ValueType.VECTOR4_CURVE, value: Vector4CurveData];
|
|
266
283
|
/*********************************************/
|
|
267
284
|
/*********************************************/
|
|
268
285
|
export type ColorExpression = RGBAColor | GradientColor | RGBAColors;
|
package/es/number-expression.js
CHANGED
|
@@ -75,6 +75,14 @@ export var ValueType;
|
|
|
75
75
|
* 贝塞尔曲线四元数
|
|
76
76
|
*/
|
|
77
77
|
ValueType[ValueType["BEZIER_CURVE_QUAT"] = 23] = "BEZIER_CURVE_QUAT";
|
|
78
|
+
/**
|
|
79
|
+
* 颜色曲线
|
|
80
|
+
*/
|
|
81
|
+
ValueType[ValueType["COLOR_CURVE"] = 24] = "COLOR_CURVE";
|
|
82
|
+
/**
|
|
83
|
+
* Vector4 曲线
|
|
84
|
+
*/
|
|
85
|
+
ValueType[ValueType["VECTOR4_CURVE"] = 25] = "VECTOR4_CURVE";
|
|
78
86
|
})(ValueType || (ValueType = {}));
|
|
79
87
|
/**
|
|
80
88
|
* 关键帧类型
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/es/scene.d.ts
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import type { Composition, CompositionData } from './composition';
|
|
2
2
|
import type { SpineResource } from './item/spine-item';
|
|
3
|
-
import type { PlayerVersion,
|
|
4
|
-
import type {
|
|
3
|
+
import type { PlayerVersion, ShapeGeometry } from './type';
|
|
4
|
+
import type { TextureDefine } from './texture';
|
|
5
5
|
import type { FontBase, FontDefine } from './text';
|
|
6
6
|
import type { BinaryFile } from './binary';
|
|
7
|
-
import type { ComponentData
|
|
7
|
+
import type { ComponentData } from './components';
|
|
8
8
|
import type { VFXItemData } from './vfx-item-data';
|
|
9
9
|
import type { AnimationClipData } from './animation-clip-data';
|
|
10
|
+
import type { AssetBase, ImageSource } from './assets';
|
|
11
|
+
import type { RenderSettings } from './render-settings';
|
|
12
|
+
import type { EffectsObjectData } from './effects-object-data';
|
|
13
|
+
import type { MaterialData } from './material-data';
|
|
14
|
+
import type { GeometryData } from './geometry-data';
|
|
15
|
+
import type { ShaderData } from './shader-data';
|
|
10
16
|
/**
|
|
11
17
|
* runtime 2.0 之前的场景信息
|
|
12
18
|
* 素材信息存放于统一数据结构中
|
|
@@ -50,7 +56,7 @@ export interface JSONSceneLegacy {
|
|
|
50
56
|
/**
|
|
51
57
|
* 贴图信息
|
|
52
58
|
*/
|
|
53
|
-
images:
|
|
59
|
+
images: ImageSource[];
|
|
54
60
|
/**
|
|
55
61
|
* 根据合成ID,每个合成用到的 image 的数组索引
|
|
56
62
|
*/
|
|
@@ -62,7 +68,7 @@ export interface JSONSceneLegacy {
|
|
|
62
68
|
/**
|
|
63
69
|
* 蒙版形状信息
|
|
64
70
|
*/
|
|
65
|
-
shapes:
|
|
71
|
+
shapes: ShapeGeometry[];
|
|
66
72
|
/**
|
|
67
73
|
* 插件类型信息
|
|
68
74
|
* 'model@1.0'
|
|
@@ -97,6 +103,10 @@ export interface JSONSceneLegacy {
|
|
|
97
103
|
* 如果是内置模块,但是需要额外的代码引入,比如滤镜则会加入 requires 数组中
|
|
98
104
|
*/
|
|
99
105
|
export type SceneRequire = 'filter';
|
|
106
|
+
export declare enum JSONSceneVersion {
|
|
107
|
+
'3.0' = "3.0",
|
|
108
|
+
'LATEST' = "3.1"
|
|
109
|
+
}
|
|
100
110
|
/**
|
|
101
111
|
* 场景信息
|
|
102
112
|
* 素材信息存放于统一数据结构中
|
|
@@ -107,8 +117,9 @@ export interface JSONScene {
|
|
|
107
117
|
* JSON 版本
|
|
108
118
|
*
|
|
109
119
|
* 3.0 EC 改造、移除滤镜元素
|
|
120
|
+
* 3.1 音视频
|
|
110
121
|
*/
|
|
111
|
-
version:
|
|
122
|
+
version: JSONSceneVersion;
|
|
112
123
|
/**
|
|
113
124
|
* 播放器版本信息
|
|
114
125
|
*/
|
|
@@ -127,11 +138,15 @@ export interface JSONScene {
|
|
|
127
138
|
* 渲染所需合成列表
|
|
128
139
|
*/
|
|
129
140
|
compositions: CompositionData[];
|
|
141
|
+
/**
|
|
142
|
+
* 渲染配置
|
|
143
|
+
*/
|
|
144
|
+
renderSettings?: RenderSettings;
|
|
130
145
|
/******************************** 以下皆为可复用信息,加载在对应 Manager 中 *******************************/
|
|
131
146
|
/**
|
|
132
147
|
* 贴图信息
|
|
133
148
|
*/
|
|
134
|
-
images:
|
|
149
|
+
images: ImageSource[];
|
|
135
150
|
/**
|
|
136
151
|
* 根据合成 ID,每个合成用到的 image 的数组索引
|
|
137
152
|
*/
|
|
@@ -143,7 +158,7 @@ export interface JSONScene {
|
|
|
143
158
|
/**
|
|
144
159
|
* 蒙版形状信息
|
|
145
160
|
*/
|
|
146
|
-
shapes:
|
|
161
|
+
shapes: ShapeGeometry[];
|
|
147
162
|
/**
|
|
148
163
|
* 插件类型信息
|
|
149
164
|
* 'model@1.0'
|
|
@@ -154,6 +169,16 @@ export interface JSONScene {
|
|
|
154
169
|
* 数据模板下掉可以不要 FontBase[]
|
|
155
170
|
*/
|
|
156
171
|
fonts?: FontBase[] | FontDefine[];
|
|
172
|
+
/**
|
|
173
|
+
* 视频资源
|
|
174
|
+
* @since 2.0.0
|
|
175
|
+
*/
|
|
176
|
+
videos?: AssetBase[];
|
|
177
|
+
/**
|
|
178
|
+
* 音频资源
|
|
179
|
+
* @since 2.0.0
|
|
180
|
+
*/
|
|
181
|
+
audios?: AssetBase[];
|
|
157
182
|
/**
|
|
158
183
|
* 二进制文件地址
|
|
159
184
|
*/
|
package/es/scene.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { TransformData } from '../item/base-item';
|
|
2
|
+
import type { Vector2Data } from '../math';
|
|
3
|
+
import type { ShapeComponentData } from './shape-component-data';
|
|
4
|
+
import type { ShapeFillParam } from './shape-fill-param';
|
|
5
|
+
import type { ShapePrimitiveType } from './shape-primitive-type';
|
|
6
|
+
/**
|
|
7
|
+
* 自定义形状点
|
|
8
|
+
*/
|
|
9
|
+
export interface CustomShapePoint {
|
|
10
|
+
/**
|
|
11
|
+
* 顶点索引
|
|
12
|
+
*/
|
|
13
|
+
point: number;
|
|
14
|
+
/**
|
|
15
|
+
* 入射点索引
|
|
16
|
+
*/
|
|
17
|
+
easingIn: number;
|
|
18
|
+
/**
|
|
19
|
+
* 出射点索引
|
|
20
|
+
*/
|
|
21
|
+
easingOut: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* 自定义形状参数
|
|
25
|
+
*/
|
|
26
|
+
export interface CustomShape {
|
|
27
|
+
/**
|
|
28
|
+
* 点索引 - 用于构成闭合图形
|
|
29
|
+
*/
|
|
30
|
+
indexes: CustomShapePoint[];
|
|
31
|
+
/**
|
|
32
|
+
* 是否为闭合图形 - 用于Stroke
|
|
33
|
+
*/
|
|
34
|
+
close: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* 填充属性
|
|
37
|
+
*/
|
|
38
|
+
fill?: ShapeFillParam;
|
|
39
|
+
/**
|
|
40
|
+
* 空间变换
|
|
41
|
+
*/
|
|
42
|
+
transform?: TransformData;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* 自定义图形组件
|
|
46
|
+
*/
|
|
47
|
+
export interface CustomShapeData extends ShapeComponentData {
|
|
48
|
+
/**
|
|
49
|
+
* 矢量类型 - 形状
|
|
50
|
+
*/
|
|
51
|
+
type: ShapePrimitiveType.Custom;
|
|
52
|
+
/**
|
|
53
|
+
* 路径点
|
|
54
|
+
*/
|
|
55
|
+
points: Vector2Data[];
|
|
56
|
+
/**
|
|
57
|
+
* 入射控制点
|
|
58
|
+
*/
|
|
59
|
+
easingIns: Vector2Data[];
|
|
60
|
+
/**
|
|
61
|
+
* 入射控制点
|
|
62
|
+
*/
|
|
63
|
+
easingOuts: Vector2Data[];
|
|
64
|
+
/**
|
|
65
|
+
* 自定义形状
|
|
66
|
+
*/
|
|
67
|
+
shapes: CustomShape[];
|
|
68
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { TransformData } from '../item/base-item';
|
|
2
|
+
import type { ShapeComponentData } from './shape-component-data';
|
|
3
|
+
import type { ShapeFillParam } from './shape-fill-param';
|
|
4
|
+
import type { ShapePrimitiveType } from './shape-primitive-type';
|
|
5
|
+
/**
|
|
6
|
+
* 椭圆组件参数
|
|
7
|
+
*/
|
|
8
|
+
export interface EllipseData extends ShapeComponentData {
|
|
9
|
+
type: ShapePrimitiveType.Ellipse;
|
|
10
|
+
/**
|
|
11
|
+
* x 轴半径
|
|
12
|
+
* -- TODO 后续完善类型
|
|
13
|
+
* -- TODO 可以看一下用xRadius/yRadius 还是 width/height
|
|
14
|
+
*/
|
|
15
|
+
xRadius: number;
|
|
16
|
+
/**
|
|
17
|
+
* y 轴半径
|
|
18
|
+
*/
|
|
19
|
+
yRadius: number;
|
|
20
|
+
/**
|
|
21
|
+
* 填充属性
|
|
22
|
+
*/
|
|
23
|
+
fill?: ShapeFillParam;
|
|
24
|
+
/**
|
|
25
|
+
* 空间变换
|
|
26
|
+
*/
|
|
27
|
+
transform?: TransformData;
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './custom-shape-data';
|
|
2
|
+
export * from './ellipse-data';
|
|
3
|
+
export * from './polygon-data';
|
|
4
|
+
export * from './rectangle-data';
|
|
5
|
+
export * from './shape-component-data';
|
|
6
|
+
export * from './shape-fill-param';
|
|
7
|
+
export * from './shape-primitive-type';
|
|
8
|
+
export * from './shape-stroke-param';
|
|
9
|
+
export * from './star-data';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './custom-shape-data';
|
|
2
|
+
export * from './ellipse-data';
|
|
3
|
+
export * from './polygon-data';
|
|
4
|
+
export * from './rectangle-data';
|
|
5
|
+
export * from './shape-component-data';
|
|
6
|
+
export * from './shape-fill-param';
|
|
7
|
+
export * from './shape-primitive-type';
|
|
8
|
+
export * from './shape-stroke-param';
|
|
9
|
+
export * from './star-data';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { TransformData } from '../item/base-item';
|
|
2
|
+
import type { ShapeComponentData } from './shape-component-data';
|
|
3
|
+
import type { ShapeFillParam } from './shape-fill-param';
|
|
4
|
+
/**
|
|
5
|
+
* 多边形参数
|
|
6
|
+
*/
|
|
7
|
+
export interface PolygonData extends ShapeComponentData {
|
|
8
|
+
/**
|
|
9
|
+
* 顶点数
|
|
10
|
+
*/
|
|
11
|
+
pointCount: number;
|
|
12
|
+
/**
|
|
13
|
+
* 外切圆半径
|
|
14
|
+
*/
|
|
15
|
+
radius: number;
|
|
16
|
+
/**
|
|
17
|
+
* 角点圆度
|
|
18
|
+
*/
|
|
19
|
+
roundness: number;
|
|
20
|
+
/**
|
|
21
|
+
* 填充属性
|
|
22
|
+
*/
|
|
23
|
+
fill?: ShapeFillParam;
|
|
24
|
+
/**
|
|
25
|
+
* 空间变换
|
|
26
|
+
*/
|
|
27
|
+
transform?: TransformData;
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { TransformData } from '../item/base-item';
|
|
2
|
+
import type { ShapeComponentData } from './shape-component-data';
|
|
3
|
+
import type { ShapeFillParam } from './shape-fill-param';
|
|
4
|
+
/**
|
|
5
|
+
* 矩形参数
|
|
6
|
+
*/
|
|
7
|
+
export interface RectangleData extends ShapeComponentData {
|
|
8
|
+
/**
|
|
9
|
+
* 宽度
|
|
10
|
+
*/
|
|
11
|
+
width: number;
|
|
12
|
+
/**
|
|
13
|
+
* 高度
|
|
14
|
+
*/
|
|
15
|
+
height: number;
|
|
16
|
+
/**
|
|
17
|
+
* 角点元素
|
|
18
|
+
*/
|
|
19
|
+
roundness: number;
|
|
20
|
+
/**
|
|
21
|
+
* 填充属性
|
|
22
|
+
*/
|
|
23
|
+
fill?: ShapeFillParam;
|
|
24
|
+
/**
|
|
25
|
+
* 空间变换
|
|
26
|
+
*/
|
|
27
|
+
transform?: TransformData;
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ComponentData } from '../components/component-data';
|
|
2
|
+
import type { ShapePrimitiveType } from './shape-primitive-type';
|
|
3
|
+
import type { ShapeStrokeParam } from './shape-stroke-param';
|
|
4
|
+
/**
|
|
5
|
+
* 矢量图形组件
|
|
6
|
+
*/
|
|
7
|
+
export interface ShapeComponentData extends ComponentData {
|
|
8
|
+
/**
|
|
9
|
+
* 矢量类型
|
|
10
|
+
*/
|
|
11
|
+
type: ShapePrimitiveType;
|
|
12
|
+
/**
|
|
13
|
+
* 描边属性
|
|
14
|
+
*/
|
|
15
|
+
stroke?: ShapeStrokeParam;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 矢量图形类型
|
|
3
|
+
*/
|
|
4
|
+
export declare enum ShapePrimitiveType {
|
|
5
|
+
/**
|
|
6
|
+
* 自定义图形
|
|
7
|
+
*/
|
|
8
|
+
Custom = 0,
|
|
9
|
+
/**
|
|
10
|
+
* 矩形
|
|
11
|
+
*/
|
|
12
|
+
Rectangle = 1,
|
|
13
|
+
/**
|
|
14
|
+
* 椭圆
|
|
15
|
+
*/
|
|
16
|
+
Ellipse = 2,
|
|
17
|
+
/**
|
|
18
|
+
* 多边形
|
|
19
|
+
*/
|
|
20
|
+
Polygon = 3,
|
|
21
|
+
/**
|
|
22
|
+
* 星形
|
|
23
|
+
*/
|
|
24
|
+
Star = 4
|
|
25
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 矢量图形类型
|
|
3
|
+
*/
|
|
4
|
+
export var ShapePrimitiveType;
|
|
5
|
+
(function (ShapePrimitiveType) {
|
|
6
|
+
/**
|
|
7
|
+
* 自定义图形
|
|
8
|
+
*/
|
|
9
|
+
ShapePrimitiveType[ShapePrimitiveType["Custom"] = 0] = "Custom";
|
|
10
|
+
/**
|
|
11
|
+
* 矩形
|
|
12
|
+
*/
|
|
13
|
+
ShapePrimitiveType[ShapePrimitiveType["Rectangle"] = 1] = "Rectangle";
|
|
14
|
+
/**
|
|
15
|
+
* 椭圆
|
|
16
|
+
*/
|
|
17
|
+
ShapePrimitiveType[ShapePrimitiveType["Ellipse"] = 2] = "Ellipse";
|
|
18
|
+
/**
|
|
19
|
+
* 多边形
|
|
20
|
+
*/
|
|
21
|
+
ShapePrimitiveType[ShapePrimitiveType["Polygon"] = 3] = "Polygon";
|
|
22
|
+
/**
|
|
23
|
+
* 星形
|
|
24
|
+
*/
|
|
25
|
+
ShapePrimitiveType[ShapePrimitiveType["Star"] = 4] = "Star";
|
|
26
|
+
})(ShapePrimitiveType || (ShapePrimitiveType = {}));
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ColorData } from '../math/color-data';
|
|
2
|
+
export declare enum ShapeConnectType {
|
|
3
|
+
}
|
|
4
|
+
export declare enum ShapePointType {
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* 矢量描边参数
|
|
8
|
+
*/
|
|
9
|
+
export interface ShapeStrokeParam {
|
|
10
|
+
/**
|
|
11
|
+
* 线宽
|
|
12
|
+
*/
|
|
13
|
+
width: number;
|
|
14
|
+
/**
|
|
15
|
+
* 线颜色
|
|
16
|
+
*/
|
|
17
|
+
color: ColorData;
|
|
18
|
+
/**
|
|
19
|
+
* 连接类型
|
|
20
|
+
*/
|
|
21
|
+
connectType: ShapeConnectType;
|
|
22
|
+
/**
|
|
23
|
+
* 点类型
|
|
24
|
+
*/
|
|
25
|
+
pointType: ShapePointType;
|
|
26
|
+
}
|