@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.
Files changed (99) hide show
  1. package/es/animation-clip-data.d.ts +1 -1
  2. package/es/assets.d.ts +95 -0
  3. package/es/assets.js +18 -0
  4. package/es/binary.d.ts +2 -1
  5. package/es/buitin-object-guid.d.ts +1 -0
  6. package/es/buitin-object-guid.js +1 -0
  7. package/es/components/component-data.d.ts +7 -0
  8. package/es/components/component-data.js +1 -0
  9. package/es/components/index.d.ts +2 -0
  10. package/es/components/index.js +2 -0
  11. package/es/components/post-process-volume-data.d.ts +38 -0
  12. package/es/components/post-process-volume-data.js +1 -0
  13. package/es/composition.d.ts +0 -4
  14. package/es/constants.d.ts +6 -0
  15. package/es/constants.js +6 -0
  16. package/es/curve-data/color-curve-data.d.ts +7 -0
  17. package/es/curve-data/color-curve-data.js +1 -0
  18. package/es/curve-data/index.d.ts +2 -0
  19. package/es/curve-data/index.js +2 -0
  20. package/es/curve-data/vector-curve-datas.d.ts +16 -0
  21. package/es/curve-data/vector-curve-datas.js +1 -0
  22. package/es/data-type.d.ts +50 -0
  23. package/es/data-type.js +55 -0
  24. package/es/effects-object-data.d.ts +6 -0
  25. package/es/effects-object-data.js +1 -0
  26. package/es/effects-package-data.d.ts +9 -0
  27. package/es/effects-package-data.js +1 -0
  28. package/es/{components.d.ts → geometry-data.d.ts} +1 -95
  29. package/es/{components.js → geometry-data.js} +0 -39
  30. package/es/index.d.ts +17 -2
  31. package/es/index.js +17 -2
  32. package/es/item/audio-item.d.ts +46 -0
  33. package/es/item/audio-item.js +1 -0
  34. package/es/item/base-item.d.ts +3 -10
  35. package/es/item/effect-item.d.ts +6 -0
  36. package/es/item/interact-item.d.ts +1 -5
  37. package/es/item/model/light.d.ts +6 -1
  38. package/es/item/model/render.d.ts +5 -1
  39. package/es/item/model/render.js +4 -0
  40. package/es/item/model/skybox.d.ts +4 -11
  41. package/es/item/model/tree.d.ts +12 -12
  42. package/es/item/particle-item.d.ts +3 -68
  43. package/es/item/particle-shape.d.ts +12 -12
  44. package/es/item/rich-text-item.d.ts +35 -0
  45. package/es/item/rich-text-item.js +1 -0
  46. package/es/item/spine-item.d.ts +7 -2
  47. package/es/item/sprite-item.d.ts +1 -43
  48. package/es/item/text-item.d.ts +35 -64
  49. package/es/item/video-item.d.ts +82 -0
  50. package/es/item/video-item.js +1 -0
  51. package/es/item.d.ts +4 -1
  52. package/es/material-data.d.ts +21 -0
  53. package/es/material-data.js +1 -0
  54. package/es/math/color-data.d.ts +6 -0
  55. package/es/math/color-data.js +1 -0
  56. package/es/math/index.d.ts +2 -0
  57. package/es/math/index.js +2 -0
  58. package/es/math/vector-data.d.ts +15 -0
  59. package/es/math/vector-data.js +1 -0
  60. package/es/number-expression.d.ts +18 -1
  61. package/es/number-expression.js +8 -0
  62. package/es/render-settings.d.ts +4 -0
  63. package/es/render-settings.js +1 -0
  64. package/es/scene.d.ts +33 -8
  65. package/es/scene.js +5 -1
  66. package/es/shader-data.d.ts +6 -0
  67. package/es/shader-data.js +1 -0
  68. package/es/shape/custom-shape-data.d.ts +68 -0
  69. package/es/shape/custom-shape-data.js +1 -0
  70. package/es/shape/ellipse-data.d.ts +28 -0
  71. package/es/shape/ellipse-data.js +1 -0
  72. package/es/shape/index.d.ts +9 -0
  73. package/es/shape/index.js +9 -0
  74. package/es/shape/polygon-data.d.ts +28 -0
  75. package/es/shape/polygon-data.js +1 -0
  76. package/es/shape/rectangle-data.d.ts +28 -0
  77. package/es/shape/rectangle-data.js +1 -0
  78. package/es/shape/shape-component-data.d.ts +16 -0
  79. package/es/shape/shape-component-data.js +1 -0
  80. package/es/shape/shape-fill-param.d.ts +10 -0
  81. package/es/shape/shape-fill-param.js +1 -0
  82. package/es/shape/shape-primitive-type.d.ts +25 -0
  83. package/es/shape/shape-primitive-type.js +26 -0
  84. package/es/shape/shape-stroke-param.d.ts +26 -0
  85. package/es/shape/shape-stroke-param.js +8 -0
  86. package/es/shape/star-data.d.ts +36 -0
  87. package/es/shape/star-data.js +1 -0
  88. package/es/texture.d.ts +48 -0
  89. package/es/texture.js +1 -0
  90. package/es/timeline/playables/sprite-color-playable-asset-data.d.ts +2 -1
  91. package/es/timeline/playables/transform-playable-asset-data.d.ts +2 -1
  92. package/es/timeline/timeline-asset-data.d.ts +3 -1
  93. package/es/timeline/track/track-asset-data.d.ts +2 -1
  94. package/es/type.d.ts +25 -16
  95. package/es/type.js +33 -13
  96. package/es/vfx-item-data.d.ts +2 -1
  97. package/package.json +13 -12
  98. package/es/image.d.ts +0 -123
  99. package/es/image.js +0 -9
