sapdon 3.0.3 → 3.2.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 (219) hide show
  1. package/README.md +11 -3
  2. package/doc/api.md +2 -2
  3. package/doc/oc/index.md +0 -0
  4. package/doc/sapdon-ts.md +7 -5
  5. package/package.json +18 -19
  6. package/{dist/cli/dev-server/server.d.ts → prod/cli/index.d.ts} +9 -3
  7. package/prod/cli/index.js +1 -0
  8. package/prod/cli/start.js +1428 -0
  9. package/{dist → prod}/core/index.d.ts +2325 -1643
  10. package/prod/core/index.js +59017 -0
  11. package/{dist → prod}/oc/index.d.ts +3 -3
  12. package/prod/oc/index.js +1 -0
  13. package/prod/utils/index.d.ts +41 -0
  14. package/prod/utils/index.js +1 -0
  15. package/dist/cli/build.d.ts +0 -7
  16. package/dist/cli/build.js +0 -234
  17. package/dist/cli/dev-server/client.d.ts +0 -2
  18. package/dist/cli/dev-server/client.js +0 -21
  19. package/dist/cli/dev-server/config.d.ts +0 -3
  20. package/dist/cli/dev-server/config.js +0 -3
  21. package/dist/cli/dev-server/handles.d.ts +0 -4
  22. package/dist/cli/dev-server/handles.js +0 -5
  23. package/dist/cli/dev-server/hmr.d.ts +0 -1
  24. package/dist/cli/dev-server/hmr.js +0 -13
  25. package/dist/cli/dev-server/index.d.ts +0 -4
  26. package/dist/cli/dev-server/index.js +0 -17
  27. package/dist/cli/dev-server/server.js +0 -59
  28. package/dist/cli/dev-server/syncFiles.d.ts +0 -3
  29. package/dist/cli/dev-server/syncFiles.js +0 -37
  30. package/dist/cli/index.d.ts +0 -23
  31. package/dist/cli/index.js +0 -1
  32. package/dist/cli/init.d.ts +0 -9
  33. package/dist/cli/init.js +0 -80
  34. package/dist/cli/load.d.ts +0 -3
  35. package/dist/cli/load.js +0 -94
  36. package/dist/cli/start.d.ts +0 -2
  37. package/dist/cli/start.js +0 -2
  38. package/dist/cli/tools/textureSet.d.ts +0 -13
  39. package/dist/cli/tools/textureSet.js +0 -103
  40. package/dist/cli/utils.d.ts +0 -13
  41. package/dist/cli/utils.js +0 -89
  42. package/dist/core/addon/biome.d.ts +0 -22
  43. package/dist/core/addon/biome.js +0 -27
  44. package/dist/core/addon/block/block.d.ts +0 -41
  45. package/dist/core/addon/block/block.js +0 -46
  46. package/dist/core/addon/controllers/animationController.d.ts +0 -43
  47. package/dist/core/addon/controllers/animationController.js +0 -73
  48. package/dist/core/addon/entity/clientEntity.d.ts +0 -107
  49. package/dist/core/addon/entity/clientEntity.js +0 -149
  50. package/dist/core/addon/entity/entity.d.ts +0 -42
  51. package/dist/core/addon/entity/entity.js +0 -50
  52. package/dist/core/addon/feature/oreFeature.d.ts +0 -19
  53. package/dist/core/addon/feature/oreFeature.js +0 -24
  54. package/dist/core/addon/featureRule.d.ts +0 -20
  55. package/dist/core/addon/featureRule.js +0 -25
  56. package/dist/core/addon/item/attachable.d.ts +0 -94
  57. package/dist/core/addon/item/attachable.js +0 -134
  58. package/dist/core/addon/item/item.d.ts +0 -19
  59. package/dist/core/addon/item/item.js +0 -26
  60. package/dist/core/addon/manifest.d.ts +0 -49
  61. package/dist/core/addon/manifest.js +0 -65
  62. package/dist/core/addon/menuCategory.d.ts +0 -6
  63. package/dist/core/addon/menuCategory.js +0 -7
  64. package/dist/core/addon/recipe/baseRecipe.d.ts +0 -12
  65. package/dist/core/addon/recipe/baseRecipe.js +0 -23
  66. package/dist/core/addon/recipe/data.d.ts +0 -66
  67. package/dist/core/addon/recipe/data.js +0 -74
  68. package/dist/core/addon/recipe/furnace.d.ts +0 -17
  69. package/dist/core/addon/recipe/furnace.js +0 -43
  70. package/dist/core/addon/recipe/shaped.d.ts +0 -26
  71. package/dist/core/addon/recipe/shaped.js +0 -53
  72. package/dist/core/addon/recipe/shapeless.d.ts +0 -18
  73. package/dist/core/addon/recipe/shapeless.js +0 -36
  74. package/dist/core/biome/biome.d.ts +0 -14
  75. package/dist/core/biome/biome.js +0 -23
  76. package/dist/core/biome/biomeComponent.d.ts +0 -46
  77. package/dist/core/biome/biomeComponent.js +0 -77
  78. package/dist/core/block/basicBlock.d.ts +0 -48
  79. package/dist/core/block/basicBlock.js +0 -105
  80. package/dist/core/block/block.d.ts +0 -32
  81. package/dist/core/block/block.js +0 -92
  82. package/dist/core/block/blockComponent.d.ts +0 -187
  83. package/dist/core/block/blockComponent.js +0 -500
  84. package/dist/core/block/cropBlock.d.ts +0 -4
  85. package/dist/core/block/cropBlock.js +0 -27
  86. package/dist/core/block/geometryBlock.d.ts +0 -12
  87. package/dist/core/block/geometryBlock.js +0 -16
  88. package/dist/core/block/oreBlock.d.ts +0 -9
  89. package/dist/core/block/oreBlock.js +0 -25
  90. package/dist/core/block/rotatableBlock.d.ts +0 -27
  91. package/dist/core/block/rotatableBlock.js +0 -107
  92. package/dist/core/block/tileBlock.d.ts +0 -17
  93. package/dist/core/block/tileBlock.js +0 -125
  94. package/dist/core/entity/basicEntity.d.ts +0 -111
  95. package/dist/core/entity/basicEntity.js +0 -170
  96. package/dist/core/entity/behavior/followMob.d.ts +0 -12
  97. package/dist/core/entity/behavior/followMob.js +0 -35
  98. package/dist/core/entity/behavior/followParent.d.ts +0 -7
  99. package/dist/core/entity/behavior/followParent.js +0 -15
  100. package/dist/core/entity/behavior/randomStroll.d.ts +0 -31
  101. package/dist/core/entity/behavior/randomStroll.js +0 -63
  102. package/dist/core/entity/behavior/tempt.d.ts +0 -73
  103. package/dist/core/entity/behavior/tempt.js +0 -134
  104. package/dist/core/entity/bundles/basicBundle.d.ts +0 -13
  105. package/dist/core/entity/bundles/basicBundle.js +0 -45
  106. package/dist/core/entity/clientEntity.d.ts +0 -20
  107. package/dist/core/entity/clientEntity.js +0 -37
  108. package/dist/core/entity/componets/entityComponet.d.ts +0 -202
  109. package/dist/core/entity/componets/entityComponet.js +0 -347
  110. package/dist/core/entity/data/nativeEntityData.d.ts +0 -9
  111. package/dist/core/entity/data/nativeEntityData.js +0 -38
  112. package/dist/core/entity/entity.d.ts +0 -15
  113. package/dist/core/entity/entity.js +0 -18
  114. package/dist/core/entity/nativeEntity.d.ts +0 -8
  115. package/dist/core/entity/nativeEntity.js +0 -28
  116. package/dist/core/entity/navigation/walk.d.ts +0 -23
  117. package/dist/core/entity/navigation/walk.js +0 -56
  118. package/dist/core/entity/projectile.d.ts +0 -3
  119. package/dist/core/entity/projectile.js +0 -7
  120. package/dist/core/factory/biomeFactory.d.ts +0 -4
  121. package/dist/core/factory/biomeFactory.js +0 -13
  122. package/dist/core/factory/blockFactory.d.ts +0 -34
  123. package/dist/core/factory/blockFactory.js +0 -143
  124. package/dist/core/factory/entityFactory.d.ts +0 -17
  125. package/dist/core/factory/entityFactory.js +0 -75
  126. package/dist/core/factory/featureFactory.d.ts +0 -6
  127. package/dist/core/factory/featureFactory.js +0 -23
  128. package/dist/core/factory/itemExtra.d.ts +0 -8
  129. package/dist/core/factory/itemExtra.js +0 -9
  130. package/dist/core/factory/itemFactory.d.ts +0 -27
  131. package/dist/core/factory/itemFactory.js +0 -112
  132. package/dist/core/factory/recipeFactory.d.ts +0 -18
  133. package/dist/core/factory/recipeFactory.js +0 -39
  134. package/dist/core/factory/uiFactory.d.ts +0 -12
  135. package/dist/core/factory/uiFactory.js +0 -32
  136. package/dist/core/feature/oreFeature.d.ts +0 -10
  137. package/dist/core/feature/oreFeature.js +0 -11
  138. package/dist/core/feature-rule/condition/biomeFilter.d.ts +0 -26
  139. package/dist/core/feature-rule/condition/biomeFilter.js +0 -36
  140. package/dist/core/feature-rule/condition/featureConditions.d.ts +0 -27
  141. package/dist/core/feature-rule/condition/featureConditions.js +0 -37
  142. package/dist/core/feature-rule/distribution/coordinateDistribution.d.ts +0 -17
  143. package/dist/core/feature-rule/distribution/coordinateDistribution.js +0 -23
  144. package/dist/core/feature-rule/distribution/featureDistribution.d.ts +0 -31
  145. package/dist/core/feature-rule/distribution/featureDistribution.js +0 -41
  146. package/dist/core/feature-rule/featureRule.d.ts +0 -17
  147. package/dist/core/feature-rule/featureRule.js +0 -26
  148. package/dist/core/index.js +0 -1
  149. package/dist/core/item/armor.d.ts +0 -21
  150. package/dist/core/item/armor.js +0 -90
  151. package/dist/core/item/attachable.d.ts +0 -6
  152. package/dist/core/item/attachable.js +0 -26
  153. package/dist/core/item/food.d.ts +0 -24
  154. package/dist/core/item/food.js +0 -38
  155. package/dist/core/item/item.d.ts +0 -36
  156. package/dist/core/item/item.js +0 -69
  157. package/dist/core/item/itemComponents.d.ts +0 -113
  158. package/dist/core/item/itemComponents.js +0 -225
  159. package/dist/core/registry.d.ts +0 -12
  160. package/dist/core/registry.js +0 -16
  161. package/dist/core/texture.d.ts +0 -18
  162. package/dist/core/texture.js +0 -38
  163. package/dist/core/ui/buttonMapping.d.ts +0 -97
  164. package/dist/core/ui/buttonMapping.js +0 -132
  165. package/dist/core/ui/dataBindingObject.d.ts +0 -97
  166. package/dist/core/ui/dataBindingObject.js +0 -134
  167. package/dist/core/ui/elements/button.d.ts +0 -21
  168. package/dist/core/ui/elements/button.js +0 -101
  169. package/dist/core/ui/elements/collectionPanel.d.ts +0 -12
  170. package/dist/core/ui/elements/collectionPanel.js +0 -53
  171. package/dist/core/ui/elements/grid.d.ts +0 -8
  172. package/dist/core/ui/elements/grid.js +0 -33
  173. package/dist/core/ui/elements/image.d.ts +0 -13
  174. package/dist/core/ui/elements/image.js +0 -55
  175. package/dist/core/ui/elements/label.d.ts +0 -14
  176. package/dist/core/ui/elements/label.js +0 -61
  177. package/dist/core/ui/elements/panel.d.ts +0 -11
  178. package/dist/core/ui/elements/panel.js +0 -49
  179. package/dist/core/ui/elements/scrollingPanel.d.ts +0 -14
  180. package/dist/core/ui/elements/scrollingPanel.js +0 -59
  181. package/dist/core/ui/elements/stackPanel.d.ts +0 -14
  182. package/dist/core/ui/elements/stackPanel.js +0 -37
  183. package/dist/core/ui/elements/uiElement.d.ts +0 -53
  184. package/dist/core/ui/elements/uiElement.js +0 -129
  185. package/dist/core/ui/properties/control.d.ts +0 -214
  186. package/dist/core/ui/properties/control.js +0 -286
  187. package/dist/core/ui/properties/dataBinding.d.ts +0 -6
  188. package/dist/core/ui/properties/dataBinding.js +0 -16
  189. package/dist/core/ui/properties/factory.d.ts +0 -37
  190. package/dist/core/ui/properties/factory.js +0 -62
  191. package/dist/core/ui/properties/gridProp.d.ts +0 -65
  192. package/dist/core/ui/properties/gridProp.js +0 -90
  193. package/dist/core/ui/properties/input.d.ts +0 -97
  194. package/dist/core/ui/properties/input.js +0 -134
  195. package/dist/core/ui/properties/layout.d.ts +0 -105
  196. package/dist/core/ui/properties/layout.js +0 -145
  197. package/dist/core/ui/properties/scrollView.d.ts +0 -105
  198. package/dist/core/ui/properties/scrollView.js +0 -145
  199. package/dist/core/ui/properties/sound.d.ts +0 -47
  200. package/dist/core/ui/properties/sound.js +0 -66
  201. package/dist/core/ui/properties/sprite.d.ts +0 -161
  202. package/dist/core/ui/properties/sprite.js +0 -222
  203. package/dist/core/ui/properties/text.d.ts +0 -135
  204. package/dist/core/ui/properties/text.js +0 -187
  205. package/dist/core/ui/registry/uiSystemRegistry.d.ts +0 -8
  206. package/dist/core/ui/registry/uiSystemRegistry.js +0 -26
  207. package/dist/core/ui/systems/chest.d.ts +0 -5
  208. package/dist/core/ui/systems/chest.js +0 -21
  209. package/dist/core/ui/systems/containerUISystem.d.ts +0 -67
  210. package/dist/core/ui/systems/containerUISystem.js +0 -214
  211. package/dist/core/ui/systems/guidebook.d.ts +0 -9
  212. package/dist/core/ui/systems/guidebook.js +0 -206
  213. package/dist/core/ui/systems/serverForm.d.ts +0 -13
  214. package/dist/core/ui/systems/serverForm.js +0 -116
  215. package/dist/core/ui/systems/system.d.ts +0 -16
  216. package/dist/core/ui/systems/system.js +0 -37
  217. package/dist/oc/index.js +0 -1
  218. package/doc/cli.md +0 -24
  219. /package/doc/hello_sapdon/{sapdon/344/275/277/347/224/250/346/225/231/347/250/213.md" → hello_sapdon.md} +0 -0
@@ -1,286 +0,0 @@
1
- /**
2
- * Control Class
3
- *
4
- * This class represents a UI control element with various properties and methods to manipulate its state.
5
- *
6
- * Properties:
7
- * - visible: boolean - If the UI element should be visible (default: true)
8
- * - enabled: boolean - If true and if the UI element or any of its children have the locked state then they will be in the locked (default: true)
9
- * - layer: int - Z-Index/Layer (like zindex in CSS) relative to parent element. Higher layers will render above (default: 0)
10
- * - alpha: float - Alpha/transparency of the element. It will only affect the UI element. Its children will be unaffected. (default: 1.0)
11
- * - propagate_alpha: boolean - If alpha should not only apply to the parent if possible but also all its children (default: false)
12
- * - clips_children: boolean - Cuts off visually and interactively everything beyond the boundaries of the UI element (default: false)
13
- * - allow_clipping: boolean - If clips_children works in the UI element. Otherwise, it won't have any effect (default: true)
14
- * - clip_offset: Vector [x, y] - Offset from the start of the clipping (default: [0, 0])
15
- * - clip_state_change_event: string - Event triggered when the clip state changes
16
- * - enable_scissor_test: boolean - Enables scissor test for clipping (default: false)
17
- * - property_bag: object - Property bag contains properties/variables that are more related with the data than the actual structure and look of the UI element
18
- * - selected: boolean - If the text box is selected by default
19
- * - use_child_anchors: boolean - Use the anchor_from and anchor_to of the child of the UI element (default: false)
20
- * - controls: array - For adding children to the element
21
- * - anims: string[] - Array of the animation names
22
- * - disable_anim_fast_forward: boolean - Disables fast-forwarding animations
23
- * - animation_reset_name: string - Name of the animation to reset to
24
- * - ignored: boolean - If the UI element should be ignored (default: false)
25
- * - variables: array or object - A bunch of conditions that change the variables values
26
- * - modifications: array - Allows to modify the UI files of resource packs below (vanilla being the most bottom one)
27
- * - grid_position: Vector [row, column] - Position that the control will take inside the grid. This also allows to modify specific grid items of a hardcoded grid
28
- * - collection_index: int - Index that the control takes in the collection
29
- */
30
- /**
31
- * Control 类
32
- *
33
- * 该类表示一个具有各种属性和方法的 UI 控件元素,用于操作其状态。
34
- *
35
- * 属性:
36
- * - visible: boolean - 控制 UI 元素是否可见(默认值:true)
37
- * - enabled: boolean - 如果为 true,且 UI 元素或其任何子元素处于锁定状态,则它们将被锁定(默认值:true)
38
- * - layer: int - 相对于父元素的 Z-Index/层级(类似于 CSS 中的 zindex)。较高的层级将渲染在上方(默认值:0)
39
- * - alpha: float - 元素的透明度。仅影响 UI 元素本身,其子元素不受影响。如果希望透明度同时应用于父元素和子元素,请使用 propagate_alpha(默认值:1.0)
40
- * - propagate_alpha: boolean - 透明度是否应同时应用于父元素及其所有子元素(默认值:false)
41
- * - clips_children: boolean - 是否在视觉上和交互上裁剪超出 UI 元素边界的内容(默认值:false)
42
- * - allow_clipping: boolean - 是否允许在 UI 元素中启用裁剪。否则,clips_children 将无效(默认值:true)
43
- * - clip_offset: Vector [x, y] - 裁剪起始点的偏移量(默认值:[0, 0])
44
- * - clip_state_change_event: string - 裁剪状态更改时触发的事件
45
- * - enable_scissor_test: boolean - 是否启用裁剪测试(默认值:false)
46
- * - property_bag: object - 属性包,包含与数据相关的属性/变量,而不是 UI 元素的实际结构和外观
47
- * - selected: boolean - 文本框是否默认被选中
48
- * - use_child_anchors: boolean - 是否使用 UI 元素子元素的 anchor_from 和 anchor_to(默认值:false)
49
- * - controls: array - 用于向元素添加子元素
50
- * - anims: string[] - 动画名称数组
51
- * - disable_anim_fast_forward: boolean - 是否禁用动画快进
52
- * - animation_reset_name: string - 重置动画的名称
53
- * - ignored: boolean - 是否忽略该 UI 元素(默认值:false)
54
- * - variables: array 或 object - 一组条件,用于更改变量的值
55
- * - modifications: array - 允许修改资源包中的 UI 文件(最底层为原版资源包)
56
- * - grid_position: Vector [row, column] - 控件在网格中的位置。此属性还允许修改硬编码网格中的特定网格项
57
- * - collection_index: int - 控件在集合中的索引
58
- */
59
- export class Control {
60
- constructor() {
61
- /*
62
- this.visible = true;
63
- this.enabled = true;
64
- this.layer = 0;
65
- this.alpha = 1.0;
66
- this.propagate_alpha = false;
67
- this.clips_children = false;
68
- this.allow_clipping = true;
69
- this.clip_offset = [0, 0];
70
- this.clip_state_change_event = '';
71
- this.enable_scissor_test = false;
72
- this.property_bag = {};
73
- this.selected = false;
74
- this.use_child_anchors = false;
75
- this.controls = [];
76
- this.anims = [];
77
- this.disable_anim_fast_forward = false;
78
- this.animation_reset_name = '';
79
- this.ignored = false;
80
- this.variables = {};
81
- this.modifications = [];
82
- this.grid_position = [0, 0];
83
- this.collection_index = 0;
84
- */
85
- }
86
- /**
87
- * 设置控件的可见性。
88
- * @param {boolean} visible - 控件是否可见(默认值:true)
89
- * @returns {Control} 返回当前实例以支持链式调用
90
- */
91
- setVisible(visible = true) {
92
- this.visible = visible;
93
- return this;
94
- }
95
- /**
96
- * 设置控件的启用状态。
97
- * @param {boolean} enabled - 控件是否启用(默认值:true)
98
- * @returns {Control} 返回当前实例以支持链式调用
99
- */
100
- setEnabled(enabled = true) {
101
- this.enabled = enabled;
102
- return this;
103
- }
104
- /**
105
- * 设置控件的层级(z-index)。
106
- * @param {number} layer - 要设置的层级(默认值:0)
107
- * @returns {Control} 返回当前实例以支持链式调用
108
- */
109
- setLayer(layer = 0) {
110
- this.layer = layer;
111
- return this;
112
- }
113
- /**
114
- * 设置控件的透明度。
115
- * @param {number} alpha - 要设置的透明度值(默认值:1.0)
116
- * @returns {Control} 返回当前实例以支持链式调用
117
- */
118
- setAlpha(alpha = 1.0) {
119
- this.alpha = alpha;
120
- return this;
121
- }
122
- /**
123
- * 设置透明度是否应传播到子元素。
124
- * @param {boolean} propagate - 透明度是否应传播(默认值:false)
125
- * @returns {Control} 返回当前实例以支持链式调用
126
- */
127
- setPropagateAlpha(propagate = false) {
128
- this.propagate_alpha = propagate;
129
- return this;
130
- }
131
- /**
132
- * 设置控件是否应裁剪其子元素。
133
- * @param {boolean} clips - 控件是否应裁剪其子元素(默认值:false)
134
- * @returns {Control} 返回当前实例以支持链式调用
135
- */
136
- setClipsChildren(clips = false) {
137
- this.clips_children = clips;
138
- return this;
139
- }
140
- /**
141
- * 设置控件是否允许裁剪。
142
- * @param {boolean} allow - 是否允许裁剪(默认值:true)
143
- * @returns {Control} 返回当前实例以支持链式调用
144
- */
145
- setAllowClipping(allow = true) {
146
- this.allow_clipping = allow;
147
- return this;
148
- }
149
- /**
150
- * 设置控件的裁剪偏移量。
151
- * @param {number[]} offset - 裁剪偏移量,格式为 [x, y](默认值:[0, 0])
152
- * @returns {Control} 返回当前实例以支持链式调用
153
- */
154
- setClipOffset(offset = [0, 0]) {
155
- this.clip_offset = offset;
156
- return this;
157
- }
158
- /**
159
- * 设置裁剪状态更改事件。
160
- * @param {string} event - 裁剪状态更改时触发的事件名称
161
- * @returns {Control} 返回当前实例以支持链式调用
162
- */
163
- setClipStateChangeEvent(event) {
164
- this.clip_state_change_event = event;
165
- return this;
166
- }
167
- /**
168
- * 设置是否启用裁剪测试。
169
- * @param {boolean} enable - 是否启用裁剪测试(默认值:false)
170
- * @returns {Control} 返回当前实例以支持链式调用
171
- */
172
- setEnableScissorTest(enable = false) {
173
- this.enable_scissor_test = enable;
174
- return this;
175
- }
176
- /**
177
- * 设置控件的属性包。
178
- * @param {object} bag - 要设置的属性包
179
- * @returns {Control} 返回当前实例以支持链式调用
180
- */
181
- setPropertyBag(bag) {
182
- this.property_bag = bag;
183
- return this;
184
- }
185
- /**
186
- * 设置控件是否被选中。
187
- * @param {boolean} selected - 控件是否被选中(默认值:false)
188
- * @returns {Control} 返回当前实例以支持链式调用
189
- */
190
- setSelected(selected = false) {
191
- this.selected = selected;
192
- return this;
193
- }
194
- /**
195
- * 设置控件是否使用子元素的锚点。
196
- * @param {boolean} use - 是否使用子元素的锚点(默认值:false)
197
- * @returns {Control} 返回当前实例以支持链式调用
198
- */
199
- setUseChildAnchors(use = false) {
200
- this.use_child_anchors = use;
201
- return this;
202
- }
203
- /**
204
- * 向控件添加子控件。
205
- * @param {Control} control - 要添加的子控件
206
- * @returns {Control} 返回当前实例以支持链式调用
207
- */
208
- addControl(control) {
209
- if (!this.controls)
210
- this.controls = [];
211
- this.controls.push(control);
212
- return this;
213
- }
214
- /**
215
- * 设置控件的动画。
216
- * @param {string[]} anims - 动画名称数组
217
- * @returns {Control} 返回当前实例以支持链式调用
218
- */
219
- setAnimations(anims) {
220
- this.anims = anims;
221
- return this;
222
- }
223
- /**
224
- * 设置是否禁用动画快进。
225
- * @param {boolean} disable - 是否禁用动画快进(默认值:false)
226
- * @returns {Control} 返回当前实例以支持链式调用
227
- */
228
- setDisableAnimFastForward(disable = false) {
229
- this.disable_anim_fast_forward = disable;
230
- return this;
231
- }
232
- /**
233
- * 设置动画重置名称。
234
- * @param {string} name - 要重置的动画名称
235
- * @returns {Control} 返回当前实例以支持链式调用
236
- */
237
- setAnimationResetName(name) {
238
- this.animation_reset_name = name;
239
- return this;
240
- }
241
- /**
242
- * 设置是否忽略该控件。
243
- * @param {boolean} ignored - 是否忽略该控件(默认值:false)
244
- * @returns {Control} 返回当前实例以支持链式调用
245
- */
246
- setIgnored(ignored = false) {
247
- this.ignored = ignored;
248
- return this;
249
- }
250
- /**
251
- * 设置控件的变量。
252
- * @param {object} variables - 要设置的变量
253
- * @returns {Control} 返回当前实例以支持链式调用
254
- */
255
- setVariables(variables) {
256
- this.variables = variables;
257
- return this;
258
- }
259
- /**
260
- * 设置控件的修改项。
261
- * @param {array} modifications - 要设置的修改项
262
- * @returns {Control} 返回当前实例以支持链式调用
263
- */
264
- setModifications(modifications) {
265
- this.modifications = modifications;
266
- return this;
267
- }
268
- /**
269
- * 设置控件在网格中的位置。
270
- * @param {number[]} position - 网格位置,格式为 [行, 列]
271
- * @returns {Control} 返回当前实例以支持链式调用
272
- */
273
- setGridPosition(position) {
274
- this.grid_position = position;
275
- return this;
276
- }
277
- /**
278
- * 设置控件在集合中的索引。
279
- * @param {number} index - 要设置的索引
280
- * @returns {Control} 返回当前实例以支持链式调用
281
- */
282
- setCollectionIndex(index) {
283
- this.collection_index = index;
284
- return this;
285
- }
286
- }
@@ -1,6 +0,0 @@
1
- export class DataBinding {
2
- setBinding(binding: any): this;
3
- bindings: any[] | undefined;
4
- binding: any;
5
- addDataBinding(dataBindingObject: any): this;
6
- }
@@ -1,16 +0,0 @@
1
- export class DataBinding {
2
- constructor() {
3
- }
4
- setBinding(binding) {
5
- if (!this.bindings)
6
- this.bindings = [];
7
- this.binding = binding;
8
- return this;
9
- }
10
- addDataBinding(dataBindingObject) {
11
- if (!this.bindings)
12
- this.bindings = [];
13
- this.bindings.push(dataBindingObject);
14
- return this;
15
- }
16
- }
@@ -1,37 +0,0 @@
1
- /**
2
- * Factory 类
3
- *
4
- * 该类表示一个工厂控件,用于管理子控件的名称和 ID。
5
- *
6
- * 属性:
7
- * - control_name: string - 工厂的子控件名
8
- * - control_ids: object - 工厂的子控件 ID 对象组
9
- */
10
- export class Factory {
11
- /**
12
- * 设置工厂的名。
13
- * @param {string} name - 名(格式:name)
14
- * @returns {Factory} 返回当前实例以支持链式调用
15
- */
16
- setName(name: string): Factory;
17
- factory: {} | undefined;
18
- /**
19
- * 设置工厂的子控件名。
20
- * @param {string} name - 子控件名(格式:namespace.controls_name)
21
- * @returns {Factory} 返回当前实例以支持链式调用
22
- */
23
- setControlName(name: string): Factory;
24
- /**
25
- * 设置工厂的子控件 ID 对象组。
26
- * @param {object} ids - 子控件 ID 对象组
27
- * @returns {Factory} 返回当前实例以支持链式调用
28
- */
29
- setControlIds(ids: object): Factory;
30
- /**
31
- * 添加一个子控件 ID。
32
- * @param {string} key - 子控件的键名
33
- * @param {string} value - 子控件的 ID 值
34
- * @returns {Factory} 返回当前实例以支持链式调用
35
- */
36
- addControlId(key: string, value: string): Factory;
37
- }
@@ -1,62 +0,0 @@
1
- /**
2
- * Factory 类
3
- *
4
- * 该类表示一个工厂控件,用于管理子控件的名称和 ID。
5
- *
6
- * 属性:
7
- * - control_name: string - 工厂的子控件名
8
- * - control_ids: object - 工厂的子控件 ID 对象组
9
- */
10
- export class Factory {
11
- constructor() {
12
- /*
13
- this.control_name = '';
14
- this.control_ids = {};
15
- */
16
- }
17
- /**
18
- * 设置工厂的名。
19
- * @param {string} name - 名(格式:name)
20
- * @returns {Factory} 返回当前实例以支持链式调用
21
- */
22
- setName(name) {
23
- if (!this.factory)
24
- this.factory = {};
25
- this.factory.name = name;
26
- return this;
27
- }
28
- /**
29
- * 设置工厂的子控件名。
30
- * @param {string} name - 子控件名(格式:namespace.controls_name)
31
- * @returns {Factory} 返回当前实例以支持链式调用
32
- */
33
- setControlName(name) {
34
- if (!this.factory)
35
- this.factory = {};
36
- this.factory.control_name = name;
37
- return this;
38
- }
39
- /**
40
- * 设置工厂的子控件 ID 对象组。
41
- * @param {object} ids - 子控件 ID 对象组
42
- * @returns {Factory} 返回当前实例以支持链式调用
43
- */
44
- setControlIds(ids) {
45
- if (!this.factory)
46
- this.factory = {};
47
- this.factory.control_ids = ids;
48
- return this;
49
- }
50
- /**
51
- * 添加一个子控件 ID。
52
- * @param {string} key - 子控件的键名
53
- * @param {string} value - 子控件的 ID 值
54
- * @returns {Factory} 返回当前实例以支持链式调用
55
- */
56
- addControlId(key, value) {
57
- if (!this.factory)
58
- this.factory = {};
59
- this.factory.control_ids[key] = value;
60
- return this;
61
- }
62
- }
@@ -1,65 +0,0 @@
1
- /**
2
- * Grid 类
3
- *
4
- * 该类表示一个网格控件属性,用于管理网格布局及其相关属性。
5
- *
6
- * 属性:
7
- * - grid_dimensions: Vector [columns, rows] - 网格的列数和行数
8
- * - maximum_grid_items: int - 网格生成的最大项目数
9
- * - grid_dimension_binding: string - 网格尺寸的绑定名称
10
- * - grid_rescaling_type: enum - 网格重新缩放方向(可能值:vertical, horizontal, none,默认值:none)
11
- * - grid_fill_direction: enum - 网格填充方向(可能值:vertical, horizontal, none,默认值:none)
12
- * - grid_item_template: string - 处理集合的子元素名称(例如:"common.container_item")
13
- * - precached_grid_item_count: int - 预缓存的网格项目数量
14
- */
15
- export class GridProp {
16
- /**
17
- * 设置网格的列数和行数。
18
- * @param {number[]} dimensions - 格式为 [columns, rows]
19
- * @returns {GridProp} 返回当前实例以支持链式调用
20
- */
21
- setGridDimensions(dimensions: number[]): GridProp;
22
- grid_dimensions: number[] | undefined;
23
- /**
24
- * 设置网格生成的最大项目数。
25
- * @param {number} maxItems - 最大项目数
26
- * @returns {GridProp} 返回当前实例以支持链式调用
27
- */
28
- setMaximumGridItems(maxItems: number): GridProp;
29
- maximum_grid_items: number | undefined;
30
- /**
31
- * 设置网格尺寸的绑定名称。
32
- * @param {string} binding - 绑定名称
33
- * @returns {GridProp} 返回当前实例以支持链式调用
34
- */
35
- setGridDimensionBinding(binding: string): GridProp;
36
- grid_dimension_binding: string | undefined;
37
- /**
38
- * 设置网格重新缩放方向。
39
- * @param {string} type - 可能值:vertical, horizontal, none(默认值:none)
40
- * @returns {GridProp} 返回当前实例以支持链式调用
41
- */
42
- setGridRescalingType(type?: string): GridProp;
43
- grid_rescaling_type: string | undefined;
44
- /**
45
- * 设置网格填充方向。
46
- * @param {string} direction - 可能值:vertical, horizontal, none(默认值:none)
47
- * @returns {GridProp} 返回当前实例以支持链式调用
48
- */
49
- setGridFillDirection(direction?: string): GridProp;
50
- grid_fill_direction: string | undefined;
51
- /**
52
- * 设置处理集合的子元素名称。
53
- * @param {string} template - 元素名称(例如:"common.container_item")
54
- * @returns {GridProp} 返回当前实例以支持链式调用
55
- */
56
- setGridItemTemplate(template: string): GridProp;
57
- grid_item_template: string | undefined;
58
- /**
59
- * 设置预缓存的网格项目数量。
60
- * @param {number} count - 预缓存数量
61
- * @returns {GridProp} 返回当前实例以支持链式调用
62
- */
63
- setPrecachedGridItemCount(count: number): GridProp;
64
- precached_grid_item_count: number | undefined;
65
- }
@@ -1,90 +0,0 @@
1
- /**
2
- * Grid 类
3
- *
4
- * 该类表示一个网格控件属性,用于管理网格布局及其相关属性。
5
- *
6
- * 属性:
7
- * - grid_dimensions: Vector [columns, rows] - 网格的列数和行数
8
- * - maximum_grid_items: int - 网格生成的最大项目数
9
- * - grid_dimension_binding: string - 网格尺寸的绑定名称
10
- * - grid_rescaling_type: enum - 网格重新缩放方向(可能值:vertical, horizontal, none,默认值:none)
11
- * - grid_fill_direction: enum - 网格填充方向(可能值:vertical, horizontal, none,默认值:none)
12
- * - grid_item_template: string - 处理集合的子元素名称(例如:"common.container_item")
13
- * - precached_grid_item_count: int - 预缓存的网格项目数量
14
- */
15
- export class GridProp {
16
- constructor() {
17
- /*
18
- this.grid_dimensions = null;
19
- this.maximum_grid_items = 0;
20
- this.grid_dimension_binding = '';
21
- this.grid_rescaling_type = 'none';
22
- this.grid_fill_direction = 'none';
23
- this.grid_item_template = '';
24
- this.precached_grid_item_count = 0;
25
- */
26
- }
27
- /**
28
- * 设置网格的列数和行数。
29
- * @param {number[]} dimensions - 格式为 [columns, rows]
30
- * @returns {GridProp} 返回当前实例以支持链式调用
31
- */
32
- setGridDimensions(dimensions) {
33
- this.grid_dimensions = dimensions;
34
- return this;
35
- }
36
- /**
37
- * 设置网格生成的最大项目数。
38
- * @param {number} maxItems - 最大项目数
39
- * @returns {GridProp} 返回当前实例以支持链式调用
40
- */
41
- setMaximumGridItems(maxItems) {
42
- this.maximum_grid_items = maxItems;
43
- return this;
44
- }
45
- /**
46
- * 设置网格尺寸的绑定名称。
47
- * @param {string} binding - 绑定名称
48
- * @returns {GridProp} 返回当前实例以支持链式调用
49
- */
50
- setGridDimensionBinding(binding) {
51
- this.grid_dimension_binding = binding;
52
- return this;
53
- }
54
- /**
55
- * 设置网格重新缩放方向。
56
- * @param {string} type - 可能值:vertical, horizontal, none(默认值:none)
57
- * @returns {GridProp} 返回当前实例以支持链式调用
58
- */
59
- setGridRescalingType(type = 'none') {
60
- this.grid_rescaling_type = type;
61
- return this;
62
- }
63
- /**
64
- * 设置网格填充方向。
65
- * @param {string} direction - 可能值:vertical, horizontal, none(默认值:none)
66
- * @returns {GridProp} 返回当前实例以支持链式调用
67
- */
68
- setGridFillDirection(direction = 'none') {
69
- this.grid_fill_direction = direction;
70
- return this;
71
- }
72
- /**
73
- * 设置处理集合的子元素名称。
74
- * @param {string} template - 元素名称(例如:"common.container_item")
75
- * @returns {GridProp} 返回当前实例以支持链式调用
76
- */
77
- setGridItemTemplate(template) {
78
- this.grid_item_template = template;
79
- return this;
80
- }
81
- /**
82
- * 设置预缓存的网格项目数量。
83
- * @param {number} count - 预缓存数量
84
- * @returns {GridProp} 返回当前实例以支持链式调用
85
- */
86
- setPrecachedGridItemCount(count) {
87
- this.precached_grid_item_count = count;
88
- return this;
89
- }
90
- }
@@ -1,97 +0,0 @@
1
- /**
2
- * Input 类
3
- *
4
- * 该类表示输入配置,用于管理 UI 元素的输入行为。
5
- *
6
- * 属性:
7
- * - button_mappings: Array of mapping objects - 按钮映射配置
8
- * - modal: boolean - 是否为模态输入
9
- * - inline_modal: boolean - 是否为内联模态输入
10
- * - always_listen_to_input: boolean - 是否始终监听输入
11
- * - always_handle_pointer: boolean - 是否始终处理指针事件
12
- * - always_handle_controller_direction: boolean - 是否始终处理控制器方向事件
13
- * - hover_enabled: boolean - 是否启用悬停事件
14
- * - prevent_touch_input: boolean - 是否阻止触摸输入
15
- * - consume_event: boolean - 是否消耗事件
16
- * - consume_hover_events: boolean - 是否消耗悬停事件
17
- * - gesture_tracking_button: string - 手势跟踪按钮
18
- */
19
- export class Input {
20
- /**
21
- * 设置按钮映射配置。
22
- * @param {ButtonMapping[]} mappings - 按钮映射配置数组
23
- * @returns {Input} 返回当前实例以支持链式调用
24
- */
25
- setButtonMappings(mappings: ButtonMapping[]): Input;
26
- button_mappings: ButtonMapping[] | undefined;
27
- /**
28
- * 设置是否为模态输入。
29
- * @param {boolean} modal - 是否为模态输入
30
- * @returns {Input} 返回当前实例以支持链式调用
31
- */
32
- setModal(modal?: boolean): Input;
33
- modal: boolean | undefined;
34
- /**
35
- * 设置是否为内联模态输入。
36
- * @param {boolean} inlineModal - 是否为内联模态输入
37
- * @returns {Input} 返回当前实例以支持链式调用
38
- */
39
- setInlineModal(inlineModal?: boolean): Input;
40
- inline_modal: boolean | undefined;
41
- /**
42
- * 设置是否始终监听输入。
43
- * @param {boolean} alwaysListen - 是否始终监听输入
44
- * @returns {Input} 返回当前实例以支持链式调用
45
- */
46
- setAlwaysListenToInput(alwaysListen?: boolean): Input;
47
- always_listen_to_input: boolean | undefined;
48
- /**
49
- * 设置是否始终处理指针事件。
50
- * @param {boolean} alwaysHandle - 是否始终处理指针事件
51
- * @returns {Input} 返回当前实例以支持链式调用
52
- */
53
- setAlwaysHandlePointer(alwaysHandle?: boolean): Input;
54
- always_handle_pointer: boolean | undefined;
55
- /**
56
- * 设置是否始终处理控制器方向事件。
57
- * @param {boolean} alwaysHandle - 是否始终处理控制器方向事件
58
- * @returns {Input} 返回当前实例以支持链式调用
59
- */
60
- setAlwaysHandleControllerDirection(alwaysHandle?: boolean): Input;
61
- always_handle_controller_direction: boolean | undefined;
62
- /**
63
- * 设置是否启用悬停事件。
64
- * @param {boolean} enabled - 是否启用悬停事件
65
- * @returns {Input} 返回当前实例以支持链式调用
66
- */
67
- setHoverEnabled(enabled?: boolean): Input;
68
- hover_enabled: boolean | undefined;
69
- /**
70
- * 设置是否阻止触摸输入。
71
- * @param {boolean} prevent - 是否阻止触摸输入
72
- * @returns {Input} 返回当前实例以支持链式调用
73
- */
74
- setPreventTouchInput(prevent?: boolean): Input;
75
- prevent_touch_input: boolean | undefined;
76
- /**
77
- * 设置是否消耗事件。
78
- * @param {boolean} consume - 是否消耗事件
79
- * @returns {Input} 返回当前实例以支持链式调用
80
- */
81
- setConsumeEvent(consume?: boolean): Input;
82
- consume_event: boolean | undefined;
83
- /**
84
- * 设置是否消耗悬停事件。
85
- * @param {boolean} consume - 是否消耗悬停事件
86
- * @returns {Input} 返回当前实例以支持链式调用
87
- */
88
- setConsumeHoverEvents(consume?: boolean): Input;
89
- consume_hover_events: boolean | undefined;
90
- /**
91
- * 设置手势跟踪按钮。
92
- * @param {string} button - 手势跟踪按钮
93
- * @returns {Input} 返回当前实例以支持链式调用
94
- */
95
- setGestureTrackingButton(button: string): Input;
96
- gesture_tracking_button: string | undefined;
97
- }