@galacean/effects-specification 2.0.0-alpha.9 → 2.0.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.
Files changed (101) hide show
  1. package/README.md +2 -10
  2. package/es/animation-clip-data.d.ts +26 -0
  3. package/es/animation-clip-data.js +1 -0
  4. package/{dist/src → es}/binary.d.ts +4 -2
  5. package/es/binary.js +1 -0
  6. package/es/buitin-object-guid.d.ts +5 -0
  7. package/es/buitin-object-guid.js +5 -0
  8. package/{dist/src → es}/components.d.ts +80 -4
  9. package/es/components.js +129 -0
  10. package/{dist/src → es}/composition.d.ts +28 -70
  11. package/es/composition.js +12 -0
  12. package/{dist/src → es}/constants.d.ts +23 -0
  13. package/es/constants.js +34 -0
  14. package/{dist/src → es}/image.d.ts +13 -6
  15. package/es/image.js +9 -0
  16. package/{dist/src → es}/index.d.ts +2 -1
  17. package/es/index.js +28 -0
  18. package/{dist/src → es}/item/base-item.d.ts +27 -7
  19. package/es/item/base-item.js +27 -0
  20. package/{dist/src → es}/item/camera-item.d.ts +5 -5
  21. package/es/item/camera-item.js +1 -0
  22. package/{dist/src → es}/item/composition-item.d.ts +4 -4
  23. package/es/item/composition-item.js +1 -0
  24. package/{dist/src → es}/item/effect-item.d.ts +2 -2
  25. package/es/item/effect-item.js +1 -0
  26. package/{dist/src → es}/item/interact-item.d.ts +3 -3
  27. package/es/item/interact-item.js +1 -0
  28. package/es/item/model/binary.js +1 -0
  29. package/{dist/src → es}/item/model/camera.d.ts +2 -2
  30. package/es/item/model/camera.js +5 -0
  31. package/es/item/model/index.js +35 -0
  32. package/{dist/src → es}/item/model/light.d.ts +2 -2
  33. package/es/item/model/light.js +19 -0
  34. package/{dist/src → es}/item/model/material.d.ts +3 -3
  35. package/es/item/model/material.js +16 -0
  36. package/{dist/src → es}/item/model/mesh.d.ts +6 -5
  37. package/es/item/model/mesh.js +5 -0
  38. package/es/item/model/render.js +42 -0
  39. package/{dist/src → es}/item/model/skybox.d.ts +9 -3
  40. package/es/item/model/skybox.js +1 -0
  41. package/{dist/src → es}/item/model/tree.d.ts +10 -0
  42. package/es/item/model/tree.js +1 -0
  43. package/es/item/null-item.d.ts +46 -0
  44. package/es/item/null-item.js +1 -0
  45. package/{dist/src → es}/item/particle-item.d.ts +20 -20
  46. package/es/item/particle-item.js +14 -0
  47. package/es/item/particle-shape.js +19 -0
  48. package/{dist/src → es}/item/plugin-item.d.ts +3 -3
  49. package/es/item/plugin-item.js +1 -0
  50. package/{dist/src → es}/item/spine-item.d.ts +44 -20
  51. package/es/item/spine-item.js +1 -0
  52. package/{dist/src → es}/item/sprite-item.d.ts +3 -3
  53. package/es/item/sprite-item.js +1 -0
  54. package/{dist/src → es}/item/text-item.d.ts +3 -3
  55. package/es/item/text-item.js +1 -0
  56. package/{dist/src → es}/item.d.ts +1 -3
  57. package/es/item.js +1 -0
  58. package/{dist/src → es}/number-expression.d.ts +21 -8
  59. package/es/number-expression.js +91 -0
  60. package/{dist/src → es}/scene.d.ts +15 -13
  61. package/es/scene.js +1 -0
  62. package/{dist/src → es}/text.d.ts +3 -49
  63. package/es/text.js +84 -0
  64. package/es/timeline/index.d.ts +5 -0
  65. package/es/timeline/index.js +5 -0
  66. package/es/timeline/playables/sprite-color-playable-asset-data.d.ts +8 -0
  67. package/es/timeline/playables/sprite-color-playable-asset-data.js +1 -0
  68. package/es/timeline/playables/transform-playable-asset-data.d.ts +17 -0
  69. package/es/timeline/playables/transform-playable-asset-data.js +1 -0
  70. package/es/timeline/timeline-asset-data.d.ts +8 -0
  71. package/es/timeline/timeline-asset-data.js +1 -0
  72. package/es/timeline/timeline-clip-data.d.ts +11 -0
  73. package/es/timeline/timeline-clip-data.js +1 -0
  74. package/es/timeline/track/track-asset-data.d.ts +9 -0
  75. package/es/timeline/track/track-asset-data.js +1 -0
  76. package/{dist/src → es}/type.d.ts +25 -12
  77. package/es/type.js +342 -0
  78. package/{dist/src → es}/vfx-item-data.d.ts +8 -9
  79. package/es/vfx-item-data.js +1 -0
  80. package/package.json +27 -48
  81. package/dist/fallback/camera.d.ts +0 -2
  82. package/dist/fallback/index.d.ts +0 -12
  83. package/dist/fallback/interact.d.ts +0 -2
  84. package/dist/fallback/migration.d.ts +0 -18
  85. package/dist/fallback/particle.d.ts +0 -2
  86. package/dist/fallback/sprite.d.ts +0 -3
  87. package/dist/fallback/utils.d.ts +0 -37
  88. package/dist/fallback.js +0 -2237
  89. package/dist/fallback.js.map +0 -1
  90. package/dist/fallback.mjs +0 -2208
  91. package/dist/fallback.mjs.map +0 -1
  92. package/dist/index.js +0 -802
  93. package/dist/index.js.map +0 -1
  94. package/dist/index.mjs +0 -787
  95. package/dist/index.mjs.map +0 -1
  96. package/dist/src/buitin-object-guid.d.ts +0 -5
  97. package/dist/src/item/null-item.d.ts +0 -94
  98. /package/{dist/src → es}/item/model/binary.d.ts +0 -0
  99. /package/{dist/src → es}/item/model/index.d.ts +0 -0
  100. /package/{dist/src → es}/item/model/render.d.ts +0 -0
  101. /package/{dist/src → es}/item/particle-shape.d.ts +0 -0
