@galacean/effects-specification 2.0.0-alpha.2 → 2.0.0-alpha.21

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 (104) 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 +9 -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/es/components.d.ts +209 -0
  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 +21 -27
  15. package/es/image.js +9 -0
  16. package/{dist/src → es}/index.d.ts +4 -2
  17. package/es/index.js +28 -0
  18. package/{dist/src → es}/item/base-item.d.ts +27 -8
  19. package/es/item/base-item.js +27 -0
  20. package/{dist/src → es}/item/camera-item.d.ts +6 -6
  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/es/item/effect-item.d.ts +35 -0
  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 +9 -8
  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 -23
  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 +2 -5
  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 +19 -19
  61. package/es/scene.js +1 -0
  62. package/{dist/src → es}/text.d.ts +3 -55
  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 +45 -20
  77. package/es/type.js +342 -0
  78. package/{dist/src → es}/vfx-item-data.d.ts +10 -11
  79. package/es/vfx-item-data.js +1 -0
  80. package/package.json +26 -47
  81. package/dist/fallback/camera.d.ts +0 -2
  82. package/dist/fallback/filter.d.ts +0 -2
  83. package/dist/fallback/index.d.ts +0 -12
  84. package/dist/fallback/interact.d.ts +0 -2
  85. package/dist/fallback/migration.d.ts +0 -13
  86. package/dist/fallback/particle.d.ts +0 -2
  87. package/dist/fallback/sprite.d.ts +0 -3
  88. package/dist/fallback/utils.d.ts +0 -36
  89. package/dist/fallback.js +0 -2155
  90. package/dist/fallback.js.map +0 -1
  91. package/dist/fallback.mjs +0 -2127
  92. package/dist/fallback.mjs.map +0 -1
  93. package/dist/index.js +0 -758
  94. package/dist/index.js.map +0 -1
  95. package/dist/index.mjs +0 -743
  96. package/dist/index.mjs.map +0 -1
  97. package/dist/src/components.d.ts +0 -93
  98. package/dist/src/item/effect-item.d.ts +0 -17
  99. package/dist/src/item/filter-item.d.ts +0 -99
  100. package/dist/src/item/null-item.d.ts +0 -94
  101. /package/{dist/src → es}/item/model/binary.d.ts +0 -0
  102. /package/{dist/src → es}/item/model/index.d.ts +0 -0
  103. /package/{dist/src → es}/item/model/render.d.ts +0 -0
  104. /package/{dist/src → es}/item/particle-shape.d.ts +0 -0
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
- import type { ComponentData, EffectsObjectData } from './components';
2
- import type { ItemEndBehavior, ParentItemEndBehavior, BaseContent, TransformData } from './item/base-item';
1
+ import type { DataPath, EffectsObjectData } from './components';
2
+ import type { EndBehavior, ParentItemEndBehavior, 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 | ParentItemEndBehavior;
42
41
  /**
43
42
  * 元素播放延时(单位秒)
44
43
  * @default 0
@@ -70,5 +69,5 @@ export interface VFXItemData extends EffectsObjectData {
70
69
  /**
71
70
  * 元素的组件数据
72
71
  */
73
- components: ComponentData[];
72
+ components: DataPath[];
74
73
  }
@@ -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.2",
3
+ "version": "2.0.0-alpha.21",
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
22
  "@commitlint/cli": "^13.2.1",
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",
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,2 +0,0 @@
1
- import type { FilterParams } from '../src/item/filter-item';
2
- export declare function getStandardFilterContent(filter: any): FilterParams;
@@ -1,12 +0,0 @@
1
- import type { BaseItem, Composition, CompressedImage, Image, JSONScene, ParticleItem, RenderLevel, SpriteItem, TemplateImage, VideoImage, FilterItem } 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 | VideoImage;
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 | FilterItem;
@@ -1,2 +0,0 @@
1
- import type { InteractContent } from '../src';
2
- export declare function getStandardInteractContent(ui: any): InteractContent;
@@ -1,13 +0,0 @@
1
- import type { JSONScene, JSONSceneLegacy } 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;
@@ -1,2 +0,0 @@
1
- import type { ParticleContent } from '../src';
2
- export declare function getStandardParticleContent(particle: any): ParticleContent;
@@ -1,3 +0,0 @@
1
- import type { BaseItemTransform, NullContent, SpriteContent } from '../src';
2
- export declare function getStandardNullContent(sprite: any, transform: BaseItemTransform): NullContent;
3
- export declare function getStandardSpriteContent(sprite: any, transform: BaseItemTransform): SpriteContent;
@@ -1,36 +0,0 @@
1
- import type { FixedNumberExpression, RGBAColorValue, ColorExpression, NumberExpression, GradientColor, FixedVec3Expression, vec4, vec3, vec2 } from '../src';
2
- import { ParticleOrigin } from '../src';
3
- export declare function arrAdd<T>(arr: T[], item: T): boolean | undefined;
4
- /**
5
- * @deprecated 请直接使用 Array.prototype.forEach 或 for...of
6
- * @param object
7
- * @param callback
8
- * @returns the mutated input object
9
- */
10
- export declare function forEach<T>(object: null | undefined | {
11
- [key: string]: T | Record<any, T>;
12
- }, callback: (val: T, key: string) => void, thisObj?: any): {
13
- [key: string]: T | Record<any, T>;
14
- } | null | undefined;
15
- export declare function ensureFixedNumber(a: any): FixedNumberExpression | undefined;
16
- export declare function ensureFixedNumberWithRandom(a: any, p: number): FixedNumberExpression | undefined;
17
- export declare function ensureRGBAValue(a: any): RGBAColorValue;
18
- export declare function ensureColorExpression(a: any, normalized?: boolean): ColorExpression | undefined;
19
- export declare function ensureNumberExpression(a: any): NumberExpression | undefined;
20
- export declare function ensureValueGetter(a: any): NumberExpression | any;
21
- export declare function ensureGradient(a: any, normalized?: boolean): GradientColor | undefined;
22
- export declare function colorToArr(hex: string | number[], normalized?: boolean): vec4;
23
- export declare function normalizeColor(a: number[]): number[] | undefined;
24
- export declare function parsePercent(c: string): number;
25
- export declare function getGradientColor(color: string | Array<string | number[]>, normalized?: boolean): GradientColor | undefined;
26
- export declare function ensureFixedVec3(a: any): FixedVec3Expression | undefined;
27
- export declare function objectValueToNumber(o: Record<string, any>): object;
28
- export declare function deleteEmptyValue(o: Record<string, any>): object;
29
- export declare function quatFromXYZRotation(out: vec4 | number[], x: number, y: number, z: number): vec4;
30
- export declare function rotationZYXFromQuat(out: vec3 | number[], quat: vec4): vec3;
31
- export declare function generateGUID(): string;
32
- /**
33
- * 提取并转换 JSON 数据中的 anchor 值
34
- */
35
- export declare function convertAnchor(anchor?: vec2, particleOrigin?: ParticleOrigin): vec2;
36
- export declare const particleOriginTranslateMap: Record<number, vec2>;