@rb-games/core 0.1.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 (388) hide show
  1. package/README.md +488 -0
  2. package/dist/devtools/DraggableController.d.ts +10 -0
  3. package/dist/devtools/DraggableController.d.ts.map +1 -0
  4. package/dist/devtools/ResizableController.d.ts +19 -0
  5. package/dist/devtools/ResizableController.d.ts.map +1 -0
  6. package/dist/devtools/index.d.ts +7 -0
  7. package/dist/devtools/index.d.ts.map +1 -0
  8. package/dist/devtools/index.js +884 -0
  9. package/dist/devtools/index.js.map +1 -0
  10. package/dist/devtools/overlayPlugin.d.ts +3 -0
  11. package/dist/devtools/overlayPlugin.d.ts.map +1 -0
  12. package/dist/devtools/spinePropertiesPlugin.d.ts +3 -0
  13. package/dist/devtools/spinePropertiesPlugin.d.ts.map +1 -0
  14. package/dist/devtools/spriteTextPropertiesPlugin.d.ts +3 -0
  15. package/dist/devtools/spriteTextPropertiesPlugin.d.ts.map +1 -0
  16. package/dist/devtools/treePlugin.d.ts +7 -0
  17. package/dist/devtools/treePlugin.d.ts.map +1 -0
  18. package/dist/engine/PixiEngine.d.ts +404 -0
  19. package/dist/engine/PixiEngine.d.ts.map +1 -0
  20. package/dist/engine/index.d.ts +2 -0
  21. package/dist/engine/index.d.ts.map +1 -0
  22. package/dist/engine/index.js +1818 -0
  23. package/dist/engine/index.js.map +1 -0
  24. package/dist/filters/ChromaKeyFilter.d.ts +64 -0
  25. package/dist/filters/ChromaKeyFilter.d.ts.map +1 -0
  26. package/dist/filters/index.d.ts +2 -0
  27. package/dist/filters/index.d.ts.map +1 -0
  28. package/dist/filters/index.js +248 -0
  29. package/dist/filters/index.js.map +1 -0
  30. package/dist/helpers/AssetHelper.d.ts +117 -0
  31. package/dist/helpers/AssetHelper.d.ts.map +1 -0
  32. package/dist/helpers/SVGAssetHelper.d.ts +397 -0
  33. package/dist/helpers/SVGAssetHelper.d.ts.map +1 -0
  34. package/dist/helpers/SVGLoader.d.ts +46 -0
  35. package/dist/helpers/SVGLoader.d.ts.map +1 -0
  36. package/dist/helpers/SVGParser.d.ts +121 -0
  37. package/dist/helpers/SVGParser.d.ts.map +1 -0
  38. package/dist/helpers/eventBridge.d.ts +150 -0
  39. package/dist/helpers/eventBridge.d.ts.map +1 -0
  40. package/dist/helpers/index.d.ts +8 -0
  41. package/dist/helpers/index.d.ts.map +1 -0
  42. package/dist/helpers/index.js +702 -0
  43. package/dist/helpers/index.js.map +1 -0
  44. package/dist/helpers/mergeUtils.d.ts +21 -0
  45. package/dist/helpers/mergeUtils.d.ts.map +1 -0
  46. package/dist/helpers/resolvePublicPath.d.ts +6 -0
  47. package/dist/helpers/resolvePublicPath.d.ts.map +1 -0
  48. package/dist/i18n/index.d.ts +2 -0
  49. package/dist/i18n/index.d.ts.map +1 -0
  50. package/dist/i18n/index.js +527 -0
  51. package/dist/i18n/index.js.map +1 -0
  52. package/dist/i18n/sharedI18n.d.ts +11 -0
  53. package/dist/i18n/sharedI18n.d.ts.map +1 -0
  54. package/dist/layout/Align.d.ts +126 -0
  55. package/dist/layout/Align.d.ts.map +1 -0
  56. package/dist/layout/Bounds.d.ts +120 -0
  57. package/dist/layout/Bounds.d.ts.map +1 -0
  58. package/dist/layout/Distribute.d.ts +103 -0
  59. package/dist/layout/Distribute.d.ts.map +1 -0
  60. package/dist/layout/Flow.d.ts +213 -0
  61. package/dist/layout/Flow.d.ts.map +1 -0
  62. package/dist/layout/PositionUtils.d.ts +57 -0
  63. package/dist/layout/PositionUtils.d.ts.map +1 -0
  64. package/dist/layout/index.d.ts +6 -0
  65. package/dist/layout/index.d.ts.map +1 -0
  66. package/dist/layout/index.js +673 -0
  67. package/dist/layout/index.js.map +1 -0
  68. package/dist/particle/Emitter.d.ts +290 -0
  69. package/dist/particle/Emitter.d.ts.map +1 -0
  70. package/dist/particle/EmitterConfig.d.ts +228 -0
  71. package/dist/particle/EmitterConfig.d.ts.map +1 -0
  72. package/dist/particle/LinkedListContainer.d.ts +7 -0
  73. package/dist/particle/LinkedListContainer.d.ts.map +1 -0
  74. package/dist/particle/Particle.d.ts +63 -0
  75. package/dist/particle/Particle.d.ts.map +1 -0
  76. package/dist/particle/ParticleUtils.d.ts +97 -0
  77. package/dist/particle/ParticleUtils.d.ts.map +1 -0
  78. package/dist/particle/PropertyList.d.ts +40 -0
  79. package/dist/particle/PropertyList.d.ts.map +1 -0
  80. package/dist/particle/PropertyNode.d.ts +74 -0
  81. package/dist/particle/PropertyNode.d.ts.map +1 -0
  82. package/dist/particle/SpineEmitter.d.ts +55 -0
  83. package/dist/particle/SpineEmitter.d.ts.map +1 -0
  84. package/dist/particle/SpineParticle.d.ts +74 -0
  85. package/dist/particle/SpineParticle.d.ts.map +1 -0
  86. package/dist/particle/behaviors/AccelerationMovement.d.ts +62 -0
  87. package/dist/particle/behaviors/AccelerationMovement.d.ts.map +1 -0
  88. package/dist/particle/behaviors/Alpha.d.ts +60 -0
  89. package/dist/particle/behaviors/Alpha.d.ts.map +1 -0
  90. package/dist/particle/behaviors/AnimatedTexture.d.ts +111 -0
  91. package/dist/particle/behaviors/AnimatedTexture.d.ts.map +1 -0
  92. package/dist/particle/behaviors/Behaviors.d.ts +71 -0
  93. package/dist/particle/behaviors/Behaviors.d.ts.map +1 -0
  94. package/dist/particle/behaviors/BlendMode.d.ts +31 -0
  95. package/dist/particle/behaviors/BlendMode.d.ts.map +1 -0
  96. package/dist/particle/behaviors/BurstSpawn.d.ts +43 -0
  97. package/dist/particle/behaviors/BurstSpawn.d.ts.map +1 -0
  98. package/dist/particle/behaviors/Color.d.ts +60 -0
  99. package/dist/particle/behaviors/Color.d.ts.map +1 -0
  100. package/dist/particle/behaviors/MultiStateAnimatedTexture.d.ts +99 -0
  101. package/dist/particle/behaviors/MultiStateAnimatedTexture.d.ts.map +1 -0
  102. package/dist/particle/behaviors/OrderedTexture.d.ts +33 -0
  103. package/dist/particle/behaviors/OrderedTexture.d.ts.map +1 -0
  104. package/dist/particle/behaviors/PathMovement.d.ts +68 -0
  105. package/dist/particle/behaviors/PathMovement.d.ts.map +1 -0
  106. package/dist/particle/behaviors/PointSpawn.d.ts +21 -0
  107. package/dist/particle/behaviors/PointSpawn.d.ts.map +1 -0
  108. package/dist/particle/behaviors/RandomColor.d.ts +17 -0
  109. package/dist/particle/behaviors/RandomColor.d.ts.map +1 -0
  110. package/dist/particle/behaviors/RandomTexture.d.ts +32 -0
  111. package/dist/particle/behaviors/RandomTexture.d.ts.map +1 -0
  112. package/dist/particle/behaviors/Rotation.d.ts +114 -0
  113. package/dist/particle/behaviors/Rotation.d.ts.map +1 -0
  114. package/dist/particle/behaviors/Scale.d.ts +74 -0
  115. package/dist/particle/behaviors/Scale.d.ts.map +1 -0
  116. package/dist/particle/behaviors/ShapeSpawn.d.ts +58 -0
  117. package/dist/particle/behaviors/ShapeSpawn.d.ts.map +1 -0
  118. package/dist/particle/behaviors/SingleTexture.d.ts +32 -0
  119. package/dist/particle/behaviors/SingleTexture.d.ts.map +1 -0
  120. package/dist/particle/behaviors/SpeedMovement.d.ts +76 -0
  121. package/dist/particle/behaviors/SpeedMovement.d.ts.map +1 -0
  122. package/dist/particle/behaviors/SpineTexture.d.ts +173 -0
  123. package/dist/particle/behaviors/SpineTexture.d.ts.map +1 -0
  124. package/dist/particle/behaviors/ZindexBehavior.d.ts +16 -0
  125. package/dist/particle/behaviors/ZindexBehavior.d.ts.map +1 -0
  126. package/dist/particle/behaviors/editor/Types.d.ts +104 -0
  127. package/dist/particle/behaviors/editor/Types.d.ts.map +1 -0
  128. package/dist/particle/behaviors/editor/behaviors/AccelerationMovement.d.ts +2 -0
  129. package/dist/particle/behaviors/editor/behaviors/AccelerationMovement.d.ts.map +1 -0
  130. package/dist/particle/behaviors/editor/behaviors/Alpha.d.ts +2 -0
  131. package/dist/particle/behaviors/editor/behaviors/Alpha.d.ts.map +1 -0
  132. package/dist/particle/behaviors/editor/behaviors/AnimatedTexture.d.ts +2 -0
  133. package/dist/particle/behaviors/editor/behaviors/AnimatedTexture.d.ts.map +1 -0
  134. package/dist/particle/behaviors/editor/behaviors/BlendMode.d.ts +2 -0
  135. package/dist/particle/behaviors/editor/behaviors/BlendMode.d.ts.map +1 -0
  136. package/dist/particle/behaviors/editor/behaviors/BurstSpawn.d.ts +2 -0
  137. package/dist/particle/behaviors/editor/behaviors/BurstSpawn.d.ts.map +1 -0
  138. package/dist/particle/behaviors/editor/behaviors/Color.d.ts +2 -0
  139. package/dist/particle/behaviors/editor/behaviors/Color.d.ts.map +1 -0
  140. package/dist/particle/behaviors/editor/behaviors/OrderedTexture.d.ts +2 -0
  141. package/dist/particle/behaviors/editor/behaviors/OrderedTexture.d.ts.map +1 -0
  142. package/dist/particle/behaviors/editor/behaviors/PathMovement.d.ts +2 -0
  143. package/dist/particle/behaviors/editor/behaviors/PathMovement.d.ts.map +1 -0
  144. package/dist/particle/behaviors/editor/behaviors/PointSpawn.d.ts +2 -0
  145. package/dist/particle/behaviors/editor/behaviors/PointSpawn.d.ts.map +1 -0
  146. package/dist/particle/behaviors/editor/behaviors/RandomTexture.d.ts +2 -0
  147. package/dist/particle/behaviors/editor/behaviors/RandomTexture.d.ts.map +1 -0
  148. package/dist/particle/behaviors/editor/behaviors/Rotation.d.ts +2 -0
  149. package/dist/particle/behaviors/editor/behaviors/Rotation.d.ts.map +1 -0
  150. package/dist/particle/behaviors/editor/behaviors/Scale.d.ts +2 -0
  151. package/dist/particle/behaviors/editor/behaviors/Scale.d.ts.map +1 -0
  152. package/dist/particle/behaviors/editor/behaviors/ShapeSpawn.d.ts +2 -0
  153. package/dist/particle/behaviors/editor/behaviors/ShapeSpawn.d.ts.map +1 -0
  154. package/dist/particle/behaviors/editor/behaviors/SingleTexture.d.ts +2 -0
  155. package/dist/particle/behaviors/editor/behaviors/SingleTexture.d.ts.map +1 -0
  156. package/dist/particle/behaviors/editor/behaviors/SpeedMovement.d.ts +2 -0
  157. package/dist/particle/behaviors/editor/behaviors/SpeedMovement.d.ts.map +1 -0
  158. package/dist/particle/behaviors/editor/behaviors/index.d.ts +15 -0
  159. package/dist/particle/behaviors/editor/behaviors/index.d.ts.map +1 -0
  160. package/dist/particle/behaviors/editor/index.d.ts +5 -0
  161. package/dist/particle/behaviors/editor/index.d.ts.map +1 -0
  162. package/dist/particle/behaviors/editor/shapes/PolygonalChain.d.ts +2 -0
  163. package/dist/particle/behaviors/editor/shapes/PolygonalChain.d.ts.map +1 -0
  164. package/dist/particle/behaviors/editor/shapes/Rectangle.d.ts +2 -0
  165. package/dist/particle/behaviors/editor/shapes/Rectangle.d.ts.map +1 -0
  166. package/dist/particle/behaviors/editor/shapes/Torus.d.ts +2 -0
  167. package/dist/particle/behaviors/editor/shapes/Torus.d.ts.map +1 -0
  168. package/dist/particle/behaviors/index.d.ts +25 -0
  169. package/dist/particle/behaviors/index.d.ts.map +1 -0
  170. package/dist/particle/behaviors/shapes/PolygonalChain.d.ts +57 -0
  171. package/dist/particle/behaviors/shapes/PolygonalChain.d.ts.map +1 -0
  172. package/dist/particle/behaviors/shapes/Rectangle.d.ts +59 -0
  173. package/dist/particle/behaviors/shapes/Rectangle.d.ts.map +1 -0
  174. package/dist/particle/behaviors/shapes/SpawnShape.d.ts +32 -0
  175. package/dist/particle/behaviors/shapes/SpawnShape.d.ts.map +1 -0
  176. package/dist/particle/behaviors/shapes/Torus.d.ts +71 -0
  177. package/dist/particle/behaviors/shapes/Torus.d.ts.map +1 -0
  178. package/dist/particle/behaviors/shapes/index.d.ts +5 -0
  179. package/dist/particle/behaviors/shapes/index.d.ts.map +1 -0
  180. package/dist/particle/index.d.ts +11 -0
  181. package/dist/particle/index.d.ts.map +1 -0
  182. package/dist/particle/index.js +2845 -0
  183. package/dist/particle/index.js.map +1 -0
  184. package/dist/plugins/Plugin.types.d.ts +80 -0
  185. package/dist/plugins/Plugin.types.d.ts.map +1 -0
  186. package/dist/plugins/device/DeviceOptimizerPlugin.d.ts +187 -0
  187. package/dist/plugins/device/DeviceOptimizerPlugin.d.ts.map +1 -0
  188. package/dist/plugins/device/DeviceOptimizerPlugin.types.d.ts +134 -0
  189. package/dist/plugins/device/DeviceOptimizerPlugin.types.d.ts.map +1 -0
  190. package/dist/plugins/device/index.d.ts +3 -0
  191. package/dist/plugins/device/index.d.ts.map +1 -0
  192. package/dist/plugins/display/DisplayPlugin.d.ts +208 -0
  193. package/dist/plugins/display/DisplayPlugin.d.ts.map +1 -0
  194. package/dist/plugins/display/DisplayPlugin.types.d.ts +174 -0
  195. package/dist/plugins/display/DisplayPlugin.types.d.ts.map +1 -0
  196. package/dist/plugins/display/displayViewport.d.ts +10 -0
  197. package/dist/plugins/display/displayViewport.d.ts.map +1 -0
  198. package/dist/plugins/display/index.d.ts +4 -0
  199. package/dist/plugins/display/index.d.ts.map +1 -0
  200. package/dist/plugins/eventbus/EventBusPlugin.d.ts +21 -0
  201. package/dist/plugins/eventbus/EventBusPlugin.d.ts.map +1 -0
  202. package/dist/plugins/eventbus/EventBusPlugin.types.d.ts +24 -0
  203. package/dist/plugins/eventbus/EventBusPlugin.types.d.ts.map +1 -0
  204. package/dist/plugins/eventbus/index.d.ts +3 -0
  205. package/dist/plugins/eventbus/index.d.ts.map +1 -0
  206. package/dist/plugins/gsap/GsapPlugin.d.ts +307 -0
  207. package/dist/plugins/gsap/GsapPlugin.d.ts.map +1 -0
  208. package/dist/plugins/gsap/index.d.ts +2 -0
  209. package/dist/plugins/gsap/index.d.ts.map +1 -0
  210. package/dist/plugins/index.d.ts +13 -0
  211. package/dist/plugins/index.d.ts.map +1 -0
  212. package/dist/plugins/index.js +12806 -0
  213. package/dist/plugins/index.js.map +1 -0
  214. package/dist/plugins/input/InputPlugin.const.d.ts +80 -0
  215. package/dist/plugins/input/InputPlugin.const.d.ts.map +1 -0
  216. package/dist/plugins/input/InputPlugin.d.ts +141 -0
  217. package/dist/plugins/input/InputPlugin.d.ts.map +1 -0
  218. package/dist/plugins/input/InputPlugin.types.d.ts +41 -0
  219. package/dist/plugins/input/InputPlugin.types.d.ts.map +1 -0
  220. package/dist/plugins/input/KeyboardManager.d.ts +139 -0
  221. package/dist/plugins/input/KeyboardManager.d.ts.map +1 -0
  222. package/dist/plugins/input/KeyboardManager.types.d.ts +27 -0
  223. package/dist/plugins/input/KeyboardManager.types.d.ts.map +1 -0
  224. package/dist/plugins/input/index.d.ts +4 -0
  225. package/dist/plugins/input/index.d.ts.map +1 -0
  226. package/dist/plugins/language/I18NextPlugin.d.ts +30 -0
  227. package/dist/plugins/language/I18NextPlugin.d.ts.map +1 -0
  228. package/dist/plugins/language/I18NextPlugin.types.d.ts +29 -0
  229. package/dist/plugins/language/I18NextPlugin.types.d.ts.map +1 -0
  230. package/dist/plugins/language/index.d.ts +3 -0
  231. package/dist/plugins/language/index.d.ts.map +1 -0
  232. package/dist/plugins/resource/ResourcePlugin.d.ts +189 -0
  233. package/dist/plugins/resource/ResourcePlugin.d.ts.map +1 -0
  234. package/dist/plugins/resource/ResourcePlugin.types.d.ts +153 -0
  235. package/dist/plugins/resource/ResourcePlugin.types.d.ts.map +1 -0
  236. package/dist/plugins/resource/index.d.ts +3 -0
  237. package/dist/plugins/resource/index.d.ts.map +1 -0
  238. package/dist/plugins/scene/Scene.d.ts +203 -0
  239. package/dist/plugins/scene/Scene.d.ts.map +1 -0
  240. package/dist/plugins/scene/ScenePlugin.d.ts +162 -0
  241. package/dist/plugins/scene/ScenePlugin.d.ts.map +1 -0
  242. package/dist/plugins/scene/ScenePlugin.types.d.ts +35 -0
  243. package/dist/plugins/scene/ScenePlugin.types.d.ts.map +1 -0
  244. package/dist/plugins/scene/index.d.ts +4 -0
  245. package/dist/plugins/scene/index.d.ts.map +1 -0
  246. package/dist/plugins/sentry/SentryPlugin.d.ts +66 -0
  247. package/dist/plugins/sentry/SentryPlugin.d.ts.map +1 -0
  248. package/dist/plugins/sentry/SentryPlugin.types.d.ts +8 -0
  249. package/dist/plugins/sentry/SentryPlugin.types.d.ts.map +1 -0
  250. package/dist/plugins/sentry/index.d.ts +3 -0
  251. package/dist/plugins/sentry/index.d.ts.map +1 -0
  252. package/dist/plugins/service/ServiceAdapter.d.ts +88 -0
  253. package/dist/plugins/service/ServiceAdapter.d.ts.map +1 -0
  254. package/dist/plugins/service/ServiceEventHelper.d.ts +6 -0
  255. package/dist/plugins/service/ServiceEventHelper.d.ts.map +1 -0
  256. package/dist/plugins/service/ServicePlugin.d.ts +135 -0
  257. package/dist/plugins/service/ServicePlugin.d.ts.map +1 -0
  258. package/dist/plugins/service/ServicePlugin.types.d.ts +14 -0
  259. package/dist/plugins/service/ServicePlugin.types.d.ts.map +1 -0
  260. package/dist/plugins/service/adapters/DevAuthAdapter.d.ts +56 -0
  261. package/dist/plugins/service/adapters/DevAuthAdapter.d.ts.map +1 -0
  262. package/dist/plugins/service/adapters/RGSAdapter.d.ts +82 -0
  263. package/dist/plugins/service/adapters/RGSAdapter.d.ts.map +1 -0
  264. package/dist/plugins/service/adapters/index.d.ts +7 -0
  265. package/dist/plugins/service/adapters/index.d.ts.map +1 -0
  266. package/dist/plugins/service/adapters/resolvePublicIp.d.ts +10 -0
  267. package/dist/plugins/service/adapters/resolvePublicIp.d.ts.map +1 -0
  268. package/dist/plugins/service/index.d.ts +10 -0
  269. package/dist/plugins/service/index.d.ts.map +1 -0
  270. package/dist/plugins/service/types/api.types.d.ts +299 -0
  271. package/dist/plugins/service/types/api.types.d.ts.map +1 -0
  272. package/dist/plugins/service/types/index.d.ts +6 -0
  273. package/dist/plugins/service/types/index.d.ts.map +1 -0
  274. package/dist/plugins/skin/ISkin.d.ts +62 -0
  275. package/dist/plugins/skin/ISkin.d.ts.map +1 -0
  276. package/dist/plugins/skin/Skin.d.ts +155 -0
  277. package/dist/plugins/skin/Skin.d.ts.map +1 -0
  278. package/dist/plugins/skin/SkinPlugin.d.ts +285 -0
  279. package/dist/plugins/skin/SkinPlugin.d.ts.map +1 -0
  280. package/dist/plugins/skin/SkinPlugin.types.d.ts +56 -0
  281. package/dist/plugins/skin/SkinPlugin.types.d.ts.map +1 -0
  282. package/dist/plugins/skin/index.d.ts +5 -0
  283. package/dist/plugins/skin/index.d.ts.map +1 -0
  284. package/dist/plugins/sound/SoundPlugin.d.ts +319 -0
  285. package/dist/plugins/sound/SoundPlugin.d.ts.map +1 -0
  286. package/dist/plugins/sound/SoundPlugin.types.d.ts +102 -0
  287. package/dist/plugins/sound/SoundPlugin.types.d.ts.map +1 -0
  288. package/dist/plugins/sound/SoundTestGUI.d.ts +42 -0
  289. package/dist/plugins/sound/SoundTestGUI.d.ts.map +1 -0
  290. package/dist/plugins/sound/index.d.ts +4 -0
  291. package/dist/plugins/sound/index.d.ts.map +1 -0
  292. package/dist/state-machine/ConfigBuilder.d.ts +239 -0
  293. package/dist/state-machine/ConfigBuilder.d.ts.map +1 -0
  294. package/dist/state-machine/StateMachine.d.ts +251 -0
  295. package/dist/state-machine/StateMachine.d.ts.map +1 -0
  296. package/dist/state-machine/guards.d.ts +151 -0
  297. package/dist/state-machine/guards.d.ts.map +1 -0
  298. package/dist/state-machine/index.d.ts +5 -0
  299. package/dist/state-machine/index.d.ts.map +1 -0
  300. package/dist/state-machine/index.js +954 -0
  301. package/dist/state-machine/index.js.map +1 -0
  302. package/dist/state-machine/types.d.ts +65 -0
  303. package/dist/state-machine/types.d.ts.map +1 -0
  304. package/dist/store/DataStore.d.ts +167 -0
  305. package/dist/store/DataStore.d.ts.map +1 -0
  306. package/dist/store/index.d.ts +3 -0
  307. package/dist/store/index.d.ts.map +1 -0
  308. package/dist/store/index.js +197 -0
  309. package/dist/store/index.js.map +1 -0
  310. package/dist/ui/behaviors/ButtonBehavior.d.ts +245 -0
  311. package/dist/ui/behaviors/ButtonBehavior.d.ts.map +1 -0
  312. package/dist/ui/behaviors/InputBehavior.d.ts +169 -0
  313. package/dist/ui/behaviors/InputBehavior.d.ts.map +1 -0
  314. package/dist/ui/behaviors/ScrollbarBehavior.d.ts +371 -0
  315. package/dist/ui/behaviors/ScrollbarBehavior.d.ts.map +1 -0
  316. package/dist/ui/behaviors/index.d.ts +4 -0
  317. package/dist/ui/behaviors/index.d.ts.map +1 -0
  318. package/dist/ui/components/ButtonComp.d.ts +138 -0
  319. package/dist/ui/components/ButtonComp.d.ts.map +1 -0
  320. package/dist/ui/components/Comp.utils.d.ts +390 -0
  321. package/dist/ui/components/Comp.utils.d.ts.map +1 -0
  322. package/dist/ui/components/Component.types.d.ts +41 -0
  323. package/dist/ui/components/Component.types.d.ts.map +1 -0
  324. package/dist/ui/components/InputComp.d.ts +43 -0
  325. package/dist/ui/components/InputComp.d.ts.map +1 -0
  326. package/dist/ui/components/LabelBox.d.ts +49 -0
  327. package/dist/ui/components/LabelBox.d.ts.map +1 -0
  328. package/dist/ui/components/ListTableComp.d.ts +106 -0
  329. package/dist/ui/components/ListTableComp.d.ts.map +1 -0
  330. package/dist/ui/components/Skinable.d.ts +261 -0
  331. package/dist/ui/components/Skinable.d.ts.map +1 -0
  332. package/dist/ui/components/SliderComp.d.ts +60 -0
  333. package/dist/ui/components/SliderComp.d.ts.map +1 -0
  334. package/dist/ui/components/SpriteTextBBCode.d.ts +16 -0
  335. package/dist/ui/components/SpriteTextBBCode.d.ts.map +1 -0
  336. package/dist/ui/components/StepperComp.d.ts +89 -0
  337. package/dist/ui/components/StepperComp.d.ts.map +1 -0
  338. package/dist/ui/components/index.d.ts +12 -0
  339. package/dist/ui/components/index.d.ts.map +1 -0
  340. package/dist/ui/components/spriteText/SpriteText.d.ts +114 -0
  341. package/dist/ui/components/spriteText/SpriteText.d.ts.map +1 -0
  342. package/dist/ui/components/spriteText/SpriteText.types.d.ts +109 -0
  343. package/dist/ui/components/spriteText/SpriteText.types.d.ts.map +1 -0
  344. package/dist/ui/components/spriteText/SpriteTextAlignment.d.ts +25 -0
  345. package/dist/ui/components/spriteText/SpriteTextAlignment.d.ts.map +1 -0
  346. package/dist/ui/components/spriteText/SpriteTextBezier.d.ts +20 -0
  347. package/dist/ui/components/spriteText/SpriteTextBezier.d.ts.map +1 -0
  348. package/dist/ui/components/spriteText/SpriteTextCurve.d.ts +4 -0
  349. package/dist/ui/components/spriteText/SpriteTextCurve.d.ts.map +1 -0
  350. package/dist/ui/components/spriteText/SpriteTextKerning.d.ts +7 -0
  351. package/dist/ui/components/spriteText/SpriteTextKerning.d.ts.map +1 -0
  352. package/dist/ui/components/spriteText/SpriteTextTexture.d.ts +16 -0
  353. package/dist/ui/components/spriteText/SpriteTextTexture.d.ts.map +1 -0
  354. package/dist/ui/components/spriteText/SpriteTextWrap.d.ts +19 -0
  355. package/dist/ui/components/spriteText/SpriteTextWrap.d.ts.map +1 -0
  356. package/dist/ui/components/spriteText/index.d.ts +3 -0
  357. package/dist/ui/components/spriteText/index.d.ts.map +1 -0
  358. package/dist/ui/index.d.ts +3 -0
  359. package/dist/ui/index.d.ts.map +1 -0
  360. package/dist/ui/index.js +4778 -0
  361. package/dist/ui/index.js.map +1 -0
  362. package/dist/utils/ArrayUtils.d.ts +24 -0
  363. package/dist/utils/ArrayUtils.d.ts.map +1 -0
  364. package/dist/utils/ColorUtils.d.ts +34 -0
  365. package/dist/utils/ColorUtils.d.ts.map +1 -0
  366. package/dist/utils/DataInjector.d.ts +67 -0
  367. package/dist/utils/DataInjector.d.ts.map +1 -0
  368. package/dist/utils/Logger.d.ts +332 -0
  369. package/dist/utils/Logger.d.ts.map +1 -0
  370. package/dist/utils/NumberFormatter.d.ts +126 -0
  371. package/dist/utils/NumberFormatter.d.ts.map +1 -0
  372. package/dist/utils/ObjectUtils.d.ts +64 -0
  373. package/dist/utils/ObjectUtils.d.ts.map +1 -0
  374. package/dist/utils/PixiUtils.d.ts +118 -0
  375. package/dist/utils/PixiUtils.d.ts.map +1 -0
  376. package/dist/utils/Throttle.d.ts +103 -0
  377. package/dist/utils/Throttle.d.ts.map +1 -0
  378. package/dist/utils/index.d.ts +9 -0
  379. package/dist/utils/index.d.ts.map +1 -0
  380. package/dist/utils/index.js +899 -0
  381. package/dist/utils/index.js.map +1 -0
  382. package/dist/vite/index.d.ts +3 -0
  383. package/dist/vite/index.d.ts.map +1 -0
  384. package/dist/vite/index.js +126 -0
  385. package/dist/vite/index.js.map +1 -0
  386. package/dist/vite/mergeLocalesPlugin.d.ts +22 -0
  387. package/dist/vite/mergeLocalesPlugin.d.ts.map +1 -0
  388. package/package.json +143 -0
