@vvfx/artis 0.0.1-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 (224) hide show
  1. package/LICENSE +22 -0
  2. package/dist/artis/artis.d.ts +44 -0
  3. package/dist/artis/base-artis.d.ts +520 -0
  4. package/dist/artis/canvas-layer-order.d.ts +19 -0
  5. package/dist/artis/create-info-to-schema.d.ts +21 -0
  6. package/dist/artis/index.d.ts +15 -0
  7. package/dist/artis/operations/index.d.ts +3 -0
  8. package/dist/artis/operations/operations.d.ts +362 -0
  9. package/dist/artis/operations/scene-operations.d.ts +26 -0
  10. package/dist/artis/operations/types.d.ts +39 -0
  11. package/dist/artis/scene-artis.d.ts +386 -0
  12. package/dist/artis/screenshot-service.d.ts +83 -0
  13. package/dist/artis/types.d.ts +130 -0
  14. package/dist/artis/wiring/index.d.ts +17 -0
  15. package/dist/artis/wiring/register-commands.d.ts +44 -0
  16. package/dist/artis/wiring/setup-commands.d.ts +5 -0
  17. package/dist/artis/wiring/setup-event-bindings.d.ts +16 -0
  18. package/dist/artis/wiring/setup-keybindings.d.ts +38 -0
  19. package/dist/artis/wiring/setup-plugins.d.ts +5 -0
  20. package/dist/artis/wiring/wiring-context.d.ts +34 -0
  21. package/dist/artis-sdk/artis-sdk.d.ts +1117 -0
  22. package/dist/artis-sdk/index.d.ts +1 -0
  23. package/dist/core/asset/asset-manager.d.ts +288 -0
  24. package/dist/core/asset/index.d.ts +3 -0
  25. package/dist/core/command/command-service.d.ts +315 -0
  26. package/dist/core/command/commands/composite-command.d.ts +45 -0
  27. package/dist/core/command/commands/frame-layout-command.d.ts +81 -0
  28. package/dist/core/command/commands/frame-layout-mode-command.d.ts +55 -0
  29. package/dist/core/command/commands/frame-move-in-command.d.ts +54 -0
  30. package/dist/core/command/commands/frame-move-out-command.d.ts +54 -0
  31. package/dist/core/command/commands/group-children-detach-command.d.ts +28 -0
  32. package/dist/core/command/commands/index.d.ts +98 -0
  33. package/dist/core/command/commands/item-align-command.d.ts +52 -0
  34. package/dist/core/command/commands/item-create-command.d.ts +66 -0
  35. package/dist/core/command/commands/item-delete-command.d.ts +40 -0
  36. package/dist/core/command/commands/item-distribute-command.d.ts +53 -0
  37. package/dist/core/command/commands/item-group-command.d.ts +41 -0
  38. package/dist/core/command/commands/item-reorder-command.d.ts +41 -0
  39. package/dist/core/command/commands/item-replace-source-command.d.ts +48 -0
  40. package/dist/core/command/commands/item-set-font-family-command.d.ts +46 -0
  41. package/dist/core/command/commands/item-set-generator-resource-command.d.ts +40 -0
  42. package/dist/core/command/commands/item-transform-command.d.ts +51 -0
  43. package/dist/core/command/commands/item-ungroup-command.d.ts +34 -0
  44. package/dist/core/command/commands/item-update-property-by-create-info-command.d.ts +41 -0
  45. package/dist/core/command/commands/item-update-property-command.d.ts +82 -0
  46. package/dist/core/command/commands/mask-commit-command.d.ts +53 -0
  47. package/dist/core/command/commands/page-auto-layout-command.d.ts +53 -0
  48. package/dist/core/command/commands/picture-cut-commit-command.d.ts +43 -0
  49. package/dist/core/command/commands/picture-expand-commit-command.d.ts +35 -0
  50. package/dist/core/command/commands/scene-switch-command.d.ts +35 -0
  51. package/dist/core/command/commands/selection-set-command.d.ts +38 -0
  52. package/dist/core/command/commands/sprite-image-command.d.ts +36 -0
  53. package/dist/core/command/commands/sprite-text-edit-commit-command.d.ts +43 -0
  54. package/dist/core/command/commands/state-hand-command.d.ts +14 -0
  55. package/dist/core/command/commands/state-image-cut-command.d.ts +14 -0
  56. package/dist/core/command/commands/state-image-expand-command.d.ts +14 -0
  57. package/dist/core/command/commands/state-image-mask-command.d.ts +15 -0
  58. package/dist/core/command/commands/state-image-text-edit-command.d.ts +14 -0
  59. package/dist/core/command/commands/state-item-create-command.d.ts +34 -0
  60. package/dist/core/command/commands/state-move-command.d.ts +14 -0
  61. package/dist/core/command/commands/state-switch-command-base.d.ts +41 -0
  62. package/dist/core/command/commands/text-move-command.d.ts +47 -0
  63. package/dist/core/command/commands/text-rotate-command.d.ts +52 -0
  64. package/dist/core/command/commands/text-scale-command.d.ts +56 -0
  65. package/dist/core/command/commands/text-update-content-command.d.ts +51 -0
  66. package/dist/core/command/commands/transform-move-command.d.ts +56 -0
  67. package/dist/core/command/commands/transform-move-with-frame-change-command.d.ts +80 -0
  68. package/dist/core/command/commands/transform-move-with-layout-command.d.ts +56 -0
  69. package/dist/core/command/commands/transform-rotate-command.d.ts +51 -0
  70. package/dist/core/command/commands/transform-scale-command.d.ts +54 -0
  71. package/dist/core/command/commands/video-play-command.d.ts +28 -0
  72. package/dist/core/command/commands/video-source-command.d.ts +39 -0
  73. package/dist/core/command/commands/viewport-fit-to-box-command.d.ts +37 -0
  74. package/dist/core/command/commands/viewport-fit-to-items-command.d.ts +43 -0
  75. package/dist/core/command/commands/viewport-move-command.d.ts +34 -0
  76. package/dist/core/command/commands/viewport-zoom-command.d.ts +35 -0
  77. package/dist/core/command/index.d.ts +5 -0
  78. package/dist/core/command/registry.d.ts +246 -0
  79. package/dist/core/command/types.d.ts +124 -0
  80. package/dist/core/element-registry/element-facade.d.ts +35 -0
  81. package/dist/core/element-registry/element-identity-strategy.d.ts +75 -0
  82. package/dist/core/element-registry/element-registry.d.ts +72 -0
  83. package/dist/core/element-registry/index.d.ts +5 -0
  84. package/dist/core/element-registry/types.d.ts +15 -0
  85. package/dist/core/gizmo/gizmo-bootstrap.d.ts +70 -0
  86. package/dist/core/gizmo/gizmo-command-binder.d.ts +55 -0
  87. package/dist/core/gizmo/gizmo-config-override.d.ts +24 -0
  88. package/dist/core/gizmo/gizmo-registry.d.ts +39 -0
  89. package/dist/core/gizmo/index.d.ts +19 -0
  90. package/dist/core/gizmo/register-gizmo-command-bindings.d.ts +20 -0
  91. package/dist/core/gizmo/state-gizmo-controller.d.ts +20 -0
  92. package/dist/core/history/history-manager.d.ts +174 -0
  93. package/dist/core/history/index.d.ts +1 -0
  94. package/dist/core/index.d.ts +25 -0
  95. package/dist/core/item/base-item.d.ts +154 -0
  96. package/dist/core/item/card-item.d.ts +91 -0
  97. package/dist/core/item/default-item-schema.d.ts +20 -0
  98. package/dist/core/item/effects-item.d.ts +99 -0
  99. package/dist/core/item/frame-item.d.ts +153 -0
  100. package/dist/core/item/generator-item.d.ts +114 -0
  101. package/dist/core/item/group-item.d.ts +51 -0
  102. package/dist/core/item/index.d.ts +25 -0
  103. package/dist/core/item/sprite-item.d.ts +80 -0
  104. package/dist/core/item/text-item.d.ts +171 -0
  105. package/dist/core/item/types.d.ts +158 -0
  106. package/dist/core/item/video-item.d.ts +120 -0
  107. package/dist/core/keybinding/index.d.ts +11 -0
  108. package/dist/core/keybinding/key-binding-controller.d.ts +44 -0
  109. package/dist/core/keybinding/key-binding-registry.d.ts +92 -0
  110. package/dist/core/keybinding/key-binding-store.d.ts +29 -0
  111. package/dist/core/keybinding/key-matcher.d.ts +24 -0
  112. package/dist/core/keybinding/types.d.ts +84 -0
  113. package/dist/core/plugin/index.d.ts +3 -0
  114. package/dist/core/plugin/io-plugin.d.ts +167 -0
  115. package/dist/core/plugin/plugin-system.d.ts +77 -0
  116. package/dist/core/predict/align-predict.d.ts +20 -0
  117. package/dist/core/predict/base/box-ops.d.ts +40 -0
  118. package/dist/core/predict/base/index.d.ts +14 -0
  119. package/dist/core/predict/base/parent-coord.d.ts +29 -0
  120. package/dist/core/predict/base/schema-box.d.ts +21 -0
  121. package/dist/core/predict/distribute-predict.d.ts +19 -0
  122. package/dist/core/predict/frame-layout-predict.d.ts +24 -0
  123. package/dist/core/predict/index.d.ts +12 -0
  124. package/dist/core/preferences/index.d.ts +2 -0
  125. package/dist/core/preferences/user-preferences-manager.d.ts +130 -0
  126. package/dist/core/quality/error-monitor/error-monitor-facade.d.ts +73 -0
  127. package/dist/core/quality/error-monitor/error-monitor.d.ts +106 -0
  128. package/dist/core/quality/error-monitor/index.d.ts +4 -0
  129. package/dist/core/quality/error-monitor/types.d.ts +198 -0
  130. package/dist/core/quality/index.d.ts +3 -0
  131. package/dist/core/quality/perf-monitor/index.d.ts +5 -0
  132. package/dist/core/quality/perf-monitor/perf-monitor-facade.d.ts +45 -0
  133. package/dist/core/quality/perf-monitor/perf-monitor.d.ts +60 -0
  134. package/dist/core/quality/perf-monitor/types.d.ts +66 -0
  135. package/dist/core/quality/stability-monitor/index.d.ts +5 -0
  136. package/dist/core/quality/stability-monitor/stability-monitor-facade.d.ts +50 -0
  137. package/dist/core/quality/stability-monitor/stability-monitor.d.ts +61 -0
  138. package/dist/core/quality/stability-monitor/types.d.ts +69 -0
  139. package/dist/core/renderer/background-controller.d.ts +56 -0
  140. package/dist/core/renderer/index.d.ts +5 -0
  141. package/dist/core/renderer/player-adapter.d.ts +129 -0
  142. package/dist/core/renderer/renderer.d.ts +134 -0
  143. package/dist/core/service/frame-service.d.ts +116 -0
  144. package/dist/core/service/index.d.ts +9 -0
  145. package/dist/core/service/interaction-providers.d.ts +20 -0
  146. package/dist/core/service/interaction-service.d.ts +211 -0
  147. package/dist/core/service/item-asset-service.d.ts +120 -0
  148. package/dist/core/service/item-creator-service.d.ts +211 -0
  149. package/dist/core/service/item-service.d.ts +641 -0
  150. package/dist/core/service/item-sync-service.d.ts +66 -0
  151. package/dist/core/service/json-scene-sync-service.d.ts +140 -0
  152. package/dist/core/service/refresh-animation-base-service.d.ts +1 -0
  153. package/dist/core/service/scene-data-assembler.d.ts +166 -0
  154. package/dist/core/service/view-service.d.ts +202 -0
  155. package/dist/core/state/base-state.d.ts +28 -0
  156. package/dist/core/state/index.d.ts +6 -0
  157. package/dist/core/state/presets.d.ts +25 -0
  158. package/dist/core/state/state-manager.d.ts +50 -0
  159. package/dist/core/state/types.d.ts +52 -0
  160. package/dist/core/store/index.d.ts +3 -0
  161. package/dist/core/store/scene-store.d.ts +194 -0
  162. package/dist/core/store/store.d.ts +36 -0
  163. package/dist/core/types/artis-config.d.ts +186 -0
  164. package/dist/core/types/artis-events.d.ts +101 -0
  165. package/dist/core/types/frame.d.ts +3 -0
  166. package/dist/core/types/generator.d.ts +28 -0
  167. package/dist/core/types/index.d.ts +15 -0
  168. package/dist/core/types/item-create-info.d.ts +205 -0
  169. package/dist/core/types/item-property.d.ts +149 -0
  170. package/dist/core/types/item-reorder.d.ts +12 -0
  171. package/dist/core/types/item-schema.d.ts +263 -0
  172. package/dist/core/types/item-set-property.d.ts +48 -0
  173. package/dist/core/types/page.d.ts +40 -0
  174. package/dist/core/types/sdk.d.ts +28 -0
  175. package/dist/core/types/view.d.ts +39 -0
  176. package/dist/helper/exporter/config.d.ts +18 -0
  177. package/dist/helper/exporter/const.d.ts +71 -0
  178. package/dist/helper/exporter/export-media.d.ts +189 -0
  179. package/dist/helper/exporter/exporter.d.ts +58 -0
  180. package/dist/helper/exporter/index.d.ts +2 -0
  181. package/dist/helper/exporter/types.d.ts +194 -0
  182. package/dist/helper/exporter/utils.d.ts +71 -0
  183. package/dist/helper/exporter/wav-audio.d.ts +35 -0
  184. package/dist/helper/html-overlay/anchor-navigation-runtime.d.ts +1 -0
  185. package/dist/helper/html-overlay/auto-height-layout.d.ts +16 -0
  186. package/dist/helper/html-overlay/auto-height-runtime.d.ts +40 -0
  187. package/dist/helper/html-overlay/document-runtime.d.ts +18 -0
  188. package/dist/helper/html-overlay/document-transform.d.ts +46 -0
  189. package/dist/helper/html-overlay/dom-order.d.ts +5 -0
  190. package/dist/helper/html-overlay/host-message-runtime.d.ts +15 -0
  191. package/dist/helper/html-overlay/html-capture-runtime.d.ts +12 -0
  192. package/dist/helper/html-overlay/html-card-service.d.ts +287 -0
  193. package/dist/helper/html-overlay/html-viewport-style.d.ts +6 -0
  194. package/dist/helper/html-overlay/index.d.ts +1 -0
  195. package/dist/helper/html-overlay/inline-script-json.d.ts +1 -0
  196. package/dist/helper/html-overlay/mime-utils.d.ts +13 -0
  197. package/dist/helper/html-overlay/overlay-transform.d.ts +30 -0
  198. package/dist/helper/html-overlay/path-utils.d.ts +34 -0
  199. package/dist/helper/html-overlay/runtime-context.d.ts +2 -0
  200. package/dist/helper/html-overlay/shell-runtime.d.ts +13 -0
  201. package/dist/helper/index.d.ts +5 -0
  202. package/dist/helper/scene-builder.d.ts +111 -0
  203. package/dist/helper/screen-shot.d.ts +51 -0
  204. package/dist/helper/size-adapt.d.ts +88 -0
  205. package/dist/index.cjs +69350 -0
  206. package/dist/index.cjs.map +1 -0
  207. package/dist/index.d.ts +19 -0
  208. package/dist/index.mjs +68963 -0
  209. package/dist/index.mjs.map +1 -0
  210. package/dist/shared/index.d.ts +1 -0
  211. package/dist/shared/player.d.ts +9 -0
  212. package/dist/utils/background-manager.d.ts +76 -0
  213. package/dist/utils/common-utils.d.ts +39 -0
  214. package/dist/utils/container-size.d.ts +7 -0
  215. package/dist/utils/find-player-item.d.ts +9 -0
  216. package/dist/utils/index.d.ts +11 -0
  217. package/dist/utils/json-data-utils.d.ts +198 -0
  218. package/dist/utils/layout-utils.d.ts +144 -0
  219. package/dist/utils/pixel-box-utils.d.ts +26 -0
  220. package/dist/utils/player-data-utils.d.ts +9 -0
  221. package/dist/utils/player-utils.d.ts +42 -0
  222. package/dist/utils/replay-utils.d.ts +22 -0
  223. package/dist/utils/types.d.ts +130 -0
  224. package/package.json +66 -0
