@galacean/effects-specification 2.0.0-alpha.1 → 2.0.0-alpha.11

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 (90) 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 +1 -1
  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 +79 -4
  9. package/es/components.js +77 -0
  10. package/{dist/src → es}/composition.d.ts +8 -8
  11. package/es/composition.js +42 -0
  12. package/es/constants.js +11 -0
  13. package/{dist/src → es}/image.d.ts +17 -23
  14. package/es/image.js +9 -0
  15. package/{dist/src → es}/index.d.ts +4 -2
  16. package/es/index.js +27 -0
  17. package/{dist/src → es}/item/base-item.d.ts +9 -6
  18. package/es/item/base-item.js +11 -0
  19. package/{dist/src → es}/item/camera-item.d.ts +1 -1
  20. package/es/item/camera-item.js +1 -0
  21. package/es/item/composition-item.js +1 -0
  22. package/es/item/effect-item.d.ts +35 -0
  23. package/es/item/effect-item.js +1 -0
  24. package/es/item/interact-item.js +1 -0
  25. package/es/item/model/binary.js +1 -0
  26. package/{dist/src → es}/item/model/camera.d.ts +20 -4
  27. package/es/item/model/camera.js +5 -0
  28. package/es/item/model/index.js +35 -0
  29. package/es/item/model/light.js +19 -0
  30. package/{dist/src → es}/item/model/material.d.ts +3 -3
  31. package/es/item/model/material.js +16 -0
  32. package/{dist/src → es}/item/model/mesh.d.ts +7 -6
  33. package/es/item/model/mesh.js +5 -0
  34. package/es/item/model/render.js +42 -0
  35. package/es/item/model/skybox.js +1 -0
  36. package/es/item/model/tree.js +1 -0
  37. package/es/item/null-item.js +1 -0
  38. package/{dist/src → es}/item/particle-item.d.ts +0 -3
  39. package/es/item/particle-item.js +14 -0
  40. package/es/item/particle-shape.js +19 -0
  41. package/es/item/plugin-item.js +1 -0
  42. package/es/item/spine-item.js +1 -0
  43. package/es/item/sprite-item.js +1 -0
  44. package/es/item/text-item.js +1 -0
  45. package/{dist/src → es}/item.d.ts +1 -2
  46. package/es/item.js +1 -0
  47. package/{dist/src → es}/number-expression.d.ts +6 -6
  48. package/es/number-expression.js +87 -0
  49. package/{dist/src → es}/scene.d.ts +4 -6
  50. package/es/scene.js +1 -0
  51. package/{dist/src → es}/text.d.ts +1 -7
  52. package/es/text.js +84 -0
  53. package/{dist/src → es}/type.d.ts +29 -8
  54. package/es/type.js +338 -0
  55. package/{dist/src → es}/vfx-item-data.d.ts +3 -3
  56. package/es/vfx-item-data.js +1 -0
  57. package/package.json +26 -47
  58. package/dist/fallback/camera.d.ts +0 -2
  59. package/dist/fallback/filter.d.ts +0 -2
  60. package/dist/fallback/index.d.ts +0 -12
  61. package/dist/fallback/interact.d.ts +0 -2
  62. package/dist/fallback/migration.d.ts +0 -13
  63. package/dist/fallback/particle.d.ts +0 -2
  64. package/dist/fallback/sprite.d.ts +0 -3
  65. package/dist/fallback/utils.d.ts +0 -36
  66. package/dist/fallback.js +0 -2149
  67. package/dist/fallback.js.map +0 -1
  68. package/dist/fallback.mjs +0 -2121
  69. package/dist/fallback.mjs.map +0 -1
  70. package/dist/index.js +0 -752
  71. package/dist/index.js.map +0 -1
  72. package/dist/index.mjs +0 -737
  73. package/dist/index.mjs.map +0 -1
  74. package/dist/src/item/effect-item.d.ts +0 -17
  75. package/dist/src/item/filter-item.d.ts +0 -99
  76. /package/{dist/src → es}/constants.d.ts +0 -0
  77. /package/{dist/src → es}/item/composition-item.d.ts +0 -0
  78. /package/{dist/src → es}/item/interact-item.d.ts +0 -0
  79. /package/{dist/src → es}/item/model/binary.d.ts +0 -0
  80. /package/{dist/src → es}/item/model/index.d.ts +0 -0
  81. /package/{dist/src → es}/item/model/light.d.ts +0 -0
  82. /package/{dist/src → es}/item/model/render.d.ts +0 -0
  83. /package/{dist/src → es}/item/model/skybox.d.ts +0 -0
  84. /package/{dist/src → es}/item/model/tree.d.ts +0 -0
  85. /package/{dist/src → es}/item/null-item.d.ts +0 -0
  86. /package/{dist/src → es}/item/particle-shape.d.ts +0 -0
  87. /package/{dist/src → es}/item/plugin-item.d.ts +0 -0
  88. /package/{dist/src → es}/item/spine-item.d.ts +0 -0
  89. /package/{dist/src → es}/item/sprite-item.d.ts +0 -0
  90. /package/{dist/src → es}/item/text-item.d.ts +0 -0