@@ -0,0 +1,17 @@
1
+ import type { DataType, EffectsObjectData } from '../../components';
2
+ import type { SizeOverLifetime, RotationOverLifetime, PositionOverLifetime } from '../../type';
3
+ export interface TransformPlayableAssetData extends EffectsObjectData {
4
+ dataType: DataType.TransformPlayableAsset;
5
+ /**
6
+ * 元素大小变化属性
7
+ */
8
+ sizeOverLifetime?: SizeOverLifetime;
9
+ /**
10
+ * 元素旋转变化属性
11
+ */
12
+ rotationOverLifetime?: RotationOverLifetime;
13
+ /**
14
+ * 元素位置变化属性
15
+ */
16
+ positionOverLifetime?: PositionOverLifetime;
17
+ }
@@ -0,0 +1,8 @@
1
+ import type { EffectsObjectData, DataPath, DataType } from '../components';
2
+ export interface TimelineAssetData extends EffectsObjectData {
3
+ dataType: DataType.TimelineAsset;
4
+ /**
5
+ * 轨道数据(TrackAssetData)
6
+ */
7
+ tracks: DataPath[];
8
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ import type { EndBehavior } from '../item/base-item';
2
+ import type { DataPath } from '../components';
3
+ export interface TimelineClipData {
4
+ start?: number;
5
+ duration?: number;
6
+ endBehavior?: EndBehavior;
7
+ /**
8
+ * 可播放资产(PlayableAssetData)
9
+ */
10
+ asset: DataPath;
11
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ import type { DataPath, EffectsObjectData } from '../../components';
2
+ import type { TimelineClipData } from '../timeline-clip-data';
3
+ export interface TrackAssetData extends EffectsObjectData {
4
+ /**
5
+ * 子轨道数据(TrackAssetData)
6
+ */
7
+ children: DataPath[];
8
+ clips: TimelineClipData;
9
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -4,11 +4,11 @@ import type { FixedVec3Expression, vec2, vec3, GradientColor, ShapePoints, Shape
4
4
  */
5
5
  export interface PlayerVersion {
6
6
  /**
7
- * Web端版本号
7
+ * Web 端版本号
8
8
  */
9
9
  web: string;
10
10
  /**
11
- * Native端版本号
11
+ * Native 端版本号
12
12
  */
13
13
  native: string;
14
14
  }
@@ -72,15 +72,15 @@ export interface SizeOverLifetime {
72
72
  */
73
73
  size?: FixedNumberExpression;
74
74
  /**
75
- * x轴大小变化信息(分轴模式)
75
+ * x 轴大小变化信息(分轴模式)
76
76
  */
77
77
  x?: FixedNumberExpression;
78
78
  /**
79
- * y轴大小变化信息(分轴模式)
79
+ * y 轴大小变化信息(分轴模式)
80
80
  */
81
81
  y?: FixedNumberExpression;
82
82
  /**
83
- * z轴大小变化信息(分轴模式)
83
+ * z 轴大小变化信息(分轴模式)
84
84
  */
85
85
  z?: FixedNumberExpression;
86
86
  }
@@ -118,15 +118,15 @@ export interface PositionOverLifetime {
118
118
  */
119
119
  asMovement?: boolean;
120
120
  /**
121
- * x轴位置变化信息
121
+ * x 轴位置变化信息
122
122
  */
123
123
  linearX?: FixedNumberExpression;
124
124
  /**
125
- * y轴位置变化信息
125
+ * y 轴位置变化信息
126
126
  */
127
127
  linearY?: FixedNumberExpression;
128
128
  /**
129
- * z轴位置变化信息
129
+ * z 轴位置变化信息
130
130
  */
131
131
  linearZ?: FixedNumberExpression;
132
132
  /**
@@ -134,15 +134,15 @@ export interface PositionOverLifetime {
134
134
  */
135
135
  asRotation?: boolean;
136
136
  /**
137
- * x轴环绕角度变化信息
137
+ * x 轴环绕角度变化信息
138
138
  */
139
139
  orbitalX?: FixedNumberExpression;
140
140
  /**
141
- * y轴环绕角度变化信息
141
+ * y 轴环绕角度变化信息
142
142
  */
143
143
  orbitalY?: FixedNumberExpression;
144
144
  /**
145
- * z轴环绕角度变化信息
145
+ * z 轴环绕角度变化信息
146
146
  */
147
147
  orbitalZ?: FixedNumberExpression;
148
148
  /**
@@ -539,7 +539,11 @@ export declare enum ItemType {
539
539
  /**
540
540
  * 特效元素
541
541
  */
542
- effect = "effect"
542
+ effect = "effect",
543
+ /**
544
+ * 节点元素
545
+ */
546
+ node = "node"
543
547
  }
544
548
  /**
545
549
  * 渲染模式
@@ -657,3 +661,12 @@ export interface ShapeGeometry {
657
661
  */
658
662
  s: ShapeSplits;
659
663
  }
664
+ export declare enum RenderType {
665
+ Opaque = "Opaque",
666
+ Transparent = "Transparent"
667
+ }
668
+ export declare enum RenderFace {
669
+ Both = "Both",
670
+ Back = "Back",
671
+ Front = "Front"
672
+ }
package/es/type.js ADDED
@@ -0,0 +1,342 @@
1
+ /*********************************************/
2
+ /* 元素属性参数类型 */
3
+ /*********************************************/
4
+ /**
5
+ * 渲染等级
6
+ */
7
+ export var RenderLevel;
8
+ (function (RenderLevel) {
9
+ RenderLevel["S"] = "S";
10
+ RenderLevel["APlus"] = "A+";
11
+ RenderLevel["A"] = "A";
12
+ RenderLevel["BPlus"] = "B+";
13
+ RenderLevel["B"] = "B";
14
+ })(RenderLevel || (RenderLevel = {}));
15
+ /**
16
+ * 混合模式
17
+ */
18
+ export var BlendingMode;
19
+ (function (BlendingMode) {
20
+ /**
21
+ * 普通混合模式
22
+ */
23
+ BlendingMode[BlendingMode["ALPHA"] = 0] = "ALPHA";
24
+ /**
25
+ * 叠加混合模式
26
+ */
27
+ BlendingMode[BlendingMode["ADD"] = 1] = "ADD";
28
+ /**
29
+ * 相乘混合模式
30
+ */
31
+ BlendingMode[BlendingMode["MULTIPLY"] = 2] = "MULTIPLY";
32
+ /**
33
+ * 亮度混合模式
34
+ */
35
+ BlendingMode[BlendingMode["BRIGHTNESS"] = 3] = "BRIGHTNESS";
36
+ /**
37
+ * 减色混合模式
38
+ */
39
+ BlendingMode[BlendingMode["SUBTRACTION"] = 4] = "SUBTRACTION";
40
+ /**
41
+ * 强光混合模式
42
+ */
43
+ BlendingMode[BlendingMode["STRONG_LIGHT"] = 5] = "STRONG_LIGHT";
44
+ /**
45
+ * 弱光混合模式
46
+ */
47
+ BlendingMode[BlendingMode["WEAK_LIGHT"] = 6] = "WEAK_LIGHT";
48
+ /**
49
+ * 亮度叠加混合模式
50
+ */
51
+ BlendingMode[BlendingMode["SUPERPOSITION"] = 7] = "SUPERPOSITION";
52
+ })(BlendingMode || (BlendingMode = {}));
53
+ /**
54
+ * 单双面模式
55
+ */
56
+ export var SideMode;
57
+ (function (SideMode) {
58
+ /**
59
+ * 双面模式
60
+ */
61
+ SideMode[SideMode["DOUBLE"] = 1032] = "DOUBLE";
62
+ /**
63
+ * 正面模式
64
+ */
65
+ SideMode[SideMode["FRONT"] = 1028] = "FRONT";
66
+ /**
67
+ * 背面模式
68
+ */
69
+ SideMode[SideMode["BACK"] = 1029] = "BACK";
70
+ })(SideMode || (SideMode = {}));
71
+ /**
72
+ * 蒙版模式
73
+ */
74
+ export var MaskMode;
75
+ (function (MaskMode) {
76
+ /**
77
+ * 无蒙版
78
+ */
79
+ MaskMode[MaskMode["NONE"] = 0] = "NONE";
80
+ /**
81
+ * 蒙版
82
+ */
83
+ MaskMode[MaskMode["MASK"] = 1] = "MASK";
84
+ /**
85
+ * 被遮挡
86
+ */
87
+ MaskMode[MaskMode["OBSCURED"] = 2] = "OBSCURED";
88
+ /**
89
+ * 被反向遮挡
90
+ */
91
+ MaskMode[MaskMode["REVERSE_OBSCURED"] = 3] = "REVERSE_OBSCURED";
92
+ })(MaskMode || (MaskMode = {}));
93
+ /**
94
+ * 发射器形状
95
+ */
96
+ export var ShapeType;
97
+ (function (ShapeType) {
98
+ /**
99
+ * 没有类型
100
+ */
101
+ ShapeType[ShapeType["NONE"] = 0] = "NONE";
102
+ /**
103
+ * 圆球
104
+ */
105
+ ShapeType[ShapeType["SPHERE"] = 1] = "SPHERE";
106
+ /**
107
+ * 圆锥
108
+ */
109
+ ShapeType[ShapeType["CONE"] = 2] = "CONE";
110
+ /**
111
+ * 半球
112
+ */
113
+ ShapeType[ShapeType["HEMISPHERE"] = 3] = "HEMISPHERE";
114
+ /**
115
+ * 圆
116
+ */
117
+ ShapeType[ShapeType["CIRCLE"] = 4] = "CIRCLE";
118
+ /**
119
+ * 圆环
120
+ */
121
+ ShapeType[ShapeType["DONUT"] = 5] = "DONUT";
122
+ /**
123
+ * 矩形
124
+ */
125
+ ShapeType[ShapeType["RECTANGLE"] = 6] = "RECTANGLE";
126
+ /**
127
+ * 矩形框
128
+ */
129
+ ShapeType[ShapeType["RECTANGLE_EDGE"] = 7] = "RECTANGLE_EDGE";
130
+ /**
131
+ * 直线
132
+ */
133
+ ShapeType[ShapeType["EDGE"] = 8] = "EDGE";
134
+ /**
135
+ * 贴图
136
+ */
137
+ ShapeType[ShapeType["TEXTURE"] = 9] = "TEXTURE";
138
+ })(ShapeType || (ShapeType = {}));
139
+ /**
140
+ * 插件类型
141
+ */
142
+ export var PluginType;
143
+ (function (PluginType) {
144
+ /**
145
+ * 陀螺仪
146
+ */
147
+ PluginType[PluginType["GYROSCOPE"] = 0] = "GYROSCOPE";
148
+ /**
149
+ * Spine
150
+ */
151
+ PluginType[PluginType["SPINE"] = 1] = "SPINE";
152
+ })(PluginType || (PluginType = {}));
153
+ /**
154
+ * 交互类型
155
+ */
156
+ export var InteractType;
157
+ (function (InteractType) {
158
+ /**
159
+ * 点击
160
+ */
161
+ InteractType[InteractType["CLICK"] = 0] = "CLICK";
162
+ /**
163
+ * 消息
164
+ * 前端收到 onMessageItem 回调
165
+ */
166
+ InteractType[InteractType["MESSAGE"] = 1] = "MESSAGE";
167
+ /**
168
+ * 拖拽
169
+ */
170
+ InteractType[InteractType["DRAG"] = 2] = "DRAG";
171
+ })(InteractType || (InteractType = {}));
172
+ /**
173
+ * 交互行为
174
+ */
175
+ export var InteractBehavior;
176
+ (function (InteractBehavior) {
177
+ /**
178
+ * 无
179
+ */
180
+ InteractBehavior[InteractBehavior["NONE"] = 0] = "NONE";
181
+ /**
182
+ * 通知
183
+ */
184
+ InteractBehavior[InteractBehavior["NOTIFY"] = 1] = "NOTIFY";
185
+ /**
186
+ * 重置播放器
187
+ */
188
+ InteractBehavior[InteractBehavior["RESUME_PLAYER"] = 2] = "RESUME_PLAYER";
189
+ /**
190
+ * 清除元素
191
+ */
192
+ InteractBehavior[InteractBehavior["REMOVE"] = 3] = "REMOVE";
193
+ /**
194
+ * 暂停播放器
195
+ */
196
+ InteractBehavior[InteractBehavior["PAUSE"] = 4] = "PAUSE";
197
+ })(InteractBehavior || (InteractBehavior = {}));
198
+ /**
199
+ * 元素类型
200
+ */
201
+ export var ItemType;
202
+ (function (ItemType) {
203
+ /**
204
+ * 错误元素
205
+ */
206
+ ItemType["base"] = "0";
207
+ /**
208
+ * 图层元素
209
+ */
210
+ ItemType["sprite"] = "1";
211
+ /**
212
+ * 粒子元素
213
+ */
214
+ ItemType["particle"] = "2";
215
+ /**
216
+ * 空节点元素
217
+ */
218
+ ItemType["null"] = "3";
219
+ /**
220
+ * 交互元素
221
+ */
222
+ ItemType["interact"] = "4";
223
+ /**
224
+ * 插件元素
225
+ */
226
+ ItemType["plugin"] = "5";
227
+ /**
228
+ * 相机元素
229
+ */
230
+ ItemType["camera"] = "6";
231
+ /**
232
+ * 预合成元素
233
+ */
234
+ ItemType["composition"] = "7";
235
+ /**
236
+ * Spine 元素
237
+ */
238
+ ItemType["spine"] = "spine";
239
+ /**
240
+ * Mesh 元素
241
+ */
242
+ ItemType["mesh"] = "mesh";
243
+ /**
244
+ * 节点树元素
245
+ */
246
+ ItemType["tree"] = "tree";
247
+ /**
248
+ * 文本元素
249
+ */
250
+ ItemType["text"] = "text";
251
+ /**
252
+ * 灯光元素
253
+ */
254
+ ItemType["light"] = "light";
255
+ /**
256
+ * 天空盒元素
257
+ */
258
+ ItemType["skybox"] = "skybox";
259
+ /**
260
+ * 特效元素
261
+ */
262
+ ItemType["effect"] = "effect";
263
+ /**
264
+ * 节点元素
265
+ */
266
+ ItemType["node"] = "node";
267
+ })(ItemType || (ItemType = {}));
268
+ /**
269
+ * 渲染模式
270
+ */
271
+ export var RenderMode;
272
+ (function (RenderMode) {
273
+ /**
274
+ * 广告牌模式
275
+ */
276
+ RenderMode[RenderMode["BILLBOARD"] = 0] = "BILLBOARD";
277
+ /**
278
+ * 网格模式
279
+ */
280
+ RenderMode[RenderMode["MESH"] = 1] = "MESH";
281
+ /**
282
+ * 垂直广告牌模式
283
+ */
284
+ RenderMode[RenderMode["VERTICAL_BILLBOARD"] = 2] = "VERTICAL_BILLBOARD";
285
+ /**
286
+ * 水平广告牌模式
287
+ */
288
+ RenderMode[RenderMode["HORIZONTAL_BILLBOARD"] = 3] = "HORIZONTAL_BILLBOARD";
289
+ })(RenderMode || (RenderMode = {}));
290
+ /**
291
+ * 变换中心
292
+ */
293
+ export var ParticleOrigin;
294
+ (function (ParticleOrigin) {
295
+ /**
296
+ * 水平和垂直中点
297
+ */
298
+ ParticleOrigin[ParticleOrigin["PARTICLE_ORIGIN_CENTER"] = 0] = "PARTICLE_ORIGIN_CENTER";
299
+ /**
300
+ * 水平左侧 垂直顶部
301
+ */
302
+ ParticleOrigin[ParticleOrigin["PARTICLE_ORIGIN_LEFT_TOP"] = 1] = "PARTICLE_ORIGIN_LEFT_TOP";
303
+ /**
304
+ * 水平左侧 垂直中间
305
+ */
306
+ ParticleOrigin[ParticleOrigin["PARTICLE_ORIGIN_LEFT_CENTER"] = 2] = "PARTICLE_ORIGIN_LEFT_CENTER";
307
+ /**
308
+ * 水平左侧 垂直底部
309
+ */
310
+ ParticleOrigin[ParticleOrigin["PARTICLE_ORIGIN_LEFT_BOTTOM"] = 3] = "PARTICLE_ORIGIN_LEFT_BOTTOM";
311
+ /**
312
+ * 水平中间 垂直顶部
313
+ */
314
+ ParticleOrigin[ParticleOrigin["PARTICLE_ORIGIN_CENTER_TOP"] = 4] = "PARTICLE_ORIGIN_CENTER_TOP";
315
+ /**
316
+ * 水平中间 垂直底部
317
+ */
318
+ ParticleOrigin[ParticleOrigin["PARTICLE_ORIGIN_CENTER_BOTTOM"] = 5] = "PARTICLE_ORIGIN_CENTER_BOTTOM";
319
+ /**
320
+ * 水平右侧 垂直顶部
321
+ */
322
+ ParticleOrigin[ParticleOrigin["PARTICLE_ORIGIN_RIGHT_TOP"] = 6] = "PARTICLE_ORIGIN_RIGHT_TOP";
323
+ /**
324
+ * 水平右侧 垂直中间
325
+ */
326
+ ParticleOrigin[ParticleOrigin["PARTICLE_ORIGIN_RIGHT_CENTER"] = 7] = "PARTICLE_ORIGIN_RIGHT_CENTER";
327
+ /**
328
+ * 水平右侧 垂直底部
329
+ */
330
+ ParticleOrigin[ParticleOrigin["PARTICLE_ORIGIN_RIGHT_BOTTOM"] = 8] = "PARTICLE_ORIGIN_RIGHT_BOTTOM";
331
+ })(ParticleOrigin || (ParticleOrigin = {}));
332
+ export var RenderType;
333
+ (function (RenderType) {
334
+ RenderType["Opaque"] = "Opaque";
335
+ RenderType["Transparent"] = "Transparent";
336
+ })(RenderType || (RenderType = {}));
337
+ export var RenderFace;
338
+ (function (RenderFace) {
339
+ RenderFace["Both"] = "Both";
340
+ RenderFace["Back"] = "Back";
341
+ RenderFace["Front"] = "Front";
342
+ })(RenderFace || (RenderFace = {}));
@@ -1,11 +1,11 @@
1
1
  import type { DataPath, EffectsObjectData } from './components';
2
- import type { ItemEndBehavior, ParentItemEndBehavior, BaseContent, TransformData } from './item/base-item';
2
+ import type { EndBehavior, BaseContent, TransformData } from './item/base-item';
3
3
  import type { ItemType, RenderLevel } from './type';
4
4
  export interface VFXItemData extends EffectsObjectData {
5
5
  /**
6
- * 元素 id
7
- * 非预合成的元素 id 为 int 类型的数字字符串
8
- * 预合成元素 id 为 `'{ref元素id}+{合成内id}'` 字符串
6
+ * 元素 ID
7
+ * 非预合成的元素 ID 为 int 类型的数字字符串
8
+ * 预合成元素 ID 为 `'{ref 元素 ID}+{合成内 ID}'` 字符串
9
9
  */
10
10
  id: string;
11
11
  /**
@@ -17,14 +17,13 @@ export interface VFXItemData extends EffectsObjectData {
17
17
  */
18
18
  duration: number;
19
19
  /**
20
- * 元素类型,string 类型
20
+ * 元素类型,String 类型
21
21
  * Galacean Effects 内部元素使用 int 数字字符串
22
22
  * plugin 模块实现者自由实现命名
23
- * 2022.12更新: spine: "spine", 陀螺仪: "5"
24
23
  */
25
- type: ItemType | string;
24
+ type: ItemType;
26
25
  /**
27
- * 父节点ID
26
+ * 父节点 ID
28
27
  * 如果父节点无法找到,播放将直接报错
29
28
  */
30
29
  parentId?: string;
@@ -38,7 +37,7 @@ export interface VFXItemData extends EffectsObjectData {
38
37
  * 元素结束行为
39
38
  * @default destroy
40
39
  */
41
- endBehavior: ItemEndBehavior | ParentItemEndBehavior;
40
+ endBehavior: EndBehavior;
42
41
  /**
43
42
  * 元素播放延时(单位秒)
44
43
  * @default 0
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,72 +1,51 @@
1
1
  {
2
2
  "name": "@galacean/effects-specification",
3
- "version": "2.0.0-alpha.9",
3
+ "version": "2.0.0",
4
4
  "description": "Galacean Effects JSON Specification",
5
- "module": "./dist/index.mjs",
6
- "main": "./dist/index.js",
7
- "types": "./dist/src/index.d.ts",
5
+ "module": "./es/index.js",
6
+ "main": "./es/index.js",
7
+ "types": "./es/index.d.ts",
8
8
  "files": [
9
- "dist"
9
+ "es"
10
10
  ],
11
11
  "exports": {
12
12
  ".": {
13
- "import": "./dist/index.mjs",
14
- "require": "./dist/index.js",
15
- "types": "./dist/src/index.d.ts"
16
- },
17
- "./dist/fallback": {
18
- "import": "./dist/fallback.mjs",
19
- "require": "./dist/fallback.js",
20
- "types": "./dist/fallback/index.d.ts"
13
+ "import": "./es/index.js",
14
+ "require": "./es/index.js",
15
+ "types": "./es/index.d.ts"
21
16
  }
22
17
  },
23
- "scripts": {
24
- "prebuild": "npm run clean:all",
25
- "build": "npm run build:dist",
26
- "build:dist": "rollup -c",
27
- "lint": "eslint {src,fallback,test} --ext .ts,.mjs",
28
- "lint:fix": "eslint {src,fallback,test} --fix --quiet --ext .ts,.mjs",
29
- "check:ts": "tsc -b tsconfig.check.json",
30
- "clean:all": "npm run clean:dist",
31
- "clean:dist": "rimraf dist/**",
32
- "test": "rollup -c --watch --test",
33
- "prepare": "husky install",
34
- "prepublishOnly": "npm run build"
35
- },
36
18
  "browserslist": [
37
19
  "iOS 9"
38
20
  ],
39
21
  "devDependencies": {
40
- "@commitlint/cli": "^19.2.2",
41
- "@commitlint/config-conventional": "^13.2.0",
42
- "@rollup/plugin-commonjs": "^21.0.3",
43
- "@rollup/plugin-node-resolve": "^13.1.3",
44
- "@rollup/plugin-typescript": "^8.3.1",
45
- "@types/chai": "^4.3.0",
46
- "@types/chai-spies": "^1.0.0",
47
- "@types/mocha": "^10.0.1",
48
- "@types/node": "^17.0.21",
49
- "@typescript-eslint/eslint-plugin": "^5.26.0",
50
- "@typescript-eslint/parser": "^5.26.0",
51
- "chai": "^4.3.6",
52
- "chai-spies": "^1.0.0",
53
- "eslint": "^8.13.0",
22
+ "@commitlint/cli": "^13.2.1",
23
+ "@commitlint/config-conventional": "^18.4.3",
24
+ "@typescript-eslint/eslint-plugin": "^7.7.0",
25
+ "@typescript-eslint/parser": "^7.7.0",
26
+ "eslint": "^8.56.0",
54
27
  "eslint-plugin-compat": "^4.2.0",
55
28
  "eslint-plugin-promise": "^6.1.1",
56
- "husky": "^7.0.4",
29
+ "husky": "^9.0.11",
57
30
  "lint-staged": "^11.2.6",
58
- "mocha": "^10.2.0",
31
+ "pnpm": "^8.15.7",
59
32
  "rimraf": "^3.0.2",
60
- "rollup": "^2.70.1",
61
- "rollup-plugin-livereload": "^2.0.5",
62
- "rollup-plugin-serve": "^1.1.0",
63
- "typescript": "^4.6.2",
64
- "uuid": "9.0.1"
33
+ "typescript": "^5.3.3"
65
34
  },
66
35
  "author": "Ant Group CO., Ltd.",
67
36
  "license": "MIT",
68
37
  "publishConfig": {
69
38
  "access": "public",
70
39
  "registry": "https://registry.npmjs.org"
40
+ },
41
+ "scripts": {
42
+ "prebuild": "npm run clean:all",
43
+ "build": "npm run build:lib",
44
+ "build:lib": "tsc -b tsconfig.build.json",
45
+ "lint": "eslint src --ext .ts,.mjs",
46
+ "lint:fix": "eslint src --fix --quiet --ext .ts,.mjs",
47
+ "check:ts": "tsc -b tsconfig.check.json",
48
+ "clean:all": "npm run clean:lib",
49
+ "clean:lib": "rimraf es/**"
71
50
  }
72
- }
51
+ }
@@ -1,2 +0,0 @@
1
- import type { CameraContent } from '../src/item/camera-item';
2
- export declare function getStandardCameraContent(model: any): CameraContent;
@@ -1,12 +0,0 @@
1
- import type { BaseItem, Composition, CompressedImage, Image, JSONScene, ParticleItem, RenderLevel, SpriteItem, TemplateImage } from '../src';
2
- export * from './utils';
3
- export declare function getStandardJSON(json: any): JSONScene;
4
- export declare function getStandardImage(image: any, index: number, imageTags: RenderLevel[]): TemplateImage | Image | CompressedImage;
5
- export declare function getStandardComposition(composition: any, opt?: {
6
- plugins?: string[];
7
- requires?: string[];
8
- }): Composition;
9
- export declare function getStandardItem(item: any, opt?: {
10
- plugins?: string[];
11
- requires?: string[];
12
- }): SpriteItem | ParticleItem | BaseItem;
@@ -1,2 +0,0 @@
1
- import type { InteractContent } from '../src';
2
- export declare function getStandardInteractContent(ui: any): InteractContent;
@@ -1,18 +0,0 @@
1
- import type { JSONScene, JSONSceneLegacy, BaseContent } from '../src';
2
- /**
3
- * 2.1 以下版本数据适配(mars-player@2.4.0 及以上版本支持 2.1 以下数据的适配)
4
- */
5
- export declare function version21Migration(json: JSONSceneLegacy): JSONSceneLegacy;
6
- /**
7
- * 2.2 以下版本数据适配(mars-player@2.5.0 及以上版本支持 2.2 以下数据的适配)
8
- */
9
- export declare function version22Migration(json: JSONSceneLegacy): JSONSceneLegacy;
10
- /**
11
- * 3.0 以下版本数据适配(runtime 2.0及以上版本支持)
12
- */
13
- export declare function version30Migration(json: JSONSceneLegacy): JSONScene;
14
- /**
15
- * 2.5 以下版本 赫尔米特数据转换成贝塞尔数据
16
- */
17
- export declare function version24Migration(json: JSONScene): JSONScene;
18
- export declare function convertParam(content: BaseContent | undefined | null): void;