@@ -0,0 +1,46 @@
1
+ import type { ComponentData, DataPath } from '../components';
2
+ import type { ItemType } from '../type';
3
+ import type { BaseItem } from './base-item';
4
+ /**
5
+ * 音频元素
6
+ */
7
+ export interface AudioItem extends BaseItem {
8
+ /**
9
+ * 元素类型(指定为 audio)
10
+ */
11
+ type: ItemType.audio;
12
+ /**
13
+ * 音频元素基础属性
14
+ */
15
+ content: AudioComponentData;
16
+ }
17
+ export interface AudioContentOptions {
18
+ /**
19
+ * 音频链接,索引到 scene 中的 audios 数组
20
+ */
21
+ audio: DataPath;
22
+ /**
23
+ * 音频播放速度
24
+ * @default 1
25
+ */
26
+ playbackRate?: number;
27
+ /**
28
+ * 是否静音播放
29
+ * @default false
30
+ */
31
+ muted?: boolean;
32
+ /**
33
+ * 音频音量大小
34
+ * @default 1
35
+ */
36
+ volume?: number;
37
+ }
38
+ /**
39
+ * 音频组件属性
40
+ */
41
+ export interface AudioComponentData extends ComponentData {
42
+ /**
43
+ * 音频元素基础属性
44
+ */
45
+ options: AudioContentOptions;
46
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,5 @@
1
1
  import type { BinaryEnv } from '../binary';
2
+ import type { Vector2Data, Vector3Data } from '../math';
2
3
  import type { vec3, vec4 } from '../number-expression';
3
4
  import type { ItemType, RenderLevel } from '../type';
4
5
  import type { CameraContent } from './camera-item';
@@ -9,6 +10,7 @@ import type { ModelLightContent, ModelMeshItemContent, ModelTreeContent, SkyboxC
9
10
  import type { NullContent } from './null-item';
10
11
  import type { ParticleContent } from './particle-item';
11
12
  import type { PluginContent } from './plugin-item';
13
+ import type { RichTextContent } from './rich-text-item';
12
14
  import type { SpineContent } from './spine-item';
13
15
  import type { SpriteContent } from './sprite-item';
14
16
  import type { TextContent } from './text-item';
@@ -126,15 +128,6 @@ export interface BaseItemTransform {
126
128
  */
127
129
  quat?: vec4;
128
130
  }
129
- export interface Vector3Data {
130
- x: number;
131
- y: number;
132
- z: number;
133
- }
134
- export interface Vector2Data {
135
- x: number;
136
- y: number;
137
- }
138
131
  export interface TransformData {
139
132
  position: Vector3Data;
140
133
  eulerHint: Vector3Data;
@@ -142,4 +135,4 @@ export interface TransformData {
142
135
  size?: Vector2Data;
143
136
  anchor?: Vector2Data;
144
137
  }
145
- export type BaseContent = SpriteContent | ParticleContent | NullContent | InteractContent | PluginContent | CompositionContent | CameraContent | TextContent | SpineContent | EffectContent | ModelTreeContent<BinaryEnv> | ModelMeshItemContent<BinaryEnv> | ModelLightContent | SkyboxContent<BinaryEnv> | any;
138
+ export type BaseContent = SpriteContent | ParticleContent | NullContent | InteractContent | PluginContent | CompositionContent | CameraContent | TextContent | RichTextContent | SpineContent | EffectContent | ModelTreeContent<BinaryEnv> | ModelMeshItemContent<BinaryEnv> | ModelLightContent | SkyboxContent<BinaryEnv> | any;
@@ -1,3 +1,4 @@
1
+ import type { ComponentData, DataPath } from '../components';
1
2
  import type { ItemType, PositionOverLifetime, RotationOverLifetime, SizeOverLifetime } from '../type';
2
3
  import type { BaseItem, EndBehavior } from './base-item';
3
4
  /**
@@ -33,3 +34,8 @@ export interface EffectContent {
33
34
  */
34
35
  positionOverLifetime?: PositionOverLifetime;
35
36
  }
37
+ export interface EffectComponentData extends ComponentData {
38
+ _priority: number;
39
+ materials: DataPath[];
40
+ geometry: DataPath;
41
+ }
@@ -28,11 +28,7 @@ export interface InteractContent {
28
28
  /**
29
29
  * 交互元素渲染属性
30
30
  */
31
- export interface InteractComponentData extends ComponentData {
32
- /**
33
- * 交互元素基础属性
34
- */
35
- options: InteractOption;
31
+ export interface InteractComponentData extends ComponentData, InteractContent {
36
32
  }
37
33
  /**
38
34
  * 交互元素基础属性
@@ -1,7 +1,8 @@
1
1
  import type { RGBAColorValue } from '../../number-expression';
2
2
  import type { BaseItem, EndBehavior } from '../base-item';
3
3
  import type { RotationOverLifetime, PositionOverLifetime, ItemType } from '../../type';
4
- import type { ColorData, ComponentData } from '../../components';
4
+ import type { ComponentData } from '../../components';
5
+ import type { ColorData } from '../../math';
5
6
  export interface ModelLightBaseOptions {
6
7
  /**
7
8
  * 挂靠的父节点
@@ -116,4 +117,8 @@ export interface ModelLightComponentData extends ComponentData {
116
117
  * @default 45度
117
118
  */
118
119
  outerConeAngle?: number;
120
+ /**
121
+ * 跟随相机
122
+ */
123
+ followCamera?: boolean;
119
124
  }
@@ -37,5 +37,9 @@ export declare enum RenderMode3D {
37
37
  /**
38
38
  * 自发光
39
39
  */
40
- emissive = "emissive"
40
+ emissive = "emissive",
41
+ /**
42
+ * 漫反射
43
+ */
44
+ diffuse = "diffuse"
41
45
  }
@@ -39,4 +39,8 @@ export var RenderMode3D;
39
39
  * 自发光
40
40
  */
41
41
  RenderMode3D["emissive"] = "emissive";
42
+ /**
43
+ * 漫反射
44
+ */
45
+ RenderMode3D["diffuse"] = "diffuse";
42
46
  })(RenderMode3D || (RenderMode3D = {}));
@@ -2,7 +2,8 @@ import type { BaseItem, EndBehavior } from '../base-item';
2
2
  import type { BinaryEnv } from '../../binary';
3
3
  import type { SkyboxCubeTexturePointer } from './binary';
4
4
  import type { ItemType } from '../../type';
5
- import type { ComponentData, DataPath, Vector4Data } from '../../components';
5
+ import type { ComponentData, DataPath } from '../../components';
6
+ import type { Vector4Data } from '../../math';
6
7
  export interface SkyboxOptions<T extends BinaryEnv> {
7
8
  /**
8
9
  * 环境光旋转
@@ -56,16 +57,6 @@ export interface ModelSkyboxItem<T extends BinaryEnv> extends BaseItem {
56
57
  * bins:[{url:'https://big/bin/'}]
57
58
  */
58
59
  export interface SkyboxComponentOptions {
59
- renderable: boolean;
60
- intensity: number;
61
- reflectionsIntensity: number;
62
- irradianceCoeffs?: number[];
63
- diffuseImage?: DataPath;
64
- specularImage: DataPath;
65
- specularImageSize: number;
66
- specularMipCount: number;
67
- }
68
- export interface SkyboxComponentData extends ComponentData {
69
60
  /**
70
61
  * Skybox 是否渲染,UI显示"可见"
71
62
  */
@@ -99,3 +90,5 @@ export interface SkyboxComponentData extends ComponentData {
99
90
  */
100
91
  specularMipCount: number;
101
92
  }
93
+ export interface SkyboxComponentData extends ComponentData, SkyboxComponentOptions {
94
+ }
@@ -25,40 +25,40 @@ export interface ModelAnimationOptions<T extends BinaryEnv> {
25
25
  tracks: ModelAnimTrackOptions<T>[];
26
26
  }
27
27
  /**
28
- * 3D场景树属性,包含动画数据
28
+ * 3D 场景树属性,包含动画数据
29
29
  */
30
30
  export interface ModelTreeOptions<T extends BinaryEnv> extends TreeOptions {
31
31
  /**
32
- * 默认动画索引,-1表示不播放动画
32
+ * 默认动画索引,-1 表示不播放动画
33
33
  */
34
34
  animation?: number;
35
35
  /**
36
- * 3D场景树中所有的动画数据
36
+ * 3D 场景树中所有的动画数据
37
37
  */
38
38
  animations?: ModelAnimationOptions<T>[];
39
39
  }
40
40
  export interface ModelTreeContent<T extends BinaryEnv> {
41
41
  /**
42
- * 3D场景树元素基础属性
42
+ * 3D 场景树元素基础属性
43
43
  */
44
44
  options: {
45
45
  tree: ModelTreeOptions<T>;
46
46
  };
47
47
  /**
48
- * 3D场景树元素大小变化属性
48
+ * 3D 场景树元素大小变化属性
49
49
  */
50
50
  sizeOverLifetime?: SizeOverLifetime;
51
51
  /**
52
- * 3D场景树元素旋转变化属性
52
+ * 3D 场景树元素旋转变化属性
53
53
  */
54
54
  rotationOverLifetime?: RotationOverLifetime;
55
55
  /**
56
- * 3D场景树元素位置变化属性
56
+ * 3D 场景树元素位置变化属性
57
57
  */
58
58
  positionOverLifetime?: PositionOverLifetime;
59
59
  }
60
60
  /**
61
- * 3D场景树元素
61
+ * 3D 场景树元素
62
62
  */
63
63
  export interface ModelTreeItem<T extends BinaryEnv> extends BaseItem {
64
64
  type: ItemType.tree;
@@ -77,21 +77,21 @@ export interface ModelAnimationData {
77
77
  }
78
78
  export interface ModelAnimationComponentData extends ComponentData {
79
79
  /**
80
- * 默认动画索引,-1表示不播放动画
80
+ * 默认动画索引,-1 表示不播放动画
81
81
  */
82
82
  animation?: number;
83
83
  /**
84
- * 3D场景树中所有的动画数据
84
+ * 3D 场景树中所有的动画数据
85
85
  */
86
86
  animations: ModelAnimationData[];
87
87
  }
88
88
  export interface AnimationComponentData extends ComponentData {
89
89
  /**
90
- * 默认动画索引,-1表示不播放动画
90
+ * 默认动画索引,-1 表示不播放动画
91
91
  */
92
92
  animation?: number;
93
93
  /**
94
- * glTF中所有的动画数据
94
+ * glTF 中所有的动画数据
95
95
  */
96
96
  animationClips: DataPath[];
97
97
  }
@@ -2,7 +2,7 @@ import type { ItemType, RendererOptions, TextureSheetAnimation, BlendingMode, Sp
2
2
  import type { FixedNumberExpression, NumberExpression, GradientColor, vec3, FixedVec3Expression, ColorExpression, FunctionExpression } from '../number-expression';
3
3
  import type { BaseItem, EndBehavior } from './base-item';
4
4
  import type { ParticleShape } from './particle-shape';
5
- import type { ComponentData } from '../components';
5
+ import type { ComponentData, DataPath } from '../components';
6
6
  /**
7
7
  * 粒子交互行为
8
8
  */
@@ -337,72 +337,7 @@ export interface ParticleContent {
337
337
  /**
338
338
  * 粒子元素渲染属性
339
339
  */
340
- export interface ParticleSystemData extends ComponentData {
341
- splits?: SplitParameter[];
342
- /**
343
- * 粒子元素基础属性
344
- */
345
- options: ParticleOptions;
346
- /**
347
- * 粒子元素材质渲染属性
348
- */
349
- renderer: RendererOptions;
350
- /**
351
- * 粒子元素发射器形状属性
352
- */
353
- shape?: ParticleShape;
354
- /**
355
- * 粒子元素发射参数属性
356
- */
357
- emission: ParticleEmission;
358
- /**
359
- * 粒子元素大小变化属性
360
- */
361
- sizeOverLifetime?: ParticleSizeOverLifetime;
362
- /**
363
- * 发射器 transform 变化
364
- */
365
- emitterTransform?: {
366
- /**
367
- * 位置变化
368
- */
369
- path?: FixedVec3Expression;
370
- };
371
- positionOverLifetime?: ParticlePositionOverLifetime;
372
- /**
373
- * 粒子元素旋转变化属性
374
- */
375
- rotationOverLifetime?: ParticleRotationOverLifetime;
376
- /**
377
- * 粒子元素色彩变化属性
378
- */
379
- colorOverLifetime?: ParticleColorOverLifetime;
380
- /**
381
- * 粒子元素贴图变化属性
382
- */
383
- textureSheetAnimation?: ParticleTextureSheetAnimation;
384
- /**
385
- * 粒子元素拖尾参数
386
- */
387
- trails?: ParticleTrail;
388
- /**
389
- * 粒子元素交互参数
390
- */
391
- interaction?: {
392
- /**
393
- * 交互行为
394
- */
395
- behavior?: ParticleInteractionBehavior;
396
- /**
397
- * 重叠元素响应开关
398
- */
399
- multiple?: boolean;
400
- /**
401
- * ray cast 射线拾取时 sphere 的半径
402
- * @default 0.4
403
- */
404
- radius?: number;
405
- };
340
+ export interface ParticleSystemData extends ComponentData, ParticleContent {
406
341
  }
407
342
  /**
408
343
  * 粒子拖尾参数
@@ -472,7 +407,7 @@ export interface ParticleTrail {
472
407
  /**
473
408
  * 拖尾贴图
474
409
  */
475
- texture?: number;
410
+ texture?: DataPath;
476
411
  /**
477
412
  * 位置受父节点影响
478
413
  * 拖尾+图层绑定同一个父节点时使用
@@ -1,4 +1,4 @@
1
- import type { ShapeType } from '../type';
1
+ import type { ParticleEmitterShapeType } from '../type';
2
2
  import type { NumberExpression, vec3 } from '../number-expression';
3
3
  export declare enum ShapeArcMode {
4
4
  /**
@@ -22,7 +22,7 @@ export interface ParticleShapeBase {
22
22
  /**
23
23
  * 粒子形状类型
24
24
  */
25
- type: ShapeType;
25
+ type: ParticleEmitterShapeType;
26
26
  /**
27
27
  * 发射模式
28
28
  */
@@ -43,7 +43,7 @@ export interface ParticleShapeBase {
43
43
  turbulenceZ?: NumberExpression;
44
44
  }
45
45
  export interface ParticleShapeNone {
46
- type: ShapeType.NONE;
46
+ type: ParticleEmitterShapeType.NONE;
47
47
  /**
48
48
  * 发射方向旋转
49
49
  */
@@ -57,7 +57,7 @@ export type ParticleShape = ParticleShapeCone | ParticleShapeCircle | ParticleSh
57
57
  * 圆锥发射器
58
58
  */
59
59
  export interface ParticleShapeCone extends ParticleShapeBase {
60
- type: ShapeType.CONE;
60
+ type: ParticleEmitterShapeType.CONE;
61
61
  /**
62
62
  * 形状角度
63
63
  */
@@ -75,7 +75,7 @@ export interface ParticleShapeCone extends ParticleShapeBase {
75
75
  * 圆发射器
76
76
  */
77
77
  export interface ParticleShapeCircle extends ParticleShapeBase {
78
- type: ShapeType.CIRCLE;
78
+ type: ParticleEmitterShapeType.CIRCLE;
79
79
  /**
80
80
  * 形状半径
81
81
  */
@@ -89,7 +89,7 @@ export interface ParticleShapeCircle extends ParticleShapeBase {
89
89
  * 圆球发射器
90
90
  */
91
91
  export interface ParticleShapeSphere extends ParticleShapeBase {
92
- type: ShapeType.SPHERE;
92
+ type: ParticleEmitterShapeType.SPHERE;
93
93
  /**
94
94
  * 形状半径
95
95
  */
@@ -103,7 +103,7 @@ export interface ParticleShapeSphere extends ParticleShapeBase {
103
103
  * 半球发射器
104
104
  */
105
105
  export interface ParticleShapeHemisphere extends ParticleShapeBase {
106
- type: ShapeType.HEMISPHERE;
106
+ type: ParticleEmitterShapeType.HEMISPHERE;
107
107
  /**
108
108
  * 形状半径
109
109
  */
@@ -117,7 +117,7 @@ export interface ParticleShapeHemisphere extends ParticleShapeBase {
117
117
  * 圆环发射器
118
118
  */
119
119
  export interface ParticleShapeDonut extends ParticleShapeBase {
120
- type: ShapeType.DONUT;
120
+ type: ParticleEmitterShapeType.DONUT;
121
121
  /**
122
122
  * 形状半径
123
123
  */
@@ -135,7 +135,7 @@ export interface ParticleShapeDonut extends ParticleShapeBase {
135
135
  * 矩形发射器
136
136
  */
137
137
  export interface ParticleShapeRect extends ParticleShapeBase {
138
- type: ShapeType.RECTANGLE;
138
+ type: ParticleEmitterShapeType.RECTANGLE;
139
139
  /**
140
140
  * 宽度
141
141
  */
@@ -149,7 +149,7 @@ export interface ParticleShapeRect extends ParticleShapeBase {
149
149
  * 矩形框发射器
150
150
  */
151
151
  export interface ParticleShapeRectEdge extends ParticleShapeBase {
152
- type: ShapeType.RECTANGLE_EDGE;
152
+ type: ParticleEmitterShapeType.RECTANGLE_EDGE;
153
153
  /**
154
154
  * 宽度
155
155
  */
@@ -163,7 +163,7 @@ export interface ParticleShapeRectEdge extends ParticleShapeBase {
163
163
  * 直线发射器
164
164
  */
165
165
  export interface ParticleShapeEdge extends ParticleShapeBase {
166
- type: ShapeType.EDGE;
166
+ type: ParticleEmitterShapeType.EDGE;
167
167
  /**
168
168
  * 宽度
169
169
  */
@@ -173,7 +173,7 @@ export interface ParticleShapeEdge extends ParticleShapeBase {
173
173
  * 贴图发射器
174
174
  */
175
175
  export interface ParticleShapeTexture extends ParticleShapeBase {
176
- type: ShapeType.TEXTURE;
176
+ type: ParticleEmitterShapeType.TEXTURE;
177
177
  detail: ParticleTextureShapeDetail;
178
178
  /**
179
179
  * 贴图随机数
@@ -0,0 +1,35 @@
1
+ import type { BaseItem, EndBehavior } from './base-item';
2
+ import type { ItemType } from '../type';
3
+ import type { BaseTextContentOptions, TextComponentData, TextContent } from './text-item';
4
+ /**
5
+ * 富文本元素
6
+ */
7
+ export interface RichTextItem extends BaseItem {
8
+ /**
9
+ * 元素类型(指定为 text)
10
+ */
11
+ type: ItemType.richtext;
12
+ /**
13
+ * 文本元素渲染信息
14
+ */
15
+ content: RichTextContent;
16
+ endBehavior: EndBehavior;
17
+ }
18
+ /**
19
+ * 文本元素渲染属性
20
+ */
21
+ export interface RichTextContent extends Omit<TextContent, 'options'> {
22
+ /**
23
+ * 文本元素基础属性
24
+ */
25
+ options: BaseTextContentOptions;
26
+ }
27
+ /**
28
+ * 富文本元素渲染属性
29
+ */
30
+ export interface RichTextComponentData extends Omit<TextComponentData, 'options'> {
31
+ /**
32
+ * 富文本元素基础属性
33
+ */
34
+ options: BaseTextContentOptions;
35
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,6 +1,7 @@
1
1
  import type { BinaryPointer } from '../binary';
2
- import type { ComponentData, DataPath, DataType } from '../components';
3
- import type { SizeOverLifetime, RotationOverLifetime, PositionOverLifetime, ColorOverLifetime, RendererOptions, ItemType } from '../type';
2
+ import type { ComponentData, DataPath } from '../components';
3
+ import type { DataType } from '../data-type';
4
+ import type { SizeOverLifetime, RotationOverLifetime, PositionOverLifetime, ColorOverLifetime, RendererOptions, ItemType, MaskMode, RenderMode } from '../type';
4
5
  import type { BaseItem, EndBehavior } from './base-item';
5
6
  /**
6
7
  * 插件元素
@@ -118,4 +119,8 @@ export interface SpineComponent extends ComponentData {
118
119
  images: DataPath[];
119
120
  skeletonType: skeletonFileType;
120
121
  };
122
+ renderer?: {
123
+ renderMode: RenderMode;
124
+ maskMode: MaskMode;
125
+ };
121
126
  }
@@ -73,47 +73,5 @@ export interface SpriteContent {
73
73
  /**
74
74
  * 图层组件属性
75
75
  */
76
- export interface SpriteComponentData extends ComponentData {
77
- /**
78
- * added by loader
79
- * @default null
80
- */
81
- splits?: SplitParameter[];
82
- /**
83
- * 图层元素基础属性
84
- */
85
- options: SpriteContentOptions;
86
- /**
87
- * 图层元素材质渲染属性
88
- */
89
- renderer: RendererOptions;
90
- /**
91
- * 图层元素大小变化属性
92
- */
93
- sizeOverLifetime?: SizeOverLifetime;
94
- /**
95
- * 图层元素旋转变化属性
96
- */
97
- rotationOverLifetime?: RotationOverLifetime;
98
- /**
99
- * 图层元素位置变化属性
100
- */
101
- positionOverLifetime?: PositionOverLifetime;
102
- /**
103
- * 图层元素色彩变化属性
104
- */
105
- colorOverLifetime?: ColorOverLifetime;
106
- /**
107
- * 图层元素贴图变化属性
108
- */
109
- textureSheetAnimation?: TextureSheetAnimation;
110
- /**
111
- * 图层交互
112
- */
113
- interaction?: {
114
- /**
115
- * 交互行为
116
- */
117
- behavior: InteractBehavior;
118
- };
76
+ export interface SpriteComponentData extends ComponentData, SpriteContent {
119
77
  }
@@ -17,7 +17,40 @@ export interface TextItem extends BaseItem {
17
17
  content: TextContent;
18
18
  endBehavior: EndBehavior;
19
19
  }
20
- export interface TextContentOptions {
20
+ export interface TextContentOptions extends BaseTextContentOptions {
21
+ /**
22
+ * 文本间隔
23
+ * @default 0
24
+ */
25
+ letterSpace?: number;
26
+ /**
27
+ * 文本固定宽度(和自适应宽高冲突)
28
+ * @default 31
29
+ */
30
+ textWidth?: number;
31
+ /**
32
+ * 文本行高
33
+ * @default 31
34
+ */
35
+ lineHeight?: number;
36
+ /**
37
+ * 文本高度
38
+ * @default 31
39
+ */
40
+ textHeight?: number;
41
+ /**
42
+ * 自适应宽高开关(和文本固定宽度冲突)
43
+ * @default false
44
+ */
45
+ autoWidth?: boolean;
46
+ /**
47
+ * 当文字超过最大宽度时,文字的表现行为
48
+ * 仅当设置文字最大宽度后生效
49
+ * @default TextOverflow.display
50
+ */
51
+ textOverflow?: TextOverflow;
52
+ }
53
+ export interface BaseTextContentOptions {
21
54
  /**
22
55
  * 文本内容
23
56
  */
@@ -37,11 +70,6 @@ export interface TextContentOptions {
37
70
  * @default 'Arial'
38
71
  */
39
72
  fontFamily?: string;
40
- /**
41
- * 文本间隔
42
- * @default 0
43
- */
44
- letterSpace?: number;
45
73
  /**
46
74
  * 上下对齐方式
47
75
  * @default TextBaseline.middle
@@ -52,26 +80,6 @@ export interface TextContentOptions {
52
80
  * @default TextAlignment.left
53
81
  */
54
82
  textAlign?: TextAlignment;
55
- /**
56
- * 文本固定宽度(和自适应宽高冲突)
57
- * @default 31
58
- */
59
- textWidth?: number;
60
- /**
61
- * 文本行高
62
- * @default 31
63
- */
64
- lineHeight?: number;
65
- /**
66
- * 文本高度
67
- * @default 31
68
- */
69
- textHeight?: number;
70
- /**
71
- * 自适应宽高开关(和文本固定宽度冲突)
72
- * @default false
73
- */
74
- autoWidth?: boolean;
75
83
  /**
76
84
  * 文本字重
77
85
  * @default TextWeight.normal
@@ -174,42 +182,5 @@ export interface TextContent {
174
182
  /**
175
183
  * 文本元素渲染属性
176
184
  */
177
- export interface TextComponentData extends ComponentData {
178
- /**
179
- * 文本元素基础属性
180
- */
181
- options: TextContentOptions;
182
- /**
183
- * 文本元素材质渲染属性
184
- */
185
- renderer: RendererOptions;
186
- /**
187
- * 文本元素大小变化属性
188
- */
189
- sizeOverLifetime?: SizeOverLifetime;
190
- /**
191
- * 文本元素旋转变化属性
192
- */
193
- rotationOverLifetime?: RotationOverLifetime;
194
- /**
195
- * 文本元素位置变化属性
196
- */
197
- positionOverLifetime?: PositionOverLifetime;
198
- /**
199
- * 文本元素色彩变化属性
200
- */
201
- colorOverLifetime?: ColorOverLifetime;
202
- /**
203
- * 文本元素贴图变化属性
204
- */
205
- textureSheetAnimation?: TextureSheetAnimation;
206
- /**
207
- * 图层交互
208
- */
209
- interaction?: {
210
- /**
211
- * 交互行为
212
- */
213
- behavior: InteractBehavior;
214
- };
185
+ export interface TextComponentData extends ComponentData, TextContent {
215
186
  }