@@ -32,25 +32,41 @@ export interface ModelCameraItem extends BaseItem {
32
32
  content: ModelCameraContent;
33
33
  endBehavior: ItemEndBehavior;
34
34
  }
35
+ export declare enum CameraType {
36
+ orthographic = "orthographic",
37
+ perspective = "perspective"
38
+ }
35
39
  export interface ModelCameraComponentData extends ComponentData {
40
+ /**
41
+ * 相机类型,默认是透视相机
42
+ */
43
+ type?: CameraType;
36
44
  /**
37
45
  * 视角属性
38
46
  */
39
- fov: number;
47
+ fov?: number;
40
48
  /**
41
49
  * 相机远平面
42
50
  */
43
- far: number;
51
+ far?: number;
44
52
  /**
45
53
  * 相机近平面
46
54
  */
47
- near: number;
55
+ near?: number;
48
56
  /**
49
57
  * 默认不提供,等于 canvas 的 `width/height`
50
58
  */
51
59
  aspect?: number;
60
+ /**
61
+ * x轴上范围(正交相机)
62
+ */
63
+ xmag?: number;
64
+ /**
65
+ * y轴上范围(正交相机)
66
+ */
67
+ ymag?: number;
52
68
  /**
53
69
  * 相机剪裁模式
54
70
  */
55
- clipMode: CameraClipMode;
71
+ clipMode?: CameraClipMode;
56
72
  }
@@ -0,0 +1,5 @@
1
+ export var CameraType;
2
+ (function (CameraType) {
3
+ CameraType["orthographic"] = "orthographic";
4
+ CameraType["perspective"] = "perspective";
5
+ })(CameraType || (CameraType = {}));
@@ -0,0 +1,35 @@
1
+ export * from './skybox';
2
+ export * from './light';
3
+ export * from './mesh';
4
+ export * from './tree';
5
+ export * from './camera';
6
+ export * from './material';
7
+ export * from './binary';
8
+ export * from './render';
9
+ /***
10
+ * 一个 meshItem 打包出来的 json 案例:
11
+ *
12
+ * {
13
+ * type:'mesh',
14
+ * pluginName:'model',
15
+ * content:{
16
+ * options:{
17
+ * skins:{},
18
+ * primitives:[
19
+ * {
20
+ * material:{
21
+ * baseColorFactor:[0,0.5,1,1],
22
+ * baseColorTexture: {
23
+ * magFilter:33071,
24
+ * imageFileId:[0,556,1342]
25
+ * }
26
+ * },
27
+ * geometry:[0,0,556]
28
+ * }
29
+ * ]
30
+ * }
31
+ *
32
+ * }
33
+ * }
34
+ * bins:[{url:'https://to/some/bin'}]
35
+ */
@@ -0,0 +1,19 @@
1
+ export var LightType;
2
+ (function (LightType) {
3
+ /**
4
+ * 点光源
5
+ */
6
+ LightType["point"] = "point";
7
+ /**
8
+ * 聚光灯
9
+ */
10
+ LightType["spot"] = "spot";
11
+ /**
12
+ * 方向光
13
+ */
14
+ LightType["directional"] = "directional";
15
+ /**
16
+ * 环境光
17
+ */
18
+ LightType["ambient"] = "ambient";
19
+ })(LightType || (LightType = {}));
@@ -13,9 +13,9 @@ export declare enum MaterialType {
13
13
  hair = "hair"
14
14
  }
