@codexo/exojs 0.7.11 → 0.7.13

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 (492) hide show
  1. package/CHANGELOG.md +442 -0
  2. package/dist/esm/animation/Tween.d.ts +60 -1
  3. package/dist/esm/animation/Tween.js +60 -1
  4. package/dist/esm/animation/Tween.js.map +1 -1
  5. package/dist/esm/animation/TweenManager.d.ts +10 -0
  6. package/dist/esm/animation/TweenManager.js +10 -0
  7. package/dist/esm/animation/TweenManager.js.map +1 -1
  8. package/dist/esm/animation/types.d.ts +15 -0
  9. package/dist/esm/animation/types.js +6 -0
  10. package/dist/esm/animation/types.js.map +1 -1
  11. package/dist/esm/audio/AbstractMedia.d.ts +11 -0
  12. package/dist/esm/audio/AbstractMedia.js +10 -0
  13. package/dist/esm/audio/AbstractMedia.js.map +1 -1
  14. package/dist/esm/audio/AudioAnalyser.d.ts +21 -0
  15. package/dist/esm/audio/AudioAnalyser.js +16 -0
  16. package/dist/esm/audio/AudioAnalyser.js.map +1 -1
  17. package/dist/esm/audio/AudioBus.d.ts +37 -0
  18. package/dist/esm/audio/AudioBus.js +36 -0
  19. package/dist/esm/audio/AudioBus.js.map +1 -1
  20. package/dist/esm/audio/AudioFilter.d.ts +7 -0
  21. package/dist/esm/audio/AudioFilter.js +6 -0
  22. package/dist/esm/audio/AudioFilter.js.map +1 -1
  23. package/dist/esm/audio/AudioListener.d.ts +19 -0
  24. package/dist/esm/audio/AudioListener.js +11 -0
  25. package/dist/esm/audio/AudioListener.js.map +1 -1
  26. package/dist/esm/audio/AudioManager.d.ts +37 -0
  27. package/dist/esm/audio/AudioManager.js +37 -0
  28. package/dist/esm/audio/AudioManager.js.map +1 -1
  29. package/dist/esm/audio/BeatDetector.d.ts +21 -0
  30. package/dist/esm/audio/BeatDetector.js +21 -0
  31. package/dist/esm/audio/BeatDetector.js.map +1 -1
  32. package/dist/esm/audio/Media.d.ts +11 -0
  33. package/dist/esm/audio/Music.d.ts +12 -0
  34. package/dist/esm/audio/Music.js +12 -0
  35. package/dist/esm/audio/Music.js.map +1 -1
  36. package/dist/esm/audio/Sound.d.ts +25 -0
  37. package/dist/esm/audio/Sound.js +18 -0
  38. package/dist/esm/audio/Sound.js.map +1 -1
  39. package/dist/esm/audio/audio-context.d.ts +48 -0
  40. package/dist/esm/audio/audio-context.js +48 -5
  41. package/dist/esm/audio/audio-context.js.map +1 -1
  42. package/dist/esm/audio/filters/ChorusFilter.d.ts +5 -0
  43. package/dist/esm/audio/filters/ChorusFilter.js +4 -0
  44. package/dist/esm/audio/filters/ChorusFilter.js.map +1 -1
  45. package/dist/esm/audio/filters/CompressorFilter.d.ts +12 -0
  46. package/dist/esm/audio/filters/CompressorFilter.js +11 -0
  47. package/dist/esm/audio/filters/CompressorFilter.js.map +1 -1
  48. package/dist/esm/audio/filters/DelayFilter.d.ts +11 -0
  49. package/dist/esm/audio/filters/DelayFilter.js +10 -0
  50. package/dist/esm/audio/filters/DelayFilter.js.map +1 -1
  51. package/dist/esm/audio/filters/DuckingFilter.d.ts +13 -0
  52. package/dist/esm/audio/filters/DuckingFilter.js +12 -0
  53. package/dist/esm/audio/filters/DuckingFilter.js.map +1 -1
  54. package/dist/esm/audio/filters/EqualizerFilter.d.ts +20 -0
  55. package/dist/esm/audio/filters/EqualizerFilter.js +40 -0
  56. package/dist/esm/audio/filters/EqualizerFilter.js.map +1 -1
  57. package/dist/esm/audio/filters/GranularFilter.d.ts +6 -0
  58. package/dist/esm/audio/filters/GranularFilter.js +6 -0
  59. package/dist/esm/audio/filters/GranularFilter.js.map +1 -1
  60. package/dist/esm/audio/filters/HighpassFilter.d.ts +10 -0
  61. package/dist/esm/audio/filters/HighpassFilter.js +9 -0
  62. package/dist/esm/audio/filters/HighpassFilter.js.map +1 -1
  63. package/dist/esm/audio/filters/LowpassFilter.d.ts +10 -0
  64. package/dist/esm/audio/filters/LowpassFilter.js +9 -0
  65. package/dist/esm/audio/filters/LowpassFilter.js.map +1 -1
  66. package/dist/esm/audio/filters/PitchShiftFilter.d.ts +2 -0
  67. package/dist/esm/audio/filters/PitchShiftFilter.js +2 -0
  68. package/dist/esm/audio/filters/PitchShiftFilter.js.map +1 -1
  69. package/dist/esm/audio/filters/ReverbFilter.d.ts +12 -0
  70. package/dist/esm/audio/filters/ReverbFilter.js +11 -0
  71. package/dist/esm/audio/filters/ReverbFilter.js.map +1 -1
  72. package/dist/esm/audio/filters/VocoderFilter.d.ts +11 -0
  73. package/dist/esm/audio/filters/VocoderFilter.js +11 -0
  74. package/dist/esm/audio/filters/VocoderFilter.js.map +1 -1
  75. package/dist/esm/audio/filters/WorkletFilter.d.ts +6 -1
  76. package/dist/esm/audio/filters/WorkletFilter.js +6 -1
  77. package/dist/esm/audio/filters/WorkletFilter.js.map +1 -1
  78. package/dist/esm/core/Application.d.ts +66 -1
  79. package/dist/esm/core/Application.js +68 -6
  80. package/dist/esm/core/Application.js.map +1 -1
  81. package/dist/esm/core/Bounds.d.ts +23 -0
  82. package/dist/esm/core/Bounds.js +23 -0
  83. package/dist/esm/core/Bounds.js.map +1 -1
  84. package/dist/esm/core/Clock.d.ts +21 -0
  85. package/dist/esm/core/Clock.js +21 -0
  86. package/dist/esm/core/Clock.js.map +1 -1
  87. package/dist/esm/core/Color.d.ts +35 -0
  88. package/dist/esm/core/Color.js +35 -0
  89. package/dist/esm/core/Color.js.map +1 -1
  90. package/dist/esm/core/Scene.d.ts +76 -0
  91. package/dist/esm/core/Scene.js +83 -0
  92. package/dist/esm/core/Scene.js.map +1 -1
  93. package/dist/esm/core/SceneManager.d.ts +62 -0
  94. package/dist/esm/core/SceneManager.js +51 -2
  95. package/dist/esm/core/SceneManager.js.map +1 -1
  96. package/dist/esm/core/SceneNode.d.ts +31 -0
  97. package/dist/esm/core/SceneNode.js +31 -0
  98. package/dist/esm/core/SceneNode.js.map +1 -1
  99. package/dist/esm/core/Signal.d.ts +44 -0
  100. package/dist/esm/core/Signal.js +39 -0
  101. package/dist/esm/core/Signal.js.map +1 -1
  102. package/dist/esm/core/Time.d.ts +21 -0
  103. package/dist/esm/core/Time.js +21 -0
  104. package/dist/esm/core/Time.js.map +1 -1
  105. package/dist/esm/core/Timer.d.ts +7 -0
  106. package/dist/esm/core/Timer.js +7 -0
  107. package/dist/esm/core/Timer.js.map +1 -1
  108. package/dist/esm/core/capabilities.d.ts +12 -0
  109. package/dist/esm/core/capabilities.js +12 -0
  110. package/dist/esm/core/capabilities.js.map +1 -1
  111. package/dist/esm/core/types.d.ts +37 -0
  112. package/dist/esm/core/utils.d.ts +48 -0
  113. package/dist/esm/core/utils.js +48 -0
  114. package/dist/esm/core/utils.js.map +1 -1
  115. package/dist/esm/debug/BoundingBoxesLayer.d.ts +8 -0
  116. package/dist/esm/debug/BoundingBoxesLayer.js +8 -0
  117. package/dist/esm/debug/BoundingBoxesLayer.js.map +1 -1
  118. package/dist/esm/debug/DebugLayer.d.ts +16 -3
  119. package/dist/esm/debug/DebugLayer.js +11 -3
  120. package/dist/esm/debug/DebugLayer.js.map +1 -1
  121. package/dist/esm/debug/DebugOverlay.d.ts +11 -0
  122. package/dist/esm/debug/DebugOverlay.js +8 -2
  123. package/dist/esm/debug/DebugOverlay.js.map +1 -1
  124. package/dist/esm/debug/HitTestLayer.d.ts +9 -0
  125. package/dist/esm/debug/HitTestLayer.js +9 -0
  126. package/dist/esm/debug/HitTestLayer.js.map +1 -1
  127. package/dist/esm/debug/PerformanceLayer.d.ts +17 -1
  128. package/dist/esm/debug/PerformanceLayer.js +18 -0
  129. package/dist/esm/debug/PerformanceLayer.js.map +1 -1
  130. package/dist/esm/debug/PointerStackLayer.d.ts +8 -0
  131. package/dist/esm/debug/PointerStackLayer.js +11 -3
  132. package/dist/esm/debug/PointerStackLayer.js.map +1 -1
  133. package/dist/esm/index.js +6 -5
  134. package/dist/esm/index.js.map +1 -1
  135. package/dist/esm/input/ArcadeStickGamepadMapping.d.ts +7 -0
  136. package/dist/esm/input/ArcadeStickGamepadMapping.js +25 -19
  137. package/dist/esm/input/ArcadeStickGamepadMapping.js.map +1 -1
  138. package/dist/esm/input/GameCubeGamepadMapping.d.ts +9 -0
  139. package/dist/esm/input/GameCubeGamepadMapping.js +9 -0
  140. package/dist/esm/input/GameCubeGamepadMapping.js.map +1 -1
  141. package/dist/esm/input/Gamepad.d.ts +181 -31
  142. package/dist/esm/input/Gamepad.js +307 -108
  143. package/dist/esm/input/Gamepad.js.map +1 -1
  144. package/dist/esm/input/GamepadAxis.d.ts +120 -0
  145. package/dist/esm/input/GamepadAxis.js +106 -0
  146. package/dist/esm/input/GamepadAxis.js.map +1 -0
  147. package/dist/esm/input/GamepadButton.d.ts +110 -0
  148. package/dist/esm/input/GamepadButton.js +99 -0
  149. package/dist/esm/input/GamepadButton.js.map +1 -0
  150. package/dist/esm/input/GamepadDefinitions.d.ts +64 -1
  151. package/dist/esm/input/GamepadDefinitions.js +44 -1
  152. package/dist/esm/input/GamepadDefinitions.js.map +1 -1
  153. package/dist/esm/input/GamepadMapping.d.ts +42 -8
  154. package/dist/esm/input/GamepadMapping.js +46 -5
  155. package/dist/esm/input/GamepadMapping.js.map +1 -1
  156. package/dist/esm/input/GamepadPromptLayouts.d.ts +35 -2
  157. package/dist/esm/input/GamepadPromptLayouts.js +43 -18
  158. package/dist/esm/input/GamepadPromptLayouts.js.map +1 -1
  159. package/dist/esm/input/GenericDualAnalogGamepadMapping.d.ts +13 -0
  160. package/dist/esm/input/GenericDualAnalogGamepadMapping.js +62 -43
  161. package/dist/esm/input/GenericDualAnalogGamepadMapping.js.map +1 -1
  162. package/dist/esm/input/GestureRecognizer.d.ts +11 -2
  163. package/dist/esm/input/GestureRecognizer.js +11 -2
  164. package/dist/esm/input/GestureRecognizer.js.map +1 -1
  165. package/dist/esm/input/InputBinding.d.ts +74 -0
  166. package/dist/esm/input/InputBinding.js +100 -0
  167. package/dist/esm/input/InputBinding.js.map +1 -0
  168. package/dist/esm/input/InputManager.d.ts +100 -21
  169. package/dist/esm/input/InputManager.js +248 -90
  170. package/dist/esm/input/InputManager.js.map +1 -1
  171. package/dist/esm/input/InteractionEvent.d.ts +13 -0
  172. package/dist/esm/input/InteractionEvent.js +8 -0
  173. package/dist/esm/input/InteractionEvent.js.map +1 -1
  174. package/dist/esm/input/InteractionManager.d.ts +34 -5
  175. package/dist/esm/input/InteractionManager.js +46 -17
  176. package/dist/esm/input/InteractionManager.js.map +1 -1
  177. package/dist/esm/input/JoyConLeftGamepadMapping.d.ts +17 -3
  178. package/dist/esm/input/JoyConLeftGamepadMapping.js +42 -3
  179. package/dist/esm/input/JoyConLeftGamepadMapping.js.map +1 -1
  180. package/dist/esm/input/JoyConRightGamepadMapping.d.ts +17 -3
  181. package/dist/esm/input/JoyConRightGamepadMapping.js +38 -3
  182. package/dist/esm/input/JoyConRightGamepadMapping.js.map +1 -1
  183. package/dist/esm/input/PlayStationGamepadMapping.d.ts +8 -0
  184. package/dist/esm/input/PlayStationGamepadMapping.js +8 -0
  185. package/dist/esm/input/PlayStationGamepadMapping.js.map +1 -1
  186. package/dist/esm/input/Pointer.d.ts +106 -71
  187. package/dist/esm/input/Pointer.js +93 -71
  188. package/dist/esm/input/Pointer.js.map +1 -1
  189. package/dist/esm/input/SteamControllerGamepadMapping.d.ts +8 -0
  190. package/dist/esm/input/SteamControllerGamepadMapping.js +8 -0
  191. package/dist/esm/input/SteamControllerGamepadMapping.js.map +1 -1
  192. package/dist/esm/input/SteamDeckGamepadMapping.d.ts +18 -0
  193. package/dist/esm/input/SteamDeckGamepadMapping.js +76 -0
  194. package/dist/esm/input/SteamDeckGamepadMapping.js.map +1 -0
  195. package/dist/esm/input/SwitchProGamepadMapping.d.ts +9 -0
  196. package/dist/esm/input/SwitchProGamepadMapping.js +9 -0
  197. package/dist/esm/input/SwitchProGamepadMapping.js.map +1 -1
  198. package/dist/esm/input/XboxGamepadMapping.d.ts +8 -0
  199. package/dist/esm/input/XboxGamepadMapping.js +8 -0
  200. package/dist/esm/input/XboxGamepadMapping.js.map +1 -1
  201. package/dist/esm/input/index.d.ts +7 -4
  202. package/dist/esm/input/types.d.ts +17 -73
  203. package/dist/esm/input/types.js +18 -77
  204. package/dist/esm/input/types.js.map +1 -1
  205. package/dist/esm/math/AbstractVector.d.ts +83 -0
  206. package/dist/esm/math/AbstractVector.js +83 -0
  207. package/dist/esm/math/AbstractVector.js.map +1 -1
  208. package/dist/esm/math/Circle.d.ts +32 -0
  209. package/dist/esm/math/Circle.js +34 -2
  210. package/dist/esm/math/Circle.js.map +1 -1
  211. package/dist/esm/math/CircleLike.d.ts +1 -0
  212. package/dist/esm/math/Collision.d.ts +39 -0
  213. package/dist/esm/math/Collision.js +5 -0
  214. package/dist/esm/math/Collision.js.map +1 -1
  215. package/dist/esm/math/Ellipse.d.ts +11 -0
  216. package/dist/esm/math/Ellipse.js +18 -2
  217. package/dist/esm/math/Ellipse.js.map +1 -1
  218. package/dist/esm/math/EllipseLike.d.ts +3 -0
  219. package/dist/esm/math/Flags.d.ts +31 -0
  220. package/dist/esm/math/Flags.js +31 -0
  221. package/dist/esm/math/Flags.js.map +1 -1
  222. package/dist/esm/math/Interval.d.ts +15 -0
  223. package/dist/esm/math/Interval.js +15 -0
  224. package/dist/esm/math/Interval.js.map +1 -1
  225. package/dist/esm/math/Line.d.ts +17 -1
  226. package/dist/esm/math/Line.js +17 -1
  227. package/dist/esm/math/Line.js.map +1 -1
  228. package/dist/esm/math/LineLike.d.ts +1 -0
  229. package/dist/esm/math/Matrix.d.ts +44 -3
  230. package/dist/esm/math/Matrix.js +44 -3
  231. package/dist/esm/math/Matrix.js.map +1 -1
  232. package/dist/esm/math/ObservableSize.d.ts +7 -0
  233. package/dist/esm/math/ObservableSize.js +7 -0
  234. package/dist/esm/math/ObservableSize.js.map +1 -1
  235. package/dist/esm/math/ObservableVector.d.ts +9 -0
  236. package/dist/esm/math/ObservableVector.js +9 -0
  237. package/dist/esm/math/ObservableVector.js.map +1 -1
  238. package/dist/esm/math/PointLike.d.ts +1 -0
  239. package/dist/esm/math/PolarVector.d.ts +15 -0
  240. package/dist/esm/math/PolarVector.js +16 -1
  241. package/dist/esm/math/PolarVector.js.map +1 -1
  242. package/dist/esm/math/Polygon.d.ts +20 -0
  243. package/dist/esm/math/Polygon.js +20 -0
  244. package/dist/esm/math/Polygon.js.map +1 -1
  245. package/dist/esm/math/PolygonLike.d.ts +4 -0
  246. package/dist/esm/math/Quadtree.d.ts +40 -3
  247. package/dist/esm/math/Quadtree.js +39 -3
  248. package/dist/esm/math/Quadtree.js.map +1 -1
  249. package/dist/esm/math/Random.d.ts +25 -0
  250. package/dist/esm/math/Random.js +25 -0
  251. package/dist/esm/math/Random.js.map +1 -1
  252. package/dist/esm/math/Rectangle.d.ts +15 -0
  253. package/dist/esm/math/Rectangle.js +17 -2
  254. package/dist/esm/math/Rectangle.js.map +1 -1
  255. package/dist/esm/math/RectangleLike.d.ts +1 -0
  256. package/dist/esm/math/Segment.d.ts +7 -0
  257. package/dist/esm/math/Segment.js +7 -0
  258. package/dist/esm/math/Segment.js.map +1 -1
  259. package/dist/esm/math/ShapeLike.d.ts +6 -0
  260. package/dist/esm/math/Size.d.ts +9 -0
  261. package/dist/esm/math/Size.js +9 -0
  262. package/dist/esm/math/Size.js.map +1 -1
  263. package/dist/esm/math/Vector.d.ts +16 -0
  264. package/dist/esm/math/Vector.js +16 -0
  265. package/dist/esm/math/Vector.js.map +1 -1
  266. package/dist/esm/math/collision-detection.d.ts +47 -1
  267. package/dist/esm/math/collision-detection.js +228 -17
  268. package/dist/esm/math/collision-detection.js.map +1 -1
  269. package/dist/esm/math/collision-primitives.d.ts +23 -0
  270. package/dist/esm/math/collision-primitives.js +23 -0
  271. package/dist/esm/math/collision-primitives.js.map +1 -1
  272. package/dist/esm/math/geometry.d.ts +42 -0
  273. package/dist/esm/math/geometry.js +37 -0
  274. package/dist/esm/math/geometry.js.map +1 -1
  275. package/dist/esm/math/utils.d.ts +41 -0
  276. package/dist/esm/math/utils.js +41 -0
  277. package/dist/esm/math/utils.js.map +1 -1
  278. package/dist/esm/particles/Particle.d.ts +37 -0
  279. package/dist/esm/particles/Particle.js +37 -0
  280. package/dist/esm/particles/Particle.js.map +1 -1
  281. package/dist/esm/particles/ParticleProperties.d.ts +15 -0
  282. package/dist/esm/particles/ParticleSystem.d.ts +69 -0
  283. package/dist/esm/particles/ParticleSystem.js +69 -0
  284. package/dist/esm/particles/ParticleSystem.js.map +1 -1
  285. package/dist/esm/particles/affectors/ColorAffector.d.ts +13 -0
  286. package/dist/esm/particles/affectors/ColorAffector.js +13 -0
  287. package/dist/esm/particles/affectors/ColorAffector.js.map +1 -1
  288. package/dist/esm/particles/affectors/ForceAffector.d.ts +11 -0
  289. package/dist/esm/particles/affectors/ForceAffector.js +11 -0
  290. package/dist/esm/particles/affectors/ForceAffector.js.map +1 -1
  291. package/dist/esm/particles/affectors/ParticleAffector.d.ts +13 -0
  292. package/dist/esm/particles/affectors/ScaleAffector.d.ts +10 -0
  293. package/dist/esm/particles/affectors/ScaleAffector.js +10 -0
  294. package/dist/esm/particles/affectors/ScaleAffector.js.map +1 -1
  295. package/dist/esm/particles/affectors/TorqueAffector.d.ts +11 -0
  296. package/dist/esm/particles/affectors/TorqueAffector.js +11 -0
  297. package/dist/esm/particles/affectors/TorqueAffector.js.map +1 -1
  298. package/dist/esm/particles/emitters/ParticleEmitter.d.ts +13 -0
  299. package/dist/esm/particles/emitters/ParticleOptions.d.ts +16 -0
  300. package/dist/esm/particles/emitters/ParticleOptions.js +16 -0
  301. package/dist/esm/particles/emitters/ParticleOptions.js.map +1 -1
  302. package/dist/esm/particles/emitters/UniversalEmitter.d.ts +23 -0
  303. package/dist/esm/particles/emitters/UniversalEmitter.js +23 -0
  304. package/dist/esm/particles/emitters/UniversalEmitter.js.map +1 -1
  305. package/dist/esm/rendering/CallbackRenderPass.d.ts +12 -0
  306. package/dist/esm/rendering/CallbackRenderPass.js +12 -0
  307. package/dist/esm/rendering/CallbackRenderPass.js.map +1 -1
  308. package/dist/esm/rendering/Container.d.ts +43 -0
  309. package/dist/esm/rendering/Container.js +43 -0
  310. package/dist/esm/rendering/Container.js.map +1 -1
  311. package/dist/esm/rendering/Drawable.d.ts +22 -0
  312. package/dist/esm/rendering/Drawable.js +22 -0
  313. package/dist/esm/rendering/Drawable.js.map +1 -1
  314. package/dist/esm/rendering/RenderBackend.d.ts +13 -0
  315. package/dist/esm/rendering/RenderBackendType.d.ts +4 -0
  316. package/dist/esm/rendering/RenderBackendType.js +4 -0
  317. package/dist/esm/rendering/RenderBackendType.js.map +1 -1
  318. package/dist/esm/rendering/RenderNode.d.ts +18 -0
  319. package/dist/esm/rendering/RenderNode.js +18 -0
  320. package/dist/esm/rendering/RenderNode.js.map +1 -1
  321. package/dist/esm/rendering/RenderPass.d.ts +8 -0
  322. package/dist/esm/rendering/RenderStats.d.ts +19 -0
  323. package/dist/esm/rendering/RenderStats.js +7 -0
  324. package/dist/esm/rendering/RenderStats.js.map +1 -1
  325. package/dist/esm/rendering/RenderTarget.d.ts +17 -0
  326. package/dist/esm/rendering/RenderTarget.js +17 -0
  327. package/dist/esm/rendering/RenderTarget.js.map +1 -1
  328. package/dist/esm/rendering/RenderTargetPass.d.ts +11 -0
  329. package/dist/esm/rendering/RenderTargetPass.js +7 -0
  330. package/dist/esm/rendering/RenderTargetPass.js.map +1 -1
  331. package/dist/esm/rendering/Renderer.d.ts +15 -0
  332. package/dist/esm/rendering/RendererRegistry.d.ts +7 -0
  333. package/dist/esm/rendering/RendererRegistry.js +7 -0
  334. package/dist/esm/rendering/RendererRegistry.js.map +1 -1
  335. package/dist/esm/rendering/View.d.ts +67 -2
  336. package/dist/esm/rendering/View.js +57 -0
  337. package/dist/esm/rendering/View.js.map +1 -1
  338. package/dist/esm/rendering/filters/BlurFilter.d.ts +9 -0
  339. package/dist/esm/rendering/filters/BlurFilter.js +8 -0
  340. package/dist/esm/rendering/filters/BlurFilter.js.map +1 -1
  341. package/dist/esm/rendering/filters/ColorFilter.d.ts +7 -0
  342. package/dist/esm/rendering/filters/ColorFilter.js +7 -0
  343. package/dist/esm/rendering/filters/ColorFilter.js.map +1 -1
  344. package/dist/esm/rendering/filters/Filter.d.ts +23 -0
  345. package/dist/esm/rendering/filters/Filter.js +20 -0
  346. package/dist/esm/rendering/filters/Filter.js.map +1 -1
  347. package/dist/esm/rendering/filters/WebGl2ShaderFilter.d.ts +5 -0
  348. package/dist/esm/rendering/filters/WebGl2ShaderFilter.js +5 -0
  349. package/dist/esm/rendering/filters/WebGl2ShaderFilter.js.map +1 -1
  350. package/dist/esm/rendering/filters/WebGpuShaderFilter.d.ts +5 -0
  351. package/dist/esm/rendering/filters/WebGpuShaderFilter.js +5 -0
  352. package/dist/esm/rendering/filters/WebGpuShaderFilter.js.map +1 -1
  353. package/dist/esm/rendering/mesh/Mesh.d.ts +2 -0
  354. package/dist/esm/rendering/mesh/Mesh.js +2 -0
  355. package/dist/esm/rendering/mesh/Mesh.js.map +1 -1
  356. package/dist/esm/rendering/primitives/Graphics.d.ts +34 -0
  357. package/dist/esm/rendering/primitives/Graphics.js +34 -0
  358. package/dist/esm/rendering/primitives/Graphics.js.map +1 -1
  359. package/dist/esm/rendering/shader/Shader.d.ts +36 -0
  360. package/dist/esm/rendering/shader/Shader.js +26 -0
  361. package/dist/esm/rendering/shader/Shader.js.map +1 -1
  362. package/dist/esm/rendering/shader/ShaderAttribute.d.ts +13 -0
  363. package/dist/esm/rendering/shader/ShaderAttribute.js +13 -0
  364. package/dist/esm/rendering/shader/ShaderAttribute.js.map +1 -1
  365. package/dist/esm/rendering/shader/ShaderUniform.d.ts +27 -0
  366. package/dist/esm/rendering/shader/ShaderUniform.js +28 -1
  367. package/dist/esm/rendering/shader/ShaderUniform.js.map +1 -1
  368. package/dist/esm/rendering/sprite/AnimatedSprite.d.ts +38 -0
  369. package/dist/esm/rendering/sprite/AnimatedSprite.js +36 -0
  370. package/dist/esm/rendering/sprite/AnimatedSprite.js.map +1 -1
  371. package/dist/esm/rendering/sprite/Sprite.d.ts +56 -0
  372. package/dist/esm/rendering/sprite/Sprite.js +56 -0
  373. package/dist/esm/rendering/sprite/Sprite.js.map +1 -1
  374. package/dist/esm/rendering/sprite/Spritesheet.d.ts +25 -0
  375. package/dist/esm/rendering/sprite/Spritesheet.js +20 -0
  376. package/dist/esm/rendering/sprite/Spritesheet.js.map +1 -1
  377. package/dist/esm/rendering/text/Text.d.ts +2 -0
  378. package/dist/esm/rendering/text/Text.js +2 -0
  379. package/dist/esm/rendering/text/Text.js.map +1 -1
  380. package/dist/esm/rendering/text/TextStyle.d.ts +29 -0
  381. package/dist/esm/rendering/text/TextStyle.js +24 -0
  382. package/dist/esm/rendering/text/TextStyle.js.map +1 -1
  383. package/dist/esm/rendering/text/types.d.ts +1 -0
  384. package/dist/esm/rendering/texture/RenderTexture.d.ts +16 -0
  385. package/dist/esm/rendering/texture/RenderTexture.js +16 -0
  386. package/dist/esm/rendering/texture/RenderTexture.js.map +1 -1
  387. package/dist/esm/rendering/texture/Sampler.d.ts +23 -0
  388. package/dist/esm/rendering/texture/Sampler.js +13 -0
  389. package/dist/esm/rendering/texture/Sampler.js.map +1 -1
  390. package/dist/esm/rendering/texture/Texture.d.ts +30 -0
  391. package/dist/esm/rendering/texture/Texture.js +30 -0
  392. package/dist/esm/rendering/texture/Texture.js.map +1 -1
  393. package/dist/esm/rendering/types.d.ts +29 -0
  394. package/dist/esm/rendering/types.js +29 -0
  395. package/dist/esm/rendering/types.js.map +1 -1
  396. package/dist/esm/rendering/utils.d.ts +20 -0
  397. package/dist/esm/rendering/utils.js +10 -0
  398. package/dist/esm/rendering/utils.js.map +1 -1
  399. package/dist/esm/rendering/video/Video.d.ts +35 -1
  400. package/dist/esm/rendering/video/Video.js +36 -2
  401. package/dist/esm/rendering/video/Video.js.map +1 -1
  402. package/dist/esm/rendering/webgl2/AbstractWebGl2BatchedRenderer.d.ts +7 -0
  403. package/dist/esm/rendering/webgl2/AbstractWebGl2BatchedRenderer.js +7 -0
  404. package/dist/esm/rendering/webgl2/AbstractWebGl2BatchedRenderer.js.map +1 -1
  405. package/dist/esm/rendering/webgl2/WebGl2Backend.d.ts +13 -0
  406. package/dist/esm/rendering/webgl2/WebGl2Backend.js +13 -0
  407. package/dist/esm/rendering/webgl2/WebGl2Backend.js.map +1 -1
  408. package/dist/esm/rendering/webgl2/WebGl2RenderBuffer.d.ts +8 -0
  409. package/dist/esm/rendering/webgl2/WebGl2RenderBuffer.js +8 -0
  410. package/dist/esm/rendering/webgl2/WebGl2RenderBuffer.js.map +1 -1
  411. package/dist/esm/rendering/webgpu/WebGpuBackend.d.ts +35 -0
  412. package/dist/esm/rendering/webgpu/WebGpuBackend.js +135 -5
  413. package/dist/esm/rendering/webgpu/WebGpuBackend.js.map +1 -1
  414. package/dist/esm/resources/AbstractAssetFactory.d.ts +20 -0
  415. package/dist/esm/resources/AbstractAssetFactory.js +20 -0
  416. package/dist/esm/resources/AbstractAssetFactory.js.map +1 -1
  417. package/dist/esm/resources/AssetFactory.d.ts +26 -0
  418. package/dist/esm/resources/AssetManifest.d.ts +45 -0
  419. package/dist/esm/resources/AssetManifest.js +25 -0
  420. package/dist/esm/resources/AssetManifest.js.map +1 -1
  421. package/dist/esm/resources/CacheFirstStrategy.d.ts +15 -0
  422. package/dist/esm/resources/CacheFirstStrategy.js +19 -4
  423. package/dist/esm/resources/CacheFirstStrategy.js.map +1 -1
  424. package/dist/esm/resources/CacheStore.d.ts +23 -0
  425. package/dist/esm/resources/CacheStrategy.d.ts +28 -0
  426. package/dist/esm/resources/Database.d.ts +45 -0
  427. package/dist/esm/resources/FactoryRegistry.d.ts +28 -0
  428. package/dist/esm/resources/FactoryRegistry.js +24 -0
  429. package/dist/esm/resources/FactoryRegistry.js.map +1 -1
  430. package/dist/esm/resources/IndexedDbDatabase.d.ts +22 -1
  431. package/dist/esm/resources/IndexedDbDatabase.js +21 -0
  432. package/dist/esm/resources/IndexedDbDatabase.js.map +1 -1
  433. package/dist/esm/resources/IndexedDbStore.d.ts +20 -0
  434. package/dist/esm/resources/IndexedDbStore.js +12 -0
  435. package/dist/esm/resources/IndexedDbStore.js.map +1 -1
  436. package/dist/esm/resources/Loader.d.ts +172 -0
  437. package/dist/esm/resources/Loader.js +129 -37
  438. package/dist/esm/resources/Loader.js.map +1 -1
  439. package/dist/esm/resources/NetworkOnlyStrategy.d.ts +11 -0
  440. package/dist/esm/resources/NetworkOnlyStrategy.js +16 -3
  441. package/dist/esm/resources/NetworkOnlyStrategy.js.map +1 -1
  442. package/dist/esm/resources/factories/BinaryFactory.d.ts +13 -0
  443. package/dist/esm/resources/factories/BinaryFactory.js +13 -0
  444. package/dist/esm/resources/factories/BinaryFactory.js.map +1 -1
  445. package/dist/esm/resources/factories/FontFactory.d.ts +37 -0
  446. package/dist/esm/resources/factories/FontFactory.js +26 -0
  447. package/dist/esm/resources/factories/FontFactory.js.map +1 -1
  448. package/dist/esm/resources/factories/ImageFactory.d.ts +26 -2
  449. package/dist/esm/resources/factories/ImageFactory.js +19 -0
  450. package/dist/esm/resources/factories/ImageFactory.js.map +1 -1
  451. package/dist/esm/resources/factories/JsonFactory.d.ts +13 -0
  452. package/dist/esm/resources/factories/JsonFactory.js +13 -0
  453. package/dist/esm/resources/factories/JsonFactory.js.map +1 -1
  454. package/dist/esm/resources/factories/MusicFactory.d.ts +36 -0
  455. package/dist/esm/resources/factories/MusicFactory.js +44 -4
  456. package/dist/esm/resources/factories/MusicFactory.js.map +1 -1
  457. package/dist/esm/resources/factories/SoundFactory.d.ts +29 -0
  458. package/dist/esm/resources/factories/SoundFactory.js +18 -0
  459. package/dist/esm/resources/factories/SoundFactory.js.map +1 -1
  460. package/dist/esm/resources/factories/SvgFactory.d.ts +19 -0
  461. package/dist/esm/resources/factories/SvgFactory.js +19 -0
  462. package/dist/esm/resources/factories/SvgFactory.js.map +1 -1
  463. package/dist/esm/resources/factories/TextFactory.d.ts +11 -0
  464. package/dist/esm/resources/factories/TextFactory.js +11 -0
  465. package/dist/esm/resources/factories/TextFactory.js.map +1 -1
  466. package/dist/esm/resources/factories/TextureFactory.d.ts +27 -2
  467. package/dist/esm/resources/factories/TextureFactory.js +20 -0
  468. package/dist/esm/resources/factories/TextureFactory.js.map +1 -1
  469. package/dist/esm/resources/factories/VideoFactory.d.ts +37 -0
  470. package/dist/esm/resources/factories/VideoFactory.js +48 -5
  471. package/dist/esm/resources/factories/VideoFactory.js.map +1 -1
  472. package/dist/esm/resources/factories/VttFactory.d.ts +18 -0
  473. package/dist/esm/resources/factories/VttFactory.js +104 -3
  474. package/dist/esm/resources/factories/VttFactory.js.map +1 -1
  475. package/dist/esm/resources/factories/WasmFactory.d.ts +16 -0
  476. package/dist/esm/resources/factories/WasmFactory.js +16 -0
  477. package/dist/esm/resources/factories/WasmFactory.js.map +1 -1
  478. package/dist/esm/resources/utils.d.ts +10 -0
  479. package/dist/esm/resources/utils.js +10 -0
  480. package/dist/esm/resources/utils.js.map +1 -1
  481. package/dist/exo.esm.js +4673 -745
  482. package/dist/exo.esm.js.map +1 -1
  483. package/package.json +8 -8
  484. package/dist/esm/input/GamepadChannels.d.ts +0 -39
  485. package/dist/esm/input/GamepadChannels.js +0 -45
  486. package/dist/esm/input/GamepadChannels.js.map +0 -1
  487. package/dist/esm/input/GamepadControl.d.ts +0 -15
  488. package/dist/esm/input/GamepadControl.js +0 -29
  489. package/dist/esm/input/GamepadControl.js.map +0 -1
  490. package/dist/esm/input/Input.d.ts +0 -28
  491. package/dist/esm/input/Input.js +0 -68
  492. package/dist/esm/input/Input.js.map +0 -1
