melonjs 20.2.0 → 20.4.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 (515) hide show
  1. package/README.md +86 -8
  2. package/build/application/application.d.ts +0 -17
  3. package/build/application/application.d.ts.map +1 -1
  4. package/build/application/settings.d.ts +6 -2
  5. package/build/application/settings.d.ts.map +1 -1
  6. package/build/audio/audio.d.ts +2 -2
  7. package/build/audio/audio.d.ts.map +1 -1
  8. package/build/audio/backend/buffer.d.ts +26 -0
  9. package/build/audio/backend/buffer.d.ts.map +1 -0
  10. package/build/audio/backend/cache.d.ts +2 -0
  11. package/build/audio/backend/cache.d.ts.map +1 -0
  12. package/build/audio/backend/core.d.ts +24 -0
  13. package/build/audio/backend/core.d.ts.map +1 -0
  14. package/build/audio/backend/engine.d.ts +35 -0
  15. package/build/audio/backend/engine.d.ts.map +1 -0
  16. package/build/audio/backend/sound.d.ts +29 -0
  17. package/build/audio/backend/sound.d.ts.map +1 -0
  18. package/build/audio/backend/spatial.d.ts +191 -0
  19. package/build/audio/backend/spatial.d.ts.map +1 -0
  20. package/build/audio/backend/types.d.ts +107 -0
  21. package/build/audio/backend/types.d.ts.map +1 -0
  22. package/build/audio/backend/voice.d.ts +8 -0
  23. package/build/audio/backend/voice.d.ts.map +1 -0
  24. package/build/audio/playback.d.ts +49 -4
  25. package/build/audio/playback.d.ts.map +1 -1
  26. package/build/audio/procedural.d.ts.map +1 -1
  27. package/build/audio/state.d.ts +69 -0
  28. package/build/audio/state.d.ts.map +1 -0
  29. package/build/audio/types.d.ts +93 -1
  30. package/build/audio/types.d.ts.map +1 -1
  31. package/build/camera/camera2d.d.ts +0 -68
  32. package/build/camera/camera2d.d.ts.map +1 -1
  33. package/build/camera/camera3d.d.ts +91 -84
  34. package/build/camera/camera3d.d.ts.map +1 -1
  35. package/build/camera/effects/fade_effect.d.ts +0 -5
  36. package/build/camera/effects/fade_effect.d.ts.map +1 -1
  37. package/build/camera/effects/mask_effect.d.ts +0 -5
  38. package/build/camera/effects/mask_effect.d.ts.map +1 -1
  39. package/build/camera/fog.d.ts +118 -0
  40. package/build/camera/fog.d.ts.map +1 -0
  41. package/build/const.d.ts +2 -2
  42. package/build/geometries/box3d.d.ts +0 -28
  43. package/build/geometries/box3d.d.ts.map +1 -1
  44. package/build/geometries/ellipse.d.ts +0 -20
  45. package/build/geometries/ellipse.d.ts.map +1 -1
  46. package/build/geometries/observablePoint.d.ts +0 -3
  47. package/build/geometries/observablePoint.d.ts.map +1 -1
  48. package/build/geometries/path2d.d.ts +0 -19
  49. package/build/geometries/path2d.d.ts.map +1 -1
  50. package/build/geometries/polygon.d.ts +0 -12
  51. package/build/geometries/polygon.d.ts.map +1 -1
  52. package/build/geometries/roundrect.d.ts +0 -18
  53. package/build/geometries/roundrect.d.ts.map +1 -1
  54. package/build/geometries/sphere.d.ts +0 -9
  55. package/build/geometries/sphere.d.ts.map +1 -1
  56. package/build/geometries/toarccanvas.d.ts.map +1 -1
  57. package/build/index.d.ts +1 -0
  58. package/build/index.d.ts.map +1 -1
  59. package/build/index.js +12150 -11289
  60. package/build/index.js.map +4 -4
  61. package/build/input/gamepad.d.ts.map +1 -1
  62. package/build/input/input.d.ts +19 -0
  63. package/build/input/input.d.ts.map +1 -1
  64. package/build/input/pointer.d.ts +0 -4
  65. package/build/input/pointer.d.ts.map +1 -1
  66. package/build/input/pointerevent.d.ts +0 -6
  67. package/build/input/pointerevent.d.ts.map +1 -1
  68. package/build/lang/deprecated.d.ts +4 -2
  69. package/build/lang/deprecated.d.ts.map +1 -1
  70. package/build/level/gltf/GLTFModel.d.ts +0 -81
  71. package/build/level/gltf/GLTFModel.d.ts.map +1 -1
  72. package/build/level/gltf/GLTFScene.d.ts +13 -44
  73. package/build/level/gltf/GLTFScene.d.ts.map +1 -1
  74. package/build/level/gltf/gltf_sampler.d.ts +1 -48
  75. package/build/level/gltf/gltf_sampler.d.ts.map +1 -1
  76. package/build/level/level.d.ts +195 -113
  77. package/build/level/level.d.ts.map +1 -1
  78. package/build/level/tiled/TMXGroup.d.ts +1 -65
  79. package/build/level/tiled/TMXGroup.d.ts.map +1 -1
  80. package/build/level/tiled/TMXLayer.d.ts +0 -44
  81. package/build/level/tiled/TMXLayer.d.ts.map +1 -1
  82. package/build/level/tiled/TMXObject.d.ts +1 -136
  83. package/build/level/tiled/TMXObject.d.ts.map +1 -1
  84. package/build/level/tiled/TMXObjectFactory.d.ts +1 -40
  85. package/build/level/tiled/TMXObjectFactory.d.ts.map +1 -1
  86. package/build/level/tiled/TMXTile.d.ts +1 -30
  87. package/build/level/tiled/TMXTile.d.ts.map +1 -1
  88. package/build/level/tiled/TMXTileMap.d.ts +0 -10
  89. package/build/level/tiled/TMXTileMap.d.ts.map +1 -1
  90. package/build/level/tiled/TMXTileset.d.ts +0 -113
  91. package/build/level/tiled/TMXTileset.d.ts.map +1 -1
  92. package/build/level/tiled/TMXTilesetGroup.d.ts +0 -1
  93. package/build/level/tiled/TMXTilesetGroup.d.ts.map +1 -1
  94. package/build/level/tiled/TMXUtils.d.ts +1 -43
  95. package/build/level/tiled/TMXUtils.d.ts.map +1 -1
  96. package/build/level/tiled/factories/shape.d.ts +1 -7
  97. package/build/level/tiled/factories/shape.d.ts.map +1 -1
  98. package/build/level/tiled/factories/text.d.ts +1 -7
  99. package/build/level/tiled/factories/text.d.ts.map +1 -1
  100. package/build/level/tiled/factories/tile.d.ts +1 -7
  101. package/build/level/tiled/factories/tile.d.ts.map +1 -1
  102. package/build/level/tiled/renderer/TMXHexagonalRenderer.d.ts +0 -60
  103. package/build/level/tiled/renderer/TMXHexagonalRenderer.d.ts.map +1 -1
  104. package/build/level/tiled/renderer/TMXIsometricRenderer.d.ts +0 -42
  105. package/build/level/tiled/renderer/TMXIsometricRenderer.d.ts.map +1 -1
  106. package/build/level/tiled/renderer/TMXObliqueRenderer.d.ts +0 -5
  107. package/build/level/tiled/renderer/TMXObliqueRenderer.d.ts.map +1 -1
  108. package/build/level/tiled/renderer/TMXOrthogonalRenderer.d.ts +0 -31
  109. package/build/level/tiled/renderer/TMXOrthogonalRenderer.d.ts.map +1 -1
  110. package/build/level/tiled/renderer/TMXRenderer.d.ts +2 -2
  111. package/build/level/tiled/renderer/TMXRenderer.d.ts.map +1 -1
  112. package/build/level/tiled/renderer/TMXStaggeredRenderer.d.ts.map +1 -1
  113. package/build/level/tiled/renderer/autodetect.d.ts +1 -6
  114. package/build/level/tiled/renderer/autodetect.d.ts.map +1 -1
  115. package/build/lighting/light2d.d.ts +0 -25
  116. package/build/lighting/light2d.d.ts.map +1 -1
  117. package/build/lighting/light3d.d.ts +0 -16
  118. package/build/lighting/light3d.d.ts.map +1 -1
  119. package/build/loader/loader.d.ts +46 -73
  120. package/build/loader/loader.d.ts.map +1 -1
  121. package/build/loader/loadingscreen.d.ts +0 -33
  122. package/build/loader/loadingscreen.d.ts.map +1 -1
  123. package/build/loader/parsers/aseprite.d.ts +0 -13
  124. package/build/loader/parsers/aseprite.d.ts.map +1 -1
  125. package/build/loader/parsers/audio.d.ts +2 -0
  126. package/build/loader/parsers/audio.d.ts.map +1 -0
  127. package/build/loader/parsers/binary.d.ts +1 -10
  128. package/build/loader/parsers/binary.d.ts.map +1 -1
  129. package/build/loader/parsers/compressed_textures/compressed_image.d.ts.map +1 -1
  130. package/build/loader/parsers/compressed_textures/parseDDS.d.ts +1 -7
  131. package/build/loader/parsers/compressed_textures/parseDDS.d.ts.map +1 -1
  132. package/build/loader/parsers/compressed_textures/parseKTX.d.ts +1 -7
  133. package/build/loader/parsers/compressed_textures/parseKTX.d.ts.map +1 -1
  134. package/build/loader/parsers/compressed_textures/parseKTX2.d.ts +1 -7
  135. package/build/loader/parsers/compressed_textures/parseKTX2.d.ts.map +1 -1
  136. package/build/loader/parsers/compressed_textures/parsePKM.d.ts +1 -7
  137. package/build/loader/parsers/compressed_textures/parsePKM.d.ts.map +1 -1
  138. package/build/loader/parsers/compressed_textures/parsePVR.d.ts +1 -7
  139. package/build/loader/parsers/compressed_textures/parsePVR.d.ts.map +1 -1
  140. package/build/loader/parsers/fontface.d.ts +1 -13
  141. package/build/loader/parsers/fontface.d.ts.map +1 -1
  142. package/build/loader/parsers/gltf.d.ts +1 -70
  143. package/build/loader/parsers/gltf.d.ts.map +1 -1
  144. package/build/loader/parsers/image.d.ts +1 -22
  145. package/build/loader/parsers/image.d.ts.map +1 -1
  146. package/build/loader/parsers/json.d.ts +1 -10
  147. package/build/loader/parsers/json.d.ts.map +1 -1
  148. package/build/loader/parsers/mtl.d.ts +1 -28
  149. package/build/loader/parsers/mtl.d.ts.map +1 -1
  150. package/build/loader/parsers/obj.d.ts +1 -59
  151. package/build/loader/parsers/obj.d.ts.map +1 -1
  152. package/build/loader/parsers/pbr.d.ts +1 -62
  153. package/build/loader/parsers/pbr.d.ts.map +1 -1
  154. package/build/loader/parsers/script.d.ts +1 -10
  155. package/build/loader/parsers/script.d.ts.map +1 -1
  156. package/build/loader/parsers/shader.d.ts +1 -52
  157. package/build/loader/parsers/shader.d.ts.map +1 -1
  158. package/build/loader/parsers/tmx.d.ts +1 -10
  159. package/build/loader/parsers/tmx.d.ts.map +1 -1
  160. package/build/loader/parsers/video.d.ts +1 -10
  161. package/build/loader/parsers/video.d.ts.map +1 -1
  162. package/build/math/color.d.ts.map +1 -1
  163. package/build/math/noise.d.ts +0 -40
  164. package/build/math/noise.d.ts.map +1 -1
  165. package/build/math/observableVector2d.d.ts +0 -3
  166. package/build/math/observableVector2d.d.ts.map +1 -1
  167. package/build/math/observableVector3d.d.ts +0 -3
  168. package/build/math/observableVector3d.d.ts.map +1 -1
  169. package/build/math/vector2d.d.ts +0 -6
  170. package/build/math/vector2d.d.ts.map +1 -1
  171. package/build/math/vertex.d.ts +25 -0
  172. package/build/math/vertex.d.ts.map +1 -1
  173. package/build/particles/emitter.d.ts +0 -65
  174. package/build/particles/emitter.d.ts.map +1 -1
  175. package/build/particles/particle.d.ts +0 -81
  176. package/build/particles/particle.d.ts.map +1 -1
  177. package/build/physics/adapter.d.ts +3 -3
  178. package/build/physics/bounds.d.ts +0 -1
  179. package/build/physics/bounds.d.ts.map +1 -1
  180. package/build/physics/broadphase/broadphase.d.ts +0 -7
  181. package/build/physics/broadphase/broadphase.d.ts.map +1 -1
  182. package/build/physics/broadphase/octree.d.ts +0 -91
  183. package/build/physics/broadphase/octree.d.ts.map +1 -1
  184. package/build/physics/broadphase/quadtree.d.ts +0 -47
  185. package/build/physics/broadphase/quadtree.d.ts.map +1 -1
  186. package/build/physics/builtin/body.d.ts +5 -69
  187. package/build/physics/builtin/body.d.ts.map +1 -1
  188. package/build/physics/builtin/detector.d.ts +0 -312
  189. package/build/physics/builtin/detector.d.ts.map +1 -1
  190. package/build/physics/builtin/sat.d.ts +1 -48
  191. package/build/physics/builtin/sat.d.ts.map +1 -1
  192. package/build/physics/builtin/sat3d.d.ts +1 -56
  193. package/build/physics/builtin/sat3d.d.ts.map +1 -1
  194. package/build/physics/collision.d.ts +0 -2
  195. package/build/physics/collision.d.ts.map +1 -1
  196. package/build/physics/response.d.ts +0 -1
  197. package/build/physics/response.d.ts.map +1 -1
  198. package/build/physics/world.d.ts.map +1 -1
  199. package/build/plugin/plugin.d.ts +9 -1
  200. package/build/plugin/plugin.d.ts.map +1 -1
  201. package/build/polyfill/index.d.ts +1 -4
  202. package/build/polyfill/index.d.ts.map +1 -1
  203. package/build/renderable/anchorPoint.d.ts +1 -73
  204. package/build/renderable/anchorPoint.d.ts.map +1 -1
  205. package/build/renderable/animation.d.ts +0 -7
  206. package/build/renderable/animation.d.ts.map +1 -1
  207. package/build/renderable/colorlayer.d.ts +0 -5
  208. package/build/renderable/colorlayer.d.ts.map +1 -1
  209. package/build/renderable/container.d.ts +0 -55
  210. package/build/renderable/container.d.ts.map +1 -1
  211. package/build/renderable/draggable.d.ts +0 -5
  212. package/build/renderable/draggable.d.ts.map +1 -1
  213. package/build/renderable/dragndrop.d.ts +1 -12
  214. package/build/renderable/dragndrop.d.ts.map +1 -1
  215. package/build/renderable/entity/entity.d.ts +0 -8
  216. package/build/renderable/entity/entity.d.ts.map +1 -1
  217. package/build/renderable/frameAnimation.d.ts +0 -41
  218. package/build/renderable/frameAnimation.d.ts.map +1 -1
  219. package/build/renderable/groundshadow.d.ts +1 -91
  220. package/build/renderable/groundshadow.d.ts.map +1 -1
  221. package/build/renderable/imagelayer.d.ts +0 -29
  222. package/build/renderable/imagelayer.d.ts.map +1 -1
  223. package/build/renderable/instanced_mesh.d.ts +26 -104
  224. package/build/renderable/instanced_mesh.d.ts.map +1 -1
  225. package/build/renderable/mesh.d.ts +145 -140
  226. package/build/renderable/mesh.d.ts.map +1 -1
  227. package/build/renderable/nineslicesprite.d.ts +0 -4
  228. package/build/renderable/nineslicesprite.d.ts.map +1 -1
  229. package/build/renderable/renderable.d.ts +17 -54
  230. package/build/renderable/renderable.d.ts.map +1 -1
  231. package/build/renderable/sprite.d.ts +7 -52
  232. package/build/renderable/sprite.d.ts.map +1 -1
  233. package/build/renderable/sprite3d.d.ts +0 -95
  234. package/build/renderable/sprite3d.d.ts.map +1 -1
  235. package/build/renderable/text/bitmaptext.d.ts +0 -14
  236. package/build/renderable/text/bitmaptext.d.ts.map +1 -1
  237. package/build/renderable/text/bitmaptextdata.d.ts +0 -22
  238. package/build/renderable/text/bitmaptextdata.d.ts.map +1 -1
  239. package/build/renderable/text/glyph.d.ts +1 -39
  240. package/build/renderable/text/glyph.d.ts.map +1 -1
  241. package/build/renderable/text/text.d.ts +0 -20
  242. package/build/renderable/text/text.d.ts.map +1 -1
  243. package/build/renderable/text/textstyle.d.ts +1 -5
  244. package/build/renderable/text/textstyle.d.ts.map +1 -1
  245. package/build/renderable/trail.d.ts +0 -29
  246. package/build/renderable/trail.d.ts.map +1 -1
  247. package/build/renderable/trigger.d.ts +0 -6
  248. package/build/renderable/trigger.d.ts.map +1 -1
  249. package/build/renderable/ui/uibaseelement.d.ts +0 -40
  250. package/build/renderable/ui/uibaseelement.d.ts.map +1 -1
  251. package/build/renderable/ui/uispriteelement.d.ts +0 -35
  252. package/build/renderable/ui/uispriteelement.d.ts.map +1 -1
  253. package/build/state/stage.d.ts +4 -68
  254. package/build/state/stage.d.ts.map +1 -1
  255. package/build/state/state.d.ts.map +1 -1
  256. package/build/system/device.d.ts +0 -12
  257. package/build/system/device.d.ts.map +1 -1
  258. package/build/system/dom.d.ts +1 -8
  259. package/build/system/dom.d.ts.map +1 -1
  260. package/build/system/event.d.ts +1 -1
  261. package/build/system/legacy_pool.d.ts +1 -6
  262. package/build/system/legacy_pool.d.ts.map +1 -1
  263. package/build/system/platform.d.ts +21 -2
  264. package/build/system/platform.d.ts.map +1 -1
  265. package/build/system/pool.d.ts +0 -9
  266. package/build/system/pool.d.ts.map +1 -1
  267. package/build/system/save.d.ts.map +1 -1
  268. package/build/system/timer.d.ts +0 -20
  269. package/build/system/timer.d.ts.map +1 -1
  270. package/build/tweens/tween.d.ts +0 -62
  271. package/build/tweens/tween.d.ts.map +1 -1
  272. package/build/utils/array-multimap.d.ts +1 -13
  273. package/build/utils/array-multimap.d.ts.map +1 -1
  274. package/build/utils/decode.d.ts.map +1 -1
  275. package/build/utils/fetchdata.d.ts +2 -0
  276. package/build/utils/fetchdata.d.ts.map +1 -0
  277. package/build/utils/utils.d.ts +0 -13
  278. package/build/utils/utils.d.ts.map +1 -1
  279. package/build/video/blendmodes.d.ts +1 -106
  280. package/build/video/blendmodes.d.ts.map +1 -1
  281. package/build/video/buffer/index.d.ts +1 -39
  282. package/build/video/buffer/index.d.ts.map +1 -1
  283. package/build/video/buffer/vertex.d.ts +1 -82
  284. package/build/video/buffer/vertex.d.ts.map +1 -1
  285. package/build/video/canvas/canvas_renderer.d.ts +7 -25
  286. package/build/video/canvas/canvas_renderer.d.ts.map +1 -1
  287. package/build/video/canvas_factory.d.ts +1 -24
  288. package/build/video/canvas_factory.d.ts.map +1 -1
  289. package/build/video/effects/blendEffect.d.ts +0 -54
  290. package/build/video/effects/blendEffect.d.ts.map +1 -1
  291. package/build/video/effects/blur.d.ts +4 -4
  292. package/build/video/effects/blur.d.ts.map +1 -1
  293. package/build/video/effects/chromaticAberration.d.ts +5 -5
  294. package/build/video/effects/chromaticAberration.d.ts.map +1 -1
  295. package/build/video/effects/colorMatrix.d.ts +5 -15
  296. package/build/video/effects/colorMatrix.d.ts.map +1 -1
  297. package/build/video/effects/desaturate.d.ts +5 -5
  298. package/build/video/effects/desaturate.d.ts.map +1 -1
  299. package/build/video/effects/dissolve.d.ts +4 -4
  300. package/build/video/effects/dissolve.d.ts.map +1 -1
  301. package/build/video/effects/dropShadow.d.ts +5 -5
  302. package/build/video/effects/dropShadow.d.ts.map +1 -1
  303. package/build/video/effects/flash.d.ts +4 -4
  304. package/build/video/effects/flash.d.ts.map +1 -1
  305. package/build/video/effects/glow.d.ts +5 -5
  306. package/build/video/effects/glow.d.ts.map +1 -1
  307. package/build/video/effects/glsl_realization.d.ts +1 -17
  308. package/build/video/effects/glsl_realization.d.ts.map +1 -1
  309. package/build/video/effects/hologram.d.ts +4 -4
  310. package/build/video/effects/hologram.d.ts.map +1 -1
  311. package/build/video/effects/invert.d.ts +5 -5
  312. package/build/video/effects/invert.d.ts.map +1 -1
  313. package/build/video/effects/outline.d.ts +6 -6
  314. package/build/video/effects/outline.d.ts.map +1 -1
  315. package/build/video/effects/pixelate.d.ts +4 -4
  316. package/build/video/effects/pixelate.d.ts.map +1 -1
  317. package/build/video/effects/radialGradient.d.ts +2 -3
  318. package/build/video/effects/radialGradient.d.ts.map +1 -1
  319. package/build/video/effects/scanline.d.ts +6 -6
  320. package/build/video/effects/scanline.d.ts.map +1 -1
  321. package/build/video/effects/sepia.d.ts +5 -5
  322. package/build/video/effects/sepia.d.ts.map +1 -1
  323. package/build/video/effects/shadereffect.d.ts +12 -123
  324. package/build/video/effects/shadereffect.d.ts.map +1 -1
  325. package/build/video/effects/shine.d.ts +3 -3
  326. package/build/video/effects/shine.d.ts.map +1 -1
  327. package/build/video/effects/tintPulse.d.ts +4 -4
  328. package/build/video/effects/tintPulse.d.ts.map +1 -1
  329. package/build/video/effects/vignette.d.ts +6 -6
  330. package/build/video/effects/vignette.d.ts.map +1 -1
  331. package/build/video/effects/wave.d.ts +4 -4
  332. package/build/video/effects/wave.d.ts.map +1 -1
  333. package/build/video/effects/wgsl/layout.d.ts +1 -27
  334. package/build/video/effects/wgsl/layout.d.ts.map +1 -1
  335. package/build/video/effects/wgsl/parse.d.ts +1 -8
  336. package/build/video/effects/wgsl/parse.d.ts.map +1 -1
  337. package/build/video/effects/wgsl/scaffold.d.ts +1 -42
  338. package/build/video/effects/wgsl/scaffold.d.ts.map +1 -1
  339. package/build/video/effects/wgsl_realization.d.ts +1 -82
  340. package/build/video/effects/wgsl_realization.d.ts.map +1 -1
  341. package/build/video/gpu/batcher.d.ts +1 -13
  342. package/build/video/gpu/batcher.d.ts.map +1 -1
  343. package/build/video/gpu/instancerecord.d.ts +1 -163
  344. package/build/video/gpu/instancerecord.d.ts.map +1 -1
  345. package/build/video/gpu/meshchunk.d.ts +1 -48
  346. package/build/video/gpu/meshchunk.d.ts.map +1 -1
  347. package/build/video/gpu/meshvertex.d.ts +1 -53
  348. package/build/video/gpu/meshvertex.d.ts.map +1 -1
  349. package/build/video/gpu/primitives.d.ts +1 -59
  350. package/build/video/gpu/primitives.d.ts.map +1 -1
  351. package/build/video/gpu/quadcorners.d.ts +1 -10
  352. package/build/video/gpu/quadcorners.d.ts.map +1 -1
  353. package/build/video/gpu/textureslots.d.ts +1 -121
  354. package/build/video/gpu/textureslots.d.ts.map +1 -1
  355. package/build/video/gpu/texturestore.d.ts +1 -138
  356. package/build/video/gpu/texturestore.d.ts.map +1 -1
  357. package/build/video/gpu/topology.d.ts.map +1 -1
  358. package/build/video/gpu/vertexformat.d.ts +0 -28
  359. package/build/video/gpu/vertexformat.d.ts.map +1 -1
  360. package/build/video/gradient.d.ts +0 -81
  361. package/build/video/gradient.d.ts.map +1 -1
  362. package/build/video/renderer.d.ts +21 -102
  363. package/build/video/renderer.d.ts.map +1 -1
  364. package/build/video/renderstate.d.ts +0 -51
  365. package/build/video/renderstate.d.ts.map +1 -1
  366. package/build/video/rendertarget/canvasrendertarget.d.ts +0 -10
  367. package/build/video/rendertarget/canvasrendertarget.d.ts.map +1 -1
  368. package/build/video/rendertarget/render_target_pool.d.ts +1 -82
  369. package/build/video/rendertarget/render_target_pool.d.ts.map +1 -1
  370. package/build/video/rendertarget/webglrendertarget.d.ts +1 -64
  371. package/build/video/rendertarget/webglrendertarget.d.ts.map +1 -1
  372. package/build/video/rendertarget/webgpurendertarget.d.ts +0 -8
  373. package/build/video/rendertarget/webgpurendertarget.d.ts.map +1 -1
  374. package/build/video/texture/atlas.d.ts +2 -76
  375. package/build/video/texture/atlas.d.ts.map +1 -1
  376. package/build/video/texture/cache.d.ts +0 -136
  377. package/build/video/texture/cache.d.ts.map +1 -1
  378. package/build/video/texture/frametexture.d.ts +1 -71
  379. package/build/video/texture/frametexture.d.ts.map +1 -1
  380. package/build/video/texture/noise_texture2d.d.ts +0 -43
  381. package/build/video/texture/noise_texture2d.d.ts.map +1 -1
  382. package/build/video/texture/parser/aseprite.d.ts +1 -8
  383. package/build/video/texture/parser/aseprite.d.ts.map +1 -1
  384. package/build/video/texture/parser/spritesheet.d.ts +1 -8
  385. package/build/video/texture/parser/spritesheet.d.ts.map +1 -1
  386. package/build/video/texture/parser/texturepacker.d.ts +1 -8
  387. package/build/video/texture/parser/texturepacker.d.ts.map +1 -1
  388. package/build/video/texture/resource.d.ts +0 -9
  389. package/build/video/texture/resource.d.ts.map +1 -1
  390. package/build/video/texture/texture2d.d.ts +0 -11
  391. package/build/video/texture/texture2d.d.ts.map +1 -1
  392. package/build/video/utils/autodetect.d.ts +1 -5
  393. package/build/video/utils/autodetect.d.ts.map +1 -1
  394. package/build/video/webgl/batchers/batcher.d.ts +0 -55
  395. package/build/video/webgl/batchers/batcher.d.ts.map +1 -1
  396. package/build/video/webgl/batchers/lit_mesh_batcher.d.ts +0 -14
  397. package/build/video/webgl/batchers/lit_mesh_batcher.d.ts.map +1 -1
  398. package/build/video/webgl/batchers/lit_quad_batcher.d.ts +0 -72
  399. package/build/video/webgl/batchers/lit_quad_batcher.d.ts.map +1 -1
  400. package/build/video/webgl/batchers/material_batcher.d.ts +0 -89
  401. package/build/video/webgl/batchers/material_batcher.d.ts.map +1 -1
  402. package/build/video/webgl/batchers/mesh_batcher.d.ts +14 -343
  403. package/build/video/webgl/batchers/mesh_batcher.d.ts.map +1 -1
  404. package/build/video/webgl/batchers/primitive_batcher.d.ts +0 -10
  405. package/build/video/webgl/batchers/primitive_batcher.d.ts.map +1 -1
  406. package/build/video/webgl/batchers/quad_batcher.d.ts +0 -30
  407. package/build/video/webgl/batchers/quad_batcher.d.ts.map +1 -1
  408. package/build/video/webgl/buffer/index.d.ts +1 -36
  409. package/build/video/webgl/buffer/index.d.ts.map +1 -1
  410. package/build/video/webgl/buffer/instance_buffer.d.ts +1 -53
  411. package/build/video/webgl/buffer/instance_buffer.d.ts.map +1 -1
  412. package/build/video/webgl/buffer/retained_geometry.d.ts +1 -81
  413. package/build/video/webgl/buffer/retained_geometry.d.ts.map +1 -1
  414. package/build/video/webgl/buffer/uniformblock.d.ts +1 -80
  415. package/build/video/webgl/buffer/uniformblock.d.ts.map +1 -1
  416. package/build/video/webgl/buffer/vertexstate.d.ts +1 -100
  417. package/build/video/webgl/buffer/vertexstate.d.ts.map +1 -1
  418. package/build/video/webgl/glshader.d.ts +2 -51
  419. package/build/video/webgl/glshader.d.ts.map +1 -1
  420. package/build/video/webgl/lighting/pack3d.d.ts +1 -47
  421. package/build/video/webgl/lighting/pack3d.d.ts.map +1 -1
  422. package/build/video/webgl/lighting/std140.d.ts +1 -109
  423. package/build/video/webgl/lighting/std140.d.ts.map +1 -1
  424. package/build/video/webgl/renderers/tmxlayer/orthogonal.d.ts +1 -103
  425. package/build/video/webgl/renderers/tmxlayer/orthogonal.d.ts.map +1 -1
  426. package/build/video/webgl/shaders/multitexture-lit.d.ts +1 -26
  427. package/build/video/webgl/shaders/multitexture-lit.d.ts.map +1 -1
  428. package/build/video/webgl/shaders/multitexture.d.ts +1 -9
  429. package/build/video/webgl/shaders/multitexture.d.ts.map +1 -1
  430. package/build/video/webgl/texture/store.d.ts +1 -50
  431. package/build/video/webgl/texture/store.d.ts.map +1 -1
  432. package/build/video/webgl/utils/attributes.d.ts +1 -11
  433. package/build/video/webgl/utils/attributes.d.ts.map +1 -1
  434. package/build/video/webgl/utils/maxtextures.d.ts +1 -36
  435. package/build/video/webgl/utils/maxtextures.d.ts.map +1 -1
  436. package/build/video/webgl/utils/precision.d.ts +1 -14
  437. package/build/video/webgl/utils/precision.d.ts.map +1 -1
  438. package/build/video/webgl/utils/program.d.ts +1 -5
  439. package/build/video/webgl/utils/program.d.ts.map +1 -1
  440. package/build/video/webgl/utils/samplercache.d.ts +1 -68
  441. package/build/video/webgl/utils/samplercache.d.ts.map +1 -1
  442. package/build/video/webgl/utils/string.d.ts +1 -21
  443. package/build/video/webgl/utils/string.d.ts.map +1 -1
  444. package/build/video/webgl/utils/topology.d.ts +1 -23
  445. package/build/video/webgl/utils/topology.d.ts.map +1 -1
  446. package/build/video/webgl/utils/uniforms.d.ts +1 -25
  447. package/build/video/webgl/utils/uniforms.d.ts.map +1 -1
  448. package/build/video/webgl/utils/vertexformat.d.ts +1 -26
  449. package/build/video/webgl/utils/vertexformat.d.ts.map +1 -1
  450. package/build/video/webgl/webgl_renderer.d.ts +24 -286
  451. package/build/video/webgl/webgl_renderer.d.ts.map +1 -1
  452. package/build/video/webgpu/batchers/lit_mesh_batcher.d.ts +0 -6
  453. package/build/video/webgpu/batchers/lit_mesh_batcher.d.ts.map +1 -1
  454. package/build/video/webgpu/batchers/lit_quad_batcher.d.ts +0 -8
  455. package/build/video/webgpu/batchers/lit_quad_batcher.d.ts.map +1 -1
  456. package/build/video/webgpu/batchers/mesh_batcher.d.ts +1 -230
  457. package/build/video/webgpu/batchers/mesh_batcher.d.ts.map +1 -1
  458. package/build/video/webgpu/batchers/primitive_batcher.d.ts.map +1 -1
  459. package/build/video/webgpu/batchers/quad_batcher.d.ts +0 -82
  460. package/build/video/webgpu/batchers/quad_batcher.d.ts.map +1 -1
  461. package/build/video/webgpu/buffer/arena.d.ts +1 -63
  462. package/build/video/webgpu/buffer/arena.d.ts.map +1 -1
  463. package/build/video/webgpu/buffer/instance_buffer.d.ts +1 -64
  464. package/build/video/webgpu/buffer/instance_buffer.d.ts.map +1 -1
  465. package/build/video/webgpu/buffer/retained_geometry.d.ts +1 -54
  466. package/build/video/webgpu/buffer/retained_geometry.d.ts.map +1 -1
  467. package/build/video/webgpu/buffer/uniformring.d.ts +1 -67
  468. package/build/video/webgpu/buffer/uniformring.d.ts.map +1 -1
  469. package/build/video/webgpu/effect_binding.d.ts +1 -16
  470. package/build/video/webgpu/effect_binding.d.ts.map +1 -1
  471. package/build/video/webgpu/pipeline/bindgroups.d.ts +1 -32
  472. package/build/video/webgpu/pipeline/bindgroups.d.ts.map +1 -1
  473. package/build/video/webgpu/pipeline/cache.d.ts +1 -163
  474. package/build/video/webgpu/pipeline/cache.d.ts.map +1 -1
  475. package/build/video/webgpu/renderers/tmxlayer/orthogonal.d.ts +1 -87
  476. package/build/video/webgpu/renderers/tmxlayer/orthogonal.d.ts.map +1 -1
  477. package/build/video/webgpu/shaders/mesh-instanced.d.ts +1 -43
  478. package/build/video/webgpu/shaders/mesh-instanced.d.ts.map +1 -1
  479. package/build/video/webgpu/texture/compressed.d.ts +1 -32
  480. package/build/video/webgpu/texture/compressed.d.ts.map +1 -1
  481. package/build/video/webgpu/texture/frametexture.d.ts +1 -62
  482. package/build/video/webgpu/texture/frametexture.d.ts.map +1 -1
  483. package/build/video/webgpu/texture/store.d.ts +1 -147
  484. package/build/video/webgpu/texture/store.d.ts.map +1 -1
  485. package/build/video/webgpu/webgpu_renderer.d.ts +2 -89
  486. package/build/video/webgpu/webgpu_renderer.d.ts.map +1 -1
  487. package/package.json +8 -11
  488. package/skills/AGENTS.md +67 -0
  489. package/skills/melonjs/SKILL.md +156 -0
  490. package/skills/melonjs-20-migration/SKILL.md +160 -0
  491. package/skills/melonjs-3d/SKILL.md +525 -0
  492. package/skills/melonjs-3d-assets/SKILL.md +258 -0
  493. package/skills/melonjs-audio/SKILL.md +236 -0
  494. package/skills/melonjs-camera-and-drawing/SKILL.md +175 -0
  495. package/skills/melonjs-deployment/SKILL.md +113 -0
  496. package/skills/melonjs-effects-and-shaders/SKILL.md +178 -0
  497. package/skills/melonjs-events/SKILL.md +159 -0
  498. package/skills/melonjs-getting-started/SKILL.md +183 -0
  499. package/skills/melonjs-input/SKILL.md +166 -0
  500. package/skills/melonjs-lighting/SKILL.md +139 -0
  501. package/skills/melonjs-loading-assets/SKILL.md +186 -0
  502. package/skills/melonjs-particles-and-trails/SKILL.md +136 -0
  503. package/skills/melonjs-performance/SKILL.md +183 -0
  504. package/skills/melonjs-physics/SKILL.md +321 -0
  505. package/skills/melonjs-plugins/SKILL.md +191 -0
  506. package/skills/melonjs-renderables/SKILL.md +214 -0
  507. package/skills/melonjs-renderer-backends/SKILL.md +173 -0
  508. package/skills/melonjs-scenes-and-state/SKILL.md +180 -0
  509. package/skills/melonjs-sprites-and-animation/SKILL.md +173 -0
  510. package/skills/melonjs-tilemaps/SKILL.md +213 -0
  511. package/skills/melonjs-ui-and-text/SKILL.md +65 -0
  512. package/build/audio/backend.d.ts +0 -140
  513. package/build/audio/backend.d.ts.map +0 -1
  514. package/build/loader/parsers/fetchdata.d.ts +0 -32
  515. package/build/loader/parsers/fetchdata.d.ts.map +0 -1