@@ -0,0 +1,102 @@
1
+ import type { PluginConfig } from '../Plugin.types';
2
+ import type { SoundChannel } from '../resource/ResourcePlugin.types';
3
+ /**
4
+ * Sound sprite data for defining segments within a sound file.
5
+ *
6
+ * @public
7
+ */
8
+ export interface SoundSpriteData {
9
+ /** Start time in seconds */
10
+ start: number;
11
+ /** End time in seconds */
12
+ end: number;
13
+ /** Whether this sprite should loop */
14
+ loop?: boolean;
15
+ }
16
+ /**
17
+ * Channel configuration for volume and instance management.
18
+ *
19
+ * @public
20
+ */
21
+ export interface ChannelConfig {
22
+ /** Default volume for this channel (0-1) */
23
+ volume: number;
24
+ /** Maximum concurrent instances for this channel */
25
+ maxInstances?: number;
26
+ /** Whether this channel is muted by default */
27
+ muted?: boolean;
28
+ }
29
+ /**
30
+ * Play options for sound playback.
31
+ *
32
+ * @public
33
+ */
34
+ export interface PlayOptions {
35
+ /** Whether to loop the sound (native seamless loop) */
36
+ loop?: boolean;
37
+ /** Volume override (0-1) */
38
+ volume?: number;
39
+ /** Playback speed (1 = normal) */
40
+ speed?: number;
41
+ /** Start time offset in seconds */
42
+ start?: number;
43
+ /** End time in seconds */
44
+ end?: number;
45
+ /**
46
+ * Interval loop: wait before replaying the sound.
47
+ * Overrides native `loop` when set.
48
+ *
49
+ * - `number` — fixed delay in ms (e.g. `1000` = 1s gap between plays)
50
+ * - `[min, max]` — random delay in ms (e.g. `[5000, 10000]` = 5-10s random gap)
51
+ */
52
+ loopInterval?: number | [number, number];
53
+ /** Optional logical group to group this playback under (for stopGroup) */
54
+ group?: string;
55
+ /** If true and group is set, auto-stop previous sounds under the same group before playing */
56
+ stopPreviousGroup?: boolean;
57
+ /** Callback when playback completes */
58
+ complete?: () => void;
59
+ }
60
+ /**
61
+ * Configuration for SoundPlugin.
62
+ *
63
+ * @public
64
+ */
65
+ export interface SoundPluginConfig extends PluginConfig {
66
+ /** Channel configurations */
67
+ channels?: Partial<Record<SoundChannel, ChannelConfig>>;
68
+ /** Master volume (0-1) */
69
+ masterVolume?: number;
70
+ /** Auto-unlock audio context on user interaction */
71
+ autoUnlock?: boolean;
72
+ /** Disable auto-pause when window loses focus */
73
+ disableAutoPause?: boolean;
74
+ }
75
+ /**
76
+ * Internal sprite registry entry.
77
+ *
78
+ * @internal
79
+ */
80
+ export interface SpriteRegistryEntry {
81
+ /** The sound alias that contains this sprite */
82
+ soundAlias: string;
83
+ /** The sprite key within the sound */
84
+ spriteKey: string;
85
+ /** The channel this sprite belongs to */
86
+ channel?: SoundChannel;
87
+ }
88
+ /**
89
+ * Options for queueIn method - fades out existing sounds and fades in a new one.
90
+ *
91
+ * @public
92
+ */
93
+ export interface QueueInOptions extends PlayOptions {
94
+ /** Duration for fade out of existing sounds (defaults to main duration if not specified) */
95
+ fadeOutDuration?: number;
96
+ /** Transition type: crossfade (simultaneous) or sequential (fade out first, then fade in) */
97
+ type?: 'crossfade' | 'sequential';
98
+ /** Override channel (uses alias's registered channel if not provided) */
99
+ channel?: SoundChannel;
100
+ }
101
+ export { SoundChannel };
102
+ //# sourceMappingURL=SoundPlugin.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SoundPlugin.types.d.ts","sourceRoot":"","sources":["../../../plugins/sound/SoundPlugin.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAErE;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,0BAA0B;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,sCAAsC;IACtC,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,4CAA4C;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,oDAAoD;IACpD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,uDAAuD;IACvD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,4BAA4B;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mCAAmC;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0BAA0B;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,0EAA0E;IAC1E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8FAA8F;IAC9F,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,uCAAuC;IACvC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAkB,SAAQ,YAAY;IACrD,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC,CAAC;IACxD,0BAA0B;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oDAAoD;IACpD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iDAAiD;IACjD,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,gDAAgD;IAChD,UAAU,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,OAAO,CAAC,EAAE,YAAY,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAe,SAAQ,WAAW;IACjD,4FAA4F;IAC5F,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,6FAA6F;IAC7F,IAAI,CAAC,EAAE,WAAW,GAAG,YAAY,CAAC;IAClC,yEAAyE;IACzE,OAAO,CAAC,EAAE,YAAY,CAAC;CACxB;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -0,0 +1,42 @@
1
+ import type { SoundPlugin } from './SoundPlugin';
2
+ /**
3
+ * Debug GUI for SoundPlugin using Tweakpane.
4
+ * Provides visual controls for testing sound playback, channels, and stop methods.
5
+ *
6
+ * @example
7
+ * ```typescript
8
+ * import { SoundTestGUI } from './SoundTestGUI';
9
+ *
10
+ * // After soundPlugin is initialized:
11
+ * if (isDevelopment) {
12
+ * new SoundTestGUI(soundPlugin);
13
+ * }
14
+ * ```
15
+ */
16
+ export declare class SoundTestGUI {
17
+ private pane;
18
+ private plugin;
19
+ private playingFolder;
20
+ private soundsFolder;
21
+ private updateInterval;
22
+ private lastSoundCount;
23
+ private params;
24
+ private channelParams;
25
+ constructor(soundPlugin: SoundPlugin);
26
+ private applyCustomStyles;
27
+ private initMasterControls;
28
+ private initChannelControls;
29
+ private initSoundsFolder;
30
+ private refreshSoundsList;
31
+ private initPlayingFolder;
32
+ private expandedAliases;
33
+ private updatePlayingList;
34
+ private initGroupControls;
35
+ private startAutoRefresh;
36
+ private syncChannelParams;
37
+ /**
38
+ * Dispose the GUI and clean up resources.
39
+ */
40
+ dispose(): void;
41
+ }
42
+ //# sourceMappingURL=SoundTestGUI.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SoundTestGUI.d.ts","sourceRoot":"","sources":["../../../plugins/sound/SoundTestGUI.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGjD;;;;;;;;;;;;;GAaG;AACH,qBAAa,YAAY;IAGvB,OAAO,CAAC,IAAI,CAAM;IAClB,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,aAAa,CAAa;IAClC,OAAO,CAAC,YAAY,CAAa;IACjC,OAAO,CAAC,cAAc,CAA+C;IACrE,OAAO,CAAC,cAAc,CAAa;IAEnC,OAAO,CAAC,MAAM,CAIZ;IAEF,OAAO,CAAC,aAAa,CAKnB;gBAEU,WAAW,EAAE,WAAW;IA4BpC,OAAO,CAAC,iBAAiB;IAoCzB,OAAO,CAAC,kBAAkB;IAqB1B,OAAO,CAAC,mBAAmB;IA6C3B,OAAO,CAAC,gBAAgB;IAKxB,OAAO,CAAC,iBAAiB;IAqEzB,OAAO,CAAC,iBAAiB;IAKzB,OAAO,CAAC,eAAe,CAA0B;IAEjD,OAAO,CAAC,iBAAiB;IAyHzB,OAAO,CAAC,iBAAiB;IAczB,OAAO,CAAC,gBAAgB;IAgBxB,OAAO,CAAC,iBAAiB;IA8BzB;;OAEG;IACI,OAAO,IAAI,IAAI;CASvB"}
@@ -0,0 +1,4 @@
1
+ export * from './SoundPlugin';
2
+ export * from './SoundPlugin.types';
3
+ export * from './SoundTestGUI';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../plugins/sound/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,239 @@
1
+ import type { StateKey, ModeKey, ScopeKey, StateMachineConfig, StateHook, TransitionGuard } from './types';
2
+ /**
3
+ * Fluent API builder for creating state machine configurations
4
+ *
5
+ * Provides a chainable interface for defining modes, states, scopes, hooks, and guards.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * const config = createConfig<GameData>()
10
+ * .initial('IDLE', 'NORMAL')
11
+ * .initialData({ balance: 1000 })
12
+ * .mode('NORMAL')
13
+ * .state('IDLE')
14
+ * .scope('ui', { spinButton: { enabled: true } })
15
+ * .state('SPIN')
16
+ * .extends('IDLE')
17
+ * .guard('canEnter', (ctx) => ctx.data.balance >= ctx.data.bet)
18
+ * .build();
19
+ * ```
20
+ *
21
+ * @template TData - Type of the state machine's data context
22
+ */
23
+ export declare class ConfigBuilder<TData = any> {
24
+ constructor(initialData?: TData);
25
+ private config;
26
+ private currentMode;
27
+ private currentState;
28
+ /**
29
+ * Define a new mode or switch to an existing mode
30
+ *
31
+ * @param name - Mode key (e.g., 'NORMAL', 'FREESPIN', 'BONUS')
32
+ * @returns This builder for chaining
33
+ */
34
+ mode(name: ModeKey): this;
35
+ /**
36
+ * Define a new state in the current mode
37
+ *
38
+ * @param name - State key (e.g., 'IDLE', 'SPIN', 'MATCH')
39
+ * @returns This builder for chaining
40
+ * @throws Error if mode() hasn't been called first
41
+ */
42
+ state(name: StateKey): this;
43
+ /**
44
+ * Make current state extend from a parent state (inheritance)
45
+ *
46
+ * Child state will inherit all properties from parent state using lodash merge.
47
+ * Child properties override parent properties.
48
+ *
49
+ * @param parentState - Parent state key to extend from
50
+ * @returns This builder for chaining
51
+ * @throws Error if mode() and state() haven't been called first
52
+ *
53
+ * @example
54
+ * ```typescript
55
+ * .state('IDLE')
56
+ * .scope('ui', { spinButton: { enabled: true, icon: 'spin' } })
57
+ *
58
+ * .state('SPIN')
59
+ * .extends('IDLE') // Inherits from IDLE
60
+ * .scope('ui', { spinButton: { icon: 'stop' } }) // Only override icon
61
+ * ```
62
+ */
63
+ extends(parentState: StateKey): this;
64
+ /**
65
+ * Define scope configuration for current state
66
+ *
67
+ * Scopes organize related configuration (ui, scene, audio, etc.).
68
+ * Values can be static or resolver functions.
69
+ *
70
+ * @param scopeName - Scope key (e.g., 'ui', 'scene', 'audio')
71
+ * @param scopeData - Scope configuration object
72
+ * @returns This builder for chaining
73
+ * @throws Error if mode() and state() haven't been called first
74
+ *
75
+ * @example
76
+ * ```typescript
77
+ * .scope('ui', {
78
+ * spinButton: {
79
+ * enabled: true,
80
+ * icon: (ctx) => ctx.data.isQuickSpin ? 'quick_spin' : 'spin',
81
+ * },
82
+ * betButtons: { enabled: false },
83
+ * })
84
+ * .scope('scene', {
85
+ * reels: { spinning: true },
86
+ * })
87
+ * ```
88
+ */
89
+ scope(scopeName: ScopeKey, scopeData: Record<string, Record<string, any>>): this;
90
+ /**
91
+ * Add onEnter lifecycle hook to current state
92
+ *
93
+ * Called when entering this state. Can be async.
94
+ * Transition waits for this hook to complete.
95
+ *
96
+ * @param hook - Lifecycle hook function
97
+ * @returns This builder for chaining
98
+ * @throws Error if mode() and state() haven't been called first
99
+ *
100
+ * @example
101
+ * ```typescript
102
+ * .onEnter(async (ctx) => {
103
+ * ctx.data.balance -= ctx.data.bet;
104
+ * await scene.playAnimation();
105
+ * })
106
+ * ```
107
+ */
108
+ onEnter(hook: StateHook<TData>): this;
109
+ /**
110
+ * Add onExit lifecycle hook to current state
111
+ *
112
+ * Called when exiting this state. Can be async.
113
+ * Transition waits for this hook to complete.
114
+ *
115
+ * @param hook - Lifecycle hook function
116
+ * @returns This builder for chaining
117
+ * @throws Error if mode() and state() haven't been called first
118
+ *
119
+ * @example
120
+ * ```typescript
121
+ * .onExit(async (ctx) => {
122
+ * await scene.cleanup();
123
+ * })
124
+ * ```
125
+ */
126
+ onExit(hook: StateHook<TData>): this;
127
+ /**
128
+ * Add transition guard to current state
129
+ *
130
+ * Guards control whether transitions are allowed.
131
+ * Return false to block transition.
132
+ *
133
+ * @param type - Guard type ('canEnter' or 'canExit')
134
+ * @param guard - Guard function
135
+ * @returns This builder for chaining
136
+ * @throws Error if mode() and state() haven't been called first
137
+ *
138
+ * @example
139
+ * ```typescript
140
+ * .guard('canEnter', (ctx) => ctx.data.balance >= ctx.data.bet)
141
+ * .guard('canExit', (ctx) => !ctx.data.isLocked)
142
+ * ```
143
+ */
144
+ guard(type: 'canEnter' | 'canExit', guard: TransitionGuard<TData>): this;
145
+ /**
146
+ * Add metadata to current state
147
+ *
148
+ * @param data - Metadata object
149
+ * @returns This builder for chaining
150
+ * @throws Error if mode() and state() haven't been called first
151
+ */
152
+ metadata(data: Record<string, any>): this;
153
+ /**
154
+ * Add lifecycle hook to current mode
155
+ *
156
+ * @param type - Hook type ('onEnter' or 'onExit')
157
+ * @param hook - Lifecycle hook function
158
+ * @returns This builder for chaining
159
+ * @throws Error if mode() hasn't been called first
160
+ *
161
+ * @example
162
+ * ```typescript
163
+ * .mode('FREESPIN')
164
+ * .modeHook('onEnter', (ctx) => {
165
+ * ctx.data.freeSpinsRemaining = 10;
166
+ * })
167
+ * ```
168
+ */
169
+ modeHook(type: 'onEnter' | 'onExit', hook: StateHook<TData>): this;
170
+ /**
171
+ * Set initial state and mode
172
+ *
173
+ * @param state - Initial state key
174
+ * @param mode - Initial mode key
175
+ * @returns This builder for chaining
176
+ *
177
+ * @example
178
+ * ```typescript
179
+ * .initial('IDLE', 'NORMAL')
180
+ * ```
181
+ */
182
+ initial(state: StateKey, mode: ModeKey): this;
183
+ /**
184
+ * Set initial data for state context
185
+ *
186
+ * @param data - Initial data object
187
+ * @returns This builder for chaining
188
+ *
189
+ * @example
190
+ * ```typescript
191
+ * .initialData({ balance: 1000, bet: 10 })
192
+ * ```
193
+ */
194
+ initialData(data: TData): this;
195
+ /**
196
+ * Enable strict mode (throws errors instead of emitting error events)
197
+ *
198
+ * @param value - Enable strict mode (default: true)
199
+ * @returns This builder for chaining
200
+ */
201
+ strict(value?: boolean): this;
202
+ /**
203
+ * Build and return the final state machine configuration
204
+ *
205
+ * @returns Complete state machine configuration
206
+ * @throws Error if initial state and mode haven't been set
207
+ *
208
+ * @example
209
+ * ```typescript
210
+ * const config = createConfig()
211
+ * .initial('IDLE', 'NORMAL')
212
+ * .mode('NORMAL')
213
+ * .state('IDLE')
214
+ * .build();
215
+ * ```
216
+ */
217
+ build(): StateMachineConfig<TData>;
218
+ }
219
+ /**
220
+ * Create a new config builder instance
221
+ *
222
+ * @template TData - Type of the state machine's data context
223
+ * @returns New ConfigBuilder instance
224
+ *
225
+ * @example
226
+ * ```typescript
227
+ * interface GameData {
228
+ * balance: number;
229
+ * bet: number;
230
+ * }
231
+ *
232
+ * const config = createConfig<GameData>()
233
+ * .initial('IDLE', 'NORMAL')
234
+ * .initialData({ balance: 1000, bet: 10 })
235
+ * .build();
236
+ * ```
237
+ */
238
+ export declare function createConfig<TData = any>(initialData?: TData): ConfigBuilder<TData>;
239
+ //# sourceMappingURL=ConfigBuilder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfigBuilder.d.ts","sourceRoot":"","sources":["../../state-machine/ConfigBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,OAAO,EACP,QAAQ,EAER,kBAAkB,EAClB,SAAS,EACT,eAAe,EAChB,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,aAAa,CAAC,KAAK,GAAG,GAAG;gBACxB,WAAW,CAAC,EAAE,KAAK;IAI/B,OAAO,CAAC,MAAM,CAEZ;IACF,OAAO,CAAC,WAAW,CAAwB;IAC3C,OAAO,CAAC,YAAY,CAAyB;IAE7C;;;;;OAKG;IACH,IAAI,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI;IAQzB;;;;;;OAMG;IACH,KAAK,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI;IAY3B;;;;;;;;;;;;;;;;;;;OAmBG;IACH,OAAO,CAAC,WAAW,EAAE,QAAQ,GAAG,IAAI;IASpC;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,KAAK,CAAC,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,IAAI;IAYhF;;;;;;;;;;;;;;;;;OAiBG;IACH,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,KAAK,CAAC,GAAG,IAAI;IASrC;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,KAAK,CAAC,GAAG,IAAI;IASpC;;;;;;;;;;;;;;;;OAgBG;IACH,KAAK,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,EAAE,KAAK,EAAE,eAAe,CAAC,KAAK,CAAC,GAAG,IAAI;IAYxE;;;;;;OAMG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI;IASzC;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,QAAQ,EAAE,IAAI,EAAE,SAAS,CAAC,KAAK,CAAC,GAAG,IAAI;IASlE;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI;IAM7C;;;;;;;;;;OAUG;IACH,WAAW,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI;IAK9B;;;;;OAKG;IACH,MAAM,CAAC,KAAK,UAAO,GAAG,IAAI;IAK1B;;;;;;;;;;;;;;OAcG;IACH,KAAK,IAAI,kBAAkB,CAAC,KAAK,CAAC;CAMnC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAAC,KAAK,GAAG,GAAG,EAAE,WAAW,CAAC,EAAE,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC,CAEnF"}
@@ -0,0 +1,251 @@
1
+ import { EventEmitter } from 'pixi.js';
2
+ import type { StateKey, ModeKey, ScopeKey, StateContext, StateMachineConfig, TransitionOptions, StateMachineEvents } from './types';
3
+ /**
4
+ * Event-driven state machine with two-level hierarchy (MODE/STATE).
5
+ *
6
+ * Features:
7
+ * - Two-level structure: MODE (NORMAL, FREESPIN, BONUS) → STATE (IDLE, SPIN, MATCH)
8
+ * - State inheritance with lodash merge
9
+ * - Scope-based configuration (ui, scene, audio, etc.)
10
+ * - Dynamic values via resolver functions
11
+ * - Async lifecycle hooks (onEnter, onExit)
12
+ * - Transition guards for validation
13
+ * - Pixi.js EventEmitter for decoupled communication
14
+ *
15
+ * @example
16
+ * ```typescript
17
+ * const config = createConfig<GameData>()
18
+ * .initial('IDLE', 'NORMAL')
19
+ * .mode('NORMAL')
20
+ * .state('IDLE')
21
+ * .scope('ui', { spinButton: { enabled: true } })
22
+ * .state('SPIN')
23
+ * .extends('IDLE')
24
+ * .guard('canEnter', (ctx) => ctx.data.balance >= ctx.data.bet)
25
+ * .build();
26
+ *
27
+ * const machine = new StateMachine(config);
28
+ * await machine.transition('SPIN');
29
+ * ```
30
+ *
31
+ * @template TData - Type of the state machine's data context
32
+ */
33
+ export declare class StateMachine<TData = any> extends EventEmitter<StateMachineEvents<TData>> {
34
+ private config;
35
+ private context;
36
+ private isTransitioning;
37
+ private resolvedStateCache;
38
+ constructor(config: StateMachineConfig<TData>);
39
+ /**
40
+ * Current state key (e.g., 'IDLE', 'SPIN', 'MATCH')
41
+ */
42
+ get state(): StateKey;
43
+ /**
44
+ * Current mode key (e.g., 'NORMAL', 'FREESPIN', 'BONUS')
45
+ */
46
+ get mode(): ModeKey;
47
+ /**
48
+ * Current state data (mutable)
49
+ */
50
+ get data(): TData;
51
+ /**
52
+ * Get a readonly copy of the current state context
53
+ *
54
+ * @returns Readonly state context with current state, mode, data, and metadata
55
+ */
56
+ getContext(): Readonly<StateContext<TData>>;
57
+ /**
58
+ * Update state data using an updater function
59
+ *
60
+ * @param updater - Function that receives current data and optionally returns new data
61
+ *
62
+ * @example
63
+ * ```typescript
64
+ * machine.updateData(data => {
65
+ * data.balance = 1000;
66
+ * data.bet = 10;
67
+ * });
68
+ * ```
69
+ */
70
+ updateData(updater: (data: TData) => TData | void): void;
71
+ private resolveStateDefinition;
72
+ private resolveScopeData;
73
+ private resolveValue;
74
+ /**
75
+ * Get resolved scope data for a specific scope
76
+ *
77
+ * @param scopeName - Name of the scope (e.g., 'ui', 'scene', 'audio')
78
+ * @returns Resolved scope data with all resolver functions evaluated
79
+ *
80
+ * @example
81
+ * ```typescript
82
+ * const uiState = machine.getScope('ui');
83
+ * console.log(uiState.spinButton.enabled); // true
84
+ * ```
85
+ */
86
+ getScope(scopeName: ScopeKey): any;
87
+ /**
88
+ * Get all resolved scope data for the current state
89
+ *
90
+ * @returns Object containing all scopes with resolved data
91
+ *
92
+ * @example
93
+ * ```typescript
94
+ * const scopes = machine.getAllScopes();
95
+ * console.log(scopes.ui); // UI scope data
96
+ * console.log(scopes.scene); // Scene scope data
97
+ * ```
98
+ */
99
+ getAllScopes(): Record<ScopeKey, any>;
100
+ /**
101
+ * Transition to a new state within the current mode
102
+ *
103
+ * This is an async operation that:
104
+ * 1. Checks guards (canExit, canEnter)
105
+ * 2. Calls onExit hook of current state
106
+ * 3. Changes the state
107
+ * 4. Calls onEnter hook of target state
108
+ * 5. Emits events (state:exit, state:enter, state:change, scope:update)
109
+ *
110
+ * @param targetState - Target state key to transition to
111
+ * @param options - Transition options
112
+ * @param options.force - Skip guard checks and force transition
113
+ * @param options.silent - Skip event emissions
114
+ * @returns Promise that resolves to true if transition succeeded, false otherwise
115
+ *
116
+ * @example
117
+ * ```typescript
118
+ * // Normal transition
119
+ * await machine.transition('SPIN');
120
+ *
121
+ * // Force transition (skip guards)
122
+ * await machine.transition('SPIN', { force: true });
123
+ *
124
+ * // Silent transition (no events)
125
+ * await machine.transition('SPIN', { silent: true });
126
+ * ```
127
+ *
128
+ * @fires state:exit - When exiting current state
129
+ * @fires state:enter - When entering target state
130
+ * @fires state:change - After state change completes
131
+ * @fires scope:update - For each scope after state change
132
+ * @fires transition:blocked - If guard check fails
133
+ * @fires error - If an error occurs during transition
134
+ */
135
+ transition(targetState: StateKey, options?: TransitionOptions): Promise<boolean>;
136
+ /**
137
+ * Change to a different mode with an optional initial state
138
+ *
139
+ * This will:
140
+ * 1. Call onExit hook of current mode
141
+ * 2. Clear state resolution cache
142
+ * 3. Change mode and state
143
+ * 4. Call onEnter hook of target mode
144
+ * 5. Call onEnter hook of initial state
145
+ * 6. Emit events
146
+ *
147
+ * @param targetMode - Target mode key to switch to
148
+ * @param initialState - Optional initial state in the target mode (defaults to config.initialState)
149
+ * @returns Promise that resolves to true if mode change succeeded, false otherwise
150
+ *
151
+ * @example
152
+ * ```typescript
153
+ * // Switch to freespin mode
154
+ * await machine.changeMode('FREESPIN', 'IDLE');
155
+ *
156
+ * // Return to normal mode
157
+ * await machine.changeMode('NORMAL', 'IDLE');
158
+ * ```
159
+ *
160
+ * @fires mode:exit - When exiting current mode
161
+ * @fires mode:enter - When entering target mode
162
+ * @fires mode:change - After mode change completes
163
+ * @fires state:enter - When entering initial state
164
+ * @fires scope:update - For each scope after mode change
165
+ */
166
+ changeMode(targetMode: ModeKey, initialState?: StateKey): Promise<boolean>;
167
+ /**
168
+ * Check if a state exists in the current mode (synchronous, no guard check)
169
+ *
170
+ * @param targetState - State key to check
171
+ * @returns True if state exists in current mode, false otherwise
172
+ *
173
+ * @example
174
+ * ```typescript
175
+ * if (machine.can('SPIN')) {
176
+ * console.log('SPIN state exists');
177
+ * }
178
+ * ```
179
+ */
180
+ can(targetState: StateKey): boolean;
181
+ /**
182
+ * Check if transition to a state is allowed (async, includes guard check)
183
+ *
184
+ * @param targetState - State key to check
185
+ * @returns Promise that resolves to true if transition is allowed, false otherwise
186
+ *
187
+ * @example
188
+ * ```typescript
189
+ * if (await machine.canAsync('SPIN')) {
190
+ * await machine.transition('SPIN');
191
+ * } else {
192
+ * console.log('Cannot transition to SPIN');
193
+ * }
194
+ * ```
195
+ */
196
+ canAsync(targetState: StateKey): Promise<boolean>;
197
+ private checkGuards;
198
+ /**
199
+ * Check if current state matches the given state key
200
+ *
201
+ * @param state - State key to compare
202
+ * @returns True if current state matches, false otherwise
203
+ *
204
+ * @example
205
+ * ```typescript
206
+ * if (machine.is('SPIN')) {
207
+ * console.log('Currently spinning');
208
+ * }
209
+ * ```
210
+ */
211
+ is(state: StateKey): boolean;
212
+ /**
213
+ * Check if current mode matches the given mode key
214
+ *
215
+ * @param mode - Mode key to compare
216
+ * @returns True if current mode matches, false otherwise
217
+ *
218
+ * @example
219
+ * ```typescript
220
+ * if (machine.isMode('FREESPIN')) {
221
+ * console.log('In freespin mode');
222
+ * }
223
+ * ```
224
+ */
225
+ isMode(mode: ModeKey): boolean;
226
+ /**
227
+ * Reset state machine to initial state and mode
228
+ *
229
+ * Clears cache and resets context to initial configuration
230
+ *
231
+ * @example
232
+ * ```typescript
233
+ * machine.reset();
234
+ * console.log(machine.state); // Initial state
235
+ * console.log(machine.mode); // Initial mode
236
+ * ```
237
+ */
238
+ reset(): void;
239
+ /**
240
+ * Destroy state machine and clean up resources
241
+ *
242
+ * Clears cache and removes all event listeners
243
+ *
244
+ * @example
245
+ * ```typescript
246
+ * machine.destroy();
247
+ * ```
248
+ */
249
+ destroy(): void;
250
+ }
251
+ //# sourceMappingURL=StateMachine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StateMachine.d.ts","sourceRoot":"","sources":["../../state-machine/StateMachine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,KAAK,EACV,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EAIjB,kBAAkB,EACnB,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,qBAAa,YAAY,CAAC,KAAK,GAAG,GAAG,CAAE,SAAQ,YAAY,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;IACpF,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,OAAO,CAAsB;IACrC,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,kBAAkB,CAA6C;gBAE3D,MAAM,EAAE,kBAAkB,CAAC,KAAK,CAAC;IA0B7C;;OAEG;IACH,IAAI,KAAK,IAAI,QAAQ,CAEpB;IAED;;OAEG;IACH,IAAI,IAAI,IAAI,OAAO,CAElB;IAED;;OAEG;IACH,IAAI,IAAI,IAAI,KAAK,CAEhB;IAED;;;;OAIG;IACH,UAAU,IAAI,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAI3C;;;;;;;;;;;;OAYG;IACH,UAAU,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,KAAK,GAAG,IAAI,GAAG,IAAI;IAOxD,OAAO,CAAC,sBAAsB;IA0D9B,OAAO,CAAC,gBAAgB;IAoBxB,OAAO,CAAC,YAAY;IAOpB;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,SAAS,EAAE,QAAQ,GAAG,GAAG;IAMlC;;;;;;;;;;;OAWG;IACH,YAAY,IAAI,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC;IAKrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACG,UAAU,CAAC,WAAW,EAAE,QAAQ,EAAE,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,OAAO,CAAC;IAwF1F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACG,UAAU,CAAC,UAAU,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;IA0EhF;;;;;;;;;;;;OAYG;IACH,GAAG,CAAC,WAAW,EAAE,QAAQ,GAAG,OAAO;IAKnC;;;;;;;;;;;;;;OAcG;IACG,QAAQ,CAAC,WAAW,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;YAKzC,WAAW;IAwBzB;;;;;;;;;;;;OAYG;IACH,EAAE,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO;IAI5B;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO;IAI9B;;;;;;;;;;;OAWG;IACH,KAAK,IAAI,IAAI;IAab;;;;;;;;;OASG;IACH,OAAO,IAAI,IAAI;CAIhB"}