@esengine/ecs-framework 2.3.0 → 2.3.1

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 (491) hide show
  1. package/dist/index.cjs +2 -0
  2. package/dist/index.cjs.map +1 -0
  3. package/dist/index.d.ts +13451 -0
  4. package/dist/index.es5.js +4 -0
  5. package/dist/index.es5.js.map +1 -0
  6. package/dist/index.mjs +2 -0
  7. package/dist/index.mjs.map +1 -0
  8. package/dist/index.umd.js +4 -0
  9. package/dist/index.umd.js.map +1 -0
  10. package/dist/package.json +47 -0
  11. package/package.json +87 -84
  12. package/bin/Core/DI/Decorators.d.ts +0 -206
  13. package/bin/Core/DI/Decorators.d.ts.map +0 -1
  14. package/bin/Core/DI/Decorators.js +0 -253
  15. package/bin/Core/DI/Decorators.js.map +0 -1
  16. package/bin/Core/DI/index.d.ts +0 -8
  17. package/bin/Core/DI/index.d.ts.map +0 -1
  18. package/bin/Core/DI/index.js +0 -7
  19. package/bin/Core/DI/index.js.map +0 -1
  20. package/bin/Core/Plugin.d.ts +0 -112
  21. package/bin/Core/Plugin.d.ts.map +0 -1
  22. package/bin/Core/Plugin.js +0 -19
  23. package/bin/Core/Plugin.js.map +0 -1
  24. package/bin/Core/PluginManager.d.ts +0 -118
  25. package/bin/Core/PluginManager.d.ts.map +0 -1
  26. package/bin/Core/PluginManager.js +0 -229
  27. package/bin/Core/PluginManager.js.map +0 -1
  28. package/bin/Core/ServiceContainer.d.ts +0 -221
  29. package/bin/Core/ServiceContainer.d.ts.map +0 -1
  30. package/bin/Core/ServiceContainer.js +0 -352
  31. package/bin/Core/ServiceContainer.js.map +0 -1
  32. package/bin/Core.d.ts +0 -379
  33. package/bin/Core.d.ts.map +0 -1
  34. package/bin/Core.js +0 -553
  35. package/bin/Core.js.map +0 -1
  36. package/bin/ECS/Component.d.ts +0 -104
  37. package/bin/ECS/Component.d.ts.map +0 -1
  38. package/bin/ECS/Component.js +0 -105
  39. package/bin/ECS/Component.js.map +0 -1
  40. package/bin/ECS/Components/HierarchyComponent.d.ts +0 -46
  41. package/bin/ECS/Components/HierarchyComponent.d.ts.map +0 -1
  42. package/bin/ECS/Components/HierarchyComponent.js +0 -65
  43. package/bin/ECS/Components/HierarchyComponent.js.map +0 -1
  44. package/bin/ECS/Components/index.d.ts +0 -2
  45. package/bin/ECS/Components/index.d.ts.map +0 -1
  46. package/bin/ECS/Components/index.js +0 -2
  47. package/bin/ECS/Components/index.js.map +0 -1
  48. package/bin/ECS/Core/ArchetypeSystem.d.ts +0 -103
  49. package/bin/ECS/Core/ArchetypeSystem.d.ts.map +0 -1
  50. package/bin/ECS/Core/ArchetypeSystem.js +0 -244
  51. package/bin/ECS/Core/ArchetypeSystem.js.map +0 -1
  52. package/bin/ECS/Core/CommandBuffer.d.ts +0 -154
  53. package/bin/ECS/Core/CommandBuffer.d.ts.map +0 -1
  54. package/bin/ECS/Core/CommandBuffer.js +0 -244
  55. package/bin/ECS/Core/CommandBuffer.js.map +0 -1
  56. package/bin/ECS/Core/ComponentPool.d.ts +0 -139
  57. package/bin/ECS/Core/ComponentPool.d.ts.map +0 -1
  58. package/bin/ECS/Core/ComponentPool.js +0 -276
  59. package/bin/ECS/Core/ComponentPool.js.map +0 -1
  60. package/bin/ECS/Core/ComponentStorage/ComponentRegistry.d.ts +0 -127
  61. package/bin/ECS/Core/ComponentStorage/ComponentRegistry.d.ts.map +0 -1
  62. package/bin/ECS/Core/ComponentStorage/ComponentRegistry.js +0 -235
  63. package/bin/ECS/Core/ComponentStorage/ComponentRegistry.js.map +0 -1
  64. package/bin/ECS/Core/ComponentStorage.d.ts +0 -185
  65. package/bin/ECS/Core/ComponentStorage.d.ts.map +0 -1
  66. package/bin/ECS/Core/ComponentStorage.js +0 -321
  67. package/bin/ECS/Core/ComponentStorage.js.map +0 -1
  68. package/bin/ECS/Core/EntityLifecyclePolicy.d.ts +0 -26
  69. package/bin/ECS/Core/EntityLifecyclePolicy.d.ts.map +0 -1
  70. package/bin/ECS/Core/EntityLifecyclePolicy.js +0 -2
  71. package/bin/ECS/Core/EntityLifecyclePolicy.js.map +0 -1
  72. package/bin/ECS/Core/EventBus.d.ts +0 -210
  73. package/bin/ECS/Core/EventBus.d.ts.map +0 -1
  74. package/bin/ECS/Core/EventBus.js +0 -370
  75. package/bin/ECS/Core/EventBus.js.map +0 -1
  76. package/bin/ECS/Core/EventSystem.d.ts +0 -225
  77. package/bin/ECS/Core/EventSystem.d.ts.map +0 -1
  78. package/bin/ECS/Core/EventSystem.js +0 -448
  79. package/bin/ECS/Core/EventSystem.js.map +0 -1
  80. package/bin/ECS/Core/Events/index.d.ts +0 -3
  81. package/bin/ECS/Core/Events/index.d.ts.map +0 -1
  82. package/bin/ECS/Core/Events/index.js +0 -3
  83. package/bin/ECS/Core/Events/index.js.map +0 -1
  84. package/bin/ECS/Core/FluentAPI/ComponentBuilder.d.ts +0 -35
  85. package/bin/ECS/Core/FluentAPI/ComponentBuilder.d.ts.map +0 -1
  86. package/bin/ECS/Core/FluentAPI/ComponentBuilder.js +0 -48
  87. package/bin/ECS/Core/FluentAPI/ComponentBuilder.js.map +0 -1
  88. package/bin/ECS/Core/FluentAPI/ECSFluentAPI.d.ts +0 -135
  89. package/bin/ECS/Core/FluentAPI/ECSFluentAPI.d.ts.map +0 -1
  90. package/bin/ECS/Core/FluentAPI/ECSFluentAPI.js +0 -166
  91. package/bin/ECS/Core/FluentAPI/ECSFluentAPI.js.map +0 -1
  92. package/bin/ECS/Core/FluentAPI/EntityBatchOperator.d.ts +0 -58
  93. package/bin/ECS/Core/FluentAPI/EntityBatchOperator.d.ts.map +0 -1
  94. package/bin/ECS/Core/FluentAPI/EntityBatchOperator.js +0 -85
  95. package/bin/ECS/Core/FluentAPI/EntityBatchOperator.js.map +0 -1
  96. package/bin/ECS/Core/FluentAPI/EntityBuilder.d.ts +0 -110
  97. package/bin/ECS/Core/FluentAPI/EntityBuilder.d.ts.map +0 -1
  98. package/bin/ECS/Core/FluentAPI/EntityBuilder.js +0 -181
  99. package/bin/ECS/Core/FluentAPI/EntityBuilder.js.map +0 -1
  100. package/bin/ECS/Core/FluentAPI/SceneBuilder.d.ts +0 -53
  101. package/bin/ECS/Core/FluentAPI/SceneBuilder.d.ts.map +0 -1
  102. package/bin/ECS/Core/FluentAPI/SceneBuilder.js +0 -79
  103. package/bin/ECS/Core/FluentAPI/SceneBuilder.js.map +0 -1
  104. package/bin/ECS/Core/FluentAPI/index.d.ts +0 -6
  105. package/bin/ECS/Core/FluentAPI/index.d.ts.map +0 -1
  106. package/bin/ECS/Core/FluentAPI/index.js +0 -6
  107. package/bin/ECS/Core/FluentAPI/index.js.map +0 -1
  108. package/bin/ECS/Core/FluentAPI.d.ts +0 -2
  109. package/bin/ECS/Core/FluentAPI.d.ts.map +0 -1
  110. package/bin/ECS/Core/FluentAPI.js +0 -3
  111. package/bin/ECS/Core/FluentAPI.js.map +0 -1
  112. package/bin/ECS/Core/Query/TypedQuery.d.ts +0 -214
  113. package/bin/ECS/Core/Query/TypedQuery.d.ts.map +0 -1
  114. package/bin/ECS/Core/Query/TypedQuery.js +0 -294
  115. package/bin/ECS/Core/Query/TypedQuery.js.map +0 -1
  116. package/bin/ECS/Core/Query/index.d.ts +0 -3
  117. package/bin/ECS/Core/Query/index.d.ts.map +0 -1
  118. package/bin/ECS/Core/Query/index.js +0 -3
  119. package/bin/ECS/Core/Query/index.js.map +0 -1
  120. package/bin/ECS/Core/QuerySystem.d.ts +0 -458
  121. package/bin/ECS/Core/QuerySystem.d.ts.map +0 -1
  122. package/bin/ECS/Core/QuerySystem.js +0 -1069
  123. package/bin/ECS/Core/QuerySystem.js.map +0 -1
  124. package/bin/ECS/Core/QueryTypes.d.ts +0 -34
  125. package/bin/ECS/Core/QueryTypes.d.ts.map +0 -1
  126. package/bin/ECS/Core/QueryTypes.js +0 -13
  127. package/bin/ECS/Core/QueryTypes.js.map +0 -1
  128. package/bin/ECS/Core/ReactiveQuery.d.ts +0 -211
  129. package/bin/ECS/Core/ReactiveQuery.d.ts.map +0 -1
  130. package/bin/ECS/Core/ReactiveQuery.js +0 -401
  131. package/bin/ECS/Core/ReactiveQuery.js.map +0 -1
  132. package/bin/ECS/Core/ReferenceTracker.d.ts +0 -111
  133. package/bin/ECS/Core/ReferenceTracker.d.ts.map +0 -1
  134. package/bin/ECS/Core/ReferenceTracker.js +0 -254
  135. package/bin/ECS/Core/ReferenceTracker.js.map +0 -1
  136. package/bin/ECS/Core/SoASerializer.d.ts +0 -28
  137. package/bin/ECS/Core/SoASerializer.d.ts.map +0 -1
  138. package/bin/ECS/Core/SoASerializer.js +0 -85
  139. package/bin/ECS/Core/SoASerializer.js.map +0 -1
  140. package/bin/ECS/Core/SoAStorage.d.ts +0 -129
  141. package/bin/ECS/Core/SoAStorage.d.ts.map +0 -1
  142. package/bin/ECS/Core/SoAStorage.js +0 -685
  143. package/bin/ECS/Core/SoAStorage.js.map +0 -1
  144. package/bin/ECS/Core/SoATypeRegistry.d.ts +0 -50
  145. package/bin/ECS/Core/SoATypeRegistry.d.ts.map +0 -1
  146. package/bin/ECS/Core/SoATypeRegistry.js +0 -135
  147. package/bin/ECS/Core/SoATypeRegistry.js.map +0 -1
  148. package/bin/ECS/Core/Storage/index.d.ts +0 -4
  149. package/bin/ECS/Core/Storage/index.d.ts.map +0 -1
  150. package/bin/ECS/Core/Storage/index.js +0 -4
  151. package/bin/ECS/Core/Storage/index.js.map +0 -1
  152. package/bin/ECS/Core/StorageDecorators.d.ts +0 -20
  153. package/bin/ECS/Core/StorageDecorators.d.ts.map +0 -1
  154. package/bin/ECS/Core/StorageDecorators.js +0 -27
  155. package/bin/ECS/Core/StorageDecorators.js.map +0 -1
  156. package/bin/ECS/CoreEvents.d.ts +0 -131
  157. package/bin/ECS/CoreEvents.d.ts.map +0 -1
  158. package/bin/ECS/CoreEvents.js +0 -163
  159. package/bin/ECS/CoreEvents.js.map +0 -1
  160. package/bin/ECS/Decorators/EntityRefDecorator.d.ts +0 -46
  161. package/bin/ECS/Decorators/EntityRefDecorator.d.ts.map +0 -1
  162. package/bin/ECS/Decorators/EntityRefDecorator.js +0 -118
  163. package/bin/ECS/Decorators/EntityRefDecorator.js.map +0 -1
  164. package/bin/ECS/Decorators/PropertyDecorator.d.ts +0 -168
  165. package/bin/ECS/Decorators/PropertyDecorator.d.ts.map +0 -1
  166. package/bin/ECS/Decorators/PropertyDecorator.js +0 -40
  167. package/bin/ECS/Decorators/PropertyDecorator.js.map +0 -1
  168. package/bin/ECS/Decorators/TypeDecorators.d.ts +0 -124
  169. package/bin/ECS/Decorators/TypeDecorators.d.ts.map +0 -1
  170. package/bin/ECS/Decorators/TypeDecorators.js +0 -151
  171. package/bin/ECS/Decorators/TypeDecorators.js.map +0 -1
  172. package/bin/ECS/Decorators/index.d.ts +0 -7
  173. package/bin/ECS/Decorators/index.d.ts.map +0 -1
  174. package/bin/ECS/Decorators/index.js +0 -4
  175. package/bin/ECS/Decorators/index.js.map +0 -1
  176. package/bin/ECS/Entity.d.ts +0 -415
  177. package/bin/ECS/Entity.d.ts.map +0 -1
  178. package/bin/ECS/Entity.js +0 -683
  179. package/bin/ECS/Entity.js.map +0 -1
  180. package/bin/ECS/EntityTags.d.ts +0 -71
  181. package/bin/ECS/EntityTags.d.ts.map +0 -1
  182. package/bin/ECS/EntityTags.js +0 -82
  183. package/bin/ECS/EntityTags.js.map +0 -1
  184. package/bin/ECS/IScene.d.ts +0 -308
  185. package/bin/ECS/IScene.d.ts.map +0 -1
  186. package/bin/ECS/IScene.js +0 -2
  187. package/bin/ECS/IScene.js.map +0 -1
  188. package/bin/ECS/Scene.d.ts +0 -799
  189. package/bin/ECS/Scene.d.ts.map +0 -1
  190. package/bin/ECS/Scene.js +0 -1203
  191. package/bin/ECS/Scene.js.map +0 -1
  192. package/bin/ECS/SceneManager.d.ts +0 -197
  193. package/bin/ECS/SceneManager.d.ts.map +0 -1
  194. package/bin/ECS/SceneManager.js +0 -264
  195. package/bin/ECS/SceneManager.js.map +0 -1
  196. package/bin/ECS/Serialization/ComponentSerializer.d.ts +0 -106
  197. package/bin/ECS/Serialization/ComponentSerializer.d.ts.map +0 -1
  198. package/bin/ECS/Serialization/ComponentSerializer.js +0 -251
  199. package/bin/ECS/Serialization/ComponentSerializer.js.map +0 -1
  200. package/bin/ECS/Serialization/EntitySerializer.d.ts +0 -111
  201. package/bin/ECS/Serialization/EntitySerializer.d.ts.map +0 -1
  202. package/bin/ECS/Serialization/EntitySerializer.js +0 -155
  203. package/bin/ECS/Serialization/EntitySerializer.js.map +0 -1
  204. package/bin/ECS/Serialization/IncrementalSerializer.d.ts +0 -259
  205. package/bin/ECS/Serialization/IncrementalSerializer.d.ts.map +0 -1
  206. package/bin/ECS/Serialization/IncrementalSerializer.js +0 -500
  207. package/bin/ECS/Serialization/IncrementalSerializer.js.map +0 -1
  208. package/bin/ECS/Serialization/SceneSerializer.d.ts +0 -213
  209. package/bin/ECS/Serialization/SceneSerializer.d.ts.map +0 -1
  210. package/bin/ECS/Serialization/SceneSerializer.js +0 -387
  211. package/bin/ECS/Serialization/SceneSerializer.js.map +0 -1
  212. package/bin/ECS/Serialization/SerializationDecorators.d.ts +0 -136
  213. package/bin/ECS/Serialization/SerializationDecorators.d.ts.map +0 -1
  214. package/bin/ECS/Serialization/SerializationDecorators.js +0 -216
  215. package/bin/ECS/Serialization/SerializationDecorators.js.map +0 -1
  216. package/bin/ECS/Serialization/VersionMigration.d.ts +0 -156
  217. package/bin/ECS/Serialization/VersionMigration.d.ts.map +0 -1
  218. package/bin/ECS/Serialization/VersionMigration.js +0 -279
  219. package/bin/ECS/Serialization/VersionMigration.js.map +0 -1
  220. package/bin/ECS/Serialization/index.d.ts +0 -18
  221. package/bin/ECS/Serialization/index.d.ts.map +0 -1
  222. package/bin/ECS/Serialization/index.js +0 -18
  223. package/bin/ECS/Serialization/index.js.map +0 -1
  224. package/bin/ECS/Systems/EntityCache.d.ts +0 -114
  225. package/bin/ECS/Systems/EntityCache.d.ts.map +0 -1
  226. package/bin/ECS/Systems/EntityCache.js +0 -145
  227. package/bin/ECS/Systems/EntityCache.js.map +0 -1
  228. package/bin/ECS/Systems/EntitySystem.d.ts +0 -591
  229. package/bin/ECS/Systems/EntitySystem.d.ts.map +0 -1
  230. package/bin/ECS/Systems/EntitySystem.js +0 -1102
  231. package/bin/ECS/Systems/EntitySystem.js.map +0 -1
  232. package/bin/ECS/Systems/HierarchySystem.d.ts +0 -155
  233. package/bin/ECS/Systems/HierarchySystem.d.ts.map +0 -1
  234. package/bin/ECS/Systems/HierarchySystem.js +0 -498
  235. package/bin/ECS/Systems/HierarchySystem.js.map +0 -1
  236. package/bin/ECS/Systems/IntervalSystem.d.ts +0 -33
  237. package/bin/ECS/Systems/IntervalSystem.d.ts.map +0 -1
  238. package/bin/ECS/Systems/IntervalSystem.js +0 -50
  239. package/bin/ECS/Systems/IntervalSystem.js.map +0 -1
  240. package/bin/ECS/Systems/PassiveSystem.d.ts +0 -17
  241. package/bin/ECS/Systems/PassiveSystem.d.ts.map +0 -1
  242. package/bin/ECS/Systems/PassiveSystem.js +0 -19
  243. package/bin/ECS/Systems/PassiveSystem.js.map +0 -1
  244. package/bin/ECS/Systems/ProcessingSystem.d.ts +0 -21
  245. package/bin/ECS/Systems/ProcessingSystem.d.ts.map +0 -1
  246. package/bin/ECS/Systems/ProcessingSystem.js +0 -20
  247. package/bin/ECS/Systems/ProcessingSystem.js.map +0 -1
  248. package/bin/ECS/Systems/WorkerEntitySystem.d.ts +0 -313
  249. package/bin/ECS/Systems/WorkerEntitySystem.d.ts.map +0 -1
  250. package/bin/ECS/Systems/WorkerEntitySystem.js +0 -792
  251. package/bin/ECS/Systems/WorkerEntitySystem.js.map +0 -1
  252. package/bin/ECS/Systems/index.d.ts +0 -8
  253. package/bin/ECS/Systems/index.d.ts.map +0 -1
  254. package/bin/ECS/Systems/index.js +0 -8
  255. package/bin/ECS/Systems/index.js.map +0 -1
  256. package/bin/ECS/TypedEntity.d.ts +0 -192
  257. package/bin/ECS/TypedEntity.d.ts.map +0 -1
  258. package/bin/ECS/TypedEntity.js +0 -254
  259. package/bin/ECS/TypedEntity.js.map +0 -1
  260. package/bin/ECS/Utils/BigIntCompatibility.d.ts +0 -151
  261. package/bin/ECS/Utils/BigIntCompatibility.d.ts.map +0 -1
  262. package/bin/ECS/Utils/BigIntCompatibility.js +0 -476
  263. package/bin/ECS/Utils/BigIntCompatibility.js.map +0 -1
  264. package/bin/ECS/Utils/BitMaskHashMap.d.ts +0 -28
  265. package/bin/ECS/Utils/BitMaskHashMap.d.ts.map +0 -1
  266. package/bin/ECS/Utils/BitMaskHashMap.js +0 -127
  267. package/bin/ECS/Utils/BitMaskHashMap.js.map +0 -1
  268. package/bin/ECS/Utils/Bits.d.ts +0 -154
  269. package/bin/ECS/Utils/Bits.d.ts.map +0 -1
  270. package/bin/ECS/Utils/Bits.js +0 -331
  271. package/bin/ECS/Utils/Bits.js.map +0 -1
  272. package/bin/ECS/Utils/ComponentSparseSet.d.ts +0 -143
  273. package/bin/ECS/Utils/ComponentSparseSet.d.ts.map +0 -1
  274. package/bin/ECS/Utils/ComponentSparseSet.js +0 -347
  275. package/bin/ECS/Utils/ComponentSparseSet.js.map +0 -1
  276. package/bin/ECS/Utils/EntityList.d.ts +0 -115
  277. package/bin/ECS/Utils/EntityList.d.ts.map +0 -1
  278. package/bin/ECS/Utils/EntityList.js +0 -258
  279. package/bin/ECS/Utils/EntityList.js.map +0 -1
  280. package/bin/ECS/Utils/EntityProcessorList.d.ts +0 -56
  281. package/bin/ECS/Utils/EntityProcessorList.d.ts.map +0 -1
  282. package/bin/ECS/Utils/EntityProcessorList.js +0 -113
  283. package/bin/ECS/Utils/EntityProcessorList.js.map +0 -1
  284. package/bin/ECS/Utils/IdentifierPool.d.ts +0 -203
  285. package/bin/ECS/Utils/IdentifierPool.d.ts.map +0 -1
  286. package/bin/ECS/Utils/IdentifierPool.js +0 -325
  287. package/bin/ECS/Utils/IdentifierPool.js.map +0 -1
  288. package/bin/ECS/Utils/Matcher.d.ts +0 -171
  289. package/bin/ECS/Utils/Matcher.d.ts.map +0 -1
  290. package/bin/ECS/Utils/Matcher.js +0 -293
  291. package/bin/ECS/Utils/Matcher.js.map +0 -1
  292. package/bin/ECS/Utils/SparseSet.d.ts +0 -170
  293. package/bin/ECS/Utils/SparseSet.d.ts.map +0 -1
  294. package/bin/ECS/Utils/SparseSet.js +0 -280
  295. package/bin/ECS/Utils/SparseSet.js.map +0 -1
  296. package/bin/ECS/Utils/index.d.ts +0 -9
  297. package/bin/ECS/Utils/index.d.ts.map +0 -1
  298. package/bin/ECS/Utils/index.js +0 -10
  299. package/bin/ECS/Utils/index.js.map +0 -1
  300. package/bin/ECS/World.d.ts +0 -238
  301. package/bin/ECS/World.d.ts.map +0 -1
  302. package/bin/ECS/World.js +0 -416
  303. package/bin/ECS/World.js.map +0 -1
  304. package/bin/ECS/WorldManager.d.ts +0 -224
  305. package/bin/ECS/WorldManager.d.ts.map +0 -1
  306. package/bin/ECS/WorldManager.js +0 -365
  307. package/bin/ECS/WorldManager.js.map +0 -1
  308. package/bin/ECS/index.d.ts +0 -26
  309. package/bin/ECS/index.d.ts.map +0 -1
  310. package/bin/ECS/index.js +0 -21
  311. package/bin/ECS/index.js.map +0 -1
  312. package/bin/Platform/IPlatformAdapter.d.ts +0 -169
  313. package/bin/Platform/IPlatformAdapter.d.ts.map +0 -1
  314. package/bin/Platform/IPlatformAdapter.js +0 -2
  315. package/bin/Platform/IPlatformAdapter.js.map +0 -1
  316. package/bin/Platform/PlatformDetector.d.ts +0 -56
  317. package/bin/Platform/PlatformDetector.d.ts.map +0 -1
  318. package/bin/Platform/PlatformDetector.js +0 -247
  319. package/bin/Platform/PlatformDetector.js.map +0 -1
  320. package/bin/Platform/PlatformManager.d.ts +0 -50
  321. package/bin/Platform/PlatformManager.d.ts.map +0 -1
  322. package/bin/Platform/PlatformManager.js +0 -114
  323. package/bin/Platform/PlatformManager.js.map +0 -1
  324. package/bin/Platform/index.d.ts +0 -19
  325. package/bin/Platform/index.d.ts.map +0 -1
  326. package/bin/Platform/index.js +0 -29
  327. package/bin/Platform/index.js.map +0 -1
  328. package/bin/Plugins/DebugPlugin.d.ts +0 -156
  329. package/bin/Plugins/DebugPlugin.d.ts.map +0 -1
  330. package/bin/Plugins/DebugPlugin.js +0 -248
  331. package/bin/Plugins/DebugPlugin.js.map +0 -1
  332. package/bin/Plugins/index.d.ts +0 -2
  333. package/bin/Plugins/index.d.ts.map +0 -1
  334. package/bin/Plugins/index.js +0 -2
  335. package/bin/Plugins/index.js.map +0 -1
  336. package/bin/Types/IUpdatable.d.ts +0 -18
  337. package/bin/Types/IUpdatable.d.ts.map +0 -1
  338. package/bin/Types/IUpdatable.js +0 -7
  339. package/bin/Types/IUpdatable.js.map +0 -1
  340. package/bin/Types/TypeHelpers.d.ts +0 -238
  341. package/bin/Types/TypeHelpers.d.ts.map +0 -1
  342. package/bin/Types/TypeHelpers.js +0 -19
  343. package/bin/Types/TypeHelpers.js.map +0 -1
  344. package/bin/Types/index.d.ts +0 -466
  345. package/bin/Types/index.d.ts.map +0 -1
  346. package/bin/Types/index.js +0 -7
  347. package/bin/Types/index.js.map +0 -1
  348. package/bin/Utils/BinarySerializer.d.ts +0 -23
  349. package/bin/Utils/BinarySerializer.d.ts.map +0 -1
  350. package/bin/Utils/BinarySerializer.js +0 -100
  351. package/bin/Utils/BinarySerializer.js.map +0 -1
  352. package/bin/Utils/Debug/AdvancedProfilerCollector.d.ts +0 -153
  353. package/bin/Utils/Debug/AdvancedProfilerCollector.d.ts.map +0 -1
  354. package/bin/Utils/Debug/AdvancedProfilerCollector.js +0 -406
  355. package/bin/Utils/Debug/AdvancedProfilerCollector.js.map +0 -1
  356. package/bin/Utils/Debug/ComponentDataCollector.d.ts +0 -32
  357. package/bin/Utils/Debug/ComponentDataCollector.d.ts.map +0 -1
  358. package/bin/Utils/Debug/ComponentDataCollector.js +0 -250
  359. package/bin/Utils/Debug/ComponentDataCollector.js.map +0 -1
  360. package/bin/Utils/Debug/DebugConfigService.d.ts +0 -16
  361. package/bin/Utils/Debug/DebugConfigService.d.ts.map +0 -1
  362. package/bin/Utils/Debug/DebugConfigService.js +0 -42
  363. package/bin/Utils/Debug/DebugConfigService.js.map +0 -1
  364. package/bin/Utils/Debug/DebugManager.d.ts +0 -131
  365. package/bin/Utils/Debug/DebugManager.d.ts.map +0 -1
  366. package/bin/Utils/Debug/DebugManager.js +0 -848
  367. package/bin/Utils/Debug/DebugManager.js.map +0 -1
  368. package/bin/Utils/Debug/EntityDataCollector.d.ts +0 -115
  369. package/bin/Utils/Debug/EntityDataCollector.d.ts.map +0 -1
  370. package/bin/Utils/Debug/EntityDataCollector.js +0 -870
  371. package/bin/Utils/Debug/EntityDataCollector.js.map +0 -1
  372. package/bin/Utils/Debug/PerformanceDataCollector.d.ts +0 -31
  373. package/bin/Utils/Debug/PerformanceDataCollector.d.ts.map +0 -1
  374. package/bin/Utils/Debug/PerformanceDataCollector.js +0 -203
  375. package/bin/Utils/Debug/PerformanceDataCollector.js.map +0 -1
  376. package/bin/Utils/Debug/SceneDataCollector.d.ts +0 -18
  377. package/bin/Utils/Debug/SceneDataCollector.d.ts.map +0 -1
  378. package/bin/Utils/Debug/SceneDataCollector.js +0 -43
  379. package/bin/Utils/Debug/SceneDataCollector.js.map +0 -1
  380. package/bin/Utils/Debug/SystemDataCollector.d.ts +0 -14
  381. package/bin/Utils/Debug/SystemDataCollector.d.ts.map +0 -1
  382. package/bin/Utils/Debug/SystemDataCollector.js +0 -60
  383. package/bin/Utils/Debug/SystemDataCollector.js.map +0 -1
  384. package/bin/Utils/Debug/WebSocketManager.d.ts +0 -54
  385. package/bin/Utils/Debug/WebSocketManager.d.ts.map +0 -1
  386. package/bin/Utils/Debug/WebSocketManager.js +0 -141
  387. package/bin/Utils/Debug/WebSocketManager.js.map +0 -1
  388. package/bin/Utils/Debug/index.d.ts +0 -11
  389. package/bin/Utils/Debug/index.d.ts.map +0 -1
  390. package/bin/Utils/Debug/index.js +0 -10
  391. package/bin/Utils/Debug/index.js.map +0 -1
  392. package/bin/Utils/Emitter.d.ts +0 -61
  393. package/bin/Utils/Emitter.d.ts.map +0 -1
  394. package/bin/Utils/Emitter.js +0 -101
  395. package/bin/Utils/Emitter.js.map +0 -1
  396. package/bin/Utils/Extensions/NumberExtension.d.ts +0 -13
  397. package/bin/Utils/Extensions/NumberExtension.d.ts.map +0 -1
  398. package/bin/Utils/Extensions/NumberExtension.js +0 -17
  399. package/bin/Utils/Extensions/NumberExtension.js.map +0 -1
  400. package/bin/Utils/Extensions/TypeUtils.d.ts +0 -13
  401. package/bin/Utils/Extensions/TypeUtils.d.ts.map +0 -1
  402. package/bin/Utils/Extensions/TypeUtils.js +0 -15
  403. package/bin/Utils/Extensions/TypeUtils.js.map +0 -1
  404. package/bin/Utils/Extensions/index.d.ts +0 -3
  405. package/bin/Utils/Extensions/index.d.ts.map +0 -1
  406. package/bin/Utils/Extensions/index.js +0 -4
  407. package/bin/Utils/Extensions/index.js.map +0 -1
  408. package/bin/Utils/GlobalManager.d.ts +0 -29
  409. package/bin/Utils/GlobalManager.d.ts.map +0 -1
  410. package/bin/Utils/GlobalManager.js +0 -50
  411. package/bin/Utils/GlobalManager.js.map +0 -1
  412. package/bin/Utils/Logger/ConsoleLogger.d.ts +0 -74
  413. package/bin/Utils/Logger/ConsoleLogger.d.ts.map +0 -1
  414. package/bin/Utils/Logger/ConsoleLogger.js +0 -187
  415. package/bin/Utils/Logger/ConsoleLogger.js.map +0 -1
  416. package/bin/Utils/Logger/Constants.d.ts +0 -36
  417. package/bin/Utils/Logger/Constants.d.ts.map +0 -1
  418. package/bin/Utils/Logger/Constants.js +0 -40
  419. package/bin/Utils/Logger/Constants.js.map +0 -1
  420. package/bin/Utils/Logger/LoggerManager.d.ts +0 -91
  421. package/bin/Utils/Logger/LoggerManager.d.ts.map +0 -1
  422. package/bin/Utils/Logger/LoggerManager.js +0 -167
  423. package/bin/Utils/Logger/LoggerManager.js.map +0 -1
  424. package/bin/Utils/Logger/Types.d.ts +0 -40
  425. package/bin/Utils/Logger/Types.d.ts.map +0 -1
  426. package/bin/Utils/Logger/Types.js +0 -2
  427. package/bin/Utils/Logger/Types.js.map +0 -1
  428. package/bin/Utils/Logger/index.d.ts +0 -5
  429. package/bin/Utils/Logger/index.d.ts.map +0 -1
  430. package/bin/Utils/Logger/index.js +0 -5
  431. package/bin/Utils/Logger/index.js.map +0 -1
  432. package/bin/Utils/PerformanceMonitor.d.ts +0 -196
  433. package/bin/Utils/PerformanceMonitor.d.ts.map +0 -1
  434. package/bin/Utils/PerformanceMonitor.js +0 -244
  435. package/bin/Utils/PerformanceMonitor.js.map +0 -1
  436. package/bin/Utils/Pool/IPoolable.d.ts +0 -29
  437. package/bin/Utils/Pool/IPoolable.d.ts.map +0 -1
  438. package/bin/Utils/Pool/IPoolable.js +0 -2
  439. package/bin/Utils/Pool/IPoolable.js.map +0 -1
  440. package/bin/Utils/Pool/Pool.d.ts +0 -109
  441. package/bin/Utils/Pool/Pool.d.ts.map +0 -1
  442. package/bin/Utils/Pool/Pool.js +0 -238
  443. package/bin/Utils/Pool/Pool.js.map +0 -1
  444. package/bin/Utils/Pool/PoolManager.d.ts +0 -96
  445. package/bin/Utils/Pool/PoolManager.d.ts.map +0 -1
  446. package/bin/Utils/Pool/PoolManager.js +0 -199
  447. package/bin/Utils/Pool/PoolManager.js.map +0 -1
  448. package/bin/Utils/Pool/index.d.ts +0 -4
  449. package/bin/Utils/Pool/index.d.ts.map +0 -1
  450. package/bin/Utils/Pool/index.js +0 -4
  451. package/bin/Utils/Pool/index.js.map +0 -1
  452. package/bin/Utils/Profiler/AutoProfiler.d.ts +0 -160
  453. package/bin/Utils/Profiler/AutoProfiler.d.ts.map +0 -1
  454. package/bin/Utils/Profiler/AutoProfiler.js +0 -503
  455. package/bin/Utils/Profiler/AutoProfiler.js.map +0 -1
  456. package/bin/Utils/Profiler/ProfilerSDK.d.ts +0 -175
  457. package/bin/Utils/Profiler/ProfilerSDK.d.ts.map +0 -1
  458. package/bin/Utils/Profiler/ProfilerSDK.js +0 -727
  459. package/bin/Utils/Profiler/ProfilerSDK.js.map +0 -1
  460. package/bin/Utils/Profiler/ProfilerTypes.d.ts +0 -218
  461. package/bin/Utils/Profiler/ProfilerTypes.d.ts.map +0 -1
  462. package/bin/Utils/Profiler/ProfilerTypes.js +0 -47
  463. package/bin/Utils/Profiler/ProfilerTypes.js.map +0 -1
  464. package/bin/Utils/Profiler/index.d.ts +0 -8
  465. package/bin/Utils/Profiler/index.d.ts.map +0 -1
  466. package/bin/Utils/Profiler/index.js +0 -7
  467. package/bin/Utils/Profiler/index.js.map +0 -1
  468. package/bin/Utils/Time.d.ts +0 -47
  469. package/bin/Utils/Time.d.ts.map +0 -1
  470. package/bin/Utils/Time.js +0 -64
  471. package/bin/Utils/Time.js.map +0 -1
  472. package/bin/Utils/Timers/ITimer.d.ts +0 -16
  473. package/bin/Utils/Timers/ITimer.d.ts.map +0 -1
  474. package/bin/Utils/Timers/ITimer.js +0 -2
  475. package/bin/Utils/Timers/ITimer.js.map +0 -1
  476. package/bin/Utils/Timers/Timer.d.ts +0 -30
  477. package/bin/Utils/Timers/Timer.d.ts.map +0 -1
  478. package/bin/Utils/Timers/Timer.js +0 -58
  479. package/bin/Utils/Timers/Timer.js.map +0 -1
  480. package/bin/Utils/Timers/TimerManager.d.ts +0 -26
  481. package/bin/Utils/Timers/TimerManager.d.ts.map +0 -1
  482. package/bin/Utils/Timers/TimerManager.js +0 -48
  483. package/bin/Utils/Timers/TimerManager.js.map +0 -1
  484. package/bin/Utils/index.d.ts +0 -11
  485. package/bin/Utils/index.d.ts.map +0 -1
  486. package/bin/Utils/index.js +0 -11
  487. package/bin/Utils/index.js.map +0 -1
  488. package/bin/index.d.ts +0 -29
  489. package/bin/index.d.ts.map +0 -1
  490. package/bin/index.js +0 -36
  491. package/bin/index.js.map +0 -1
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@esengine/ecs-framework",
3
+ "version": "2.3.1",
4
+ "description": "用于Laya、Cocos Creator等JavaScript游戏引擎的高性能ECS框架",
5
+ "main": "index.cjs",
6
+ "module": "index.mjs",
7
+ "unpkg": "index.umd.js",
8
+ "types": "index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./index.mjs",
12
+ "require": "./index.cjs",
13
+ "types": "./index.d.ts"
14
+ }
15
+ },
16
+ "files": [
17
+ "index.mjs",
18
+ "index.mjs.map",
19
+ "index.cjs",
20
+ "index.cjs.map",
21
+ "index.umd.js",
22
+ "index.umd.js.map",
23
+ "index.es5.js",
24
+ "index.es5.js.map",
25
+ "index.d.ts"
26
+ ],
27
+ "keywords": [
28
+ "ecs",
29
+ "entity-component-system",
30
+ "game-engine",
31
+ "typescript",
32
+ "cocos-creator",
33
+ "laya",
34
+ "rollup"
35
+ ],
36
+ "author": "yhh",
37
+ "license": "MIT",
38
+ "repository": {
39
+ "type": "git",
40
+ "url": "https://github.com/esengine/ecs-framework.git",
41
+ "directory": "packages/core"
42
+ },
43
+ "engines": {
44
+ "node": ">=16.0.0"
45
+ },
46
+ "sideEffects": false
47
+ }
package/package.json CHANGED
@@ -1,84 +1,87 @@
1
- {
2
- "name": "@esengine/ecs-framework",
3
- "version": "2.3.0",
4
- "description": "用于Laya、Cocos Creator等JavaScript游戏引擎的高性能ECS框架",
5
- "main": "bin/index.js",
6
- "types": "bin/index.d.ts",
7
- "exports": {
8
- ".": {
9
- "types": "./bin/index.d.ts",
10
- "import": "./bin/index.js",
11
- "development": {
12
- "types": "./src/index.ts",
13
- "import": "./src/index.ts"
14
- }
15
- }
16
- },
17
- "files": [
18
- "bin/**/*"
19
- ],
20
- "keywords": [
21
- "ecs",
22
- "entity-component-system",
23
- "game-engine",
24
- "typescript",
25
- "laya",
26
- "cocos",
27
- "egret"
28
- ],
29
- "scripts": {
30
- "clean": "rimraf bin dist tsconfig.tsbuildinfo",
31
- "build:ts": "tsc",
32
- "prebuild": "npm run clean",
33
- "build": "npm run build:ts && node build-rollup.cjs",
34
- "build:watch": "tsc --watch",
35
- "rebuild": "npm run clean && npm run build",
36
- "build:npm": "npm run build",
37
- "test": "jest --config jest.config.cjs",
38
- "test:watch": "jest --watch --config jest.config.cjs",
39
- "test:performance": "jest --config jest.performance.config.cjs",
40
- "test:coverage": "jest --coverage --config jest.config.cjs",
41
- "test:ci": "jest --ci --coverage --config jest.config.cjs",
42
- "test:clear": "jest --clearCache",
43
- "type-check": "npx tsc --noEmit",
44
- "lint": "eslint \"src/**/*.{ts,tsx}\"",
45
- "lint:fix": "eslint \"src/**/*.{ts,tsx}\" --fix"
46
- },
47
- "author": "yhh",
48
- "license": "MIT",
49
- "devDependencies": {
50
- "@babel/core": "^7.28.3",
51
- "@babel/plugin-transform-nullish-coalescing-operator": "^7.27.1",
52
- "@babel/plugin-transform-optional-chaining": "^7.27.1",
53
- "@babel/preset-env": "^7.28.3",
54
- "@rollup/plugin-babel": "^6.0.4",
55
- "@rollup/plugin-commonjs": "^28.0.3",
56
- "@rollup/plugin-node-resolve": "^16.0.1",
57
- "@rollup/plugin-terser": "^0.4.4",
58
- "@jest/globals": "^29.7.0",
59
- "@types/jest": "^29.5.14",
60
- "@types/node": "^20.19.17",
61
- "@eslint/js": "^9.37.0",
62
- "eslint": "^9.37.0",
63
- "typescript-eslint": "^8.46.1",
64
- "jest": "^29.7.0",
65
- "jest-environment-jsdom": "^29.7.0",
66
- "rimraf": "^5.0.0",
67
- "rollup": "^4.42.0",
68
- "rollup-plugin-dts": "^6.2.1",
69
- "ts-jest": "^29.4.0",
70
- "typescript": "^5.8.3"
71
- },
72
- "publishConfig": {
73
- "access": "public",
74
- "registry": "https://registry.npmjs.org/"
75
- },
76
- "repository": {
77
- "type": "git",
78
- "url": "https://github.com/esengine/ecs-framework.git",
79
- "directory": "packages/core"
80
- },
81
- "dependencies": {
82
- "tslib": "^2.8.1"
83
- }
84
- }
1
+ {
2
+ "name": "@esengine/ecs-framework",
3
+ "version": "2.3.1",
4
+ "description": "用于Laya、Cocos Creator等JavaScript游戏引擎的高性能ECS框架",
5
+ "main": "dist/index.cjs",
6
+ "module": "dist/index.mjs",
7
+ "types": "dist/index.d.ts",
8
+ "unpkg": "dist/index.umd.js",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.mjs",
13
+ "require": "./dist/index.cjs",
14
+ "development": {
15
+ "types": "./src/index.ts",
16
+ "import": "./src/index.ts"
17
+ }
18
+ }
19
+ },
20
+ "files": [
21
+ "dist/**/*"
22
+ ],
23
+ "keywords": [
24
+ "ecs",
25
+ "entity-component-system",
26
+ "game-engine",
27
+ "typescript",
28
+ "laya",
29
+ "cocos",
30
+ "egret"
31
+ ],
32
+ "scripts": {
33
+ "clean": "rimraf bin dist tsconfig.tsbuildinfo",
34
+ "build:ts": "tsc",
35
+ "prebuild": "npm run clean",
36
+ "build": "npm run build:ts && node build-rollup.cjs",
37
+ "build:watch": "tsc --watch",
38
+ "rebuild": "npm run clean && npm run build",
39
+ "build:npm": "npm run build",
40
+ "test": "jest --config jest.config.cjs",
41
+ "test:watch": "jest --watch --config jest.config.cjs",
42
+ "test:performance": "jest --config jest.performance.config.cjs",
43
+ "test:coverage": "jest --coverage --config jest.config.cjs",
44
+ "test:ci": "jest --ci --coverage --config jest.config.cjs",
45
+ "test:clear": "jest --clearCache",
46
+ "type-check": "npx tsc --noEmit",
47
+ "lint": "eslint \"src/**/*.{ts,tsx}\"",
48
+ "lint:fix": "eslint \"src/**/*.{ts,tsx}\" --fix"
49
+ },
50
+ "author": "yhh",
51
+ "license": "MIT",
52
+ "devDependencies": {
53
+ "@babel/core": "^7.28.3",
54
+ "@babel/plugin-transform-nullish-coalescing-operator": "^7.27.1",
55
+ "@babel/plugin-transform-optional-chaining": "^7.27.1",
56
+ "@babel/preset-env": "^7.28.3",
57
+ "@rollup/plugin-babel": "^6.0.4",
58
+ "@rollup/plugin-commonjs": "^28.0.3",
59
+ "@rollup/plugin-node-resolve": "^16.0.1",
60
+ "@rollup/plugin-terser": "^0.4.4",
61
+ "@jest/globals": "^29.7.0",
62
+ "@types/jest": "^29.5.14",
63
+ "@types/node": "^20.19.17",
64
+ "@eslint/js": "^9.37.0",
65
+ "eslint": "^9.37.0",
66
+ "typescript-eslint": "^8.46.1",
67
+ "jest": "^29.7.0",
68
+ "jest-environment-jsdom": "^29.7.0",
69
+ "rimraf": "^5.0.0",
70
+ "rollup": "^4.42.0",
71
+ "rollup-plugin-dts": "^6.2.1",
72
+ "ts-jest": "^29.4.0",
73
+ "typescript": "^5.8.3"
74
+ },
75
+ "publishConfig": {
76
+ "access": "public",
77
+ "registry": "https://registry.npmjs.org/"
78
+ },
79
+ "repository": {
80
+ "type": "git",
81
+ "url": "https://github.com/esengine/ecs-framework.git",
82
+ "directory": "packages/core"
83
+ },
84
+ "dependencies": {
85
+ "tslib": "^2.8.1"
86
+ }
87
+ }
@@ -1,206 +0,0 @@
1
- /**
2
- * 依赖注入装饰器
3
- *
4
- * 提供 @Injectable、@InjectProperty 和 @Updatable 装饰器,用于标记可注入的类和依赖注入点
5
- */
6
- import type { ServiceContainer } from '../ServiceContainer';
7
- import type { IService, ServiceType } from '../ServiceContainer';
8
- /**
9
- * 依赖注入元数据存储
10
- */
11
- type Constructor = abstract new (...args: unknown[]) => unknown;
12
- /**
13
- * 可注入元数据接口
14
- */
15
- export interface InjectableMetadata {
16
- /**
17
- * 是否可注入
18
- */
19
- injectable: boolean;
20
- /**
21
- * 依赖列表
22
- */
23
- dependencies: Array<ServiceType<IService> | string | symbol>;
24
- /**
25
- * 属性注入映射
26
- * key: 属性名, value: 服务类型
27
- */
28
- properties?: Map<string | symbol, ServiceType<IService>>;
29
- }
30
- /**
31
- * 可更新元数据接口
32
- */
33
- export interface UpdatableMetadata {
34
- /**
35
- * 是否可更新
36
- */
37
- updatable: boolean;
38
- /**
39
- * 更新优先级(数值越小越先执行,默认0)
40
- */
41
- priority: number;
42
- }
43
- /**
44
- * @Injectable() 装饰器
45
- *
46
- * 标记类为可注入的服务,使其可以通过ServiceContainer进行依赖注入
47
- *
48
- * @example
49
- * ```typescript
50
- * @Injectable()
51
- * class TimeService implements IService {
52
- * constructor() {}
53
- * dispose() {}
54
- * }
55
- *
56
- * @Injectable()
57
- * class PhysicsSystem extends EntitySystem {
58
- * @InjectProperty(TimeService)
59
- * private timeService!: TimeService;
60
- *
61
- * constructor() {
62
- * super(Matcher.empty());
63
- * }
64
- * }
65
- * ```
66
- */
67
- export declare function Injectable(): ClassDecorator;
68
- /**
69
- * @Updatable() 装饰器
70
- *
71
- * 标记服务类为可更新的,使其在每帧自动被ServiceContainer调用update方法。
72
- * 使用此装饰器的类必须实现IUpdatable接口(包含update方法)。
73
- *
74
- * @param priority - 更新优先级(数值越小越先执行,默认0)
75
- * @throws 如果类没有实现update方法,将在运行时抛出错误
76
- *
77
- * @example
78
- * ```typescript
79
- * @Injectable()
80
- * @Updatable()
81
- * class TimerManager implements IService, IUpdatable {
82
- * update(deltaTime?: number) {
83
- * // 每帧更新逻辑
84
- * }
85
- * dispose() {}
86
- * }
87
- *
88
- * // 指定优先级
89
- * @Injectable()
90
- * @Updatable(10)
91
- * class PhysicsManager implements IService, IUpdatable {
92
- * update() { }
93
- * dispose() {}
94
- * }
95
- * ```
96
- */
97
- export declare function Updatable(priority?: number): ClassDecorator;
98
- /**
99
- * @InjectProperty() 装饰器
100
- *
101
- * 通过属性装饰器注入依赖
102
- *
103
- * 注入时机:在构造函数执行后、onInitialize() 调用前完成
104
- *
105
- * @param serviceType 服务类型
106
- *
107
- * @example
108
- * ```typescript
109
- * @Injectable()
110
- * class PhysicsSystem extends EntitySystem {
111
- * @InjectProperty(TimeService)
112
- * private timeService!: TimeService;
113
- *
114
- * @InjectProperty(CollisionService)
115
- * private collision!: CollisionService;
116
- *
117
- * constructor() {
118
- * super(Matcher.empty());
119
- * }
120
- *
121
- * public onInitialize(): void {
122
- * // 此时属性已注入完成,可以安全使用
123
- * console.log(this.timeService.getDeltaTime());
124
- * }
125
- * }
126
- * ```
127
- */
128
- export declare function InjectProperty(serviceType: ServiceType<IService>): PropertyDecorator;
129
- /**
130
- * 检查类是否标记为可注入
131
- *
132
- * @param target 目标类
133
- * @returns 是否可注入
134
- */
135
- export declare function isInjectable(target: Constructor): boolean;
136
- /**
137
- * 获取类的依赖注入元数据
138
- *
139
- * @param target 目标类
140
- * @returns 依赖注入元数据
141
- */
142
- export declare function getInjectableMetadata(target: Constructor): InjectableMetadata | undefined;
143
- /**
144
- * 获取属性注入元数据
145
- *
146
- * @param target 目标类
147
- * @returns 属性名到服务类型的映射
148
- */
149
- export declare function getPropertyInjectMetadata(target: Constructor): Map<string | symbol, ServiceType<IService>>;
150
- /**
151
- * 创建实例并自动注入依赖
152
- *
153
- * @param constructor 构造函数
154
- * @param container 服务容器
155
- * @returns 创建的实例
156
- *
157
- * @example
158
- * ```typescript
159
- * const instance = createInstance(MySystem, container);
160
- * ```
161
- */
162
- export declare function createInstance<T>(constructor: new (...args: any[]) => T, container: ServiceContainer): T;
163
- /**
164
- * 为实例注入属性依赖
165
- *
166
- * @param instance 目标实例
167
- * @param container 服务容器
168
- */
169
- export declare function injectProperties<T extends object>(instance: T, container: ServiceContainer): void;
170
- /**
171
- * 检查类是否标记为可更新
172
- *
173
- * @param target 目标类
174
- * @returns 是否可更新
175
- */
176
- export declare function isUpdatable(target: Constructor): boolean;
177
- /**
178
- * 获取类的可更新元数据
179
- *
180
- * @param target 目标类
181
- * @returns 可更新元数据
182
- */
183
- export declare function getUpdatableMetadata(target: Constructor): UpdatableMetadata | undefined;
184
- /**
185
- * 注册可注入的服务到容器
186
- *
187
- * 自动检测@Injectable装饰器并注册服务
188
- *
189
- * @param container 服务容器
190
- * @param serviceType 服务类型
191
- * @param singleton 是否注册为单例(默认true)
192
- *
193
- * @example
194
- * ```typescript
195
- * @Injectable()
196
- * class MyService implements IService {
197
- * dispose() {}
198
- * }
199
- *
200
- * // 自动注册
201
- * registerInjectable(Core.services, MyService);
202
- * ```
203
- */
204
- export declare function registerInjectable<T extends IService>(container: ServiceContainer, serviceType: ServiceType<T>, singleton?: boolean): void;
205
- export {};
206
- //# sourceMappingURL=Decorators.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Decorators.d.ts","sourceRoot":"","sources":["../../../src/Core/DI/Decorators.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEjE;;GAEG;AACH,KAAK,WAAW,GAAG,QAAQ,MAAM,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC;AAKhE;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B;;OAEG;IACH,UAAU,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,YAAY,EAAE,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,MAAM,GAAG,MAAM,CAAC,CAAC;IAE7D;;;OAGG;IACH,UAAU,CAAC,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC;CAC5D;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAC9B;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,UAAU,IAAI,cAAc,CAU3C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,SAAS,CAAC,QAAQ,GAAE,MAAU,GAAG,cAAc,CAiB9D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,iBAAiB,CAkBpF;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAGzD;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,WAAW,GAAG,kBAAkB,GAAG,SAAS,CAEzF;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,WAAW,GAAG,GAAG,CAAC,MAAM,GAAG,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC,CAG1G;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAC5B,WAAW,EAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EACtC,SAAS,EAAE,gBAAgB,GAC5B,CAAC,CAQH;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAE,SAAS,EAAE,gBAAgB,GAAG,IAAI,CAejG;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAGxD;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,WAAW,GAAG,iBAAiB,GAAG,SAAS,CAEvF;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,QAAQ,EACjD,SAAS,EAAE,gBAAgB,EAC3B,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,EAC3B,SAAS,GAAE,OAAc,GAC1B,IAAI,CAiBN"}
@@ -1,253 +0,0 @@
1
- /**
2
- * 依赖注入装饰器
3
- *
4
- * 提供 @Injectable、@InjectProperty 和 @Updatable 装饰器,用于标记可注入的类和依赖注入点
5
- */
6
- const injectableMetadata = new WeakMap();
7
- const updatableMetadata = new WeakMap();
8
- /**
9
- * @Injectable() 装饰器
10
- *
11
- * 标记类为可注入的服务,使其可以通过ServiceContainer进行依赖注入
12
- *
13
- * @example
14
- * ```typescript
15
- * @Injectable()
16
- * class TimeService implements IService {
17
- * constructor() {}
18
- * dispose() {}
19
- * }
20
- *
21
- * @Injectable()
22
- * class PhysicsSystem extends EntitySystem {
23
- * @InjectProperty(TimeService)
24
- * private timeService!: TimeService;
25
- *
26
- * constructor() {
27
- * super(Matcher.empty());
28
- * }
29
- * }
30
- * ```
31
- */
32
- export function Injectable() {
33
- return function (target) {
34
- const existing = injectableMetadata.get(target);
35
- injectableMetadata.set(target, {
36
- injectable: true,
37
- dependencies: [],
38
- ...(existing?.properties && { properties: existing.properties })
39
- });
40
- };
41
- }
42
- /**
43
- * @Updatable() 装饰器
44
- *
45
- * 标记服务类为可更新的,使其在每帧自动被ServiceContainer调用update方法。
46
- * 使用此装饰器的类必须实现IUpdatable接口(包含update方法)。
47
- *
48
- * @param priority - 更新优先级(数值越小越先执行,默认0)
49
- * @throws 如果类没有实现update方法,将在运行时抛出错误
50
- *
51
- * @example
52
- * ```typescript
53
- * @Injectable()
54
- * @Updatable()
55
- * class TimerManager implements IService, IUpdatable {
56
- * update(deltaTime?: number) {
57
- * // 每帧更新逻辑
58
- * }
59
- * dispose() {}
60
- * }
61
- *
62
- * // 指定优先级
63
- * @Injectable()
64
- * @Updatable(10)
65
- * class PhysicsManager implements IService, IUpdatable {
66
- * update() { }
67
- * dispose() {}
68
- * }
69
- * ```
70
- */
71
- export function Updatable(priority = 0) {
72
- return function (target) {
73
- // 验证类原型上是否有update方法
74
- const prototype = target.prototype;
75
- if (!prototype || typeof prototype.update !== 'function') {
76
- throw new Error(`@Updatable() decorator requires class ${target.name} to implement IUpdatable interface with update() method. ` +
77
- 'Please add \'implements IUpdatable\' and define update(deltaTime?: number): void method.');
78
- }
79
- // 标记为可更新
80
- updatableMetadata.set(target, {
81
- updatable: true,
82
- priority
83
- });
84
- };
85
- }
86
- /**
87
- * @InjectProperty() 装饰器
88
- *
89
- * 通过属性装饰器注入依赖
90
- *
91
- * 注入时机:在构造函数执行后、onInitialize() 调用前完成
92
- *
93
- * @param serviceType 服务类型
94
- *
95
- * @example
96
- * ```typescript
97
- * @Injectable()
98
- * class PhysicsSystem extends EntitySystem {
99
- * @InjectProperty(TimeService)
100
- * private timeService!: TimeService;
101
- *
102
- * @InjectProperty(CollisionService)
103
- * private collision!: CollisionService;
104
- *
105
- * constructor() {
106
- * super(Matcher.empty());
107
- * }
108
- *
109
- * public onInitialize(): void {
110
- * // 此时属性已注入完成,可以安全使用
111
- * console.log(this.timeService.getDeltaTime());
112
- * }
113
- * }
114
- * ```
115
- */
116
- export function InjectProperty(serviceType) {
117
- return function (target, propertyKey) {
118
- let metadata = injectableMetadata.get(target.constructor);
119
- if (!metadata) {
120
- metadata = {
121
- injectable: true,
122
- dependencies: []
123
- };
124
- injectableMetadata.set(target.constructor, metadata);
125
- }
126
- if (!metadata.properties) {
127
- metadata.properties = new Map();
128
- }
129
- metadata.properties.set(propertyKey, serviceType);
130
- };
131
- }
132
- /**
133
- * 检查类是否标记为可注入
134
- *
135
- * @param target 目标类
136
- * @returns 是否可注入
137
- */
138
- export function isInjectable(target) {
139
- const metadata = injectableMetadata.get(target);
140
- return metadata?.injectable ?? false;
141
- }
142
- /**
143
- * 获取类的依赖注入元数据
144
- *
145
- * @param target 目标类
146
- * @returns 依赖注入元数据
147
- */
148
- export function getInjectableMetadata(target) {
149
- return injectableMetadata.get(target);
150
- }
151
- /**
152
- * 获取属性注入元数据
153
- *
154
- * @param target 目标类
155
- * @returns 属性名到服务类型的映射
156
- */
157
- export function getPropertyInjectMetadata(target) {
158
- const metadata = injectableMetadata.get(target);
159
- return metadata?.properties || new Map();
160
- }
161
- /**
162
- * 创建实例并自动注入依赖
163
- *
164
- * @param constructor 构造函数
165
- * @param container 服务容器
166
- * @returns 创建的实例
167
- *
168
- * @example
169
- * ```typescript
170
- * const instance = createInstance(MySystem, container);
171
- * ```
172
- */
173
- export function createInstance(constructor, container) {
174
- // 创建实例(无参数注入)
175
- const instance = new constructor();
176
- // 注入属性依赖
177
- injectProperties(instance, container);
178
- return instance;
179
- }
180
- /**
181
- * 为实例注入属性依赖
182
- *
183
- * @param instance 目标实例
184
- * @param container 服务容器
185
- */
186
- export function injectProperties(instance, container) {
187
- const constructor = instance.constructor;
188
- const metadata = getInjectableMetadata(constructor);
189
- if (!metadata?.properties || metadata.properties.size === 0) {
190
- return;
191
- }
192
- for (const [propertyKey, serviceType] of metadata.properties) {
193
- const service = container.resolve(serviceType);
194
- if (service !== null) {
195
- instance[propertyKey] = service;
196
- }
197
- }
198
- }
199
- /**
200
- * 检查类是否标记为可更新
201
- *
202
- * @param target 目标类
203
- * @returns 是否可更新
204
- */
205
- export function isUpdatable(target) {
206
- const metadata = updatableMetadata.get(target);
207
- return metadata?.updatable ?? false;
208
- }
209
- /**
210
- * 获取类的可更新元数据
211
- *
212
- * @param target 目标类
213
- * @returns 可更新元数据
214
- */
215
- export function getUpdatableMetadata(target) {
216
- return updatableMetadata.get(target);
217
- }
218
- /**
219
- * 注册可注入的服务到容器
220
- *
221
- * 自动检测@Injectable装饰器并注册服务
222
- *
223
- * @param container 服务容器
224
- * @param serviceType 服务类型
225
- * @param singleton 是否注册为单例(默认true)
226
- *
227
- * @example
228
- * ```typescript
229
- * @Injectable()
230
- * class MyService implements IService {
231
- * dispose() {}
232
- * }
233
- *
234
- * // 自动注册
235
- * registerInjectable(Core.services, MyService);
236
- * ```
237
- */
238
- export function registerInjectable(container, serviceType, singleton = true) {
239
- if (!isInjectable(serviceType)) {
240
- throw new Error(`${serviceType.name} is not marked as @Injectable(). ` +
241
- 'Please add @Injectable() decorator to the class.');
242
- }
243
- // 创建工厂函数,使用createInstance自动解析依赖
244
- const factory = (c) => createInstance(serviceType, c);
245
- // 注册到容器
246
- if (singleton) {
247
- container.registerSingleton(serviceType, factory);
248
- }
249
- else {
250
- container.registerTransient(serviceType, factory);
251
- }
252
- }
253
- //# sourceMappingURL=Decorators.js.map