package/README.md CHANGED
@@ -5,19 +5,18 @@ melonJS 2
5
5
  [![Build Status](https://github.com/melonjs/melonJS/actions/workflows/main.yml/badge.svg)](https://github.com/melonjs/melonJS/actions/workflows/main.yml)
6
6
  [![NPM Package](https://img.shields.io/npm/v/melonjs)](https://www.npmjs.com/package/melonjs)
7
7
  [![NPM Downloads](https://img.shields.io/npm/dm/melonjs)](https://www.npmjs.com/package/melonjs)
8
- [![Build Size](https://badgen.net/bundlephobia/minzip/melonjs)](https://bundlephobia.com/result?p=melonjs)
9
- [![Tree-shaking](https://badgen.net/bundlephobia/tree-shaking/melonjs)](https://bundlephobia.com/result?p=melonjs)
8
+ [![Build Size](https://img.shields.io/bundlejs/size/melonjs?label=minzip)](https://bundlejs.com/?q=melonjs)
10
9
  [![jsDelivr](https://data.jsdelivr.com/v1/package/npm/melonjs/badge?style=rounded)](https://www.jsdelivr.com/package/npm/melonjs)
11
10
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE.md)
12
11
  [![Discord](https://img.shields.io/discord/608636676461428758?color=7289da&label=discord)](https://discord.gg/aur7JMk)
13
12
  [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md)
14
13
 
15
14
 
16
- A modern & lightweight HTML5 game engine
15
+ A modern & fully featured HTML5 game engine
17
16
  -------------------------------------------------------------------------------
18
17
  ![melonJS](https://melonjs.org/img/alex4-github.png)
19
18
 
20
- [melonJS](https://melonjs.org/) is an open-source 2.5D game engine designed for indie developers — perspective and orthogonal cameras, GPU-accelerated tilemap rendering, post-processing effects, custom shaders, 3D mesh support, polygon-accurate physics, modern Tiled workflows, and high performance. Runs on WebGPU, WebGL 2 or Canvas2D with automatic fallback, tree-shakeable so you only pay for what you use, and the entire engine fits in ~150 KB minzipped of vanilla JS/TS with no toolchain lock-in. Built with ES6 classes and bundled with [esbuild](https://esbuild.github.io).
19
+ [melonJS](https://melonjs.org/) is an open-source 2.5D game engine designed for indie developers — perspective and orthogonal cameras, GPU-accelerated tilemap rendering, post-processing effects, custom shaders, 3D mesh support, polygon-accurate physics, modern Tiled workflows, and high performance. Runs on WebGPU, WebGL 2 or Canvas2D with automatic fallback. The whole engine is ~250 KB minzipped of vanilla JS/TS, with no dependencies and no toolchain lock-in. Built with modern class syntax and bundled with [esbuild](https://esbuild.github.io).
21
20
 
22
21
  [melonJS](https://melonjs.org/) is licensed under the [MIT License](LICENSE.md) and actively maintained by the team at AltByte in Singapore.
23
22
 
@@ -34,7 +33,7 @@ melonJS is designed so you can **focus on making games, not on graphics plumbing
34
33
 
35
34
  - **Scenes, loaded in one call** — `level.load(name)` brings an authored scene straight into your world. [Tiled](https://www.mapeditor.org) is a first-class citizen for **2D** — orthogonal, isometric, hexagonal & staggered maps, animated tilesets, collision shapes, object properties, compressed formats, with GPU-accelerated tile rendering on the GPU backends — and **glTF / GLB** is the equivalent for **3D scenes**: author in Blender (or any DCC tool), export a `.glb`, and the whole scene — meshes, materials, cameras, lights, and node animation — loads under a `Camera3d`, no per-mesh wiring. Animated models play back through the same animation API as a 2D `Sprite`.
36
35
 
37
- - **Batteries included, hackable by design** — Get started in minutes with minimal setup. When you need to go deeper: ES6 classes throughout, a plugin system for engine extensions, and a clean architecture that's easy to extend without fighting the framework.
36
+ - **Batteries included, hackable by design** — Get started in minutes with minimal setup. When you need to go deeper: modern class-based architecture, a plugin system for engine extensions, and a clean architecture that's easy to extend without fighting the framework.
38
37
 
39
38
  About melonJS
40
39
  -------------------------------------------------------------------------------
@@ -263,7 +262,8 @@ See the [Migrating to the Physics Adapter API](https://github.com/melonjs/melonJ
263
262
  Installation
264
263
  -------------------------------------------------------------------------------
265
264
 
266
- melonJS is distributed as a tree-shakeable ES6 module with TypeScript declarations included.
265
+ melonJS is distributed as a tree-shakeable ES module with TypeScript declarations included.
266
+ The published bundle targets **ES2022** — transpile it if you need to support older browsers.
267
267
 
268
268
  Install via [npm](https://www.npmjs.com/package/melonjs) :
269
269
 
@@ -278,14 +278,92 @@ import { Application, Sprite, loader } from 'melonjs';
278
278
  Or use it directly via [jsDelivr](https://www.jsdelivr.com/package/npm/melonjs) CDN :
279
279
 
280
280
  ```html
281
- <!-- load the ES6 module bundle of melonJS v19.x -->
282
- <script type="module" src="https://cdn.jsdelivr.net/npm/melonjs@19/+esm"></script>
281
+ <!-- load the ES module bundle of melonJS v20.x -->
282
+ <script type="module" src="https://cdn.jsdelivr.net/npm/melonjs@20/+esm"></script>
283
283
  <!-- omit the version completely to get the latest one -->
284
284
  <!-- you should NOT use this in production -->
285
285
  <script type="module" src="https://cdn.jsdelivr.net/npm/melonjs/+esm"></script>
286
286
  ```
287
287
  > Note: the debug plugin is available separately as [`@melonjs/debug-plugin`](https://www.npmjs.com/package/@melonjs/debug-plugin)
288
288
 
289
+ ### Supporting older browsers
290
+
291
+ The published bundle targets ES2022, so it uses private class members and other
292
+ modern syntax. A browser that predates those cannot parse the file at all — this
293
+ fails at load, not at the point a feature is used.
294
+
295
+ To support older browsers, transpile melonJS **together with your own code**.
296
+ The usual trap is that build setups skip `node_modules` by default, which leaves
297
+ melonJS untouched no matter how low you set your target.
298
+
299
+ With [Vite](https://vite.dev) :
300
+
301
+ ```javascript
302
+ // vite.config.js
303
+ export default {
304
+ build: {
305
+ // esbuild downlevels dependencies too, melonjs included
306
+ target: "es2020",
307
+ },
308
+ };
309
+ ```
310
+
311
+ With Babel, make sure melonJS is not excluded :
312
+
313
+ ```javascript
314
+ // webpack.config.js
315
+ {
316
+ test: /\.js$/,
317
+ // the default `exclude: /node_modules/` would skip melonjs
318
+ exclude: /node_modules\/(?!melonjs)/,
319
+ use: "babel-loader",
320
+ }
321
+ ```
322
+
323
+ Transpiling costs some size and speed: private class members become `WeakMap`
324
+ lookups, which are on hot paths in the renderer. Only reach for it if you have
325
+ users on browsers that need it.
326
+
327
+ Building with AI agents
328
+ -------------------------------------------------------------------------------
329
+
330
+ melonJS ships **skills** — guidance files that teach AI coding assistants the
331
+ engine's conventions and, more usefully, the mistakes that fail silently rather
332
+ than raising an error.
333
+
334
+ They are versioned with the engine and ship inside the package, at
335
+ `node_modules/melonjs/skills/` — so a copy matching the exact release you are
336
+ running is always on disk.
337
+
338
+ Install them into whatever assistant you use, with one command :
339
+
340
+ ```bash
341
+ npx skills add https://github.com/melonjs/melonJS/tree/master/packages/melonjs/skills
342
+ ```
343
+
344
+ It detects the assistants in your project and installs one copy of each skill
345
+ under `.agents/skills/<skill-name>`, then symlinks that copy into every
346
+ assistant's own directory, so `.claude/skills/melonjs` points back at
347
+ `.agents/skills/melonjs` and there is nothing to place by hand. It reports the
348
+ assistants it covers as it runs (77 of them at the time of writing). Add
349
+ `-a claude-code -a cursor` to target specific ones.
350
+
351
+ The set includes an `AGENTS.md` for anything following that convention (Codex,
352
+ Cursor, Gemini CLI); GitHub Copilot reads the same content from
353
+ `.github/copilot-instructions.md`. It names the three rules that produce code
354
+ which runs and is wrong, and links the API index below — if you already keep an
355
+ `AGENTS.md`, paste its sections into yours.
356
+
357
+ The command installs from `master`. To pin to the release you are running,
358
+ point it at that tag instead of `master` in the URL above.
359
+
360
+ The skills are plain markdown and can be read by any agent, or by a human.
361
+
362
+ For anything the skills do not cover, the complete API is indexed for agents at
363
+ [llms.txt](https://melonjs.github.io/melonJS/llms.txt) — every exported class,
364
+ function and type with a one-line summary and a link to its reference page,
365
+ regenerated on every docs build.
366
+
289
367
  Community
290
368
  -------------------------------------------------------------------------------
291
369
  Join us and get help or share your projects :
@@ -102,12 +102,6 @@ export default class Application {
102
102
  accumulatorMax: number;
103
103
  accumulatorUpdateDelta: number;
104
104
  stepSize: number;
105
- private _onResize?;
106
- private _onOrientationChange?;
107
- private _onScroll?;
108
- private _doResize?;
109
- private _resizeObserver;
110
- private _destroyed;
111
105
  /**
112
106
  * Simulated time advanced by one logic step, in ms — what `world.update()`
113
107
  * receives. Fixed at `1000 / world.fps` unless `timer.interpolation` is on,
@@ -307,12 +301,6 @@ export default class Application {
307
301
  * spawnImpactParticles();
308
302
  */
309
303
  freeze(duration: number, music?: boolean): Promise<void>;
310
- /** @ignore */
311
- _tick(time: number): void;
312
- /** @ignore */
313
- _onBlur(): void;
314
- /** @ignore */
315
- _onFocus(): void;
316
304
  /**
317
305
  * update all objects related to this game active scene/stage
318
306
  * @param time - current timestamp as provided by the RAF callback
@@ -330,9 +318,4 @@ export default class Application {
330
318
  * (e.g. from {@link Stage#onResetEvent} or {@link Renderable#parentApp}).
331
319
  */
332
320
  export declare let game: Application;
333
- /**
334
- * Set the default game application instance.
335
- * @ignore
336
- */
337
- export declare function setDefaultGame(app: Application): void;
338
321
  //# sourceMappingURL=application.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../src/application/application.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AAGpD,OAAO,KAAK,MAAM,qBAAqB,CAAC;AA8BxC,OAAO,KAAK,QAAQ,MAAM,wBAAwB,CAAC;AAQnD,OAAO,KAAK,EACX,mBAAmB,EACnB,2BAA2B,EAC3B,MAAM,eAAe,CAAC;AAgEvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,CAAC,OAAO,OAAO,WAAW;IAC/B;;OAEG;IACH,aAAa,EAAE,WAAW,CAAC;IAE3B;;OAEG;IACH,QAAQ,EAAG,QAAQ,CAAC;IAEpB;;OAEG;IACH,QAAQ,EAAG,QAAQ,CAAC;IAEpB;;;OAGG;IACH,KAAK,EAAE,KAAK,CAAC;IAEb;;;;OAIG;IACH,UAAU,EAAE,OAAO,CAAC;IAEpB;;;;;OAKG;IACH,UAAU,EAAE,mBAAmB,CAAC;IAEhC;;;OAGG;IACH,aAAa,EAAE,OAAO,CAAC;IAEvB;;OAEG;IACH,QAAQ,EAAE,2BAA2B,CAAC;IAEtC;;;;;;OAMG;IACH,WAAW,EAAE,OAAO,CAAC;IAErB;;;OAGG;IACH,aAAa,EAAE,OAAO,CAAC;IAEvB;;;OAGG;IACH,UAAU,EAAE,OAAO,CAAC;IAGpB,OAAO,EAAE,OAAO,CAAC;IAGjB,aAAa,EAAE,OAAO,CAAC;IAGvB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAGlB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,sBAAsB,EAAE,MAAM,C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,GAAG,GAAG,OAAO,CAEtC;IACD,IAAI,MAAM,CAAC,KAAK,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,OAAO,EAE1C;IAED;;;;;;OAMG;IACH,aAAa,IAAI,IAAI;IAErB;;;;OAIG;IACH,eAAe,IAAI,IAAI;IAevB;;;OAGG;IACH,gBAAgB,IAAI,WAAW;IAI/B;;;;;;OAMG;IACH,YAAY,IAAI,OAAO;IAIvB;;;;;;;;;;;;;;;;;OAiBG;IACH,iBAAiB,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI;IAgB1C;;;OAGG;IACH,cAAc,IAAI,IAAI;IActB;;;;;OAKG;IACH,IAAI,MAAM,IAAI,iBAAiB,CAE9B;IAED;;;;;;;OAOG;IACH,MAAM,IAAI,IAAI;IAId;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,YAAY,GAAE,OAAc,GAAG,IAAI;IAmE3C;;OAEG;IACH,OAAO,IAAI,IAAI;IAIf;;;;;;OAMG;IACH,KAAK,CAAC,KAAK,GAAE,OAAe,GAAG,IAAI;IAInC;;;OAGG;IACH,MAAM,CAAC,KAAK,GAAE,OAAe,GAAG,IAAI;IAIpC;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,GAAE,OAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAuC/D;;;OAGG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IA+C1B;;OAEG;IACH,IAAI,IAAI,IAAI;CA0CZ;AAED;;;;;GAKG;AACH,eAAO,IAAI,IAAI,EAAE,WAAW,CAAC"}
@@ -207,8 +207,9 @@ export type ApplicationSettings = {
207
207
  */
208
208
  consoleHeader: boolean;
209
209
  /**
210
- * the default blend mode to use. Every renderer supports the full set —
211
- * see {@link CanvasRenderer#setBlendMode} for the list.
210
+ * the default blend mode to use. Both GPU renderers support the full set;
211
+ * the Canvas fallback supports every mode except `"none"` — see
212
+ * {@link CanvasRenderer#setBlendMode} for the list.
212
213
  * @default "normal"
213
214
  */
214
215
  blendMode: BlendMode;
@@ -338,6 +339,9 @@ export type ApplicationSettings = {
338
339
  /**
339
340
  * Resolved application settings after init() has processed the input.
340
341
  * Includes computed properties not present in the user-facing settings.
342
+ * Hidden from the docs but deliberately kept in the emitted `.d.ts`: another
343
+ * emitted declaration imports this type, so removing it would leave a dangling
344
+ * import in the published types.
341
345
  * @ignore
342
346
  */
343
347
  export type ResolvedApplicationSettings = ApplicationSettings & {
@@ -1 +1 @@
1
- {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/application/settings.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,KAAK,QAAQ,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,QAAQ,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,KAAK,SAAS,GACX,QAAQ,GACR,UAAU,GACV,SAAS,GACT,UAAU,GACV,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,WAAW,GACX,MAAM,GACN,SAAS,GACT,YAAY,GACZ,aAAa,GACb,YAAY,GACZ,YAAY,GACZ,YAAY,CAAC;AAEhB;;;;;;;;GAQG;AACH,KAAK,WAAW,GACb,SAAS,GACT,MAAM,GACN,cAAc,GACd;IAAE,OAAO,EAAE,cAAc,CAAA;CAAE,CAAC;AAE/B,KAAK,eAAe,GAAG,SAAS,GAAG,WAAW,GAAG,kBAAkB,CAAC;AAEpE,MAAM,MAAM,mBAAmB,GAAG;IACjC;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,QAAQ,EAAE,YAAY,GAAG,QAAQ,CAAC;IAElC;;;OAGG;IACH,KA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AO,EAAE,OAAO,CAAC;IAEjB;;;;;OAKG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;;;OAIG;IACH,UAAU,CAAC,EAAE,CAAC,KAAK,QAAQ,EAAE,GAAG,KAAK,YAAY,CAAC,GAAG,SAAS,CAAC;IAE/D;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,QAAQ,EAAE,GAAG,KAAK,YAAY,CAAC,GAAG,SAAS,CAAC;IAE5D;;;;;;;;;;;;;;;;;;OAkBG;IACH,WAAW,CAAC,EAAE,KACb,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,KACR,QAAQ,CAAC;CACd,GAAG,CACD;IACA;;OAEG;IACH,MAAM,EAAE,MAAM,GAAG,WAAW,CAAC;IAC7B,MAAM,CAAC,EAAE,KAAK,CAAC;CACd,GACD;IACA,MAAM,CAAC,EAAE,KAAK,CAAC;IACf;;;OAGG;IACH,MAAM,EAAE,iBAAiB,CAAC;CACzB,CACH,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,2BAA2B,GAAG,mBAAmB,GAAG;IAC/D,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACd,CAAC"}
@@ -14,9 +14,9 @@
14
14
  * This file owns the remaining lifecycle / track / mix / unload
15
15
  * helpers, plus the barrel re-exports that compose the namespace.
16
16
  */
17
- export { getAudioContext, getMasterGain, setStopOnAudioError, stopOnAudioError, } from "./backend.ts";
18
- export { fade, load, orientation, panner, pause, play, position, rate, resume, seek, stereo, stop, } from "./playback.ts";
17
+ export { duration, fade, load, orientation, panner, pause, play, playing, position, rate, resume, seek, state, stereo, stop, } from "./playback.ts";
19
18
  export { noise, tone } from "./procedural.ts";
19
+ export { getAudioContext, getMasterGain, setStopOnAudioError, stopOnAudioError, } from "./state.ts";
20
20
  export type { LoadSettings, NoiseFilter, NoiseOptions, PannerAttributes, SoundAsset, ToneOptions, } from "./types.ts";
21
21
  /**
22
22
  * Initialize and configure the audio module.
@@ -1 +1 @@
1
- {"version":3,"file":"audio.d.ts","sourceRoot":"","sources":["../../src/audio/audio.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAeH,OAAO,EACN,eAAe,EACf,aAAa,EACb,mBAAmB,EACnB,gBAAgB,GAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EACN,IAAI,EACJ,IAAI,EACJ,WAAW,EACX,MAAM,EACN,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,MAAM,EACN,IAAI,GACJ,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE9C,YAAY,EACX,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,WAAW,GACX,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,IAAI,CAAC,MAAM,GAAE,MAAc,GAAG,OAAO,CAGpD;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEhD;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,IAAI,OAAO,CAElC;AAED;;;;GAIG;AACH,wBAAgB,MAAM,IAAI,IAAI,CAE7B;AAED;;;GAGG;AACH,wBAAgB,OAAO,IAAI,IAAI,CAE9B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAGrE;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,IAAI,IAAI,CAKhC;AAED;;;;;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ED;;;GAGG;AACH,wBAAgB,OAAO,IAAI,IAAI,CAE9B;AAED;;;GAGG;AACH,wBAAgB,SAAS,IAAI,IAAI,CAEhC;AAED;;;;GAIG;AACH,wBAAgB,KAAK,IAAI,OAAO,CAE/B;AAED;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAoBlD;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,IAAI,IAAI,CAMhC"}
@@ -0,0 +1,26 @@
1
+ import type { Sound } from "./core.ts";
2
+ /**
3
+ * Fetches the bytes for an audio URL.
4
+ *
5
+ * Defaults to the engine's shared transport, which falls back to XHR for `file:`
6
+ * URLs — `fetch()` cannot read that scheme in a Cordova or Capacitor WebView.
7
+ * {@link setAudioFetcher} overrides it, for a custom transport or a test.
8
+ *
9
+ * The default is a working implementation rather than a stub that must be
10
+ * installed, because a rejection here is not reported as an error: it tells the
11
+ * backend to abandon Web Audio for that clip and fall back to a streaming HTML5
12
+ * element. An un-installed stub would therefore degrade every network clip
13
+ * silently instead of failing loudly.
14
+ */
15
+ export type AudioFetcher = (url: string, options: {
16
+ withCredentials?: boolean | undefined;
17
+ }) => Promise<ArrayBuffer>;
18
+ /**
19
+ * Install the function the backend uses to fetch audio bytes.
20
+ * @param fetcher - obtains the bytes for a URL, rejecting on failure
21
+ */
22
+ export declare const setAudioFetcher: (fetcher: AudioFetcher) => void;
23
+ export declare const loadBuffer: (self: Sound) => void;
24
+ export declare const decodeAudioData: (arraybuffer: ArrayBuffer, self: Sound) => void;
25
+ export declare const loadSound: (self: Sound, buffer?: AudioBuffer) => void;
26
+ //# sourceMappingURL=buffer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buffer.d.ts","sourceRoot":"","sources":["../../../src/audio/backend/buffer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAIvC;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,YAAY,GAAG,CAC1B,GAAG,EAAE,MAAM,EACX,OAAO,EAAE;IAAE,eAAe,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAAE,KAC9C,OAAO,CAAC,WAAW,CAAC,CAAC;AAO1B;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,SAAS,YAAY,SAEpD,CAAC;AAuBF,eAAO,MAAM,UAAU,GAAI,MAAM,KAAK,SAgCrC,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,aAAa,WAAW,EAAE,MAAM,KAAK,SAsBpE,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,MAAM,KAAK,EAAE,SAAS,WAAW,SAiB1D,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../src/audio/backend/cache.ts"],"names":[],"mappings":""}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Constructs the singleton engine instance and re-exports the core types.
3
+ *
4
+ * Split from `index.ts` so `voice.ts` and `sound.ts` can reach the singleton
5
+ * without importing the public barrel, which would be a cycle.
6
+ */
7
+ import { AudioEngine } from "./engine.ts";
8
+ import { Sound } from "./sound.ts";
9
+ import type { SpatialAudioEngine } from "./spatial.ts";
10
+ import { Voice } from "./voice.ts";
11
+ /**
12
+ * The global audio controller singleton.
13
+ *
14
+ * Upstream shipped spatial audio as an opt-in plugin behind a registry. There
15
+ * was only ever one plugin, so the registry was pure indirection: spatial is
16
+ * installed directly by the engine constructor and the singleton is typed
17
+ * `SpatialAudioEngine`.
18
+ */
19
+ declare const audioEngine: SpatialAudioEngine;
20
+ export { cache } from "./cache.ts";
21
+ export type { AudioBufferSourceNodeWithLegacy, EventListener, GainNodeWithBufferSource, HTMLAudioElementWithUnlocked, QueueItem, SoundOptions, WindowWithAudio, } from "./types.ts";
22
+ export { isGainNode, isHTMLAudioElement } from "./types.ts";
23
+ export { AudioEngine, audioEngine, Sound, Voice };
24
+ //# sourceMappingURL=core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../src/audio/backend/core.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC;;;;;;;GAOG;AACH,QAAA,MAAM,WAAW,EAAwB,kBAAkB,CAAC;AAE5D,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,YAAY,EACX,+BAA+B,EAC/B,aAAa,EACb,wBAAwB,EACxB,4BAA4B,EAC5B,SAAS,EACT,YAAY,EACZ,eAAe,GACf,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC"}
@@ -0,0 +1,35 @@
1
+ import type { Sound } from "./sound.ts";
2
+ import { type HTMLAudioElementWithUnlocked } from "./types.ts";
3
+ export declare class AudioEngine {
4
+ html5PoolSize: number;
5
+ sounds: Sound[];
6
+ masterGain: GainNode | null;
7
+ noAudio: boolean;
8
+ usingWebAudio: boolean;
9
+ autoSuspend: boolean;
10
+ ctx: AudioContext | null;
11
+ autoUnlock: boolean;
12
+ state: string;
13
+ constructor();
14
+ volume(vol?: number): number | this;
15
+ mute(muted: boolean): this;
16
+ stop(): this;
17
+ unload(): this;
18
+ codecs(ext: string): boolean;
19
+ /**
20
+ * Create the shared `AudioContext` and master gain node if they do not exist
21
+ * yet, and return the context.
22
+ *
23
+ * Idempotent: with a context already live this returns it untouched. It used
24
+ * to be a free function in `helpers/` that reached back into the singleton,
25
+ * with no internal guard — so six call sites each carried their own
26
+ * `if (!ctx)` check to stop a second context being built and the first
27
+ * leaked.
28
+ *
29
+ * Browsers create a context in the `suspended` state until a user gesture
30
+ * resumes it, so building one early costs nothing and plays nothing.
31
+ * @returns the shared context, or `null` when Web Audio is unavailable
32
+ */
33
+ ensureContext(): AudioContext | null;
34
+ }
35
+ //# sourceMappingURL=engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../../src/audio/backend/engine.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,OAAO,EACN,KAAK,4BAA4B,EAGjC,MAAM,YAAY,CAAC;AAEpB,qBAAa,WAAW;IAWvB,aAAa,EAAE,MAAM,CAAM;IAM3B,MAAM,EAAE,KAAK,EAAE,CAAM;IAqBrB,UAAU,EAAE,QAAQ,GAAG,IAAI,CAAQ;IACnC,OAAO,EAAE,OAAO,CAAS;IACzB,aAAa,EAAE,OAAO,CAAQ;IAC9B,WAAW,EAAE,OAAO,CAAQ;IAC5B,GAAG,EAAE,YAAY,GAAG,IAAI,CAAQ;IAChC,UAAU,EAAE,OAAO,CAAQ;IAC3B,KAAK,EAAE,MAAM,CAAe;;IAqD5B,MAAM,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAoCnC,IAAI,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IA2B1B,IAAI,IAAI,IAAI;IAQZ,MAAM,IAAI,IAAI;IAkBd,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAI5B;;;;;;;;;;;;;OAaG;IACH,aAAa,IAAI,YAAY,GAAG,IAAI;IAmCpC,MAAM,IAAI,IAAI;IAmCd,YAAY,IAAI,IAAI;IAqEpB,YAAY,IAAI,IAAI;IAiGpB,iBAAiB,IAAI,4BAA4B;IAoCjD,kBAAkB,CAAC,KAAK,EAAE,4BAA4B,GAAG,IAAI;IAQ7D,YAAY,IAAI,IAAI;IA6CpB,WAAW,IAAI,IAAI;CAsDnB"}
@@ -0,0 +1,29 @@
1
+ import { type HTMLAudioElementWithUnlocked, type SoundOptions } from "./types.ts";
2
+ import { Voice } from "./voice.ts";
3
+ declare class Sound {
4
+ constructor(o: SoundOptions);
5
+ init(o: SoundOptions): this;
6
+ load(): this;
7
+ play(sprite?: string | number, internal?: boolean): number | null;
8
+ pause(id?: number, internal?: boolean): this;
9
+ stop(id?: number, internal?: boolean): this;
10
+ mute(muted: boolean, id?: number): boolean | this;
11
+ volume(): number;
12
+ volume(vol: number, id?: number, internal?: boolean): this;
13
+ fade(from: number, to: number, len: number, id?: number): this;
14
+ loop(): boolean;
15
+ loop(loop: boolean, id?: number): this;
16
+ rate(): number;
17
+ rate(rate: number, id?: number): this;
18
+ seek(): number;
19
+ seek(seek: number, id?: number): this;
20
+ playing(id?: number): boolean;
21
+ duration(id?: number): number;
22
+ state(): string;
23
+ unload(): null;
24
+ on(event: string, fn: (...args: unknown[]) => void, id?: number, once?: boolean): this;
25
+ off(event: string, fn?: (...args: unknown[]) => void, id?: number): this;
26
+ once(event: string, fn: (...args: unknown[]) => void, id?: number): this;
27
+ }
28
+ export { Sound };
29
+ //# sourceMappingURL=sound.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sound.d.ts","sourceRoot":"","sources":["../../../src/audio/backend/sound.ts"],"names":[],"mappings":"AAKA,OAAO,EAEN,KAAK,4BAA4B,EAIjC,KAAK,YAAY,EACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,cAAM,KAAK;gBA2KE,CAAC,EAAE,YAAY;IAW3B,IAAI,CAAC,CAAC,EAAE,YAAY,GAAG,IAAI;IA0H3B,IAAI,IAAI,IAAI;IA6EZ,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,GA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ions with spatial audio properties.
5
+ * Use this interface when creating a Sound instance with spatial audio capabilities.
6
+ * @example
7
+ * ```typescript
8
+ * const sound = new Sound({
9
+ * src: ['sound.mp3'],
10
+ * pos: [10, 20, 30],
11
+ * stereo: 0.5,
12
+ * distanceModel: 'inverse'
13
+ * } as SpatialSoundOptions);
14
+ * ```
15
+ */
16
+ /** Panner attributes a spatial sound can be configured with. */
17
+ export interface PannerAttrOptions {
18
+ /** Inner angle of the sound cone in degrees. */
19
+ coneInnerAngle: number;
20
+ /** Outer angle of the sound cone in degrees. */
21
+ coneOuterAngle: number;
22
+ /** Gain value outside the outer cone (0.0 to 1.0). */
23
+ coneOuterGain: number;
24
+ /** Distance model algorithm. */
25
+ distanceModel: "linear" | "inverse" | "exponential";
26
+ /** Maximum distance for the distance model. */
27
+ maxDistance: number;
28
+ /** Panning model algorithm. */
29
+ panningModel: "equalpower" | "HRTF";
30
+ /** Reference distance for the distance model. */
31
+ refDistance: number;
32
+ /** Rolloff factor for the distance model. */
33
+ rolloffFactor: number;
34
+ }
35
+ export interface SpatialSoundOptions extends SoundOptions {
36
+ /** 3D position of the sound source [x, y, z]. */
37
+ pos?: [number, number, number];
38
+ /** Orientation vector of the sound source [x, y, z]. */
39
+ orientation?: [number, number, number];
40
+ /** Stereo panning value from -1.0 (left) to 1.0 (right). */
41
+ stereo?: number;
42
+ /** Inner angle of the sound cone in degrees. Default: `360` */
43
+ coneInnerAngle?: number;
44
+ /** Outer angle of the sound cone in degrees. Default: `360` */
45
+ coneOuterAngle?: number;
46
+ /** Gain value outside the outer cone. Range: 0.0 to 1.0. Default: `0` */
47
+ coneOuterGain?: number;
48
+ /** Distance model algorithm: 'linear', 'inverse', or 'exponential'. Default: `'inverse'` */
49
+ distanceModel?: "linear" | "inverse" | "exponential";
50
+ /** Maximum distance for the distance model. Default: `10000` */
51
+ maxDistance?: number;
52
+ /** Panning model: 'equalpower' or 'HRTF'. Default: `'HRTF'` */
53
+ panningModel?: "equalpower" | "HRTF";
54
+ /** Reference distance for the distance model. Default: `1` */
55
+ refDistance?: number;
56
+ /** Rolloff factor for the distance model. Default: `1` */
57
+ rolloffFactor?: number;
58
+ /** Fires when the stereo panning changes. */
59
+ onstereo?: () => void;
60
+ /** Fires when the 3D position changes. */
61
+ onpos?: () => void;
62
+ /** Fires when the orientation changes. */
63
+ onorientation?: () => void;
64
+ }
65
+ /**
66
+ * audioEngine instance with spatial audio capabilities.
67
+ * Use this type when the spatial plugin is registered to get full type safety for spatial audio methods.
68
+ * @example
69
+ * ```typescript
70
+ * import { audioEngine } from 'engine';
71
+ * import { SpatialAudioPlugin, type SpatialAudioEngine } from 'engine/plugins/spatial';
72
+ *
73
+ * audioEngine.addPlugin(new SpatialAudioPlugin());
74
+ *
75
+ * const engine: SpatialAudioEngine = audioEngine as SpatialAudioEngine;
76
+ * engine.pos(10, 20, 30); // Set listener position
77
+ * engine.orientation(0, 0, -1, 0, 1, 0); // Set listener orientation
78
+ * engine.stereo(0.5); // Set stereo panning
79
+ * ```
80
+ */
81
+ export type SpatialAudioEngine = AudioEngine & SpatialAudioState & {
82
+ /**
83
+ * Set or get the listener's 3D position.
84
+ * @param x - X coordinate (optional)
85
+ * @param y - Y coordinate (optional)
86
+ * @param z - Z coordinate (optional)
87
+ * @returns If called with no arguments, returns the current position [x, y, z]. Otherwise, returns the audioEngine instance for chaining.
88
+ */
89
+ pos(x?: number, y?: number, z?: number): SpatialAudioEngine | [number, number, number];
90
+ /**
91
+ * Set or get the listener's orientation.
92
+ * @param x - Forward X component (optional)
93
+ * @param y - Forward Y component (optional)
94
+ * @param z - Forward Z component (optional)
95
+ * @param xUp - Up X component (optional)
96
+ * @param yUp - Up Y component (optional)
97
+ * @param zUp - Up Z component (optional)
98
+ * @returns If called with no arguments, returns the current orientation [forwardX, forwardY, forwardZ, upX, upY, upZ]. Otherwise, returns the audioEngine instance for chaining.
99
+ */
100
+ orientation(x?: number, y?: number, z?: number, xUp?: number, yUp?: number, zUp?: number): SpatialAudioEngine | [number, number, number, number, number, number];
101
+ /**
102
+ * Set or get the stereo panning value.
103
+ * @param pan - Panning value from -1.0 (left) to 1.0 (right) (optional)
104
+ * @returns If called with no arguments, returns the current panning value. Otherwise, returns the audioEngine instance for chaining.
105
+ */
106
+ stereo(pan?: number): SpatialAudioEngine;
107
+ };
108
+ /**
109
+ * Sound instance with spatial audio capabilities.
110
+ * Use this type when the spatial plugin is registered to get full type safety for spatial audio methods.
111
+ * @example
112
+ * ```typescript
113
+ * import { Sound } from 'engine';
114
+ * import { SpatialAudioPlugin, type SpatialSound, type SpatialSoundOptions } from 'engine/plugins/spatial';
115
+ *
116
+ * audioEngine.addPlugin(new SpatialAudioPlugin());
117
+ *
118
+ * const sound: SpatialSound = new Sound({
119
+ * src: ['sound.mp3'],
120
+ * pos: [10, 20, 30]
121
+ * } as SpatialSoundOptions) as SpatialSound;
122
+ *
123
+ * sound.pos(5, 10, 15); // Set sound position
124
+ * sound.stereo(0.5); // Set stereo panning
125
+ * sound.orientation(0, 1, 0); // Set sound orientation
126
+ * ```
127
+ */
128
+ export type SpatialSound = Sound & SpatialSoundState & {
129
+ /**
130
+ * Set or get the sound's 3D position.
131
+ * @param x - X coordinate (optional)
132
+ * @param y - Y coordinate (optional)
133
+ * @param z - Z coordinate (optional)
134
+ * @param id - Voice ID to target a specific sound instance (optional)
135
+ * @returns If called with no arguments, returns the current position [x, y, z]. Otherwise, returns the Sound instance for chaining.
136
+ */
137
+ pos(x?: number, y?: number, z?: number, id?: number): SpatialSound | [number, number, number] | null;
138
+ /**
139
+ * Set or get the sound's orientation vector.
140
+ * @param x - X component (optional)
141
+ * @param y - Y component (optional)
142
+ * @param z - Z component (optional)
143
+ * @param id - Voice ID to target a specific sound instance (optional)
144
+ * @returns If called with no arguments, returns the current orientation [x, y, z]. Otherwise, returns the Sound instance for chaining.
145
+ */
146
+ orientation(x?: number, y?: number, z?: number, id?: number): SpatialSound | [number, number, number] | null;
147
+ /**
148
+ * Set or get the stereo panning value.
149
+ * @param pan - Panning value from -1.0 (left) to 1.0 (right) (optional)
150
+ * @param id - Voice ID to target a specific sound instance (optional)
151
+ * @returns If called with no arguments, returns the current panning value. Otherwise, returns the Sound instance for chaining.
152
+ */
153
+ stereo(pan?: number, id?: number): SpatialSound | number | null;
154
+ /**
155
+ * Set or get panner node attributes.
156
+ * @param o - Panner attributes object (optional)
157
+ * @param id - Voice ID to target a specific sound instance (optional)
158
+ * @returns If called with no arguments, returns the current panner attributes. Otherwise, returns the Sound instance for chaining.
159
+ */
160
+ pannerAttr(o?: PannerAttrOptions | number, id?: number): SpatialSound | PannerAttrOptions;
161
+ };
162
+ /**
163
+ * Spatial Audio Plugin
164
+ * Adds 3D spatial audio and stereo panning capabilities to audioEngine and Sound instances
165
+ */
166
+ /**
167
+ * Initialize spatial audio when audioEngine is initialized
168
+ * This is called either:
169
+ * - When audioEngine initializes (if plugin was registered before)
170
+ * - Immediately during registration (if audioEngine is already initialized)
171
+ * @param engine - the audio engine singleton
172
+ */
173
+ export declare function installSpatialOnEngine(engine: AudioEngine): void;
174
+ /**
175
+ * Extend Sound instances with spatial audio methods
176
+ * @param sound - the sound the hook fires for
177
+ * @param options - the options the sound was constructed with
178
+ */
179
+ export declare function installSpatialOnSound(sound: Sound, options: SoundOptions): void;
180
+ /**
181
+ * Extend Voice instances with spatial audio properties
182
+ * @param voice - the individual playing instance
183
+ * @param parent - the sound the voice belongs to
184
+ */
185
+ export declare function installSpatialOnVoice(voice: Voice, parent: Sound): void;
186
+ /**
187
+ * Handle load queue for spatial audio
188
+ * @param sound - the sound the hook fires for
189
+ */
190
+ export declare function applySpatialAfterLoad(sound: Sound): void;
191
+ //# sourceMappingURL=spatial.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spatial.d.ts","sourceRoot":"","sources":["../../../src/audio/backend/spatial.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EACN,KAAK,WAAW,EAE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