@@ -0,0 +1,106 @@
1
+ import { clamp } from '../math/utils.js';
2
+ import { ChannelOffset } from './types.js';
3
+
4
+ /**
5
+ * Single mappable analog axis on a physical gamepad. Holds the raw browser
6
+ * `Gamepad.axes[]` index, the canonical channel the value is written to, and
7
+ * the transform pipeline applied each frame by {@link transformValue}.
8
+ *
9
+ * Direction-split axis channels (e.g. `LeftStickLeft`, `LeftStickRight`)
10
+ * live in the 0..1 range — set `invert: true` on the negative half so it
11
+ * reads positive when pushed in its direction.
12
+ *
13
+ * Aggregate channels (e.g. `LeftStickX`, `LeftStickY`) live in the full
14
+ * -1..1 range — set `bipolar: true` to preserve sign through the pipeline.
15
+ *
16
+ * The static namespace exports (`GamepadAxis.LeftStickLeft`,
17
+ * `.LeftStickX`, ...) carry the canonical channel offsets used to address
18
+ * each axis.
19
+ */
20
+ class GamepadAxis {
21
+ index;
22
+ channel;
23
+ invert;
24
+ normalize;
25
+ threshold;
26
+ bipolar;
27
+ constructor(index, channel, options = {}) {
28
+ this.index = index;
29
+ this.channel = channel;
30
+ this.invert = options.invert ?? false;
31
+ this.normalize = options.normalize ?? false;
32
+ this.threshold = clamp(options.threshold ?? 0.2, 0, 1);
33
+ this.bipolar = options.bipolar ?? false;
34
+ }
35
+ /**
36
+ * Apply the axis transform pipeline to a raw browser axis value
37
+ * (typically `Gamepad.axes[i]`, in -1..1).
38
+ *
39
+ * Pipeline: clamp to [-1, 1] → optional invert → optional normalize to
40
+ * [0, 1] → bipolar passthrough OR deadzone (returns 0 when the absolute
41
+ * value is at or below `threshold`).
42
+ */
43
+ transformValue(value) {
44
+ let result = clamp(value, -1, 1);
45
+ if (this.invert) {
46
+ result *= -1;
47
+ }
48
+ if (this.normalize) {
49
+ result = (result + 1) / 2;
50
+ }
51
+ if (this.bipolar) {
52
+ return Math.abs(result) > this.threshold ? result : 0;
53
+ }
54
+ return result > this.threshold ? result : 0;
55
+ }
56
+ }
57
+ const axis = (offset) => (ChannelOffset.Gamepads + offset);
58
+ /* eslint-disable @typescript-eslint/no-namespace, @typescript-eslint/naming-convention */
59
+ /**
60
+ * Channel-identifier constants. The axis section starts after the 32-slot
61
+ * button block: 24 named axes (offsets 32..55) plus 8 reserved slots
62
+ * (offsets 56..63).
63
+ */
64
+ (function (GamepadAxis) {
65
+ // Direction-split (0..1, "buttons-style").
66
+ GamepadAxis.LeftStickLeft = axis(32);
67
+ GamepadAxis.LeftStickRight = axis(33);
68
+ GamepadAxis.LeftStickUp = axis(34);
69
+ GamepadAxis.LeftStickDown = axis(35);
70
+ GamepadAxis.RightStickLeft = axis(36);
71
+ GamepadAxis.RightStickRight = axis(37);
72
+ GamepadAxis.RightStickUp = axis(38);
73
+ GamepadAxis.RightStickDown = axis(39);
74
+ // Aggregate (-1..1, "stick-style").
75
+ /** Signed left-stick X axis (-1..1). Negative = left, positive = right. */
76
+ GamepadAxis.LeftStickX = axis(40);
77
+ /** Signed left-stick Y axis (-1..1). Negative = up (screen-up), positive = down. */
78
+ GamepadAxis.LeftStickY = axis(41);
79
+ /** Signed right-stick X axis (-1..1). */
80
+ GamepadAxis.RightStickX = axis(42);
81
+ /** Signed right-stick Y axis (-1..1). */
82
+ GamepadAxis.RightStickY = axis(43);
83
+ // Touchpad XY (PlayStation 4/5, Steam Deck, dual-touchpad Steam-class hardware).
84
+ /** Primary touchpad X (0..1, left to right). PlayStation, Steam Deck (left pad), Steam Controller. */
85
+ GamepadAxis.TouchpadX = axis(44);
86
+ /** Primary touchpad Y (0..1, top to bottom). */
87
+ GamepadAxis.TouchpadY = axis(45);
88
+ /** Secondary touchpad X (0..1). Steam Deck (right pad), other dual-touchpad hardware. */
89
+ GamepadAxis.Touchpad2X = axis(46);
90
+ /** Secondary touchpad Y (0..1). */
91
+ GamepadAxis.Touchpad2Y = axis(47);
92
+ // Auxiliary axes (4 bipolar axes split into 8 non-negative channels).
93
+ GamepadAxis.AuxiliaryAxis0Negative = axis(48);
94
+ GamepadAxis.AuxiliaryAxis0Positive = axis(49);
95
+ GamepadAxis.AuxiliaryAxis1Negative = axis(50);
96
+ GamepadAxis.AuxiliaryAxis1Positive = axis(51);
97
+ GamepadAxis.AuxiliaryAxis2Negative = axis(52);
98
+ GamepadAxis.AuxiliaryAxis2Positive = axis(53);
99
+ GamepadAxis.AuxiliaryAxis3Negative = axis(54);
100
+ GamepadAxis.AuxiliaryAxis3Positive = axis(55);
101
+ // Offsets 56..63 reserved for future named axes / custom mapping use.
102
+ })(GamepadAxis || (GamepadAxis = {}));
103
+ /* eslint-enable @typescript-eslint/no-namespace, @typescript-eslint/naming-convention */
104
+
105
+ export { GamepadAxis };
106
+ //# sourceMappingURL=GamepadAxis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GamepadAxis.js","sources":["../../../../src/input/GamepadAxis.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAuDA;;;;;;;;;;;;;;;AAeG;MACU,WAAW,CAAA;AACJ,IAAA,KAAK;AACL,IAAA,OAAO;AACP,IAAA,MAAM;AACN,IAAA,SAAS;AACT,IAAA,SAAS;AACT,IAAA,OAAO;AAEvB,IAAA,WAAA,CAAmB,KAAa,EAAE,OAA2B,EAAE,UAA8B,EAAE,EAAA;AAC3F,QAAA,IAAI,CAAC,KAAK,GAAG,KAAK;AAClB,QAAA,IAAI,CAAC,OAAO,GAAG,OAAO;QACtB,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,KAAK;QACrC,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,KAAK;AAC3C,QAAA,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,IAAI,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;QACtD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,KAAK;IAC3C;AAEA;;;;;;;AAOG;AACI,IAAA,cAAc,CAAC,KAAa,EAAA;QAC/B,IAAI,MAAM,GAAG,KAAK,CAAC,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;AAEhC,QAAA,IAAI,IAAI,CAAC,MAAM,EAAE;YACb,MAAM,IAAI,EAAE;QAChB;AAEA,QAAA,IAAI,IAAI,CAAC,SAAS,EAAE;YAChB,MAAM,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC;QAC7B;AAEA,QAAA,IAAI,IAAI,CAAC,OAAO,EAAE;AACd,YAAA,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,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AE,CAAC;;AAGrB,IAAA,WAAA,CAAA,sBAAsB,GAAG,IAAI,CAAC,EAAE,CAAC;AACjC,IAAA,WAAA,CAAA,sBAAsB,GAAG,IAAI,CAAC,EAAE,CAAC;AACjC,IAAA,WAAA,CAAA,sBAAsB,GAAG,IAAI,CAAC,EAAE,CAAC;AACjC,IAAA,WAAA,CAAA,sBAAsB,GAAG,IAAI,CAAC,EAAE,CAAC;AACjC,IAAA,WAAA,CAAA,sBAAsB,GAAG,IAAI,CAAC,EAAE,CAAC;AACjC,IAAA,WAAA,CAAA,sBAAsB,GAAG,IAAI,CAAC,EAAE,CAAC;AACjC,IAAA,WAAA,CAAA,sBAAsB,GAAG,IAAI,CAAC,EAAE,CAAC;AACjC,IAAA,WAAA,CAAA,sBAAsB,GAAG,IAAI,CAAC,EAAE,CAAC;;AAElD,CAAC,EAzCgB,WAAW,KAAX,WAAW,GAAA,EAAA,CAAA,CAAA;AA0C5B;;;;"}
@@ -0,0 +1,110 @@
1
+ declare const gamepadButtonChannelBrand: unique symbol;
2
+ /**
3
+ * Branded literal-union type identifying a canonical button-style gamepad
4
+ * input channel. Members are absolute offsets into the engine's shared
5
+ * {@link Float32Array} input channel buffer (relative to slot 0): the 32
6
+ * slots reserved for a gamepad slot's button section, computed as
7
+ * `ChannelOffset.Gamepads + 0..31` (512..543 with the default layout —
8
+ * `ChannelSize.Category = 256`, `Gamepads = 2 * Category = 512`).
9
+ *
10
+ * The 24 named buttons (`South`-`Paddle4`) cover offsets 0..23; offsets
11
+ * 24..31 are reserved for forward-compat / custom-mapping use and remain
12
+ * part of this type so custom `GamepadMapping` subclasses can address them
13
+ * without casting.
14
+ *
15
+ * The brand keeps the type system from confusing button channels with
16
+ * {@link GamepadAxisChannel} or raw `number`s during mapping authoring.
17
+ * User code does not construct values of this type directly — read them
18
+ * from the {@link GamepadButton} namespace (`GamepadButton.South`, ...).
19
+ *
20
+ * @internal
21
+ */
22
+ export type GamepadButtonChannel = (512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543) & {
23
+ readonly [gamepadButtonChannelBrand]: void;
24
+ };
25
+ /** Construction options for a {@link GamepadButton}. */
26
+ export interface GamepadButtonOptions {
27
+ /** Negate the raw value before threshold comparison. Default `false`. */
28
+ invert?: boolean;
29
+ /** Activation threshold in 0..1 — values at or below this read as 0 (deadzone). Default 0.2. */
30
+ threshold?: number;
31
+ }
32
+ /**
33
+ * Single mappable button on a physical gamepad. Holds the raw browser
34
+ * `Gamepad.buttons[]` index, the canonical channel the value is written to,
35
+ * and the deadzone/inversion transform applied each frame by
36
+ * {@link transformValue}.
37
+ *
38
+ * Used by concrete {@link GamepadMapping} subclasses to declare a device's
39
+ * button layout. User code typically constructs these via
40
+ * `new GamepadButton(rawIndex, GamepadButton.South)` only when authoring a
41
+ * custom mapping.
42
+ *
43
+ * The static namespace exports (`GamepadButton.South`, `.East`, ...) carry
44
+ * the canonical channel offsets used to address each button.
45
+ */
46
+ export declare class GamepadButton {
47
+ readonly index: number;
48
+ readonly channel: GamepadButtonChannel;
49
+ readonly invert: boolean;
50
+ readonly threshold: number;
51
+ constructor(index: number, channel: GamepadButtonChannel, options?: GamepadButtonOptions);
52
+ /**
53
+ * Apply the button's transform pipeline to a raw browser button value
54
+ * (typically `Gamepad.buttons[i].value`, in 0..1).
55
+ *
56
+ * Pipeline: clamp to [0, 1] → optional invert → deadzone (returns 0 when
57
+ * the result is at or below `threshold`).
58
+ */
59
+ transformValue(value: number): number;
60
+ }
61
+ /**
62
+ * Channel-identifier constants — same convention as `Pointer.X` /
63
+ * `Keyboard.Space`. The first 32 slots of each gamepad sub-buffer are
64
+ * reserved for buttons (24 named, 8 buffer for future / custom mappings).
65
+ */
66
+ export declare namespace GamepadButton {
67
+ /** Bottom face button. Xbox=A, PlayStation=✕, Switch (horizontal Joy-Con)=B. Conventional usage: confirm / primary action / jump. */
68
+ const South: GamepadButtonChannel;
69
+ /** Right face button. Xbox=B, PlayStation=○, Switch=A. Conventional usage: cancel / back / secondary. */
70
+ const East: GamepadButtonChannel;
71
+ /** Left face button. Xbox=X, PlayStation=□, Switch=Y. Conventional usage: tertiary action. */
72
+ const West: GamepadButtonChannel;
73
+ /** Top face button. Xbox=Y, PlayStation=△, Switch=X. Conventional usage: quaternary action. */
74
+ const North: GamepadButtonChannel;
75
+ const LeftShoulder: GamepadButtonChannel;
76
+ const RightShoulder: GamepadButtonChannel;
77
+ /** Left trigger as a button (analog 0..1 reported through the same channel). */
78
+ const LeftTrigger: GamepadButtonChannel;
79
+ /** Right trigger as a button. */
80
+ const RightTrigger: GamepadButtonChannel;
81
+ /** Select / Back / Minus button. */
82
+ const Select: GamepadButtonChannel;
83
+ /** Start / Options / Plus button. */
84
+ const Start: GamepadButtonChannel;
85
+ /** Left analog stick click (L3). */
86
+ const LeftStick: GamepadButtonChannel;
87
+ /** Right analog stick click (R3). */
88
+ const RightStick: GamepadButtonChannel;
89
+ const DPadUp: GamepadButtonChannel;
90
+ const DPadDown: GamepadButtonChannel;
91
+ const DPadLeft: GamepadButtonChannel;
92
+ const DPadRight: GamepadButtonChannel;
93
+ /** Home / Guide / PS button. */
94
+ const Guide: GamepadButtonChannel;
95
+ /** Share / Create button (PS4/PS5, Xbox Series). */
96
+ const Share: GamepadButtonChannel;
97
+ /** Capture / Screenshot button (Switch, Xbox Series). */
98
+ const Capture: GamepadButtonChannel;
99
+ /** Touchpad click (PlayStation). */
100
+ const Touchpad: GamepadButtonChannel;
101
+ /** First paddle / extra button (Xbox Elite, Steam Controller, PS5 Edge, Steam Deck L4). */
102
+ const Paddle1: GamepadButtonChannel;
103
+ /** Second paddle / extra button (Xbox Elite, Steam Deck R4, PS5 Edge). */
104
+ const Paddle2: GamepadButtonChannel;
105
+ /** Third paddle / extra button (Xbox Elite, Steam Deck L5). */
106
+ const Paddle3: GamepadButtonChannel;
107
+ /** Fourth paddle / extra button (Xbox Elite, Steam Deck R5). */
108
+ const Paddle4: GamepadButtonChannel;
109
+ }
110
+ export {};
@@ -0,0 +1,99 @@
1
+ import { clamp } from '../math/utils.js';
2
+ import { ChannelOffset } from './types.js';
3
+
4
+ /**
5
+ * Single mappable button on a physical gamepad. Holds the raw browser
6
+ * `Gamepad.buttons[]` index, the canonical channel the value is written to,
7
+ * and the deadzone/inversion transform applied each frame by
8
+ * {@link transformValue}.
9
+ *
10
+ * Used by concrete {@link GamepadMapping} subclasses to declare a device's
11
+ * button layout. User code typically constructs these via
12
+ * `new GamepadButton(rawIndex, GamepadButton.South)` only when authoring a
13
+ * custom mapping.
14
+ *
15
+ * The static namespace exports (`GamepadButton.South`, `.East`, ...) carry
16
+ * the canonical channel offsets used to address each button.
17
+ */
18
+ class GamepadButton {
19
+ index;
20
+ channel;
21
+ invert;
22
+ threshold;
23
+ constructor(index, channel, options = {}) {
24
+ this.index = index;
25
+ this.channel = channel;
26
+ this.invert = options.invert ?? false;
27
+ this.threshold = clamp(options.threshold ?? 0.2, 0, 1);
28
+ }
29
+ /**
30
+ * Apply the button's transform pipeline to a raw browser button value
31
+ * (typically `Gamepad.buttons[i].value`, in 0..1).
32
+ *
33
+ * Pipeline: clamp to [0, 1] → optional invert → deadzone (returns 0 when
34
+ * the result is at or below `threshold`).
35
+ */
36
+ transformValue(value) {
37
+ let result = clamp(value, 0, 1);
38
+ if (this.invert) {
39
+ result = 1 - result;
40
+ }
41
+ return result > this.threshold ? result : 0;
42
+ }
43
+ }
44
+ const button = (offset) => (ChannelOffset.Gamepads + offset);
45
+ /* eslint-disable @typescript-eslint/no-namespace, @typescript-eslint/naming-convention */
46
+ /**
47
+ * Channel-identifier constants — same convention as `Pointer.X` /
48
+ * `Keyboard.Space`. The first 32 slots of each gamepad sub-buffer are
49
+ * reserved for buttons (24 named, 8 buffer for future / custom mappings).
50
+ */
51
+ (function (GamepadButton) {
52
+ /** Bottom face button. Xbox=A, PlayStation=✕, Switch (horizontal Joy-Con)=B. Conventional usage: confirm / primary action / jump. */
53
+ GamepadButton.South = button(0);
54
+ /** Right face button. Xbox=B, PlayStation=○, Switch=A. Conventional usage: cancel / back / secondary. */
55
+ GamepadButton.East = button(1);
56
+ /** Left face button. Xbox=X, PlayStation=□, Switch=Y. Conventional usage: tertiary action. */
57
+ GamepadButton.West = button(2);
58
+ /** Top face button. Xbox=Y, PlayStation=△, Switch=X. Conventional usage: quaternary action. */
59
+ GamepadButton.North = button(3);
60
+ GamepadButton.LeftShoulder = button(4);
61
+ GamepadButton.RightShoulder = button(5);
62
+ /** Left trigger as a button (analog 0..1 reported through the same channel). */
63
+ GamepadButton.LeftTrigger = button(6);
64
+ /** Right trigger as a button. */
65
+ GamepadButton.RightTrigger = button(7);
66
+ /** Select / Back / Minus button. */
67
+ GamepadButton.Select = button(8);
68
+ /** Start / Options / Plus button. */
69
+ GamepadButton.Start = button(9);
70
+ /** Left analog stick click (L3). */
71
+ GamepadButton.LeftStick = button(10);
72
+ /** Right analog stick click (R3). */
73
+ GamepadButton.RightStick = button(11);
74
+ GamepadButton.DPadUp = button(12);
75
+ GamepadButton.DPadDown = button(13);
76
+ GamepadButton.DPadLeft = button(14);
77
+ GamepadButton.DPadRight = button(15);
78
+ /** Home / Guide / PS button. */
79
+ GamepadButton.Guide = button(16);
80
+ /** Share / Create button (PS4/PS5, Xbox Series). */
81
+ GamepadButton.Share = button(17);
82
+ /** Capture / Screenshot button (Switch, Xbox Series). */
83
+ GamepadButton.Capture = button(18);
84
+ /** Touchpad click (PlayStation). */
85
+ GamepadButton.Touchpad = button(19);
86
+ /** First paddle / extra button (Xbox Elite, Steam Controller, PS5 Edge, Steam Deck L4). */
87
+ GamepadButton.Paddle1 = button(20);
88
+ /** Second paddle / extra button (Xbox Elite, Steam Deck R4, PS5 Edge). */
89
+ GamepadButton.Paddle2 = button(21);
90
+ /** Third paddle / extra button (Xbox Elite, Steam Deck L5). */
91
+ GamepadButton.Paddle3 = button(22);
92
+ /** Fourth paddle / extra button (Xbox Elite, Steam Deck R5). */
93
+ GamepadButton.Paddle4 = button(23);
94
+ // Offsets 24..31 reserved for future named buttons / custom mapping use.
95
+ })(GamepadButton || (GamepadButton = {}));
96
+ /* eslint-enable @typescript-eslint/no-namespace, @typescript-eslint/naming-convention */
97
+
98
+ export { GamepadButton };
99
+ //# sourceMappingURL=GamepadButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GamepadButton.js","sources":["../../../../src/input/GamepadButton.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAwCA;;;;;;;;;;;;;AAaG;MACU,aAAa,CAAA;AACN,IAAA,KAAK;AACL,IAAA,OAAO;AACP,IAAA,MAAM;AACN,IAAA,SAAS;AAEzB,IAAA,WAAA,CAAmB,KAAa,EAAE,OAA6B,EAAE,UAAgC,EAAE,EAAA;AAC/F,QAAA,IAAI,CAAC,KAAK,GAAG,KAAK;AAClB,QAAA,IAAI,CAAC,OAAO,GAAG,OAAO;QACtB,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,KAAK;AACrC,QAAA,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,IAAI,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;IAC1D;AAEA;;;;;;AAMG;AACI,IAAA,cAAc,CAAC,KAAa,EAAA;QAC/B,IAAI,MAAM,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;AAE/B,QAAA,IAAI,IAAI,CAAC,MAAM,EAAE;AACb,YAAA,MAAM,GAAG,CAAC,GAAG,MAAM;QACvB;AAEA,QAAA,OAAO,MAAM,GAAG,IAAI,CAAC,SAAS,GAAG,MAAM,GAAG,CAAC;IAC/C;AACH;AAED,MAAM,MAAM,GAAG,CAAC,MAAc,MAA4B,aAAa,CAAC,QAAQ,GAAG,MAAM,CAAyB;AAElH;AACA;;;;AAIG;AACH,CAAA,UAAiB,aAAa,EAAA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AAC,EAAE,CAAC;;AAE1B,IAAA,aAAA,CAAA,OAAO,GAAS,MAAM,CAAC,EAAE,CAAC;;AAE1B,IAAA,aAAA,CAAA,OAAO,GAAS,MAAM,CAAC,EAAE,CAAC;;AAE1B,IAAA,aAAA,CAAA,OAAO,GAAS,MAAM,CAAC,EAAE,CAAC;;AAE1B,IAAA,aAAA,CAAA,OAAO,GAAS,MAAM,CAAC,EAAE,CAAC;;AAE3C,CAAC,EA5CgB,aAAa,KAAb,aAAa,GAAA,EAAA,CAAA,CAAA;AA6C9B;;;;"}
@@ -1,9 +1,25 @@
1
1
  import type { GamepadMapping } from './GamepadMapping';