15
15
  export declare enum MaterialBlending {
16
- opaque = 100,
17
- masked = 101,
18
- translucent = 102,
16
+ opaque = 100,// 不透明
17
+ masked = 101,// 遮罩
18
+ translucent = 102,// 半透明
19
19
  additive = 103
20
20
  }
21
21
  export type MaterialOptions<T extends BinaryEnv> = MaterialUnlitOptions<T> | MaterialPBROptions<T>;
@@ -0,0 +1,16 @@
1
+ // 材质类型
2
+ export var MaterialType;
3
+ (function (MaterialType) {
4
+ MaterialType["unlit"] = "unlit";
5
+ MaterialType["pbr"] = "pbr";
6
+ // 头发材质,在 pbr 材质基础上扩展
7
+ MaterialType["hair"] = "hair";
8
+ })(MaterialType || (MaterialType = {}));
9
+ // 混合模式
10
+ export var MaterialBlending;
11
+ (function (MaterialBlending) {
12
+ MaterialBlending[MaterialBlending["opaque"] = 100] = "opaque";
13
+ MaterialBlending[MaterialBlending["masked"] = 101] = "masked";
14
+ MaterialBlending[MaterialBlending["translucent"] = 102] = "translucent";
15
+ MaterialBlending[MaterialBlending["additive"] = 103] = "additive";
16
+ })(MaterialBlending || (MaterialBlending = {}));
@@ -5,7 +5,7 @@ import type { GeometryPointer } from './binary';
5
5
  import type { vec3 } from '../../number-expression';
6
6
  import type { InteractBehavior, ItemType } from '../../type';
7
7
  import type { ModelAnimationTrackDataPointer } from './binary';
8
- import type { ComponentData, DataPath, GeometryData, MaterialData } from '../../components';
8
+ import type { ComponentData, DataPath } from '../../components';
9
9
  export type BufferType = WebGLRenderingContext['FLOAT'] | WebGLRenderingContext['INT'] | WebGLRenderingContext['SHORT'] | WebGLRenderingContext['BYTE'] | WebGLRenderingContext['UNSIGNED_INT'] | WebGLRenderingContext['UNSIGNED_SHORT'] | WebGLRenderingContext['UNSIGNED_BYTE'];
10
10
  export interface PrimitiveOptions<T extends BinaryEnv> {
11
11
  geometry: GeometryPointer<T>;
@@ -69,8 +69,8 @@ export interface ModelMeshItem<T extends BinaryEnv> extends BaseItem {
69
69
  endBehavior: ItemEndBehavior;
70
70
  }
71
71
  export interface PrimitiveData {
72
- geometry: GeometryData;
73
- material: MaterialData;
72
+ geometry: DataPath;
73
+ material: DataPath;
74
74
  }
75
75
  export interface SkinData {
76
76
  name?: string;
@@ -84,13 +84,14 @@ export interface MorphData {
84
84
  export interface ModelMeshComponentData extends ComponentData {
85
85
  hide?: boolean;
86
86
  /**
87
- * 蒙皮数据
87
+ * 骨骼根节点
88
88
  */
89
- skin?: SkinData;
89
+ rootBone: DataPath;
90
90
  /**
91
91
  * Morph数据
92
92
  */
93
93
  morph?: MorphData;
94
- primitives: PrimitiveData[];
94
+ geometry: DataPath;
95
+ materials: DataPath[];
95
96
  interaction?: ModelItemBounding;
96
97
  }
@@ -0,0 +1,5 @@
1
+ export var ModelBoundingType;
2
+ (function (ModelBoundingType) {
3
+ ModelBoundingType[ModelBoundingType["box"] = 2] = "box";
4
+ ModelBoundingType[ModelBoundingType["sphere"] = 3] = "sphere";
5
+ })(ModelBoundingType || (ModelBoundingType = {}));
@@ -0,0 +1,42 @@
1
+ /**
2
+ * 3D渲染模式:将渲染过程中的中间结果输出,主要用于排查渲染效果问题,支持 pbr 和 unlit 材质
3
+ */
4
+ export var RenderMode3D;
5
+ (function (RenderMode3D) {
6
+ /**
7
+ * 正常渲染
8
+ */
9
+ RenderMode3D["none"] = "none";
10
+ /**
11
+ * 纹理坐标
12
+ */
13
+ RenderMode3D["uv"] = "uv";
14
+ /**
15
+ * 世界坐标法线
16
+ */
17
+ RenderMode3D["normal"] = "normal";
18
+ /**
19
+ * 基础颜色
20
+ */
21
+ RenderMode3D["basecolor"] = "basecolor";
22
+ /**
23
+ * 基础颜色 Alpha
24
+ */
25
+ RenderMode3D["alpha"] = "alpha";
26
+ /**
27
+ * 金属度
28
+ */
29
+ RenderMode3D["metallic"] = "metallic";
30
+ /**
31
+ * 粗超度
32
+ */
33
+ RenderMode3D["roughness"] = "roughness";
34
+ /**
35
+ * 环境遮蔽
36
+ */
37
+ RenderMode3D["ao"] = "ao";
38
+ /**
39
+ * 自发光
40
+ */
41
+ RenderMode3D["emissive"] = "emissive";
42
+ })(RenderMode3D || (RenderMode3D = {}));
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -2,7 +2,6 @@ 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, ItemEndBehavior } from './base-item';
4
4
  import type { ParticleShape } from './particle-shape';
5
- import type { DistortionFilterParams } from './filter-item';
6
5
  import type { ComponentData } from '../components';
7
6
  /**
8
7
  * 粒子交互行为
@@ -334,7 +333,6 @@ export interface ParticleContent {
334
333
  */
335
334
  radius?: number;
336
335
  };
337
- filter?: DistortionFilterParams;
338
336
  }
