@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,285 @@
1
+ import { Skin } from './Skin';
2
+ import type { SkinPluginConfig, SkinOptions } from './SkinPlugin.types';
3
+ import type { EnginePlugin } from '../Plugin.types';
4
+ import { PixiEngine } from '../../engine/PixiEngine';
5
+ /**
6
+ * Event data for global data changes.
7
+ *
8
+ * @public
9
+ */
10
+ export interface GlobalDataChangeEvent {
11
+ /** Property path that changed */
12
+ path: string;
13
+ /** Previous value */
14
+ oldValue: any;
15
+ /** New value */
16
+ newValue: any;
17
+ /** Skins affected by this change */
18
+ affectedSkins: Skin<any>[];
19
+ }
20
+ /**
21
+ * Skin management plugin for theme-based UI configuration.
22
+ *
23
+ * SkinPlugin provides a centralized system for managing UI themes and data injection.
24
+ * It allows components to have multiple themes and dynamically inject global data.
25
+ *
26
+ * ## Features
27
+ *
28
+ * - **Multi-Theme Support**: Create skins with multiple theme variants
29
+ * - **Global Theme Switching**: Change themes across all skins at once
30
+ * - **Data Injection**: Inject global data into skin properties using template strings
31
+ * - **Automatic Updates**: Components automatically update when data changes
32
+ * - **Type-Safe**: Full TypeScript support with generics
33
+ *
34
+ * ## Core Concepts
35
+ *
36
+ * ### 1. Skins
37
+ * Skins are theme-based configuration objects. Each skin can have multiple themes
38
+ * (default, dark, mobile, etc.) and properties are merged from default + current theme.
39
+ *
40
+ * ### 2. Global Data Injection
41
+ * Use template strings `${path}` in skin data to reference global values:
42
+ * ```typescript
43
+ * const skinData = {
44
+ * default: {
45
+ * color: '${ui.default.themeColor.default}', // Will be injected
46
+ * fontSize: '${ui.default.fontSize.normal}' // Will be injected
47
+ * }
48
+ * };
49
+ * ```
50
+ *
51
+ * ### 3. Theme Inheritance
52
+ * Themes inherit from the default theme. Only specify differences:
53
+ * ```typescript
54
+ * {
55
+ * default: { color: 0xFF0000, size: 100 },
56
+ * dark: { color: 0x000000 } // size inherited from default
57
+ * }
58
+ * ```
59
+ *
60
+ * @example
61
+ * Basic usage:
62
+ * ```typescript
63
+ * const skinPlugin = new SkinPlugin({ debugMode: true });
64
+ * engine.registerPlugin(skinPlugin);
65
+ *
66
+ * // Create a button skin
67
+ * const { skin: buttonSkin } = skinPlugin.createSkin({
68
+ * data: {
69
+ * default: {
70
+ * up: { background: { texture: 'btn_spin_up' } },
71
+ * over: { background: { texture: 'btn_spin_over' } }
72
+ * },
73
+ * dark: {
74
+ * up: { background: { texture: 'btn_spin_dark_up' } }
75
+ * }
76
+ * }
77
+ * });
78
+ *
79
+ * // Use skin properties
80
+ * const button = new ButtonComp({
81
+ * skinData: buttonSkin.getProperties()
82
+ * });
83
+ *
84
+ * // Switch theme
85
+ * skinPlugin.setTheme('dark');
86
+ * ```
87
+ *
88
+ * @example
89
+ * Global data injection from EmptyScene:
90
+ * ```typescript
91
+ * const skinPlugin = engine.getPlugin<SkinPlugin>('skinPlugin');
92
+ *
93
+ * // Set global UI values
94
+ * skinPlugin.setGlobalData('ui.default.fontSize.header', 36);
95
+ * skinPlugin.setGlobalData('ui.default.fontSize.normal', 24);
96
+ * skinPlugin.setGlobalData('ui.default.fontFamily', 'NotoSansBlack');
97
+ * skinPlugin.setGlobalData('ui.default.textColor', 0xFFFFFF);
98
+ * skinPlugin.setGlobalData('ui.default.themeColor.default', 0xFFD100);
99
+ *
100
+ * // Create skin with template strings
101
+ * const { skin } = skinPlugin.createSkin({
102
+ * data: {
103
+ * default: {
104
+ * title: {
105
+ * fontSize: '${ui.default.fontSize.header}',
106
+ * fontFamily: '${ui.default.fontFamily}',
107
+ * fill: '${ui.default.textColor}'
108
+ * },
109
+ * button: {
110
+ * color: '${ui.default.themeColor.default}'
111
+ * }
112
+ * }
113
+ * }
114
+ * });
115
+ *
116
+ * // Properties are automatically injected
117
+ * const props = skin.getProperties();
118
+ * // { title: { fontSize: 36, fontFamily: 'NotoSansBlack', fill: 0xFFFFFF },
119
+ * // button: { color: 0xFFD100 } }
120
+ * ```
121
+ *
122
+ * @example
123
+ * Using with DataInjector from EmptyScene:
124
+ * ```typescript
125
+ * import { DataInjector } from '@rb-games/core/utils';
126
+ *
127
+ * // Start with default skin
128
+ * let autoplaySkin = defaultAutoplayMenuSkin;
129
+ *
130
+ * // Inject specific textures
131
+ * autoplaySkin = DataInjector(autoplaySkin, 'options.buttonSkin', {
132
+ * up: { background: { texture: 'btn_checkbox_up' } },
133
+ * over: { background: { texture: 'btn_checkbox_over' } },
134
+ * down: { background: { texture: 'btn_checkbox_down' } }
135
+ * });
136
+ *
137
+ * autoplaySkin = DataInjector(autoplaySkin, 'count.sliderSkin', {
138
+ * up: { knob: { texture: 'icon_autoplay_slider_up' } },
139
+ * over: { knob: { texture: 'icon_autoplay_slider_over' } }
140
+ * });
141
+ *
142
+ * // Create skin with injected data
143
+ * const { skin } = skinPlugin.createSkin({
144
+ * data: { default: autoplaySkin }
145
+ * });
146
+ * ```
147
+ *
148
+ * @example
149
+ * Listening to data changes:
150
+ * ```typescript
151
+ * const { skin } = skinPlugin.createSkin({ data: skinData });
152
+ *
153
+ * // Listen for data injection
154
+ * skin.on('dataInjected', (event) => {
155
+ * console.log(`Data changed: ${event.path}`);
156
+ * console.log(`Old: ${event.oldValue}, New: ${event.newValue}`);
157
+ * updateComponent(skin.getProperties());
158
+ * });
159
+ *
160
+ * // Listen for theme changes
161
+ * skin.on('themeChanged', (event) => {
162
+ * console.log(`Theme: ${event.oldTheme} -> ${event.newTheme}`);
163
+ * updateComponent(skin.getProperties());
164
+ * });
165
+ *
166
+ * // Change global data (triggers dataInjected event)
167
+ * skinPlugin.setGlobalData('ui.button.color', 0xFF0000);
168
+ * ```
169
+ *
170
+ * @category Plugins
171
+ * @public
172
+ */
173
+ export declare class SkinPlugin implements EnginePlugin {
174
+ name: string;
175
+ priority: number;
176
+ dependencies: string[];
177
+ private skins;
178
+ private skinCache;
179
+ private globalTheme;
180
+ private config;
181
+ private isInitialized;
182
+ private globalData;
183
+ constructor(config?: SkinPluginConfig);
184
+ initialize(engine: PixiEngine): Promise<void>;
185
+ onReady(engine: PixiEngine): void;
186
+ isReady(): boolean;
187
+ cleanup(): void;
188
+ /**
189
+ * Creates a new skin instance.
190
+ *
191
+ * Factory method that creates and registers a skin.
192
+ *
193
+ * @typeParam T - The type of skin properties
194
+ * @param options - Skin configuration options
195
+ * @returns Object containing the skin instance and its ID
196
+ *
197
+ * @example
198
+ * ```typescript
199
+ * const { skin, skinId } = skinPlugin.createSkin({
200
+ * data: {
201
+ * default: { color: 0xFF0000 },
202
+ * dark: { color: 0x000000 }
203
+ * },
204
+ * defaultTheme: 'default'
205
+ * });
206
+ * ```
207
+ */
208
+ createSkin<T extends Record<string, any>>(options: SkinOptions<T>): {
209
+ skin: Skin<T>;
210
+ skinId: string;
211
+ cached?: boolean;
212
+ };
213
+ private createAndRegisterSkin;
214
+ registerSkin(skin: Skin<any>): string;
215
+ unregisterSkin(skin: Skin<any> | string): void;
216
+ /**
217
+ * Sets the global theme for all registered skins.
218
+ *
219
+ * Applies the theme to all skins that have it defined.
220
+ *
221
+ * @param themeName - Theme name to activate
222
+ *
223
+ * @example
224
+ * ```typescript
225
+ * skinPlugin.setTheme('dark');
226
+ * skinPlugin.setTheme('mobile');
227
+ * ```
228
+ */
229
+ setTheme(themeName: string): void;
230
+ getTheme(): string;
231
+ getSkinCount(): number;
232
+ getAllSkins(): Skin<any>[];
233
+ clearAllSkins(): void;
234
+ getSkinById(id: string): Skin<any> | undefined;
235
+ /**
236
+ * Sets global data for property injection.
237
+ *
238
+ * Updates global data and triggers 'dataInjected' event on affected skins.
239
+ * Skins using template strings like `${path}` will be automatically updated.
240
+ *
241
+ * @param path - Dot-notation path (e.g., 'ui.button.color')
242
+ * @param value - Value to set
243
+ * @example
244
+ * ```typescript
245
+ * skinPlugin.setGlobalData('ui.default.themeColor.default', 0xFFD100);
246
+ * skinPlugin.setGlobalData('ui.default.fontSize.header', 36);
247
+ * // Or set multiple values at once:
248
+ * skinPlugin.setGlobalData({
249
+ * 'ui.default.themeColor.default': 0xFFD100,
250
+ * 'ui.default.fontSize.header': 36
251
+ * });
252
+ * ```
253
+ */
254
+ setGlobalData(path: string, value: any): void;
255
+ setGlobalData(data: Record<string, any>): void;
256
+ /**
257
+ * Gets global data.
258
+ *
259
+ * @param path - Optional dot-notation path. If omitted, returns all global data.
260
+ * @returns Global data value or entire global data object
261
+ */
262
+ getGlobalData(path?: string): any;
263
+ clearGlobalData(): void;
264
+ clearCache(): void;
265
+ getCacheStats(): {
266
+ size: number;
267
+ entries: Array<{
268
+ key: string;
269
+ skinId: string;
270
+ refCount: number;
271
+ }>;
272
+ };
273
+ private generateCacheKey;
274
+ private stringifyDeterministic;
275
+ private simpleHash;
276
+ injectGlobalData<T>(skinData: T): T;
277
+ private setNestedProperty;
278
+ private getNestedProperty;
279
+ private injectProperties;
280
+ private findSkinsUsingProperty;
281
+ private skinUsesProperty;
282
+ private objectContainsTemplate;
283
+ [key: symbol]: any;
284
+ }
285
+ //# sourceMappingURL=SkinPlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SkinPlugin.d.ts","sourceRoot":"","sources":["../../../plugins/skin/SkinPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAGrD;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,qBAAqB;IACrB,QAAQ,EAAE,GAAG,CAAC;IACd,gBAAgB;IAChB,QAAQ,EAAE,GA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typeParam T - The type of properties for each theme
5
+ *
6
+ * @example
7
+ * ```typescript
8
+ * const buttonThemes: ThemeData<ButtonSkinData> = {
9
+ * default: { color: 0xFF0000, size: 100 },
10
+ * dark: { color: 0x000000, size: 100 },
11
+ * mobile: { color: 0xFF0000, size: 80 }
12
+ * };
13
+ * ```
14
+ *
15
+ * @public
16
+ */
17
+ export interface ThemeData<T = any> {
18
+ [themeName: string]: T;
19
+ }
20
+ /**
21
+ * Options for creating a skin.
22
+ *
23
+ * @typeParam T - The type of skin properties
24
+ *
25
+ * @public
26
+ */
27
+ export interface SkinOptions<T> {
28
+ /** Theme data mapping theme names to properties */
29
+ data: ThemeData<T>;
30
+ /** Default theme name (uses first theme if not specified) */
31
+ defaultTheme?: string;
32
+ /** Use cache to reuse existing skins with same structure (default: false) */
33
+ useCache?: boolean;
34
+ /** Manual cache key for template-based skins (optional) */
35
+ cacheKey?: string;
36
+ }
37
+ /**
38
+ * Callback for theme change events.
39
+ *
40
+ * @typeParam T - The type of skin properties
41
+ *
42
+ * @public
43
+ */
44
+ export type SkinChangeListener<T> = (skin: any, oldTheme: string, newTheme: string) => void;
45
+ /**
46
+ * Configuration for SkinPlugin.
47
+ *
48
+ * @public
49
+ */
50
+ export interface SkinPluginConfig {
51
+ /** Automatically cleanup skins when plugin is destroyed (default: true) */
52
+ autoCleanup?: boolean;
53
+ /** Enable skin caching to prevent duplicate skin creation (default: true) */
54
+ enableCache?: boolean;
55
+ }
56
+ //# sourceMappingURL=SkinPlugin.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SkinPlugin.types.d.ts","sourceRoot":"","sources":["../../../plugins/skin/SkinPlugin.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,SAAS,CAAC,CAAC,GAAG,GAAG;IAChC,CAAC,SAAS,EAAE,MAAM,GAAG,CAAC,CAAC;CACxB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,mDAAmD;IACnD,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;IACnB,6DAA6D;IAC7D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;AAE5F;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,2EAA2E;IAC3E,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,6EAA6E;IAC7E,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB"}
@@ -0,0 +1,5 @@
1
+ export * from './Skin';
2
+ export * from './SkinPlugin';
3
+ export type * from './SkinPlugin.types';
4
+ export type * from './ISkin';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../plugins/skin/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,mBAAmB,oBAAoB,CAAC;AACxC,mBAAmB,SAAS,CAAC"}
@@ -0,0 +1,319 @@
1
+ import { IMediaInstance } from '@pixi/sound';
2
+ import { PixiEngine } from '../../engine/PixiEngine';
3
+ import type { EnginePlugin } from '../Plugin.types';
4
+ import type { SoundPluginConfig, SoundSpriteData, PlayOptions, QueueInOptions, SoundChannel } from './SoundPlugin.types';
5
+ /**
6
+ * Sound playback and channel management plugin for PixiJS games.
7
+ *
8
+ * SoundPlugin provides a unified API for playing sounds, managing audio channels,
9
+ * and handling sound sprites. It works with ResourcePlugin for asset loading.
10
+ *
11
+ * ## Features
12
+ *
13
+ * - **Channel System**: Separate volume/mute control for music, voice, sfx, ui
14
+ * - **Sound Sprites**: Play segments of longer audio files
15
+ * - **Unified Play API**: Same `play(alias)` for both sprites and regular sounds
16
+ * - **Fade Effects**: FadeIn, fadeOut, crossfade with GSAP
17
+ * - **Mobile Unlock**: Auto-unlock AudioContext on user interaction
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * const soundPlugin = new SoundPlugin({
22
+ * channels: {
23
+ * music: { volume: 0.7, maxInstances: 1 },
24
+ * sfx: { volume: 0.8, maxInstances: 10 },
25
+ * },
26
+ * masterVolume: 1.0,
27
+ * autoUnlock: true,
28
+ * });
29
+ *
30
+ * engine.registerPlugin(soundPlugin);
31
+ * await engine.initialize();
32
+ *
33
+ * // Add sprites
34
+ * soundPlugin.addSprites('sfx-sprite', {
35
+ * 'win-big': { start: 0, end: 3 },
36
+ * 'spin': { start: 4, end: 5 },
37
+ * });
38
+ *
39
+ * // Play sounds (sprites or regular)
40
+ * await soundPlugin.play('win-big');
41
+ * await soundPlugin.play('bgm-main', { loop: true });
42
+ * ```
43
+ *
44
+ * @category Plugins
45
+ * @public
46
+ */
47
+ export declare class SoundPlugin implements EnginePlugin {
48
+ name: string;
49
+ priority: number;
50
+ dependencies: string[];
51
+ private config;
52
+ /** Sprite alias -> sound alias + sprite key mapping */
53
+ private spriteRegistry;
54
+ /** Channel configurations */
55
+ private channels;
56
+ /** Currently playing instances by alias */
57
+ private playingInstances;
58
+ /** Sound alias -> channel mapping */
59
+ private soundChannelMap;
60
+ /** Master volume */
61
+ private _masterVolume;
62
+ /** Audio context unlocked flag */
63
+ private _unlocked;
64
+ /** Active interval loop timers by alias */
65
+ private intervalTimers;
66
+ /** Active interval loop instance per alias — only this instance may schedule the next play */
67
+ private activeLoopInstances;
68
+ /** Store original PlayOptions for interval loops to restore on trigger/replay */
69
+ private intervalLoopOptions;
70
+ /** Store original volume for all playing sounds (for mute/unmute restore) */
71
+ private soundVolumeMap;
72
+ /** Group -> tracked instances for stopGroup support */
73
+ private groupInstances;
74
+ constructor(config?: SoundPluginConfig);
75
+ initialize(_engine: PixiEngine): Promise<void>;
76
+ onReady(_engine: PixiEngine): void;
77
+ cleanup(): void;
78
+ /**
79
+ * Initialize channel configurations
80
+ */
81
+ private initializeChannels;
82
+ /**
83
+ * Setup auto-unlock for mobile browsers
84
+ */
85
+ private setupAutoUnlock;
86
+ /**
87
+ * Add sound sprites to a sound file.
88
+ * Each sprite key becomes a playable alias.
89
+ *
90
+ * @param soundAlias - The alias of the loaded sound file
91
+ * @param sprites - Map of sprite names to their start/end times
92
+ * @param channel - Optional channel assignment for all sprites
93
+ *
94
+ * @example
95
+ * ```typescript
96
+ * soundPlugin.addSprites('sfx-sprite', {
97
+ * 'win-big': { start: 0, end: 3 },
98
+ * 'spin': { start: 4, end: 5.5 },
99
+ * 'click': { start: 6, end: 6.2 },
100
+ * }, 'sfx');
101
+ * ```
102
+ */
103
+ addSprites(soundAlias: string, sprites: Record<string, SoundSpriteData>, channel?: SoundChannel): void;
104
+ /**
105
+ * Add sprites from a JSON file.
106
+ *
107
+ * @param soundAlias - The alias of the loaded sound file
108
+ * @param jsonPath - Path to the JSON file containing sprite definitions
109
+ * @param channel - Optional channel assignment for all sprites
110
+ */
111
+ addSpritesFromJson(soundAlias: string, jsonPath: string, channel?: SoundChannel): Promise<void>;
112
+ /**
113
+ * Register a sound alias to a channel.
114
+ *
115
+ * @param alias - Sound alias
116
+ * @param channel - Channel to assign
117
+ */
118
+ setChannel(alias: string, channel: SoundChannel): void;
119
+ /**
120
+ * Play a sound by alias. Works for both regular sounds and sprites.
121
+ *
122
+ * @param alias - Sound alias or sprite name
123
+ * @param options - Play options
124
+ * @returns Promise resolving to the media instance
125
+ *
126
+ * @example
127
+ * ```typescript
128
+ * // Play regular sound
129
+ * await soundPlugin.play('bgm-main', { loop: true });
130
+ *
131
+ * // Play sprite (same API)
132
+ * await soundPlugin.play('win-big');
133
+ * ```
134
+ */
135
+ play(alias: string, options?: PlayOptions): Promise<IMediaInstance | null>;
136
+ /**
137
+ * Stop all sounds registered under a logical group.
138
+ *
139
+ * @param group - The logical group set via PlayOptions.group
140
+ */
141
+ stopGroup(group: string): void;
142
+ /**
143
+ * Stop a sound by alias.
144
+ *
145
+ * @param alias - Sound alias or sprite name
146
+ */
147
+ stopAlias(alias: string): void;
148
+ /**
149
+ * Stop all sounds in a specific channel.
150
+ *
151
+ * @param channel - Channel name (music, sfx, voice, ui)
152
+ */
153
+ stopChannel(channel: SoundChannel): void;
154
+ /**
155
+ * Stop all playing sounds.
156
+ */
157
+ stopAll(): void;
158
+ /**
159
+ * Pause a sound by alias.
160
+ *
161
+ * @param alias - Sound alias
162
+ */
163
+ pause(alias: string): void;
164
+ /**
165
+ * Resume a paused sound.
166
+ *
167
+ * @param alias - Sound alias
168
+ */
169
+ resume(alias: string): void;
170
+ /**
171
+ * Fade in a sound.
172
+ *
173
+ * @param alias - Sound alias
174
+ * @param duration - Fade duration in seconds
175
+ * @param options - Play options
176
+ */
177
+ fadeIn(alias: string, duration: number, options?: PlayOptions): Promise<void>;
178
+ /**
179
+ * Fade out a sound.
180
+ *
181
+ * @param alias - Sound alias
182
+ * @param duration - Fade duration in seconds
183
+ * @param stopAfter - Whether to stop the sound after fading out
184
+ */
185
+ fadeOut(alias: string, duration: number, stopAfter?: boolean): Promise<void>;
186
+ /**
187
+ * Crossfade between two sounds.
188
+ *
189
+ * @param fromAlias - Sound to fade out
190
+ * @param toAlias - Sound to fade in
191
+ * @param duration - Crossfade duration in seconds
192
+ * @param options - Play options for the new sound
193
+ */
194
+ crossfade(fromAlias: string, toAlias: string, duration: number, options?: PlayOptions): Promise<void>;
195
+ /**
196
+ * Fade out all sounds in a channel.
197
+ *
198
+ * @param channel - Channel name
199
+ * @param duration - Fade duration in seconds
200
+ */
201
+ fadeOutChannel(channel: SoundChannel, duration: number): Promise<void>;
202
+ /**
203
+ * Queue in a new sound by fading out all sounds in its channel and fading in the new one.
204
+ * Supports both crossfade (simultaneous) and sequential (fade out first, then fade in) transitions.
205
+ *
206
+ * @param alias - Sound alias to play
207
+ * @param duration - Fade in duration in seconds
208
+ * @param options - Queue in options (includes fadeOutDuration, type, channel, and PlayOptions)
209
+ * @returns The new sound instance, or null if failed
210
+ *
211
+ * @example
212
+ * ```typescript
213
+ * // Crossfade (default) - fade out existing and fade in new simultaneously
214
+ * soundPlugin.queueIn('freespin', 1, { loop: true });
215
+ *
216
+ * // Sequential - fade out first, then fade in
217
+ * soundPlugin.queueIn('freespin', 1, { loop: true, type: 'sequential' });
218
+ *
219
+ * // Different fade durations
220
+ * soundPlugin.queueIn('freespin', 1, { loop: true, fadeOutDuration: 0.5 });
221
+ * ```
222
+ */
223
+ queueIn(alias: string, duration: number, options?: QueueInOptions): Promise<IMediaInstance | null>;
224
+ /**
225
+ * Set channel volume.
226
+ *
227
+ * @param channel - Channel name
228
+ * @param volume - Volume (0-1)
229
+ */
230
+ setChannelVolume(channel: SoundChannel, volume: number): void;
231
+ /**
232
+ * Get channel volume.
233
+ *
234
+ * @param channel - Channel name
235
+ * @returns Volume (0-1)
236
+ */
237
+ getChannelVolume(channel: SoundChannel): number;
238
+ /**
239
+ * Mute a channel.
240
+ *
241
+ * @param channel - Channel name
242
+ */
243
+ muteChannel(channel: SoundChannel): void;
244
+ /**
245
+ * Unmute a channel.
246
+ *
247
+ * @param channel - Channel name
248
+ */
249
+ unmuteChannel(channel: SoundChannel): void;
250
+ /**
251
+ * Set volume on all currently playing instances in a channel.
252
+ * Takes into account the original sound volume from soundVolumeMap.
253
+ */
254
+ private setChannelInstancesVolume;
255
+ /**
256
+ * Check if a channel is muted.
257
+ *
258
+ * @param channel - Channel name
259
+ * @returns True if muted
260
+ */
261
+ isChannelMuted(channel: SoundChannel): boolean;
262
+ /**
263
+ * Pause all sounds in a channel.
264
+ *
265
+ * @param channel - Channel name
266
+ */
267
+ pauseChannel(channel: SoundChannel): void;
268
+ /**
269
+ * Resume all sounds in a channel.
270
+ *
271
+ * @param channel - Channel name
272
+ */
273
+ resumeChannel(channel: SoundChannel): void;
274
+ /**
275
+ * Set master volume.
276
+ *
277
+ * @param volume - Volume (0-1)
278
+ */
279
+ set masterVolume(volume: number);
280
+ /**
281
+ * Get master volume.
282
+ */
283
+ get masterVolume(): number;
284
+ /**
285
+ * Check if audio context is unlocked.
286
+ */
287
+ get isUnlocked(): boolean;
288
+ /**
289
+ * Calculate interval delay from a fixed number or random range.
290
+ */
291
+ private getIntervalDelay;
292
+ /**
293
+ * Clear an active interval timer for an alias.
294
+ */
295
+ private clearIntervalTimer;
296
+ /**
297
+ * Trigger an interval loop sound immediately, skipping the wait timer.
298
+ * Only works for sounds that are in interval loop mode (loopInterval).
299
+ *
300
+ * @param alias - Sound alias to trigger
301
+ */
302
+ triggerIntervalLoop(alias: string): void;
303
+ /**
304
+ * Check if an alias is currently in interval loop mode.
305
+ *
306
+ * @param alias - Sound alias to check
307
+ * @returns True if the alias is an active interval loop
308
+ */
309
+ isIntervalLoop(alias: string): boolean;
310
+ /**
311
+ * Check if an alias is waiting for its next interval play.
312
+ *
313
+ * @param alias - Sound alias to check
314
+ * @returns True if the alias has a pending interval timer
315
+ */
316
+ isWaitingForInterval(alias: string): boolean;
317
+ [key: symbol]: any;
318
+ }
319
+ //# sourceMappingURL=SoundPlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SoundPlugin.d.ts","sourceRoot":"","sources":["../../../plugins/sound/SoundPlugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,cAAc,EAAE,MAAM,aAAa,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EAEf,WAAW,EACX,cAAc,EAEd,YAAY,EACb,MAAM,qBAAqB,CAAC;AAE7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,qBAAa,WAAY,YAAW,YAA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