2
+ /** Convenience alias for the non-null element type returned by `navigator.getGamepads()`. */
2
3
  export type BrowserGamepad = NonNullable<ReturnType<Navigator['getGamepads']>[number]>;
4
+ /**
5
+ * Value a {@link GamepadDefinition.resolve} callback may return.
6
+ *
7
+ * Return a bare {@link GamepadMapping} to accept the device with the definition's
8
+ * default name, an object with an optional `name` override, or `null`/`undefined`
9
+ * to decline the device and let the next definition in the list try.
10
+ */
3
11
  export type GamepadDefinitionResult = GamepadMapping | {
4
12
  name?: string;
5
13
  mapping: GamepadMapping;
6
14
  } | null | undefined;
15
+ /**
16
+ * Parsed metadata extracted from a browser `Gamepad.id` string.
17
+ *
18
+ * `vendorId` and `productId` are four-hex-digit strings (e.g. `"045e"`, `"028e"`).
19
+ * `productKey` is the colon-joined pair (`"045e:028e"`), used as a compact lookup key.
20
+ * `name` is the human-readable portion of the id with the vendor/product tokens removed,
21
+ * or `null` when the id contained only identifiers.
22
+ */
7
23
  export interface GamepadDescriptor {
8
24
  id: string;
9
25
  index: number;
@@ -13,19 +29,66 @@ export interface GamepadDescriptor {
13
29
  productKey: string | null;
14
30
  name: string | null;
15
31
  }
32
+ /**
33
+ * A rule that matches one or more physical gamepads and produces a {@link GamepadMapping}.
34
+ *
35
+ * `ids` is an optional allow-list of vendor IDs (`"045e"`) or `vendorId:productId`
36
+ * pairs (`"045e:028e"`); when omitted the definition matches every device.
37
+ * `resolve` is called with the parsed {@link GamepadDescriptor} and must return a
38
+ * {@link GamepadDefinitionResult} — `null`/`undefined` to skip, a mapping otherwise.
39
+ */
16
40
  export interface GamepadDefinition {
17
41
  ids?: string | Array<string>;
18
42
  name?: string;
19
43
  resolve: (descriptor: GamepadDescriptor) => GamepadDefinitionResult;
20
44
  }
45
+ /**
46
+ * The fully resolved product of running a {@link GamepadDefinition} against a
47
+ * connected gamepad — bundles the original descriptor, the resolved display name,
48
+ * and the chosen {@link GamepadMapping} together for use by {@link Gamepad}.
49
+ */
21
50
  export interface ResolvedGamepadDefinition {
22
51
  descriptor: GamepadDescriptor;
23
52
  name: string;
24
53
  mapping: GamepadMapping;
25
54
  }
26
- export declare const normalizeIds: (ids?: string | Array<string>) => Array<string>;
55
+ /**
56
+ * Returns `true` when `descriptor` matches any entry in `ids`.
57
+ *
58
+ * A colon-containing id (e.g. `"045e:028e"`) is matched against
59
+ * `descriptor.productKey`; a bare four-hex id is matched against
60
+ * `descriptor.vendorId`. Passing no `ids` always returns `true`.
61
+ */
27
62
  export declare const matchesIds: (descriptor: GamepadDescriptor, ids?: string | Array<string>) => boolean;
63
+ /**
64
+ * Parses the raw browser `Gamepad.id` string into a structured {@link GamepadDescriptor}.
65
+ *
66
+ * Attempts multiple vendor/product ID patterns (hex-prefixed, plain, VID/PID, bare pair)
67
+ * in order of specificity, then strips the matched tokens to derive a clean `name`.
68
+ */
28
69
  export declare const parseGamepadDescriptor: (gamepad: BrowserGamepad) => GamepadDescriptor;
70
+ /**
71
+ * Runs a single {@link GamepadDefinition} against a descriptor, respecting its
72
+ * `ids` filter. Returns `null` when the definition declines the device.
73
+ */
29
74
  export declare const resolveDefinition: (definition: GamepadDefinition, descriptor: GamepadDescriptor) => ResolvedGamepadDefinition | null;
75
+ /**
76
+ * Resolves the best-matching {@link ResolvedGamepadDefinition} for a connected gamepad.
77
+ *
78
+ * Iterates `definitions` in order — exact product IDs first, then vendor fallbacks,
79
+ * then a generic catch-all — and returns the first match. Falls back to
80
+ * {@link GenericDualAnalogGamepadMapping} when no definition matches.
81
+ *
82
+ * @example
83
+ * const resolved = resolveGamepadDefinition(navigator.getGamepads()[0]!);
84
+ * const gamepad = new Gamepad(browserGamepad, channels, resolved);
85
+ */
30
86
  export declare const resolveGamepadDefinition: (gamepadOrDescriptor: BrowserGamepad | GamepadDescriptor, definitions?: ReadonlyArray<GamepadDefinition>) => ResolvedGamepadDefinition;
87
+ /**
88
+ * The default ordered list of {@link GamepadDefinition} entries used by
89
+ * {@link resolveGamepadDefinition} when no custom list is supplied.
90
+ *
91
+ * Ordered as: exact product-ID matches → vendor-ID fallbacks → generic catch-all.
92
+ * Register custom definitions by prepending to a copy and passing it explicitly.
93
+ */
31
94
  export declare const builtInGamepadDefinitions: Array<GamepadDefinition>;
@@ -5,6 +5,7 @@ import { JoyConLeftGamepadMapping } from './JoyConLeftGamepadMapping.js';
5
5
  import { JoyConRightGamepadMapping } from './JoyConRightGamepadMapping.js';
6
6
  import { PlayStationGamepadMapping } from './PlayStationGamepadMapping.js';
7
7
  import { SteamControllerGamepadMapping } from './SteamControllerGamepadMapping.js';
8
+ import { SteamDeckGamepadMapping } from './SteamDeckGamepadMapping.js';
8
9
  import { SwitchProGamepadMapping } from './SwitchProGamepadMapping.js';
9
10
  import { XboxGamepadMapping } from './XboxGamepadMapping.js';
10
11
 
@@ -59,6 +60,10 @@ const resolveDefinitionResult = (definition, descriptor) => {
59
60
  mapping: result,
60
61
  };
61
62
  };