@@ -0,0 +1,153 @@
1
+ import { FrameItemProperty, FrameLayoutMode, type LayoutInfo, type FrameItemSchema } from '../types';
2
+ import { ArtisItemType, FrameItemOptions } from './types';
3
+ import { BaseItem } from './base-item';
4
+ import type { FrameManager } from '@vvfx/gizmo';
5
+ /** Artis-only adapter between persisted element IDs and gizmo runtime instance IDs. */
6
+ export type FrameItemIdAdapter = {
7
+ toRuntimeId(id: string): string | undefined;
8
+ toElementId(runtimeId: string): string;
9
+ };
10
+ /**
11
+ * 画板/框架元素 ArtisItem 类
12
+ * 支持自动布局和自由布局两种模式
13
+ * 底层以 composition 形式渲染
14
+ */
15
+ export declare class FrameItem extends BaseItem {
16
+ /**
17
+ * 元素类型
18
+ */
19
+ readonly type = ArtisItemType.FRAME;
20
+ /**
21
+ * 预合成元素ID
22
+ */
23
+ subCompositionItemId: string;
24
+ /**
25
+ * 元素属性
26
+ */
27
+ property: FrameItemProperty;
28
+ private _frameManager?;
29
+ private _idAdapter;
30
+ /** Initialization buffer only; released once the item is attached to FrameManager. */
31
+ private _frameSeed?;
32
+ constructor(options: FrameItemOptions);
33
+ /** Attach the compatibility item facade to the gizmo-owned Frame data source. */
34
+ bindFrameManager(frameManager: FrameManager, idAdapter?: FrameItemIdAdapter): void;
35
+ private _getFrameSeed;
36
+ private _getRuntimeFrameData;
37
+ private _getLayoutMode;
38
+ private _getChildren;
39
+ private _getAutoLayoutConfig;
40
+ private _getLayoutInfos;
41
+ private _setLayoutMode;
42
+ private _setChildren;
43
+ private _setAutoLayoutConfig;
44
+ private _setLayoutInfos;
45
+ /**
46
+ * 子元素ID列表(只读)
47
+ */
48
+ get children(): readonly string[];
49
+ /**
50
+ * 布局模式
51
+ */
52
+ get layoutMode(): FrameLayoutMode;
53
+ /**
54
+ * 设置布局模式
55
+ * @param value 布局模式
56
+ */
57
+ set layoutMode(value: FrameLayoutMode);
58
+ /**
59
+ * 布局信息
60
+ */
61
+ get layoutInfos(): Record<string, LayoutInfo> | undefined;
62
+ /**
63
+ * 设置布局信息
64
+ * @param info 布局信息
65
+ */
66
+ set layoutInfos(info: Record<string, LayoutInfo> | undefined);
67
+ /**
68
+ * 位置
69
+ */
70
+ get position(): [number, number];
71
+ /**
72
+ * 设置位置
73
+ * @param value 位置坐标 [x, y]
74
+ */
75
+ set position(value: [number, number]);
76
+ /**
77
+ * 宽度
78
+ */
79
+ get width(): number;
80
+ /**
81
+ * 设置宽度
82
+ * @param value 宽度
83
+ */
84
+ set width(value: number);
85
+ /**
86
+ * 高度
87
+ */
88
+ get height(): number;
89
+ /**
90
+ * 设置高度
91
+ * @param value 高度
92
+ */
93
+ set height(value: number);
94
+ /**
95
+ * 缩放
96
+ */
97
+ get scale(): [number, number];
98
+ /**
99
+ * 设置缩放
100
+ * @param value 缩放比 [sx, sy]
101
+ */
102
+ set scale(value: [number, number]);
103
+ /**
104
+ * 旋转(二维旋转角度)
105
+ */
106
+ get rotation(): number;
107
+ /**
108
+ * 设置旋转角度(二维)
109
+ * @param value 旋转角度
110
+ */
111
+ set rotation(value: number);
112
+ /**
113
+ * 添加子元素
114
+ * @param itemId 子元素ID
115
+ * @returns 是否添加成功
116
+ */
117
+ addChild(itemId: string): boolean;
118
+ /**
119
+ * 移除子元素
120
+ * @param itemId 子元素ID
121
+ * @returns 是否移除成功
122
+ */
123
+ removeChild(itemId: string): boolean;
124
+ /** Set one child's layout metadata using Artis element IDs. */
125
+ setChildLayoutInfo(itemId: string, layoutInfo: LayoutInfo): boolean;
126
+ /**
127
+ * 是否包含指定子元素
128
+ * @param itemId 子元素ID
129
+ * @returns 是否包含
130
+ */
131
+ hasChild(itemId: string): boolean;
132
+ /**
133
+ * 清空所有子元素
134
+ */
135
+ clearChildren(): void;
136
+ /**
137
+ * 转换为 FrameItemSchema
138
+ * @param withParent 是否包含父节点ID
139
+ * @returns FrameItemSchema 对象
140
+ */
141
+ toSchema(withParent?: boolean): FrameItemSchema;
142
+ /**
143
+ * 克隆 ArtisItem
144
+ * @returns 新的 FrameItem 实例
145
+ */
146
+ clone(): FrameItem;
147
+ }
148
+ /**
149
+ * 类型守卫:检查是否是 FrameItem
150
+ * @param obj 待检查对象
151
+ * @returns 是否是 FrameItem 实例
152
+ */
153
+ export declare function isFrameItem(obj: any): obj is FrameItem;
@@ -0,0 +1,114 @@
1
+ import { GeneratorType, type GeneratorItemProperty, type GeneratorItemSchema, type VideoItemSchema, type SpriteItemSchema } from '../types';
2
+ import { ArtisItemType, GeneratorItemOptions } from './types';
3
+ import { BaseItem } from './base-item';
4
+ /**
5
+ * 资源生成器元素 ArtisItem 类
6
+ * 支持 image 和 video 两种生成器类型
7
+ * 在 Player 中以透明 SpriteItem 形式渲染
8
+ * 支持属性扩展,可转换为 SpriteItem 或 VideoItem
9
+ */
10
+ export declare class GeneratorItem extends BaseItem {
11
+ /**
12
+ * 元素类型(独立类型,不属于 spec.ItemType)
13
+ */
14
+ readonly type = ArtisItemType.GENERATOR;
15
+ /**
16
+ * 元素属性(包含 generatorType)
17
+ */
18
+ property: GeneratorItemProperty;
19
+ constructor(options: GeneratorItemOptions);
20
+ /**
21
+ * 生成器类型
22
+ */
23
+ get generatorType(): GeneratorType;
24
+ /**
25
+ * 设置生成器类型
26
+ * @param value 生成器类型
27
+ */
28
+ set generatorType(value: GeneratorType);
29
+ /**
30
+ * 图片地址(生成器返回空)
31
+ */
32
+ get image(): string;
33
+ /**
34
+ * 设置图片地址(生成器不支持,操作无效)
35
+ * @param _value 图片地址(忽略)
36
+ */
37
+ set image(_value: string);
38
+ /**
39
+ * 位置
40
+ */
41
+ get position(): [number, number];
42
+ /**
43
+ * 设置位置
44
+ * @param value 位置坐标 [x, y]
45
+ */
46
+ set position(value: [number, number]);
47
+ /**
48
+ * 宽度
49
+ */
50
+ get width(): number;
51
+ /**
52
+ * 设置宽度
53
+ * @param value 宽度
54
+ */
55
+ set width(value: number);
56
+ /**
57
+ * 高度
58
+ */
59
+ get height(): number;
60
+ /**
61
+ * 设置高度
62
+ * @param value 高度
63
+ */
64
+ set height(value: number);
65
+ /**
66
+ * 旋转(二维旋转角度)
67
+ */
68
+ get rotation(): number;
69
+ /**
70
+ * 设置旋转角度(二维)
71
+ * @param value 旋转角度
72
+ */
73
+ set rotation(value: number);
74
+ /**
75
+ * 转换后元素名:去掉"生成器"后缀。
76
+ *
77
+ * 转换为 sprite/video 后,元素不应再带"生成器"占位语义——否则
78
+ * `isGeneratorPlayerItem`(sprite && name 含"生成器")仍判真,
79
+ * IconGizmo 会继续在该真元素上画生成器图标,造成残留。
80
+ * @returns 去掉"生成器"片段后的名称(如"图片生成器"→"图片")
81
+ */
82
+ private getConvertedName;
83
+ /**
84
+ * 转换为 GeneratorItemSchema
85
+ * @param withParent 是否包含父节点ID
86
+ * @returns GeneratorItemSchema 对象
87
+ */
88
+ toSchema(withParent?: boolean): GeneratorItemSchema;
89
+ /**
90
+ * 转换为 VideoItemSchema(用于转换为视频元素)
91
+ * @param videoUrl 视频资源地址
92
+ * @param withParent 是否包含父节点ID
93
+ * @returns VideoItemSchema 对象
94
+ */
95
+ toVideoSchema(videoUrl: string, withParent?: boolean): VideoItemSchema;
96
+ /**
97
+ * 转换为 SpriteItemSchema(用于转换为图片元素)
98
+ * @param imageUrl 图片资源地址
99
+ * @param withParent 是否包含父节点ID
100
+ * @returns SpriteItemSchema 对象
101
+ */
102
+ toSpriteSchema(imageUrl: string, withParent?: boolean): SpriteItemSchema;
103
+ /**
104
+ * 克隆 ArtisItem
105
+ * @returns 新的 GeneratorItem 实例
106
+ */
107
+ clone(): GeneratorItem;
108
+ }
109
+ /**
110
+ * 类型守卫:检查是否是 GeneratorItem
111
+ * @param obj 待检查对象
112
+ * @returns 是否是 GeneratorItem 实例
113
+ */
114
+ export declare function isGeneratorItem(obj: any): obj is GeneratorItem;
@@ -0,0 +1,51 @@
1
+ import { type GroupItemProperty, type GroupItemSchema } from '../types';
2
+ import { ArtisItemType, type GroupItemOptions } from './types';
3
+ import { BaseItem } from './base-item';
4
+ /**
5
+ * 空节点/组 ArtisItem 类
6
+ * 支持属性扩展
7
+ */
8
+ export declare class GroupItem extends BaseItem {
9
+ /**
10
+ * 元素类型
11
+ */
12
+ readonly type = ArtisItemType.GROUP;
13
+ /**
14
+ * 元素属性
15
+ */
16
+ property: GroupItemProperty;
17
+ constructor(options: GroupItemOptions);
18
+ /** 位置 */
19
+ get position(): [number, number];
20
+ /** 设置位置
21
+ * @param value 位置坐标 [x, y]
22
+ */
23
+ set position(value: [number, number]);
24
+ /** 缩放 */
25
+ get scale(): [number, number];
26
+ /** 设置缩放
27
+ * @param value 缩放比例 [x, y]
28
+ */
29
+ set scale(value: [number, number]);
30
+ /** 旋转(二维旋转角度) */
31
+ get rotation(): number;
32
+ /** 设置旋转角度(二维,写入 rotation[2])
33
+ * @param value 旋转角度
34
+ */
35
+ set rotation(value: number);
36
+ /**
37
+ * 转换为 GroupItemSchema
38
+ * @param withParent 是否包含父节点ID
39
+ * @returns GroupItemSchema 数据快照
40
+ */
41
+ toSchema(withParent?: boolean): GroupItemSchema;
42
+ /**
43
+ * 克隆 ArtisItem
44
+ * @returns 新的 GroupItem 实例(带新 ID,深拷贝属性与扩展)
45
+ */
46
+ clone(): GroupItem;
47
+ }
48
+ /**
49
+ * 类型守卫:检查是否是 GroupItem
50
+ */
51
+ export declare function isGroupItem(obj: any): obj is GroupItem;
@@ -0,0 +1,25 @@
1
+ export type { ArtisItemOptions, SpriteItemOptions, TextItemOptions, VideoItemOptions, GroupItemOptions, GeneratorItemOptions, EffectsItemOptions, FrameItemOptions, CardItemOptions, } from './types';
2
+ export { ArtisItemType } from './types';
3
+ export { BaseItem, isBaseItem } from './base-item';
4
+ export { SpriteItem, isSpriteItem } from './sprite-item';
5
+ export { TextItem, isTextItem } from './text-item';
6
+ export { VideoItem, isVideoItem } from './video-item';
7
+ export { GroupItem, isGroupItem } from './group-item';
8
+ export { GeneratorItem, isGeneratorItem } from './generator-item';
9
+ export { EffectsItem, isEffectsItem } from './effects-item';
10
+ export { FrameItem, isFrameItem } from './frame-item';
11
+ export { CardItem, isCardItem } from './card-item';
12
+ export { buildItemSchemaByCreateType } from './default-item-schema';
13
+ import { SpriteItem } from './sprite-item';
14
+ import { GroupItem } from './group-item';
15
+ import { TextItem } from './text-item';
16
+ import { VideoItem } from './video-item';
17
+ import { GeneratorItem } from './generator-item';
18
+ import { EffectsItem } from './effects-item';
19
+ import type { FrameItem } from './frame-item';
20
+ import type { CardItem } from './card-item';
21
+ /**
22
+ * ArtisItem 类型联合
23
+ * 用于替换原来的 ArtisItem type
24
+ */
25
+ export type ArtisItem = SpriteItem | TextItem | VideoItem | GroupItem | GeneratorItem | EffectsItem | FrameItem | CardItem;
@@ -0,0 +1,80 @@
1
+ import { type SpriteItemProperty, type SpriteItemSchema } from '../types';
2
+ import { ArtisItemType, type SpriteItemOptions } from './types';
3
+ import { BaseItem } from './base-item';
4
+ /**
5
+ * 图片元素 ArtisItem 类
6
+ * 支持属性扩展
7
+ */
8
+ export declare class SpriteItem extends BaseItem {
9
+ /**
10
+ * 元素类型
11
+ */
12
+ readonly type = ArtisItemType.SPRITE;
13
+ /**
14
+ * 元素属性
15
+ */
16
+ property: SpriteItemProperty;
17
+ constructor(options: SpriteItemOptions);
18
+ /**
19
+ * 尺寸模式:'auto'=随资源自适应,'fixed'=尺寸定死。auto→fixed 由 ItemService 在显式设尺寸时翻转。
20
+ */
21
+ get sizeMode(): 'auto' | 'fixed';
22
+ /**
23
+ * 图片地址
24
+ */
25
+ get image(): string;
26
+ /**
27
+ * 设置图片地址
28
+ * @param value 图片地址
29
+ */
30
+ set image(value: string);
31
+ /**
32
+ * 位置
33
+ */
34
+ get position(): [number, number];
35
+ /**
36
+ * 设置位置
37
+ * @param value 位置坐标 [x, y]
38
+ */
39
+ set position(value: [number, number]);
40
+ /** 宽度 */
41
+ get width(): number;
42
+ /**
43
+ * 设置宽度
44
+ * @param value 宽度
45
+ */
46
+ set width(value: number);
47
+ /** 高度 */
48
+ get height(): number;
49
+ /**
50
+ * 设置高度
51
+ * @param value 高度
52
+ */
53
+ set height(value: number);
54
+ /**
55
+ * 旋转(二维旋转角度)
56
+ */
57
+ get rotation(): number;
58
+ /**
59
+ * 设置旋转角度(二维)
60
+ * @param value 旋转角度
61
+ */
62
+ set rotation(value: number);
63
+ /**
64
+ * 转换为 SpriteItemSchema
65
+ * @param withParent 是否包含父节点ID
66
+ * @returns SpriteItemSchema 对象
67
+ */
68
+ toSchema(withParent?: boolean): SpriteItemSchema;
69
+ /**
70
+ * 克隆 ArtisItem
71
+ * @returns 新的 SpriteItem 实例
72
+ */
73
+ clone(): SpriteItem;
74
+ }
75
+ /**
76
+ * 类型守卫:检查是否是 SpriteItem
77
+ * @param obj 待检查对象
78
+ * @returns 是否是 SpriteItem 实例
79
+ */
80
+ export declare function isSpriteItem(obj: any): obj is SpriteItem;
@@ -0,0 +1,171 @@
1
+ import { type TextItemProperty, type TextItemSchema } from '../types';
2
+ import { spec } from '../../shared';
3
+ import { ArtisItemType, type TextItemOptions } from './types';
4
+ import { BaseItem } from './base-item';
5
+ /**
6
+ * 文本元素 ArtisItem 类
7
+ * 支持属性扩展
8
+ */
9
+ export declare class TextItem extends BaseItem {
10
+ /**
11
+ * 元素类型
12
+ */
13
+ readonly type = ArtisItemType.TEXT;
14
+ /**
15
+ * 元素属性
16
+ */
17
+ property: TextItemProperty;
18
+ constructor(options: TextItemOptions);
19
+ /**
20
+ * 文本内容
21
+ */
22
+ get text(): string;
23
+ /**
24
+ * 设置文本内容
25
+ * @param value 文本内容
26
+ */
27
+ set text(value: string);
28
+ /**
29
+ * 字体名称
30
+ */
31
+ get fontFamily(): string;
32
+ /**
33
+ * 设置字体名称
34
+ * @param value 字体名称
35
+ */
36
+ set fontFamily(value: string);
37
+ /**
38
+ * 字号
39
+ */
40
+ get fontSize(): number;
41
+ /**
42
+ * 设置字号
43
+ * @param value 字号
44
+ */
45
+ set fontSize(value: number);
46
+ /**
47
+ * 字重
48
+ */
49
+ get fontWeight(): spec.TextWeight;
50
+ /**
51
+ * 设置字重
52
+ * @param value 字重
53
+ */
54
+ set fontWeight(value: spec.TextWeight);
55
+ /**
56
+ * 字体样式
57
+ */
58
+ get fontStyle(): spec.FontStyle;
59
+ /**
60
+ * 设置字体样式
61
+ * @param value 字体样式
62
+ */
63
+ set fontStyle(value: spec.FontStyle);
64
+ /**
65
+ * 文本对齐方式
66
+ */
67
+ get textAlign(): spec.TextAlignment;
68
+ /**
69
+ * 设置文本对齐方式
70
+ * @param value 文本对齐方式
71
+ */
72
+ set textAlign(value: spec.TextAlignment);
73
+ /**
74
+ * 文本颜色 [r, g, b, a]
75
+ */
76
+ get color(): [number, number, number, number];
77
+ /**
78
+ * 设置文本颜色
79
+ * @param value 颜色 [r, g, b, a]
80
+ */
81
+ set color(value: [number, number, number, number]);
82
+ /**
83
+ * 文本宽度
84
+ */
85
+ get width(): number;
86
+ /**
87
+ * 设置文本宽度
88
+ * @param value 宽度
89
+ */
90
+ set width(value: number);
91
+ /**
92
+ * 行高
93
+ */
94
+ get lineHeight(): number;
95
+ /**
96
+ * 设置行高
97
+ * @param value 行高
98
+ */
99
+ set lineHeight(value: number);
100
+ /**
101
+ * 文本高度
102
+ */
103
+ get height(): number;
104
+ /**
105
+ * 设置文本高度
106
+ * @param value 高度
107
+ */
108
+ set height(value: number);
109
+ /**
110
+ * 描边颜色
111
+ */
112
+ get outlineColor(): spec.vec4 | undefined;
113
+ /**
114
+ * 设置描边颜色
115
+ * @param value 描边颜色
116
+ */
117
+ set outlineColor(value: spec.vec4 | undefined);
118
+ /**
119
+ * 描边宽度
120
+ */
121
+ get outlineWidth(): number | undefined;
122
+ /**
123
+ * 设置描边宽度
124
+ * @param value 描边宽度
125
+ */
126
+ set outlineWidth(value: number | undefined);
127
+ /**
128
+ * 描边开关
129
+ */
130
+ get outlineEnabled(): boolean;
131
+ /**
132
+ * 设置描边开关
133
+ * @param value 是否启用描边
134
+ */
135
+ set outlineEnabled(value: boolean);
136
+ /**
137
+ * 位置
138
+ */
139
+ get position(): [number, number];
140
+ /**
141
+ * 设置位置
142
+ * @param value 位置坐标 [x, y]
143
+ */
144
+ set position(value: [number, number]);
145
+ /**
146
+ * 旋转(二维旋转角度)
147
+ */
148
+ get rotation(): number;
149
+ /**
150
+ * 设置旋转角度(二维)
151
+ * @param value 旋转角度
152
+ */
153
+ set rotation(value: number);
154
+ /**
155
+ * 转换为 TextItemSchema
156
+ * @param withParent 是否包含父节点ID
157
+ * @returns TextItemSchema 对象
158
+ */
159
+ toSchema(withParent?: boolean): TextItemSchema;
160
+ /**
161
+ * 克隆 ArtisItem
162
+ * @returns 新的 TextItem 实例
163
+ */
164
+ clone(): TextItem;
165
+ }
166
+ /**
167
+ * 类型守卫:检查是否是 TextItem
168
+ * @param obj 待检查对象
169
+ * @returns 是否是 TextItem 实例
170
+ */
171
+ export declare function isTextItem(obj: any): obj is TextItem;