339
337
  /**
340
338
  * 粒子元素渲染属性
@@ -405,7 +403,6 @@ export interface ParticleSystemData extends ComponentData {
405
403
  */
406
404
  radius?: number;
407
405
  };
408
- filter?: DistortionFilterParams;
409
406
  }
410
407
  /**
411
408
  * 粒子拖尾参数
@@ -0,0 +1,14 @@
1
+ /**
2
+ * 粒子交互行为
3
+ */
4
+ export var ParticleInteractionBehavior;
5
+ (function (ParticleInteractionBehavior) {
6
+ /**
7
+ * 无
8
+ */
9
+ ParticleInteractionBehavior[ParticleInteractionBehavior["none"] = 0] = "none";
10
+ /**
11
+ * 移出粒子
12
+ */
13
+ ParticleInteractionBehavior[ParticleInteractionBehavior["removeParticle"] = 1] = "removeParticle";
14
+ })(ParticleInteractionBehavior || (ParticleInteractionBehavior = {}));
@@ -0,0 +1,19 @@
1
+ export var ShapeArcMode;
2
+ (function (ShapeArcMode) {
3
+ /**
4
+ * 随机
5
+ */
6
+ ShapeArcMode[ShapeArcMode["RANDOM"] = 0] = "RANDOM";
7
+ /**
8
+ * 单向循环
9
+ */
10
+ ShapeArcMode[ShapeArcMode["UNIDIRECTIONAL_CYCLE"] = 1] = "UNIDIRECTIONAL_CYCLE";
11
+ /**
12
+ * 双向循环
13
+ */
14
+ ShapeArcMode[ShapeArcMode["BIDIRECTIONAL_CYCLE"] = 2] = "BIDIRECTIONAL_CYCLE";
15
+ /**
16
+ * 均匀爆发
17
+ */
18
+ ShapeArcMode[ShapeArcMode["UNIFORM_BURST"] = 3] = "UNIFORM_BURST";
19
+ })(ShapeArcMode || (ShapeArcMode = {}));
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -5,7 +5,6 @@ import type { PluginItem } from './item/plugin-item';
5
5
  import type { ParticleItem } from './item/particle-item';
6
6
  import type { InteractItem } from './item/interact-item';
7
7
  import type { ModelCameraItem, ModelLightItem, ModelMeshItem, ModelSkyboxItem, ModelTreeItem } from './item/model';
8
- import type { FilterItem } from './item/filter-item';
9
8
  import type { CameraItem } from './item/camera-item';
10
9
  import type { CompositionItem } from './item/composition-item';
11
10
  import type { TextItem } from './item/text-item';