63
+ /**
64
+ * Normalises an `ids` value into a trimmed, lower-case string array ready for
65
+ * comparison against a {@link GamepadDescriptor}.
66
+ */
62
67
  const normalizeIds = (ids) => {
63
68
  if (!ids) {
64
69
  return [];
@@ -66,6 +71,13 @@ const normalizeIds = (ids) => {
66
71
  const values = Array.isArray(ids) ? ids : [ids];
67
72
  return values.map(normalizeId);
68
73
  };
74
+ /**
75
+ * Returns `true` when `descriptor` matches any entry in `ids`.
76
+ *
77
+ * A colon-containing id (e.g. `"045e:028e"`) is matched against
78
+ * `descriptor.productKey`; a bare four-hex id is matched against
79
+ * `descriptor.vendorId`. Passing no `ids` always returns `true`.
80
+ */
69
81
  const matchesIds = (descriptor, ids) => {
70
82
  if (!ids) {
71
83
  return true;
@@ -83,6 +95,12 @@ const matchesIds = (descriptor, ids) => {
83
95
  }
84
96
  return false;
85
97
  };
98
+ /**
99
+ * Parses the raw browser `Gamepad.id` string into a structured {@link GamepadDescriptor}.
100
+ *
101
+ * Attempts multiple vendor/product ID patterns (hex-prefixed, plain, VID/PID, bare pair)
102
+ * in order of specificity, then strips the matched tokens to derive a clean `name`.
103
+ */
86
104
  const parseGamepadDescriptor = (gamepad) => {
87
105
  const label = gamepad.id.trim() || `Gamepad ${gamepad.index}`;
88
106
  const productKey = parseProductKey(label);
@@ -98,12 +116,27 @@ const parseGamepadDescriptor = (gamepad) => {
98
116
  name: parseName(label),
99
117
  };
100
118
  };
119
+ /**
120
+ * Runs a single {@link GamepadDefinition} against a descriptor, respecting its
121
+ * `ids` filter. Returns `null` when the definition declines the device.
122
+ */
101
123
  const resolveDefinition = (definition, descriptor) => {
102
124
  if (!matchesIds(descriptor, definition.ids)) {
103
125
  return null;
104
126
  }
105
127
  return resolveDefinitionResult(definition, descriptor);
106
128
  };
129
+ /**
130
+ * Resolves the best-matching {@link ResolvedGamepadDefinition} for a connected gamepad.
131
+ *
132
+ * Iterates `definitions` in order — exact product IDs first, then vendor fallbacks,
133
+ * then a generic catch-all — and returns the first match. Falls back to
134
+ * {@link GenericDualAnalogGamepadMapping} when no definition matches.
135
+ *
136
+ * @example
137
+ * const resolved = resolveGamepadDefinition(navigator.getGamepads()[0]!);
138
+ * const gamepad = new Gamepad(browserGamepad, channels, resolved);
139
+ */
107
140
  const resolveGamepadDefinition = (gamepadOrDescriptor, definitions = builtInGamepadDefinitions) => {
108
141
  const descriptor = 'connected' in gamepadOrDescriptor
109
142
  ? parseGamepadDescriptor(gamepadOrDescriptor)
@@ -141,6 +174,8 @@ const exactDeviceDefinitions = [
141
174
  createStaticGamepadDefinition('Switch 2 Pro Controller', () => new SwitchProGamepadMapping(), '057e:2069'),
142
175
  createStaticGamepadDefinition('Switch 2 GameCube Controller', () => new GameCubeGamepadMapping(), '057e:2073'),
143
176
  createStaticGamepadDefinition('Steam Controller', () => new SteamControllerGamepadMapping(), ['28de:1102', '28de:1142']),
177
+ createStaticGamepadDefinition('Steam Virtual Gamepad', () => new GenericDualAnalogGamepadMapping(), '28de:11ff'),
178
+ createStaticGamepadDefinition('Steam Deck', () => new SteamDeckGamepadMapping(), '28de:1205'),
144
179
  createStaticGamepadDefinition('F310 Gamepad', () => new GenericDualAnalogGamepadMapping(), '046d:c216'),
145
180
  createStaticGamepadDefinition('F710 Gamepad', () => new GenericDualAnalogGamepadMapping(), ['046d:c219', '046d:c21f']),
146
181
  createStaticGamepadDefinition('8BitDo P30 Controller', () => new GenericDualAnalogGamepadMapping(), ['2dc8:5107', '2dc8:5108']),
@@ -163,13 +198,21 @@ const exactDeviceDefinitions = [
163
198
  const vendorFallbackDefinitions = [
164
199
  createStaticGamepadDefinition('Microsoft Controller', () => new XboxGamepadMapping(), '045e'),
165
200
  createStaticGamepadDefinition('Sony Controller', () => new PlayStationGamepadMapping(), '054c'),
201
+ createStaticGamepadDefinition('Valve Controller', () => new SteamDeckGamepadMapping(), '28de'),
166
202
  ];
167
203
  const genericFallbackDefinition = createStaticGamepadDefinition('Generic Gamepad', () => new GenericDualAnalogGamepadMapping());
204
+ /**
205
+ * The default ordered list of {@link GamepadDefinition} entries used by
206
+ * {@link resolveGamepadDefinition} when no custom list is supplied.
207
+ *
208
+ * Ordered as: exact product-ID matches → vendor-ID fallbacks → generic catch-all.
209
+ * Register custom definitions by prepending to a copy and passing it explicitly.
210
+ */
168
211
  const builtInGamepadDefinitions = [
169
212
  ...exactDeviceDefinitions,
170
213
  ...vendorFallbackDefinitions,
171
214
  genericFallbackDefinition,
172
215
  ];
173
216
 
174
- export { builtInGamepadDefinitions, matchesIds, normalizeIds, parseGamepadDescriptor, resolveDefinition, resolveGamepadDefinition };
217
+ export { builtInGamepadDefinitions, matchesIds, parseGamepadDescriptor, resolveDefinition, resolveGamepadDefinition };
175
218
  //# sourceMappingURL=GamepadDefinitions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GamepadDefinitions.js","sources":["../../../../src/input/GamepadDefinitions.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;AA6CA,MAAM,oBAAoB,GAAG,yDAAyD;AACtF,MAAM,uBAAuB,GAAG,6DAA6D;AAC7F,MAAM,wBAAwB,GAAG,sCAAsC;AACvE,MAAM,aAAa,GAAG,uDAAuD;AAE7E,MAAM,6BAA6B,GAAG,CAClC,IAAY,EACZ,aAAmC,EACnC,GAA4B,MACP;IACrB,GAAG;IACH,IAAI;AACJ,IAAA,OAAO,EAAE,OAAO;QACZ,IAAI;QACJ,OAAO,EAAE,aAAa,EAAE;KAC3B,CAAC;AACL,CAAA,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,EAAU,KAAa,EAAE,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE;AAEnE,MAAM,eAAe,GAAG,CAAC,EAAU,KAAmB;AAClD,IAAA,MAAM,KAAK,GAAG,uBAAuB,CAAC,IAAI,CAAC,EAAE;AACtC,WAAA,oBAAoB,CAAC,IAAI,CAAC,EAAE;AAC5B,WAAA,aAAa,CAAC,IAAI,CAAC,EAAE;AACrB,WAAA,wBAAwB,CAAC,IAAI,CAAC,EAAE,CAAC;IAExC,IAAI,CAAC,KAAK,EAAE;AACR,QAAA,OAAO,IAAI;IACf;AAEA,IAAA,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAA,CAAA,EAAI,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE;AAChE,CAAC;AAED,MAAM,SAAS,GAAG,CAAC,KAAa,KAAmB;IAC/C,MAAM,IAAI,GAAG;AACR,SAAA,OA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AA6B,CAAC,kBAAkB,EAAE,MAAM,IAAI,uBAAuB,EAAE,EAAE,MAAM,CAAC;CACjG;AAED,MAAM,yBAAyB,GAAG,6BAA6B,CAAC,iBAAiB,EAAE,MAAM,IAAI,+BAA+B,EAAE,CAAC;AAE/H;;;;;;AAMG;AACI,MAAM,yBAAyB,GAA6B;AAC/D,IAAA,GAAG,sBAAsB;AACzB,IAAA,GAAG,yBAAyB;IAC5B,yBAAyB;;;;;"}
@@ -1,6 +1,11 @@
1
- import { GamepadControl } from './GamepadControl';
2
- import type { GamepadControlOptions } from './GamepadControl';
3
- import type { GamepadChannel } from './GamepadChannels';
1
+ import type { GamepadButton } from './GamepadButton';
2
+ import type { GamepadAxis } from './GamepadAxis';
3
+ import type { GamepadButtonChannel } from './GamepadButton';
4
+ import type { GamepadAxisChannel } from './GamepadAxis';
5
+ /**
6
+ * Discriminant tag identifying which device family a {@link GamepadMapping} belongs to.
7
+ * Used to select the correct mapping at runtime when a gamepad connects.
8
+ */
4
9
  export declare enum GamepadMappingFamily {
5
10
  GenericDualAnalog = "genericDualAnalog",
6
11
  Xbox = "xbox",
@@ -10,14 +15,43 @@ export declare enum GamepadMappingFamily {
10
15
  JoyConRight = "joyConRight",
11
16
  GameCube = "gameCube",
12
17
  SteamController = "steamController",
18
+ SteamDeck = "steamDeck",
13
19
  ArcadeStick = "arcadeStick"
14
20
  }
15
- export type GamepadControlDefinition = readonly [number, GamepadChannel, GamepadControlOptions?];
21
+ /**
22
+ * Abstract translation layer between the browser's raw {@link https://developer.mozilla.org/en-US/docs/Web/API/Gamepad Gamepad API}
23
+ * indices and ExoJS-canonical channel buffers.
24
+ *
25
+ * Each concrete subclass encodes one device family's button/axis layout as
26
+ * ordered arrays of {@link GamepadButton} / {@link GamepadAxis} instances.
27
+ * The engine selects the appropriate mapping when a gamepad connects and
28
+ * uses it to route raw values to the correct input channels every frame.
29
+ */
16
30
  export declare abstract class GamepadMapping {
31
+ /** Identifies the device family this mapping targets. */
17
32
  abstract readonly family: GamepadMappingFamily;
18
- readonly buttons: Array<GamepadControl>;
19
- readonly axes: Array<GamepadControl>;
20
- protected constructor(buttons: Array<GamepadControl>, axes: Array<GamepadControl>);
33
+ /** Ordered list of buttons, indexed by the Gamepad API button index. */
34
+ readonly buttons: ReadonlyArray<GamepadButton>;
35
+ /** Ordered list of axes, indexed by the Gamepad API axis index. */
36
+ readonly axes: ReadonlyArray<GamepadAxis>;
37
+ protected constructor(buttons: ReadonlyArray<GamepadButton>, axes: ReadonlyArray<GamepadAxis>);
38
+ /**
39
+ * Returns `true` when this mapping declares at least one button or axis
40
+ * control that writes to `channel`. Use to detect device-specific
41
+ * capabilities at runtime — e.g. before binding an input to a
42
+ * right-stick channel that may not exist on a single Joy-Con.
43
+ *
44
+ * @example
45
+ * ```ts
46
+ * if (gamepad.mapping?.hasChannel(GamepadAxis.RightStickX)) {
47
+ * pad.onActive(GamepadAxis.RightStickX, (v) => crosshair.x += v * 8);
48
+ * }
49
+ * ```
50
+ */
51
+ hasChannel(channel: GamepadButtonChannel | GamepadAxisChannel): boolean;
52
+ /**
53
+ * Releases all button and axis control references held by this mapping.
54
+ * Call when the associated gamepad disconnects to allow garbage collection.
55
+ */
21
56
  destroy(): void;
22
- static createControls(definitions: ReadonlyArray<GamepadControlDefinition>): Array<GamepadControl>;
23
57
  }