@@ -14,4 +13,4 @@ import type { TextItem } from './item/text-item';
14
13
  * 1.0版本
15
14
  * 基类,无对应元素
16
15
  */
17
- export type Item = SpriteItem | ParticleItem | NullItem | PluginItem | InteractItem | FilterItem | CameraItem | TextItem | ModelMeshItem<'json'> | ModelSkyboxItem<'json'> | ModelTreeItem<'json'> | ModelLightItem | ModelCameraItem | SpineItem | CompositionItem | ModelMeshItem<'studio'> | ModelSkyboxItem<'studio'> | ModelTreeItem<'studio'>;
16
+ 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'>;
package/es/item.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -150,12 +150,12 @@ export type LinearPathValue = [
150
150
  * 关键帧类型
151
151
  */
152
152
  export declare enum BezierKeyframeType {
153
- AUTO = 0,
154
- EASE = 1,
155
- EASE_IN = 2,
156
- EASE_OUT = 3,
157
- LINE = 4,
158
- HOLD = 5,
153
+ AUTO = 0,// 自动
154
+ EASE = 1,// 缓动
155
+ EASE_IN = 2,// 缓入
156
+ EASE_OUT = 3,// 缓出
157
+ LINE = 4,// 线性 (默认进)
158
+ HOLD = 5,// 定格
159
159
  LINE_OUT = 6
160
160
  }
161
161
  /**
@@ -0,0 +1,87 @@
1
+ /*********************************************/
2
+ /* 基本数值属性参数 */
3
+ /*********************************************/
4
+ export var ValueType;
5
+ (function (ValueType) {
6
+ /**
7
+ * 常数
8
+ */
9
+ ValueType[ValueType["CONSTANT"] = 0] = "CONSTANT";
10
+ /**
11
+ * 二维常数向量
12
+ */
13
+ ValueType[ValueType["CONSTANT_VEC2"] = 1] = "CONSTANT_VEC2";
14
+ /**
15
+ * 三维常数向量
16
+ */
17
+ ValueType[ValueType["CONSTANT_VEC3"] = 2] = "CONSTANT_VEC3";
18
+ /**
19
+ * 四维常数向量
20
+ */
21
+ ValueType[ValueType["CONSTANT_VEC4"] = 3] = "CONSTANT_VEC4";
22
+ /**
23
+ * 随机数
24
+ */
25
+ ValueType[ValueType["RANDOM"] = 4] = "RANDOM";
26
+ /**
27
+ * 直线
28
+ */
29
+ ValueType[ValueType["LINE"] = 5] = "LINE";
30
+ /**
31
+ * 曲线
32
+ */
33
+ ValueType[ValueType["CURVE"] = 6] = "CURVE";
34
+ /**
35
+ * 贝塞尔路径
36
+ */
37
+ ValueType[ValueType["BEZIER_PATH"] = 7] = "BEZIER_PATH";
38
+ /**
39
+ * 颜色
40
+ */
41
+ ValueType[ValueType["RGBA_COLOR"] = 8] = "RGBA_COLOR";
42
+ /**
43
+ * 渐变色
44
+ */
45
+ ValueType[ValueType["GRADIENT_COLOR"] = 9] = "GRADIENT_COLOR";
46
+ /**
47
+ * 蒙版形状点集
48
+ */
49
+ ValueType[ValueType["SHAPE_POINTS"] = 10] = "SHAPE_POINTS";
50
+ /**
51
+ * 蒙版形状切分
52
+ */
53
+ ValueType[ValueType["SHAPE_SPLITS"] = 11] = "SHAPE_SPLITS";
54
+ /**
55
+ *直线路径
56
+ */
57
+ ValueType[ValueType["LINEAR_PATH"] = 12] = "LINEAR_PATH";
58
+ /**
59
+ * 多色
60
+ */
61
+ ValueType[ValueType["COLORS"] = 13] = "COLORS";
62
+ /**
63
+ * 二进制指针
64
+ */
65
+ ValueType[ValueType["BINARY"] = 20] = "BINARY";
66
+ /**
67
+ * 贝塞尔曲线
68
+ */
69
+ ValueType[ValueType["BEZIER_CURVE"] = 21] = "BEZIER_CURVE";
70
+ /**
71
+ * 贝塞尔曲线路径
72
+ */
73
+ ValueType[ValueType["BEZIER_CURVE_PATH"] = 22] = "BEZIER_CURVE_PATH";
74
+ })(ValueType || (ValueType = {}));
75
+ /**
76
+ * 关键帧类型
77
+ */
78
+ export var BezierKeyframeType;
79
+ (function (BezierKeyframeType) {
80
+ BezierKeyframeType[BezierKeyframeType["AUTO"] = 0] = "AUTO";
81
+ BezierKeyframeType[BezierKeyframeType["EASE"] = 1] = "EASE";
82
+ BezierKeyframeType[BezierKeyframeType["EASE_IN"] = 2] = "EASE_IN";
83
+ BezierKeyframeType[BezierKeyframeType["EASE_OUT"] = 3] = "EASE_OUT";
84
+ BezierKeyframeType[BezierKeyframeType["LINE"] = 4] = "LINE";
85
+ BezierKeyframeType[BezierKeyframeType["HOLD"] = 5] = "HOLD";
86
+ BezierKeyframeType[BezierKeyframeType["LINE_OUT"] = 6] = "LINE_OUT";
87
+ })(BezierKeyframeType || (BezierKeyframeType = {}));
@@ -23,8 +23,10 @@ export interface JSONSceneLegacy {
23
23
  * 2.0 改造升级
24
24
  * 2.1 增加文本元素
25
25
  * 2.2 数据类型兼容
26
+ * 2.3 新增动态视频、陀螺仪支持旋转
27
+ * 2.4 支持贝塞尔曲线
26
28
  */
27
- version: '1.0' | '1.1' | '1.2' | '1.3' | '1.5' | '1.8' | '2.0' | '2.1' | '2.2';
29
+ version: '1.0' | '1.1' | '1.2' | '1.3' | '1.5' | '1.8' | '2.0' | '2.1' | '2.2' | '2.3' | '2.4';
28
30
  /**
29
31
  * 播放器版本信息
30
32
  */
@@ -103,7 +105,7 @@ export interface JSONScene {
103
105
  /**
104
106
  * JSON 版本
105
107
  *
106
- * 3.0 EC 改造
108
+ * 3.0 EC 改造、移除滤镜元素
107
109
  */
108
110
  version: string;
109
111
  /**
@@ -146,10 +148,6 @@ export interface JSONScene {
146
148
  * 'model@1.0'
147
149
  */
148
150
  plugins: string[];
149
- /**
150
- * 保留字段
151
- */
152
- requires: SceneRequire[];
153
151
  /**
154
152
  * 字体资源
155
153
  * 数据模板下掉可以不要 FontBase[]
package/es/scene.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -1,9 +1,3 @@
1
- import type { RGBAColor } from './number-expression';
2
- export interface StringTemplate {
3
- fonts: FontBase[];
4
- texts: Text[];
5
- colors: RGBAColor[];
6
- }
7
1
  /**
8
2
  * 字体资源
9
3
  * @version 2.3
@@ -171,7 +165,7 @@ export declare enum FontStyle {
171
165
  /**
172
166
  * 正常
173
167
  */
174
- normal = "normal",
168
+ normal = "normal",// default
175
169
  /**
176
170
  * 斜体
177
171
  */
package/es/text.js ADDED
@@ -0,0 +1,84 @@
1
+ export var TextOverflow;
2
+ (function (TextOverflow) {
3
+ /**
4
+ * display 模式下,会显示所有文本,存在文本超过边界框的情况。
5
+ */
6
+ TextOverflow[TextOverflow["display"] = 0] = "display";
7
+ /**
8
+ * clip 模式下,当文本内容超出边界框时,多余的会被截断。
9
+ */
10
+ TextOverflow[TextOverflow["clip"] = 1] = "clip";
11
+ /**
12
+ * ellipsis 模式下,会使用(...)来代替超出边界框的内容。
13
+ */
14
+ TextOverflow[TextOverflow["ellipsis"] = 2] = "ellipsis";
15
+ })(TextOverflow || (TextOverflow = {}));
16
+ export var TextBaseline;
17
+ (function (TextBaseline) {
18
+ /**
19
+ * 文本顶对齐。
20
+ */
21
+ TextBaseline[TextBaseline["top"] = 0] = "top";
22
+ /**
23
+ * 文本垂直居中对齐。
24
+ */
25
+ TextBaseline[TextBaseline["middle"] = 1] = "middle";
26
+ /**
27
+ * 文本底对齐。
28
+ */
29
+ TextBaseline[TextBaseline["bottom"] = 2] = "bottom";
30
+ })(TextBaseline || (TextBaseline = {}));
31
+ export var TextAlignment;
32
+ (function (TextAlignment) {
33
+ /**
34
+ * text alignment starts from(x,y) to right direction
35
+ * 从(x,y)开始第一个字符,向右边延伸
36
+ */
37
+ TextAlignment[TextAlignment["left"] = 0] = "left";
38
+ /**
39
+ * (x,y) is middle position of text, where (left + right)/2 =(x,y)
40
+ * (x,y) 为文字中间位置,(最左位置 + 最右位置)/2 = (x,y)
41
+ */
42
+ TextAlignment[TextAlignment["middle"] = 1] = "middle";
43
+ /**
44
+ * text alignment ends with(x,y) from left direction
45
+ * 从(x,y)结束最后一个字符,向左边延伸
46
+ */
47
+ TextAlignment[TextAlignment["right"] = 2] = "right";
48
+ })(TextAlignment || (TextAlignment = {}));
49
+ /**
50
+ * 文本字重
51
+ */
52
+ export var TextWeight;
53
+ (function (TextWeight) {
54
+ /**
55
+ * 正常
56
+ */
57
+ TextWeight["normal"] = "normal";
58
+ /**
59
+ * 粗体
60
+ */
61
+ TextWeight["bold"] = "bold";
62
+ /**
63
+ * 瘦体
64
+ */
65
+ TextWeight["lighter"] = "lighter";
66
+ })(TextWeight || (TextWeight = {}));
67
+ /**
68
+ * 文本样式
69
+ */
70
+ export var FontStyle;
71
+ (function (FontStyle) {
72
+ /**
73
+ * 正常
74
+ */
75
+ FontStyle["normal"] = "normal";
76
+ /**
77
+ * 斜体
78
+ */
79
+ FontStyle["italic"] = "italic";
80
+ /**
81
+ * 倾斜体
82
+ */
83
+ FontStyle["oblique"] = "oblique";
84
+ })(FontStyle || (FontStyle = {}));
@@ -512,10 +512,6 @@ export declare enum ItemType {
512
512
  * 预合成元素
513
513
  */
514
514
  composition = "7",
515
- /**
516
- * 滤镜图层
517
- */
518
- filter = "8",
519
515
  /**
520
516
  * Spine 元素
521
517
  */
@@ -616,21 +612,37 @@ export interface PluginGyroscopeTarget {
616
612
  */
617
613
  name: string;
618
614
  /**
619
- * x轴最小值
615
+ * x 轴位移最小值
620
616
  */
621
617
  xMin: number;
622
618
  /**
623
- * x轴最大值
619
+ * x 轴位移最大值
624
620
  */
625
621
  xMax: number;
626
622
  /**
627
- * y轴最小值
623
+ * y 轴位移最小值
628
624
  */
629
625
  yMin: number;
630
626
  /**
631
- * y轴最大值
627
+ * y 轴位移最大值
632
628
  */
633
629
  yMax: number;
630
+ /**
631
+ * 绕 x 轴(水平)旋转角度最小值
632
+ */
633
+ hMin: number;
634
+ /**
635
+ * 绕 x 轴(水平)旋转角度最大值
636
+ */
637
+ hMax: number;
638
+ /**
639
+ * 绕 y 轴(垂直)旋转角度最小值
640
+ */
641
+ vMin: number;
642
+ /**
643
+ * 绕 y 轴(垂直)旋转角度最大值
644
+ */
645
+ vMax: number;
634
646
  }
635
647
  /**
636
648
  * 二维蒙版形状属性
@@ -645,3 +657,12 @@ export interface ShapeGeometry {
645
657
  */
646
658
  s: ShapeSplits;
647
659
  }
660
+ export declare enum RenderType {
661
+ Opaque = "Opaque",
662
+ Transparent = "Transparent"
663
+ }
664
+ export declare enum RenderFace {
665
+ Both = "Both",
666
+ Back = "Back",
667
+ Front = "Front"
668
+ }