1681-engine 0.0.0-stage → 0.5.9

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 (831) hide show
  1. package/CHANGELOG.md +357 -0
  2. package/LICENSE +21 -0
  3. package/README.md +164 -2
  4. package/dist/1681-engine.js +471 -0
  5. package/dist/ambient/ColorGrade.js +40 -0
  6. package/dist/ambient/DayClock.js +56 -0
  7. package/dist/ambient/WeatherLayer.js +90 -0
  8. package/dist/ambient/grade.js +12 -0
  9. package/dist/ambient/weather.js +51 -0
  10. package/dist/anim/AnimStateMachine.js +163 -0
  11. package/dist/anim/Animator.js +66 -0
  12. package/dist/anim/animStateCompile.js +112 -0
  13. package/dist/anim/animStateSystem.js +16 -0
  14. package/dist/anim/animationSystem.js +14 -0
  15. package/dist/anim/asepriteSlices.js +21 -0
  16. package/dist/anim/asepriteTags.js +34 -0
  17. package/dist/anim/parseAseprite.js +82 -0
  18. package/dist/assets/AssetLoader.js +202 -0
  19. package/dist/assets/loadAseprite.js +49 -0
  20. package/dist/assets/takeCleanerWorker-DTcI_Jqr.js +30 -0
  21. package/dist/assets/textureAtlas.js +58 -0
  22. package/dist/audio/Footsteps.js +25 -0
  23. package/dist/audio/MusicPlayer.js +77 -0
  24. package/dist/audio/SoundEngine.js +125 -0
  25. package/dist/audio/cleanTake.js +29 -0
  26. package/dist/audio/music/ElementVoice.js +34 -0
  27. package/dist/audio/music/GraphVoice.js +38 -0
  28. package/dist/audio/music/MusicChannel.js +57 -0
  29. package/dist/audio/music/musicVoice.js +12 -0
  30. package/dist/audio/sampleBank.js +81 -0
  31. package/dist/audio/soundTable.js +8 -0
  32. package/dist/audio/synth.js +35 -0
  33. package/dist/core/BitmapLabel.js +48 -0
  34. package/dist/core/Camera.js +149 -0
  35. package/dist/core/Clock.js +40 -0
  36. package/dist/core/Graphics.js +68 -0
  37. package/dist/core/Group.js +28 -0
  38. package/dist/core/Image.js +50 -0
  39. package/dist/core/ObjectFactory.js +54 -0
  40. package/dist/core/Pointer.js +80 -0
  41. package/dist/core/Rectangle.js +50 -0
  42. package/dist/core/Stage.js +85 -0
  43. package/dist/core/Text.js +21 -0
  44. package/dist/core/TextureRegistry.js +141 -0
  45. package/dist/core/Timeline.js +210 -0
  46. package/dist/core/TimelineBuilder.js +72 -0
  47. package/dist/core/TimelineChild.js +83 -0
  48. package/dist/core/Tweener.js +135 -0
  49. package/dist/core/atlas.js +37 -0
  50. package/dist/core/atlasPlan.js +21 -0
  51. package/dist/core/blendLayer.js +11 -0
  52. package/dist/core/eases.js +20 -0
  53. package/dist/core/gameObject.js +117 -0
  54. package/dist/core/pixelZoom.js +43 -0
  55. package/dist/core/pixiPatches.js +17 -0
  56. package/dist/core/runDue.js +28 -0
  57. package/dist/core/silhouette.js +49 -0
  58. package/dist/core/timelinePlace.js +23 -0
  59. package/dist/core/tweenProps.js +11 -0
  60. package/dist/debug/DebugOverlay.js +93 -0
  61. package/dist/debug/DrawCallCounter.js +44 -0
  62. package/dist/debug/ErrorLog.js +21 -0
  63. package/dist/debug/FrameStats.js +41 -0
  64. package/dist/debug/inspectWorld.js +28 -0
  65. package/dist/diagnostics/ErrorDeduper.js +26 -0
  66. package/dist/diagnostics/FrameSampler.js +41 -0
  67. package/dist/diagnostics/bootWatch.js +20 -0
  68. package/dist/diagnostics/captureErrors.js +26 -0
  69. package/dist/diagnostics/contextLoss.js +24 -0
  70. package/dist/diagnostics/frameStats.js +30 -0
  71. package/dist/diagnostics/gpuInfo.js +21 -0
  72. package/dist/diagnostics/renderGuard.js +23 -0
  73. package/dist/ecs/SparseSet.js +54 -0
  74. package/dist/ecs/World.js +306 -0
  75. package/dist/ecs/fields.js +25 -0
  76. package/dist/engine/Engine.js +106 -0
  77. package/dist/engine/FixedLoop.js +36 -0
  78. package/dist/engine/HiddenPause.js +27 -0
  79. package/dist/engine/Scene.js +78 -0
  80. package/dist/engine/SceneManager.js +72 -0
  81. package/dist/events/EventBus.js +41 -0
  82. package/dist/fx/Afterimages.js +82 -0
  83. package/dist/fx/FloatingText.js +71 -0
  84. package/dist/fx/hitStop.js +27 -0
  85. package/dist/fx/viewCull.js +9 -0
  86. package/dist/i18n/Translator.js +71 -0
  87. package/dist/i18n/extractStrings.js +57 -0
  88. package/dist/i18n/formatMessage.js +18 -0
  89. package/dist/input/Actions.js +139 -0
  90. package/dist/input/AimGesture.js +74 -0
  91. package/dist/input/Keyboard.js +53 -0
  92. package/dist/input/Keymap.js +170 -0
  93. package/dist/input/TargetLock.js +72 -0
  94. package/dist/input/aimAxis.js +7 -0
  95. package/dist/input/keyChord.js +28 -0
  96. package/dist/input/longPress.js +31 -0
  97. package/dist/input/rumble.js +42 -0
  98. package/dist/input/stickAxis.js +22 -0
  99. package/dist/input/touchDetect.js +6 -0
  100. package/dist/light/LightLayer.js +83 -0
  101. package/dist/nav/MinHeap.js +38 -0
  102. package/dist/nav/findPath.js +77 -0
  103. package/dist/nav/navGrid.js +35 -0
  104. package/dist/nav/nearestOpen.js +18 -0
  105. package/dist/nav/straightenPath.js +50 -0
  106. package/dist/net/Connection.js +107 -0
  107. package/dist/net/InterpolationBuffer.js +56 -0
  108. package/dist/net/PredictedMover.js +60 -0
  109. package/dist/net/Room.js +91 -0
  110. package/dist/net/RoomHost.js +100 -0
  111. package/dist/net/cadence.js +21 -0
  112. package/dist/net/constants.js +10 -0
  113. package/dist/net/lobby/LobbyClient.js +123 -0
  114. package/dist/net/lobby/LobbyHost.js +365 -0
  115. package/dist/net/lobby/LobbyRooms.js +65 -0
  116. package/dist/net/lobby/Matchmaker.js +105 -0
  117. package/dist/net/movement.js +84 -0
  118. package/dist/net/protocol.js +10 -0
  119. package/dist/net/reconnect.js +10 -0
  120. package/dist/net/serverClock.js +21 -0
  121. package/dist/net/snapshotCodec.js +91 -0
  122. package/dist/parallax/Parallax.js +31 -0
  123. package/dist/parallax/ParallaxLayer.js +69 -0
  124. package/dist/parallax/parallaxMath.js +26 -0
  125. package/dist/particles/Emitter.js +107 -0
  126. package/dist/particles/ParticleBudget.js +31 -0
  127. package/dist/particles/ParticleSim.js +59 -0
  128. package/dist/particles/particleCurves.js +47 -0
  129. package/dist/particles/particleSampling.js +29 -0
  130. package/dist/physics/Body.js +201 -0
  131. package/dist/physics/BroadPhase.js +55 -0
  132. package/dist/physics/Contact.js +75 -0
  133. package/dist/physics/ContactSolver.js +69 -0
  134. package/dist/physics/PhysicsWorld.js +220 -0
  135. package/dist/physics/SpatialHash.js +38 -0
  136. package/dist/physics/collide.js +75 -0
  137. package/dist/physics/collidePolygon.js +93 -0
  138. package/dist/physics/contactReport.js +13 -0
  139. package/dist/physics/drawColliders.js +30 -0
  140. package/dist/physics/physicsSystem.js +7 -0
  141. package/dist/physics/polygon.js +79 -0
  142. package/dist/physics/raycast.js +61 -0
  143. package/dist/physics/syncToBody.js +18 -0
  144. package/dist/physics/tileBodies.js +58 -0
  145. package/dist/physics/types.js +7 -0
  146. package/dist/pixel/Darkness.js +169 -0
  147. package/dist/pixel/DitherVignette.js +56 -0
  148. package/dist/pixel/Evaporation.js +84 -0
  149. package/dist/pixel/NightShade.js +33 -0
  150. package/dist/pixel/PixelLayer.js +210 -0
  151. package/dist/pixel/PixelMarks.js +99 -0
  152. package/dist/pixel/SwayProp.js +74 -0
  153. package/dist/pixel/aimPixels.js +67 -0
  154. package/dist/pixel/lights.js +43 -0
  155. package/dist/pixel/nineSlice.js +61 -0
  156. package/dist/pixel/paintLayer.js +35 -0
  157. package/dist/pixel/palette.js +56 -0
  158. package/dist/pixel/pixel.js +277 -0
  159. package/dist/pixel/pixelPaint.js +197 -0
  160. package/dist/pixel/pixelParticles.js +35 -0
  161. package/dist/pixel/pixelTone.js +163 -0
  162. package/dist/pixel/propKit.js +40 -0
  163. package/dist/pixel/ramp.js +101 -0
  164. package/dist/pixel/selout.js +34 -0
  165. package/dist/pixel/spritePixels.js +58 -0
  166. package/dist/pixel/swayRig.js +86 -0
  167. package/dist/pixel/vignetteMask.js +23 -0
  168. package/dist/pixel/weatherArt.js +60 -0
  169. package/dist/pixel.js +96 -0
  170. package/dist/platform/appResume.js +18 -0
  171. package/dist/platform/fullscreen.js +52 -0
  172. package/dist/platform/orientation.js +26 -0
  173. package/dist/platform/pointerLock.js +37 -0
  174. package/dist/platform/reducedMotion.js +23 -0
  175. package/dist/platform/timeoutSignal.js +14 -0
  176. package/dist/platform/touch.js +32 -0
  177. package/dist/postfx/BloomFilter.js +64 -0
  178. package/dist/postfx/ChromaticAberrationFilter.js +24 -0
  179. package/dist/postfx/ColorAdjustFilter.js +75 -0
  180. package/dist/postfx/CrtFilter.js +41 -0
  181. package/dist/postfx/PixelateFilter.js +26 -0
  182. package/dist/postfx/PostFx.js +122 -0
  183. package/dist/postfx/ShockwaveFilter.js +48 -0
  184. package/dist/postfx/VignetteFilter.js +36 -0
  185. package/dist/postfx/fxAnimator.js +37 -0
  186. package/dist/postfx/fxShader.js +127 -0
  187. package/dist/postfx.js +25 -0
  188. package/dist/react/ChoiceDialog.js +50 -0
  189. package/dist/react/ConfirmDialog.js +52 -0
  190. package/dist/react/Glyph.js +62 -0
  191. package/dist/react/Modal.js +37 -0
  192. package/dist/react/Panel.js +23 -0
  193. package/dist/react/PixelImage.js +23 -0
  194. package/dist/react/Select.js +98 -0
  195. package/dist/react/Slider.js +61 -0
  196. package/dist/react/SplitPane.js +23 -0
  197. package/dist/react/TabStrip.js +31 -0
  198. package/dist/react/TitleTips.js +41 -0
  199. package/dist/react/Tooltip.js +27 -0
  200. package/dist/react/UiProvider.js +49 -0
  201. package/dist/react/baseCss.js +221 -0
  202. package/dist/react/choiceStore.js +22 -0
  203. package/dist/react/classNames.js +18 -0
  204. package/dist/react/confirmStore.js +29 -0
  205. package/dist/react/labels.js +17 -0
  206. package/dist/react/placement.js +48 -0
  207. package/dist/react/useFillSheet.js +22 -0
  208. package/dist/react/useFitToViewport.js +28 -0
  209. package/dist/react/usePicked.js +12 -0
  210. package/dist/react/useStore.js +8 -0
  211. package/dist/react/useViewport.js +16 -0
  212. package/dist/react.js +77 -0
  213. package/dist/rig/PosePlayer.js +91 -0
  214. package/dist/rig/RigView.js +124 -0
  215. package/dist/rig/Skeleton.js +30 -0
  216. package/dist/rig/humanoid.js +5 -0
  217. package/dist/rig/humanoid.json.js +29 -0
  218. package/dist/rig/humanoidPoses.js +29 -0
  219. package/dist/rig/poseMath.js +53 -0
  220. package/dist/rig/poses.json.js +149 -0
  221. package/dist/save/Autosaver.js +53 -0
  222. package/dist/save/MemoryBackend.js +18 -0
  223. package/dist/save/SaveStore.js +102 -0
  224. package/dist/save/WebStorageBackend.js +26 -0
  225. package/dist/save/checksum.js +9 -0
  226. package/dist/save/migrateSave.js +26 -0
  227. package/dist/settings.js +26 -0
  228. package/dist/tilemap/TilemapView.js +68 -0
  229. package/dist/tilemap/collision.js +24 -0
  230. package/dist/tilemap/tiled.js +137 -0
  231. package/dist/transitions/CrossfadeTransition.js +23 -0
  232. package/dist/transitions/DitherWipeTransition.js +69 -0
  233. package/dist/transitions/FadeTransition.js +33 -0
  234. package/dist/transitions/Letterbox.js +41 -0
  235. package/dist/transitions/ditherMask.js +14 -0
  236. package/dist/transitions/transitionTo.js +27 -0
  237. package/dist/transitions/tweenDone.js +14 -0
  238. package/dist/types/ambient/ColorGrade.d.ts +41 -0
  239. package/dist/types/ambient/ColorGrade.d.ts.map +1 -0
  240. package/dist/types/ambient/DayClock.d.ts +80 -0
  241. package/dist/types/ambient/DayClock.d.ts.map +1 -0
  242. package/dist/types/ambient/WeatherLayer.d.ts +78 -0
  243. package/dist/types/ambient/WeatherLayer.d.ts.map +1 -0
  244. package/dist/types/ambient/grade.d.ts +22 -0
  245. package/dist/types/ambient/grade.d.ts.map +1 -0
  246. package/dist/types/ambient/weather.d.ts +49 -0
  247. package/dist/types/ambient/weather.d.ts.map +1 -0
  248. package/dist/types/anim/AnimStateMachine.d.ts +80 -0
  249. package/dist/types/anim/AnimStateMachine.d.ts.map +1 -0
  250. package/dist/types/anim/Animator.d.ts +50 -0
  251. package/dist/types/anim/Animator.d.ts.map +1 -0
  252. package/dist/types/anim/animStateCompile.d.ts +52 -0
  253. package/dist/types/anim/animStateCompile.d.ts.map +1 -0
  254. package/dist/types/anim/animStateSystem.d.ts +10 -0
  255. package/dist/types/anim/animStateSystem.d.ts.map +1 -0
  256. package/dist/types/anim/animStateTypes.d.ts +50 -0
  257. package/dist/types/anim/animStateTypes.d.ts.map +1 -0
  258. package/dist/types/anim/animationSystem.d.ts +13 -0
  259. package/dist/types/anim/animationSystem.d.ts.map +1 -0
  260. package/dist/types/anim/asepriteSlices.d.ts +19 -0
  261. package/dist/types/anim/asepriteSlices.d.ts.map +1 -0
  262. package/dist/types/anim/asepriteTags.d.ts +16 -0
  263. package/dist/types/anim/asepriteTags.d.ts.map +1 -0
  264. package/dist/types/anim/asepriteTypes.d.ts +159 -0
  265. package/dist/types/anim/asepriteTypes.d.ts.map +1 -0
  266. package/dist/types/anim/parseAseprite.d.ts +21 -0
  267. package/dist/types/anim/parseAseprite.d.ts.map +1 -0
  268. package/dist/types/assets/AssetLoader.d.ts +140 -0
  269. package/dist/types/assets/AssetLoader.d.ts.map +1 -0
  270. package/dist/types/assets/loadAseprite.d.ts +27 -0
  271. package/dist/types/assets/loadAseprite.d.ts.map +1 -0
  272. package/dist/types/assets/textureAtlas.d.ts +35 -0
  273. package/dist/types/assets/textureAtlas.d.ts.map +1 -0
  274. package/dist/types/audio/Footsteps.d.ts +33 -0
  275. package/dist/types/audio/Footsteps.d.ts.map +1 -0
  276. package/dist/types/audio/MusicPlayer.d.ts +65 -0
  277. package/dist/types/audio/MusicPlayer.d.ts.map +1 -0
  278. package/dist/types/audio/SoundEngine.d.ts +47 -0
  279. package/dist/types/audio/SoundEngine.d.ts.map +1 -0
  280. package/dist/types/audio/cleanTake.d.ts +3 -0
  281. package/dist/types/audio/cleanTake.d.ts.map +1 -0
  282. package/dist/types/audio/music/ElementVoice.d.ts +14 -0
  283. package/dist/types/audio/music/ElementVoice.d.ts.map +1 -0
  284. package/dist/types/audio/music/GraphVoice.d.ts +22 -0
  285. package/dist/types/audio/music/GraphVoice.d.ts.map +1 -0
  286. package/dist/types/audio/music/MusicChannel.d.ts +35 -0
  287. package/dist/types/audio/music/MusicChannel.d.ts.map +1 -0
  288. package/dist/types/audio/music/musicVoice.d.ts +26 -0
  289. package/dist/types/audio/music/musicVoice.d.ts.map +1 -0
  290. package/dist/types/audio/sampleBank.d.ts +27 -0
  291. package/dist/types/audio/sampleBank.d.ts.map +1 -0
  292. package/dist/types/audio/soundTable.d.ts +14 -0
  293. package/dist/types/audio/soundTable.d.ts.map +1 -0
  294. package/dist/types/audio/synth.d.ts +34 -0
  295. package/dist/types/audio/synth.d.ts.map +1 -0
  296. package/dist/types/audio/takeCleanerWorker.d.ts +2 -0
  297. package/dist/types/audio/takeCleanerWorker.d.ts.map +1 -0
  298. package/dist/types/core/BitmapLabel.d.ts +36 -0
  299. package/dist/types/core/BitmapLabel.d.ts.map +1 -0
  300. package/dist/types/core/Camera.d.ts +115 -0
  301. package/dist/types/core/Camera.d.ts.map +1 -0
  302. package/dist/types/core/Clock.d.ts +23 -0
  303. package/dist/types/core/Clock.d.ts.map +1 -0
  304. package/dist/types/core/Graphics.d.ts +37 -0
  305. package/dist/types/core/Graphics.d.ts.map +1 -0
  306. package/dist/types/core/Group.d.ts +15 -0
  307. package/dist/types/core/Group.d.ts.map +1 -0
  308. package/dist/types/core/Image.d.ts +25 -0
  309. package/dist/types/core/Image.d.ts.map +1 -0
  310. package/dist/types/core/ObjectFactory.d.ts +34 -0
  311. package/dist/types/core/ObjectFactory.d.ts.map +1 -0
  312. package/dist/types/core/Pointer.d.ts +45 -0
  313. package/dist/types/core/Pointer.d.ts.map +1 -0
  314. package/dist/types/core/Rectangle.d.ts +26 -0
  315. package/dist/types/core/Rectangle.d.ts.map +1 -0
  316. package/dist/types/core/Stage.d.ts +58 -0
  317. package/dist/types/core/Stage.d.ts.map +1 -0
  318. package/dist/types/core/Text.d.ts +22 -0
  319. package/dist/types/core/Text.d.ts.map +1 -0
  320. package/dist/types/core/TextureRegistry.d.ts +90 -0
  321. package/dist/types/core/TextureRegistry.d.ts.map +1 -0
  322. package/dist/types/core/Timeline.d.ts +115 -0
  323. package/dist/types/core/Timeline.d.ts.map +1 -0
  324. package/dist/types/core/TimelineBuilder.d.ts +53 -0
  325. package/dist/types/core/TimelineBuilder.d.ts.map +1 -0
  326. package/dist/types/core/TimelineChild.d.ts +51 -0
  327. package/dist/types/core/TimelineChild.d.ts.map +1 -0
  328. package/dist/types/core/Tweener.d.ts +70 -0
  329. package/dist/types/core/Tweener.d.ts.map +1 -0
  330. package/dist/types/core/atlas.d.ts +16 -0
  331. package/dist/types/core/atlas.d.ts.map +1 -0
  332. package/dist/types/core/atlasPlan.d.ts +34 -0
  333. package/dist/types/core/atlasPlan.d.ts.map +1 -0
  334. package/dist/types/core/blendLayer.d.ts +23 -0
  335. package/dist/types/core/blendLayer.d.ts.map +1 -0
  336. package/dist/types/core/eases.d.ts +3 -0
  337. package/dist/types/core/eases.d.ts.map +1 -0
  338. package/dist/types/core/gameObject.d.ts +42 -0
  339. package/dist/types/core/gameObject.d.ts.map +1 -0
  340. package/dist/types/core/pixelZoom.d.ts +45 -0
  341. package/dist/types/core/pixelZoom.d.ts.map +1 -0
  342. package/dist/types/core/pixiPatches.d.ts +9 -0
  343. package/dist/types/core/pixiPatches.d.ts.map +1 -0
  344. package/dist/types/core/runDue.d.ts +15 -0
  345. package/dist/types/core/runDue.d.ts.map +1 -0
  346. package/dist/types/core/silhouette.d.ts +16 -0
  347. package/dist/types/core/silhouette.d.ts.map +1 -0
  348. package/dist/types/core/timelinePlace.d.ts +23 -0
  349. package/dist/types/core/timelinePlace.d.ts.map +1 -0
  350. package/dist/types/core/tweenProps.d.ts +8 -0
  351. package/dist/types/core/tweenProps.d.ts.map +1 -0
  352. package/dist/types/core/types.d.ts +4 -0
  353. package/dist/types/core/types.d.ts.map +1 -0
  354. package/dist/types/debug/DebugOverlay.d.ts +63 -0
  355. package/dist/types/debug/DebugOverlay.d.ts.map +1 -0
  356. package/dist/types/debug/DrawCallCounter.d.ts +20 -0
  357. package/dist/types/debug/DrawCallCounter.d.ts.map +1 -0
  358. package/dist/types/debug/ErrorLog.d.ts +20 -0
  359. package/dist/types/debug/ErrorLog.d.ts.map +1 -0
  360. package/dist/types/debug/FrameStats.d.ts +21 -0
  361. package/dist/types/debug/FrameStats.d.ts.map +1 -0
  362. package/dist/types/debug/inspectWorld.d.ts +14 -0
  363. package/dist/types/debug/inspectWorld.d.ts.map +1 -0
  364. package/dist/types/diagnostics/ErrorDeduper.d.ts +17 -0
  365. package/dist/types/diagnostics/ErrorDeduper.d.ts.map +1 -0
  366. package/dist/types/diagnostics/FrameSampler.d.ts +37 -0
  367. package/dist/types/diagnostics/FrameSampler.d.ts.map +1 -0
  368. package/dist/types/diagnostics/bootWatch.d.ts +25 -0
  369. package/dist/types/diagnostics/bootWatch.d.ts.map +1 -0
  370. package/dist/types/diagnostics/captureErrors.d.ts +24 -0
  371. package/dist/types/diagnostics/captureErrors.d.ts.map +1 -0
  372. package/dist/types/diagnostics/contextLoss.d.ts +35 -0
  373. package/dist/types/diagnostics/contextLoss.d.ts.map +1 -0
  374. package/dist/types/diagnostics/frameStats.d.ts +30 -0
  375. package/dist/types/diagnostics/frameStats.d.ts.map +1 -0
  376. package/dist/types/diagnostics/gpuInfo.d.ts +9 -0
  377. package/dist/types/diagnostics/gpuInfo.d.ts.map +1 -0
  378. package/dist/types/diagnostics/renderGuard.d.ts +12 -0
  379. package/dist/types/diagnostics/renderGuard.d.ts.map +1 -0
  380. package/dist/types/ecs/SparseSet.d.ts +25 -0
  381. package/dist/types/ecs/SparseSet.d.ts.map +1 -0
  382. package/dist/types/ecs/World.d.ts +137 -0
  383. package/dist/types/ecs/World.d.ts.map +1 -0
  384. package/dist/types/ecs/fields.d.ts +34 -0
  385. package/dist/types/ecs/fields.d.ts.map +1 -0
  386. package/dist/types/engine/Engine.d.ts +96 -0
  387. package/dist/types/engine/Engine.d.ts.map +1 -0
  388. package/dist/types/engine/FixedLoop.d.ts +32 -0
  389. package/dist/types/engine/FixedLoop.d.ts.map +1 -0
  390. package/dist/types/engine/HiddenPause.d.ts +22 -0
  391. package/dist/types/engine/HiddenPause.d.ts.map +1 -0
  392. package/dist/types/engine/Scene.d.ts +67 -0
  393. package/dist/types/engine/Scene.d.ts.map +1 -0
  394. package/dist/types/engine/SceneManager.d.ts +36 -0
  395. package/dist/types/engine/SceneManager.d.ts.map +1 -0
  396. package/dist/types/events/EventBus.d.ts +20 -0
  397. package/dist/types/events/EventBus.d.ts.map +1 -0
  398. package/dist/types/fx/Afterimages.d.ts +62 -0
  399. package/dist/types/fx/Afterimages.d.ts.map +1 -0
  400. package/dist/types/fx/FloatingText.d.ts +71 -0
  401. package/dist/types/fx/FloatingText.d.ts.map +1 -0
  402. package/dist/types/fx/hitStop.d.ts +20 -0
  403. package/dist/types/fx/hitStop.d.ts.map +1 -0
  404. package/dist/types/fx/viewCull.d.ts +14 -0
  405. package/dist/types/fx/viewCull.d.ts.map +1 -0
  406. package/dist/types/i18n/Translator.d.ts +52 -0
  407. package/dist/types/i18n/Translator.d.ts.map +1 -0
  408. package/dist/types/i18n/extractStrings.d.ts +25 -0
  409. package/dist/types/i18n/extractStrings.d.ts.map +1 -0
  410. package/dist/types/i18n/formatMessage.d.ts +10 -0
  411. package/dist/types/i18n/formatMessage.d.ts.map +1 -0
  412. package/dist/types/index.d.ts +164 -0
  413. package/dist/types/index.d.ts.map +1 -0
  414. package/dist/types/input/Actions.d.ts +100 -0
  415. package/dist/types/input/Actions.d.ts.map +1 -0
  416. package/dist/types/input/AimGesture.d.ts +106 -0
  417. package/dist/types/input/AimGesture.d.ts.map +1 -0
  418. package/dist/types/input/Keyboard.d.ts +30 -0
  419. package/dist/types/input/Keyboard.d.ts.map +1 -0
  420. package/dist/types/input/Keymap.d.ts +85 -0
  421. package/dist/types/input/Keymap.d.ts.map +1 -0
  422. package/dist/types/input/TargetLock.d.ts +56 -0
  423. package/dist/types/input/TargetLock.d.ts.map +1 -0
  424. package/dist/types/input/aimAxis.d.ts +9 -0
  425. package/dist/types/input/aimAxis.d.ts.map +1 -0
  426. package/dist/types/input/keyChord.d.ts +15 -0
  427. package/dist/types/input/keyChord.d.ts.map +1 -0
  428. package/dist/types/input/longPress.d.ts +21 -0
  429. package/dist/types/input/longPress.d.ts.map +1 -0
  430. package/dist/types/input/rumble.d.ts +41 -0
  431. package/dist/types/input/rumble.d.ts.map +1 -0
  432. package/dist/types/input/stickAxis.d.ts +26 -0
  433. package/dist/types/input/stickAxis.d.ts.map +1 -0
  434. package/dist/types/input/touchDetect.d.ts +18 -0
  435. package/dist/types/input/touchDetect.d.ts.map +1 -0
  436. package/dist/types/light/LightLayer.d.ts +65 -0
  437. package/dist/types/light/LightLayer.d.ts.map +1 -0
  438. package/dist/types/nav/MinHeap.d.ts +15 -0
  439. package/dist/types/nav/MinHeap.d.ts.map +1 -0
  440. package/dist/types/nav/findPath.d.ts +38 -0
  441. package/dist/types/nav/findPath.d.ts.map +1 -0
  442. package/dist/types/nav/navGrid.d.ts +48 -0
  443. package/dist/types/nav/navGrid.d.ts.map +1 -0
  444. package/dist/types/nav/nearestOpen.d.ts +8 -0
  445. package/dist/types/nav/nearestOpen.d.ts.map +1 -0
  446. package/dist/types/nav/straightenPath.d.ts +13 -0
  447. package/dist/types/nav/straightenPath.d.ts.map +1 -0
  448. package/dist/types/net/Connection.d.ts +88 -0
  449. package/dist/types/net/Connection.d.ts.map +1 -0
  450. package/dist/types/net/InterpolationBuffer.d.ts +36 -0
  451. package/dist/types/net/InterpolationBuffer.d.ts.map +1 -0
  452. package/dist/types/net/PredictedMover.d.ts +43 -0
  453. package/dist/types/net/PredictedMover.d.ts.map +1 -0
  454. package/dist/types/net/Room.d.ts +69 -0
  455. package/dist/types/net/Room.d.ts.map +1 -0
  456. package/dist/types/net/RoomHost.d.ts +74 -0
  457. package/dist/types/net/RoomHost.d.ts.map +1 -0
  458. package/dist/types/net/cadence.d.ts +22 -0
  459. package/dist/types/net/cadence.d.ts.map +1 -0
  460. package/dist/types/net/constants.d.ts +33 -0
  461. package/dist/types/net/constants.d.ts.map +1 -0
  462. package/dist/types/net/lobby/LobbyClient.d.ts +107 -0
  463. package/dist/types/net/lobby/LobbyClient.d.ts.map +1 -0
  464. package/dist/types/net/lobby/LobbyHost.d.ts +147 -0
  465. package/dist/types/net/lobby/LobbyHost.d.ts.map +1 -0
  466. package/dist/types/net/lobby/LobbyRooms.d.ts +56 -0
  467. package/dist/types/net/lobby/LobbyRooms.d.ts.map +1 -0
  468. package/dist/types/net/lobby/Matchmaker.d.ts +57 -0
  469. package/dist/types/net/lobby/Matchmaker.d.ts.map +1 -0
  470. package/dist/types/net/lobby/index.d.ts +6 -0
  471. package/dist/types/net/lobby/index.d.ts.map +1 -0
  472. package/dist/types/net/lobby/lobbyProtocol.d.ts +143 -0
  473. package/dist/types/net/lobby/lobbyProtocol.d.ts.map +1 -0
  474. package/dist/types/net/movement.d.ts +50 -0
  475. package/dist/types/net/movement.d.ts.map +1 -0
  476. package/dist/types/net/protocol.d.ts +59 -0
  477. package/dist/types/net/protocol.d.ts.map +1 -0
  478. package/dist/types/net/reconnect.d.ts +14 -0
  479. package/dist/types/net/reconnect.d.ts.map +1 -0
  480. package/dist/types/net/serverClock.d.ts +14 -0
  481. package/dist/types/net/serverClock.d.ts.map +1 -0
  482. package/dist/types/net/snapshotCodec.d.ts +55 -0
  483. package/dist/types/net/snapshotCodec.d.ts.map +1 -0
  484. package/dist/types/parallax/Parallax.d.ts +37 -0
  485. package/dist/types/parallax/Parallax.d.ts.map +1 -0
  486. package/dist/types/parallax/ParallaxLayer.d.ts +80 -0
  487. package/dist/types/parallax/ParallaxLayer.d.ts.map +1 -0
  488. package/dist/types/parallax/parallaxMath.d.ts +50 -0
  489. package/dist/types/parallax/parallaxMath.d.ts.map +1 -0
  490. package/dist/types/particles/Emitter.d.ts +97 -0
  491. package/dist/types/particles/Emitter.d.ts.map +1 -0
  492. package/dist/types/particles/ParticleBudget.d.ts +28 -0
  493. package/dist/types/particles/ParticleBudget.d.ts.map +1 -0
  494. package/dist/types/particles/ParticleSim.d.ts +38 -0
  495. package/dist/types/particles/ParticleSim.d.ts.map +1 -0
  496. package/dist/types/particles/particleCurves.d.ts +21 -0
  497. package/dist/types/particles/particleCurves.d.ts.map +1 -0
  498. package/dist/types/particles/particleSampling.d.ts +20 -0
  499. package/dist/types/particles/particleSampling.d.ts.map +1 -0
  500. package/dist/types/physics/Body.d.ts +130 -0
  501. package/dist/types/physics/Body.d.ts.map +1 -0
  502. package/dist/types/physics/BroadPhase.d.ts +26 -0
  503. package/dist/types/physics/BroadPhase.d.ts.map +1 -0
  504. package/dist/types/physics/Contact.d.ts +62 -0
  505. package/dist/types/physics/Contact.d.ts.map +1 -0
  506. package/dist/types/physics/ContactSolver.d.ts +29 -0
  507. package/dist/types/physics/ContactSolver.d.ts.map +1 -0
  508. package/dist/types/physics/PhysicsWorld.d.ts +78 -0
  509. package/dist/types/physics/PhysicsWorld.d.ts.map +1 -0
  510. package/dist/types/physics/PhysicsWorldOptions.d.ts +24 -0
  511. package/dist/types/physics/PhysicsWorldOptions.d.ts.map +1 -0
  512. package/dist/types/physics/SpatialHash.d.ts +23 -0
  513. package/dist/types/physics/SpatialHash.d.ts.map +1 -0
  514. package/dist/types/physics/collide.d.ts +27 -0
  515. package/dist/types/physics/collide.d.ts.map +1 -0
  516. package/dist/types/physics/collidePolygon.d.ts +14 -0
  517. package/dist/types/physics/collidePolygon.d.ts.map +1 -0
  518. package/dist/types/physics/contactReport.d.ts +8 -0
  519. package/dist/types/physics/contactReport.d.ts.map +1 -0
  520. package/dist/types/physics/drawColliders.d.ts +43 -0
  521. package/dist/types/physics/drawColliders.d.ts.map +1 -0
  522. package/dist/types/physics/physicsSystem.d.ts +5 -0
  523. package/dist/types/physics/physicsSystem.d.ts.map +1 -0
  524. package/dist/types/physics/polygon.d.ts +28 -0
  525. package/dist/types/physics/polygon.d.ts.map +1 -0
  526. package/dist/types/physics/raycast.d.ts +19 -0
  527. package/dist/types/physics/raycast.d.ts.map +1 -0
  528. package/dist/types/physics/syncToBody.d.ts +16 -0
  529. package/dist/types/physics/syncToBody.d.ts.map +1 -0
  530. package/dist/types/physics/tileBodies.d.ts +36 -0
  531. package/dist/types/physics/tileBodies.d.ts.map +1 -0
  532. package/dist/types/physics/types.d.ts +116 -0
  533. package/dist/types/physics/types.d.ts.map +1 -0
  534. package/dist/types/pixel/Darkness.d.ts +90 -0
  535. package/dist/types/pixel/Darkness.d.ts.map +1 -0
  536. package/dist/types/pixel/DitherVignette.d.ts +35 -0
  537. package/dist/types/pixel/DitherVignette.d.ts.map +1 -0
  538. package/dist/types/pixel/Evaporation.d.ts +30 -0
  539. package/dist/types/pixel/Evaporation.d.ts.map +1 -0
  540. package/dist/types/pixel/NightShade.d.ts +38 -0
  541. package/dist/types/pixel/NightShade.d.ts.map +1 -0
  542. package/dist/types/pixel/PixelLayer.d.ts +85 -0
  543. package/dist/types/pixel/PixelLayer.d.ts.map +1 -0
  544. package/dist/types/pixel/PixelMarks.d.ts +68 -0
  545. package/dist/types/pixel/PixelMarks.d.ts.map +1 -0
  546. package/dist/types/pixel/SwayProp.d.ts +52 -0
  547. package/dist/types/pixel/SwayProp.d.ts.map +1 -0
  548. package/dist/types/pixel/aimPixels.d.ts +23 -0
  549. package/dist/types/pixel/aimPixels.d.ts.map +1 -0
  550. package/dist/types/pixel/index.d.ts +33 -0
  551. package/dist/types/pixel/index.d.ts.map +1 -0
  552. package/dist/types/pixel/lights.d.ts +34 -0
  553. package/dist/types/pixel/lights.d.ts.map +1 -0
  554. package/dist/types/pixel/nineSlice.d.ts +71 -0
  555. package/dist/types/pixel/nineSlice.d.ts.map +1 -0
  556. package/dist/types/pixel/paintLayer.d.ts +35 -0
  557. package/dist/types/pixel/paintLayer.d.ts.map +1 -0
  558. package/dist/types/pixel/palette.d.ts +58 -0
  559. package/dist/types/pixel/palette.d.ts.map +1 -0
  560. package/dist/types/pixel/pixel.d.ts +80 -0
  561. package/dist/types/pixel/pixel.d.ts.map +1 -0
  562. package/dist/types/pixel/pixelPaint.d.ts +44 -0
  563. package/dist/types/pixel/pixelPaint.d.ts.map +1 -0
  564. package/dist/types/pixel/pixelParticles.d.ts +21 -0
  565. package/dist/types/pixel/pixelParticles.d.ts.map +1 -0
  566. package/dist/types/pixel/pixelTone.d.ts +51 -0
  567. package/dist/types/pixel/pixelTone.d.ts.map +1 -0
  568. package/dist/types/pixel/propKit.d.ts +26 -0
  569. package/dist/types/pixel/propKit.d.ts.map +1 -0
  570. package/dist/types/pixel/ramp.d.ts +57 -0
  571. package/dist/types/pixel/ramp.d.ts.map +1 -0
  572. package/dist/types/pixel/selout.d.ts +3 -0
  573. package/dist/types/pixel/selout.d.ts.map +1 -0
  574. package/dist/types/pixel/spritePixels.d.ts +29 -0
  575. package/dist/types/pixel/spritePixels.d.ts.map +1 -0
  576. package/dist/types/pixel/swayRig.d.ts +72 -0
  577. package/dist/types/pixel/swayRig.d.ts.map +1 -0
  578. package/dist/types/pixel/vignetteMask.d.ts +16 -0
  579. package/dist/types/pixel/vignetteMask.d.ts.map +1 -0
  580. package/dist/types/pixel/weatherArt.d.ts +29 -0
  581. package/dist/types/pixel/weatherArt.d.ts.map +1 -0
  582. package/dist/types/platform/appResume.d.ts +25 -0
  583. package/dist/types/platform/appResume.d.ts.map +1 -0
  584. package/dist/types/platform/fullscreen.d.ts +37 -0
  585. package/dist/types/platform/fullscreen.d.ts.map +1 -0
  586. package/dist/types/platform/orientation.d.ts +19 -0
  587. package/dist/types/platform/orientation.d.ts.map +1 -0
  588. package/dist/types/platform/pointerLock.d.ts +26 -0
  589. package/dist/types/platform/pointerLock.d.ts.map +1 -0
  590. package/dist/types/platform/reducedMotion.d.ts +20 -0
  591. package/dist/types/platform/reducedMotion.d.ts.map +1 -0
  592. package/dist/types/platform/timeoutSignal.d.ts +6 -0
  593. package/dist/types/platform/timeoutSignal.d.ts.map +1 -0
  594. package/dist/types/platform/touch.d.ts +10 -0
  595. package/dist/types/platform/touch.d.ts.map +1 -0
  596. package/dist/types/postfx/BloomFilter.d.ts +33 -0
  597. package/dist/types/postfx/BloomFilter.d.ts.map +1 -0
  598. package/dist/types/postfx/ChromaticAberrationFilter.d.ts +11 -0
  599. package/dist/types/postfx/ChromaticAberrationFilter.d.ts.map +1 -0
  600. package/dist/types/postfx/ColorAdjustFilter.d.ts +32 -0
  601. package/dist/types/postfx/ColorAdjustFilter.d.ts.map +1 -0
  602. package/dist/types/postfx/CrtFilter.d.ts +16 -0
  603. package/dist/types/postfx/CrtFilter.d.ts.map +1 -0
  604. package/dist/types/postfx/PixelateFilter.d.ts +8 -0
  605. package/dist/types/postfx/PixelateFilter.d.ts.map +1 -0
  606. package/dist/types/postfx/PostFx.d.ts +92 -0
  607. package/dist/types/postfx/PostFx.d.ts.map +1 -0
  608. package/dist/types/postfx/ShockwaveFilter.d.ts +20 -0
  609. package/dist/types/postfx/ShockwaveFilter.d.ts.map +1 -0
  610. package/dist/types/postfx/VignetteFilter.d.ts +19 -0
  611. package/dist/types/postfx/VignetteFilter.d.ts.map +1 -0
  612. package/dist/types/postfx/fxAnimator.d.ts +32 -0
  613. package/dist/types/postfx/fxAnimator.d.ts.map +1 -0
  614. package/dist/types/postfx/fxShader.d.ts +49 -0
  615. package/dist/types/postfx/fxShader.d.ts.map +1 -0
  616. package/dist/types/postfx/index.d.ts +11 -0
  617. package/dist/types/postfx/index.d.ts.map +1 -0
  618. package/dist/types/react/ChoiceDialog.d.ts +8 -0
  619. package/dist/types/react/ChoiceDialog.d.ts.map +1 -0
  620. package/dist/types/react/ConfirmDialog.d.ts +9 -0
  621. package/dist/types/react/ConfirmDialog.d.ts.map +1 -0
  622. package/dist/types/react/Glyph.d.ts +54 -0
  623. package/dist/types/react/Glyph.d.ts.map +1 -0
  624. package/dist/types/react/Modal.d.ts +22 -0
  625. package/dist/types/react/Modal.d.ts.map +1 -0
  626. package/dist/types/react/Panel.d.ts +29 -0
  627. package/dist/types/react/Panel.d.ts.map +1 -0
  628. package/dist/types/react/PixelImage.d.ts +19 -0
  629. package/dist/types/react/PixelImage.d.ts.map +1 -0
  630. package/dist/types/react/Select.d.ts +27 -0
  631. package/dist/types/react/Select.d.ts.map +1 -0
  632. package/dist/types/react/Slider.d.ts +24 -0
  633. package/dist/types/react/Slider.d.ts.map +1 -0
  634. package/dist/types/react/SplitPane.d.ts +26 -0
  635. package/dist/types/react/SplitPane.d.ts.map +1 -0
  636. package/dist/types/react/TabStrip.d.ts +31 -0
  637. package/dist/types/react/TabStrip.d.ts.map +1 -0
  638. package/dist/types/react/TitleTips.d.ts +15 -0
  639. package/dist/types/react/TitleTips.d.ts.map +1 -0
  640. package/dist/types/react/Tooltip.d.ts +22 -0
  641. package/dist/types/react/Tooltip.d.ts.map +1 -0
  642. package/dist/types/react/UiProvider.d.ts +52 -0
  643. package/dist/types/react/UiProvider.d.ts.map +1 -0
  644. package/dist/types/react/baseCss.d.ts +27 -0
  645. package/dist/types/react/baseCss.d.ts.map +1 -0
  646. package/dist/types/react/choiceStore.d.ts +34 -0
  647. package/dist/types/react/choiceStore.d.ts.map +1 -0
  648. package/dist/types/react/classNames.d.ts +12 -0
  649. package/dist/types/react/classNames.d.ts.map +1 -0
  650. package/dist/types/react/confirmStore.d.ts +30 -0
  651. package/dist/types/react/confirmStore.d.ts.map +1 -0
  652. package/dist/types/react/index.d.ts +33 -0
  653. package/dist/types/react/index.d.ts.map +1 -0
  654. package/dist/types/react/labels.d.ts +24 -0
  655. package/dist/types/react/labels.d.ts.map +1 -0
  656. package/dist/types/react/placement.d.ts +59 -0
  657. package/dist/types/react/placement.d.ts.map +1 -0
  658. package/dist/types/react/useFillSheet.d.ts +9 -0
  659. package/dist/types/react/useFillSheet.d.ts.map +1 -0
  660. package/dist/types/react/useFitToViewport.d.ts +20 -0
  661. package/dist/types/react/useFitToViewport.d.ts.map +1 -0
  662. package/dist/types/react/usePicked.d.ts +9 -0
  663. package/dist/types/react/usePicked.d.ts.map +1 -0
  664. package/dist/types/react/useStore.d.ts +8 -0
  665. package/dist/types/react/useStore.d.ts.map +1 -0
  666. package/dist/types/react/useViewport.d.ts +4 -0
  667. package/dist/types/react/useViewport.d.ts.map +1 -0
  668. package/dist/types/rig/PosePlayer.d.ts +64 -0
  669. package/dist/types/rig/PosePlayer.d.ts.map +1 -0
  670. package/dist/types/rig/RigView.d.ts +68 -0
  671. package/dist/types/rig/RigView.d.ts.map +1 -0
  672. package/dist/types/rig/Skeleton.d.ts +14 -0
  673. package/dist/types/rig/Skeleton.d.ts.map +1 -0
  674. package/dist/types/rig/humanoid.d.ts +4 -0
  675. package/dist/types/rig/humanoid.d.ts.map +1 -0
  676. package/dist/types/rig/humanoidPoses.d.ts +117 -0
  677. package/dist/types/rig/humanoidPoses.d.ts.map +1 -0
  678. package/dist/types/rig/poseMath.d.ts +14 -0
  679. package/dist/types/rig/poseMath.d.ts.map +1 -0
  680. package/dist/types/rig/rigTypes.d.ts +82 -0
  681. package/dist/types/rig/rigTypes.d.ts.map +1 -0
  682. package/dist/types/save/Autosaver.d.ts +43 -0
  683. package/dist/types/save/Autosaver.d.ts.map +1 -0
  684. package/dist/types/save/MemoryBackend.d.ts +10 -0
  685. package/dist/types/save/MemoryBackend.d.ts.map +1 -0
  686. package/dist/types/save/SaveBackend.d.ts +14 -0
  687. package/dist/types/save/SaveBackend.d.ts.map +1 -0
  688. package/dist/types/save/SaveStore.d.ts +73 -0
  689. package/dist/types/save/SaveStore.d.ts.map +1 -0
  690. package/dist/types/save/WebStorageBackend.d.ts +14 -0
  691. package/dist/types/save/WebStorageBackend.d.ts.map +1 -0
  692. package/dist/types/save/checksum.d.ts +7 -0
  693. package/dist/types/save/checksum.d.ts.map +1 -0
  694. package/dist/types/save/migrateSave.d.ts +17 -0
  695. package/dist/types/save/migrateSave.d.ts.map +1 -0
  696. package/dist/types/settings.d.ts +25 -0
  697. package/dist/types/settings.d.ts.map +1 -0
  698. package/dist/types/tilemap/TilemapView.d.ts +42 -0
  699. package/dist/types/tilemap/TilemapView.d.ts.map +1 -0
  700. package/dist/types/tilemap/collision.d.ts +16 -0
  701. package/dist/types/tilemap/collision.d.ts.map +1 -0
  702. package/dist/types/tilemap/tiled.d.ts +104 -0
  703. package/dist/types/tilemap/tiled.d.ts.map +1 -0
  704. package/dist/types/transitions/CrossfadeTransition.d.ts +20 -0
  705. package/dist/types/transitions/CrossfadeTransition.d.ts.map +1 -0
  706. package/dist/types/transitions/DitherWipeTransition.d.ts +35 -0
  707. package/dist/types/transitions/DitherWipeTransition.d.ts.map +1 -0
  708. package/dist/types/transitions/FadeTransition.d.ts +20 -0
  709. package/dist/types/transitions/FadeTransition.d.ts.map +1 -0
  710. package/dist/types/transitions/Letterbox.d.ts +33 -0
  711. package/dist/types/transitions/Letterbox.d.ts.map +1 -0
  712. package/dist/types/transitions/Transition.d.ts +22 -0
  713. package/dist/types/transitions/Transition.d.ts.map +1 -0
  714. package/dist/types/transitions/ditherMask.d.ts +13 -0
  715. package/dist/types/transitions/ditherMask.d.ts.map +1 -0
  716. package/dist/types/transitions/transitionTo.d.ts +16 -0
  717. package/dist/types/transitions/transitionTo.d.ts.map +1 -0
  718. package/dist/types/transitions/tweenDone.d.ts +5 -0
  719. package/dist/types/transitions/tweenDone.d.ts.map +1 -0
  720. package/dist/types/ui/Bar.d.ts +41 -0
  721. package/dist/types/ui/Bar.d.ts.map +1 -0
  722. package/dist/types/ui/Button.d.ts +47 -0
  723. package/dist/types/ui/Button.d.ts.map +1 -0
  724. package/dist/types/ui/Dialog.d.ts +47 -0
  725. package/dist/types/ui/Dialog.d.ts.map +1 -0
  726. package/dist/types/ui/FocusManager.d.ts +53 -0
  727. package/dist/types/ui/FocusManager.d.ts.map +1 -0
  728. package/dist/types/ui/Label.d.ts +24 -0
  729. package/dist/types/ui/Label.d.ts.map +1 -0
  730. package/dist/types/ui/List.d.ts +23 -0
  731. package/dist/types/ui/List.d.ts.map +1 -0
  732. package/dist/types/ui/Panel.d.ts +38 -0
  733. package/dist/types/ui/Panel.d.ts.map +1 -0
  734. package/dist/types/ui/ScrollView.d.ts +56 -0
  735. package/dist/types/ui/ScrollView.d.ts.map +1 -0
  736. package/dist/types/ui/Slider.d.ts +47 -0
  737. package/dist/types/ui/Slider.d.ts.map +1 -0
  738. package/dist/types/ui/Stack.d.ts +16 -0
  739. package/dist/types/ui/Stack.d.ts.map +1 -0
  740. package/dist/types/ui/Toggle.d.ts +31 -0
  741. package/dist/types/ui/Toggle.d.ts.map +1 -0
  742. package/dist/types/ui/UiHost.d.ts +18 -0
  743. package/dist/types/ui/UiHost.d.ts.map +1 -0
  744. package/dist/types/ui/UiPointerGate.d.ts +17 -0
  745. package/dist/types/ui/UiPointerGate.d.ts.map +1 -0
  746. package/dist/types/ui/UiRoot.d.ts +73 -0
  747. package/dist/types/ui/UiRoot.d.ts.map +1 -0
  748. package/dist/types/ui/Widget.d.ts +56 -0
  749. package/dist/types/ui/Widget.d.ts.map +1 -0
  750. package/dist/types/ui/dom/DomOverlay.d.ts +52 -0
  751. package/dist/types/ui/dom/DomOverlay.d.ts.map +1 -0
  752. package/dist/types/ui/dom/DomWorldAnchors.d.ts +50 -0
  753. package/dist/types/ui/dom/DomWorldAnchors.d.ts.map +1 -0
  754. package/dist/types/ui/dom/InputShield.d.ts +20 -0
  755. package/dist/types/ui/dom/InputShield.d.ts.map +1 -0
  756. package/dist/types/ui/dom/createStore.d.ts +22 -0
  757. package/dist/types/ui/dom/createStore.d.ts.map +1 -0
  758. package/dist/types/ui/dom/shieldDecision.d.ts +34 -0
  759. package/dist/types/ui/dom/shieldDecision.d.ts.map +1 -0
  760. package/dist/types/ui/dom/worldToScreen.d.ts +24 -0
  761. package/dist/types/ui/dom/worldToScreen.d.ts.map +1 -0
  762. package/dist/types/ui/index.d.ts +42 -0
  763. package/dist/types/ui/index.d.ts.map +1 -0
  764. package/dist/types/ui/layout/anchor.d.ts +9 -0
  765. package/dist/types/ui/layout/anchor.d.ts.map +1 -0
  766. package/dist/types/ui/layout/barDrain.d.ts +25 -0
  767. package/dist/types/ui/layout/barDrain.d.ts.map +1 -0
  768. package/dist/types/ui/layout/fitToViewport.d.ts +32 -0
  769. package/dist/types/ui/layout/fitToViewport.d.ts.map +1 -0
  770. package/dist/types/ui/layout/focusNav.d.ts +13 -0
  771. package/dist/types/ui/layout/focusNav.d.ts.map +1 -0
  772. package/dist/types/ui/layout/geometry.d.ts +35 -0
  773. package/dist/types/ui/layout/geometry.d.ts.map +1 -0
  774. package/dist/types/ui/layout/listWidth.d.ts +13 -0
  775. package/dist/types/ui/layout/listWidth.d.ts.map +1 -0
  776. package/dist/types/ui/layout/placeTooltip.d.ts +23 -0
  777. package/dist/types/ui/layout/placeTooltip.d.ts.map +1 -0
  778. package/dist/types/ui/layout/scroll.d.ts +17 -0
  779. package/dist/types/ui/layout/scroll.d.ts.map +1 -0
  780. package/dist/types/ui/layout/slider.d.ts +7 -0
  781. package/dist/types/ui/layout/slider.d.ts.map +1 -0
  782. package/dist/types/ui/layout/stack.d.ts +26 -0
  783. package/dist/types/ui/layout/stack.d.ts.map +1 -0
  784. package/dist/types/ui/layout/wrapRow.d.ts +6 -0
  785. package/dist/types/ui/layout/wrapRow.d.ts.map +1 -0
  786. package/dist/types/ui/rich/RichText.d.ts +48 -0
  787. package/dist/types/ui/rich/RichText.d.ts.map +1 -0
  788. package/dist/types/ui/rich/richFonts.d.ts +70 -0
  789. package/dist/types/ui/rich/richFonts.d.ts.map +1 -0
  790. package/dist/types/ui/rich/richLayout.d.ts +76 -0
  791. package/dist/types/ui/rich/richLayout.d.ts.map +1 -0
  792. package/dist/types/ui/rich/richMarkup.d.ts +48 -0
  793. package/dist/types/ui/rich/richMarkup.d.ts.map +1 -0
  794. package/dist/ui/Bar.js +53 -0
  795. package/dist/ui/Button.js +57 -0
  796. package/dist/ui/Dialog.js +55 -0
  797. package/dist/ui/FocusManager.js +96 -0
  798. package/dist/ui/Label.js +35 -0
  799. package/dist/ui/List.js +44 -0
  800. package/dist/ui/Panel.js +37 -0
  801. package/dist/ui/ScrollView.js +95 -0
  802. package/dist/ui/Slider.js +54 -0
  803. package/dist/ui/Stack.js +27 -0
  804. package/dist/ui/Toggle.js +36 -0
  805. package/dist/ui/UiHost.js +8 -0
  806. package/dist/ui/UiPointerGate.js +24 -0
  807. package/dist/ui/UiRoot.js +92 -0
  808. package/dist/ui/Widget.js +89 -0
  809. package/dist/ui/dom/DomOverlay.js +58 -0
  810. package/dist/ui/dom/DomWorldAnchors.js +58 -0
  811. package/dist/ui/dom/InputShield.js +26 -0
  812. package/dist/ui/dom/createStore.js +41 -0
  813. package/dist/ui/dom/shieldDecision.js +35 -0
  814. package/dist/ui/dom/worldToScreen.js +10 -0
  815. package/dist/ui/layout/anchor.js +19 -0
  816. package/dist/ui/layout/barDrain.js +24 -0
  817. package/dist/ui/layout/fitToViewport.js +16 -0
  818. package/dist/ui/layout/focusNav.js +41 -0
  819. package/dist/ui/layout/geometry.js +20 -0
  820. package/dist/ui/layout/listWidth.js +9 -0
  821. package/dist/ui/layout/placeTooltip.js +27 -0
  822. package/dist/ui/layout/scroll.js +23 -0
  823. package/dist/ui/layout/slider.js +19 -0
  824. package/dist/ui/layout/stack.js +26 -0
  825. package/dist/ui/layout/wrapRow.js +12 -0
  826. package/dist/ui/rich/RichText.js +87 -0
  827. package/dist/ui/rich/richFonts.js +105 -0
  828. package/dist/ui/rich/richLayout.js +132 -0
  829. package/dist/ui/rich/richMarkup.js +67 -0
  830. package/dist/ui.js +95 -0
  831. package/package.json +112 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asepriteTags.d.ts","sourceRoot":"","sources":["../../../src/anim/asepriteTags.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAIzD,2FAA2F;AAC3F,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,iBAAiB,CAEvE;AAED,sFAAsF;AACtF,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAGlE;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CA2B1G"}
@@ -0,0 +1,159 @@
1
+ import type { AnimationClip } from './Animator.js';
2
+ export interface AsepriteRect {
3
+ x: number;
4
+ y: number;
5
+ w: number;
6
+ h: number;
7
+ }
8
+ /** One frame as Aseprite writes it. */
9
+ export interface AsepriteJsonFrame {
10
+ /** Only in the "array" layout; the "hash" layout keys the frame by it instead. */
11
+ filename?: string;
12
+ frame: AsepriteRect;
13
+ rotated?: boolean;
14
+ trimmed?: boolean;
15
+ spriteSourceSize?: AsepriteRect;
16
+ sourceSize?: {
17
+ w: number;
18
+ h: number;
19
+ };
20
+ /** Milliseconds. */
21
+ duration?: number;
22
+ }
23
+ export interface AsepriteJsonTag {
24
+ name: string;
25
+ from: number;
26
+ to: number;
27
+ direction?: string;
28
+ /** A count as a string ("3"); absent means forever. Aseprite 1.3 and later. */
29
+ repeat?: string | number;
30
+ color?: string;
31
+ data?: string;
32
+ }
33
+ export interface AsepriteJsonSliceKey {
34
+ frame: number;
35
+ bounds: AsepriteRect;
36
+ center?: AsepriteRect;
37
+ pivot?: {
38
+ x: number;
39
+ y: number;
40
+ };
41
+ }
42
+ export interface AsepriteJsonSlice {
43
+ name: string;
44
+ color?: string;
45
+ data?: string;
46
+ keys: AsepriteJsonSliceKey[];
47
+ }
48
+ export interface AsepriteJsonLayer {
49
+ name: string;
50
+ group?: string;
51
+ opacity?: number;
52
+ blendMode?: string;
53
+ color?: string;
54
+ data?: string;
55
+ /** Cels carrying user data or a colour, when the export includes them. */
56
+ cels?: {
57
+ frame: number;
58
+ data?: string;
59
+ color?: string;
60
+ }[];
61
+ }
62
+ export interface AsepriteJson {
63
+ frames: AsepriteJsonFrame[] | Record<string, AsepriteJsonFrame>;
64
+ meta: {
65
+ app?: string;
66
+ version?: string;
67
+ image?: string;
68
+ format?: string;
69
+ size?: {
70
+ w: number;
71
+ h: number;
72
+ };
73
+ scale?: string;
74
+ frameTags?: AsepriteJsonTag[];
75
+ layers?: AsepriteJsonLayer[];
76
+ slices?: AsepriteJsonSlice[];
77
+ };
78
+ }
79
+ export type AsepriteDirection = 'forward' | 'reverse' | 'pingpong' | 'pingpong_reverse';
80
+ /** A frame of the sheet, by its index (the texture frame's name is that index as a string). */
81
+ export interface AsepriteFrame {
82
+ index: number;
83
+ /** Aseprite's file name for the frame ("hero 3.aseprite"); look a frame up by it with `frameNamed`. */
84
+ name: string;
85
+ /** Where it lies on the sheet image. */
86
+ rect: AsepriteRect;
87
+ /** Milliseconds. */
88
+ duration: number;
89
+ /** The untrimmed size of the sprite. */
90
+ sourceW: number;
91
+ sourceH: number;
92
+ /** Where the trimmed rect sits inside the untrimmed sprite (0, 0 when not trimmed). */
93
+ offsetX: number;
94
+ offsetY: number;
95
+ trimmed: boolean;
96
+ }
97
+ export interface AsepriteTag {
98
+ name: string;
99
+ from: number;
100
+ to: number;
101
+ direction: AsepriteDirection;
102
+ /** Passes to play; 0 is forever. */
103
+ repeat: number;
104
+ color?: string;
105
+ data?: string;
106
+ }
107
+ export interface AsepriteSliceKey {
108
+ /** The key holds from this frame until the next key's frame. */
109
+ frame: number;
110
+ bounds: AsepriteRect;
111
+ /** The 9-slice centre, in the slice's own coordinates. */
112
+ center?: AsepriteRect;
113
+ pivot?: {
114
+ x: number;
115
+ y: number;
116
+ };
117
+ }
118
+ export interface AsepriteSlice {
119
+ name: string;
120
+ color?: string;
121
+ data?: string;
122
+ /** Sorted by frame. */
123
+ keys: AsepriteSliceKey[];
124
+ }
125
+ export interface AsepriteLayer {
126
+ name: string;
127
+ group?: string;
128
+ opacity: number;
129
+ blendMode: string;
130
+ color?: string;
131
+ data?: string;
132
+ }
133
+ /** A cel's user data: what a game marks a frame with (a footstep, a hit) on a layer kept for marks. */
134
+ export interface AsepriteCue {
135
+ layer: string;
136
+ frame: number;
137
+ data: string;
138
+ }
139
+ /** A marker a clip fires when its playback reaches `frame` (the frame's position within the clip). */
140
+ export interface ClipMarker {
141
+ frame: number;
142
+ name: string;
143
+ }
144
+ export interface AsepriteSheet {
145
+ /** The sheet image's file name as written in the JSON (relative to the JSON file). */
146
+ image: string;
147
+ width: number;
148
+ height: number;
149
+ frames: AsepriteFrame[];
150
+ tags: AsepriteTag[];
151
+ /** One clip per tag, by tag name; frames are sheet frame indices, durations from the frames. */
152
+ clips: Record<string, AnimationClip>;
153
+ /** Every frame in order, looping: for a sheet with no tags. */
154
+ all: AnimationClip;
155
+ slices: AsepriteSlice[];
156
+ layers: AsepriteLayer[];
157
+ cues: AsepriteCue[];
158
+ }
159
+ //# sourceMappingURL=asepriteTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asepriteTypes.d.ts","sourceRoot":"","sources":["../../../src/anim/asepriteTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAOhD,MAAM,WAAW,YAAY;IAC3B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,uCAAuC;AACvC,MAAM,WAAW,iBAAiB;IAChC,kFAAkF;IAClF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,YAAY,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gBAAgB,CAAC,EAAE,YAAY,CAAC;IAChC,UAAU,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;K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Aa,EAAE,CAAC;IACxB,IAAI,EAAE,WAAW,EAAE,CAAC;CACrB"}
@@ -0,0 +1,21 @@
1
+ import type { AsepriteSheet, ClipMarker } from './asepriteTypes.js';
2
+ /**
3
+ * Reads Aseprite's exported sprite-sheet JSON — either frame layout, "hash" (frames keyed by file name) or "array" —
4
+ * into frames, one `Animator` clip per tag, slices, layers and cel cues. Pure: no image is touched, so it runs under
5
+ * node and in a worker; `addAsepriteTextures` / `loadAseprite` cut the sheet image by the frames it returns.
6
+ *
7
+ * ```ts
8
+ * const sheet = parseAseprite(json);
9
+ * const anim = new Animator(sheet.clips, 'idle'); // tag names are clip names; frames are sheet frame indices
10
+ * ```
11
+ */
12
+ export declare function parseAseprite(json: unknown): AsepriteSheet;
13
+ /** The index of the frame Aseprite named `name`, or -1. */
14
+ export declare function frameNamed(sheet: AsepriteSheet, name: string): number;
15
+ /**
16
+ * Markers for every clip from the sheet's cel cues: wherever a clip shows a sheet frame whose cel carries user data,
17
+ * a marker of that data at that position of the clip. A ping-pong shows a frame twice a round trip, so it fires twice,
18
+ * as a footstep should. `layer` keeps only the cues of one layer (a layer kept for marks, say "events").
19
+ */
20
+ export declare function clipMarkers(sheet: AsepriteSheet, layer?: string): Record<string, ClipMarker[]>;
21
+ //# sourceMappingURL=parseAseprite.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseAseprite.d.ts","sourceRoot":"","sources":["../../../src/anim/parseAseprite.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAMV,aAAa,EAGb,UAAU,EACX,MAAM,iBAAiB,CAAC;AAKzB;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,aAAa,CA6D1D;AA0BD,2DAA2D;AAC3D,wBAAgB,UAAU,CAAC,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAErE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,aAAa,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,CAAC,CAiB9F"}
@@ -0,0 +1,140 @@
1
+ import type { CanvasTexture } from '../core/TextureRegistry.js';
2
+ import { type TileMap, type Tileset } from '../tilemap/tiled.js';
3
+ import { type AtlasFrame } from './textureAtlas.js';
4
+ /** Where loaded images go: the stage's `TextureRegistry` satisfies it. */
5
+ export interface TextureSink {
6
+ addCanvas(key: string, canvas: HTMLCanvasElement): unknown;
7
+ addSpriteSheet(key: string, canvas: HTMLCanvasElement, size: {
8
+ frameWidth: number;
9
+ frameHeight: number;
10
+ }): unknown;
11
+ /** Needed only by `atlas`; the stage's `TextureRegistry` has it. */
12
+ addAtlas?(key: string, pages: readonly {
13
+ canvas: HTMLCanvasElement;
14
+ frames: readonly AtlasFrame[];
15
+ }[]): CanvasTexture | unknown;
16
+ }
17
+ /** What a fetch must answer with; `arrayBuffer` is optional so older custom transports keep working (blob is used). */
18
+ export interface AssetResponse {
19
+ ok: boolean;
20
+ status: number;
21
+ blob(): Promise<Blob>;
22
+ json(): Promise<unknown>;
23
+ text(): Promise<string>;
24
+ arrayBuffer?(): Promise<ArrayBuffer>;
25
+ }
26
+ /** What an atlas brought besides its textures: its frame names (every page) and animations. */
27
+ export interface AtlasInfo {
28
+ frames: string[];
29
+ animations: Record<string, string[]>;
30
+ pages: number;
31
+ }
32
+ export interface AssetLoaderOptions {
33
+ /** Prefix for relative URLs (default: none, so relative to the page). */
34
+ baseUrl?: string;
35
+ /** Requests running at once (default 6). */
36
+ concurrency?: number;
37
+ /** For tests and custom transports: defaults to the global `fetch`. */
38
+ fetch?: (url: string) => Promise<AssetResponse>;
39
+ /** Turns image bytes into a canvas; defaults to `createImageBitmap` drawn onto a new canvas. */
40
+ toCanvas?: (blob: Blob) => Promise<HTMLCanvasElement>;
41
+ /**
42
+ * The context `audio` decodes through (default: the engine's sound context, `sound.audioContext`, once a gesture
43
+ * opened it). Null means "not yet": the bytes are kept and decoded on first `decodeAudio`.
44
+ */
45
+ audioContext?: () => BaseAudioContext | null;
46
+ /** Installs a font's bytes; defaults to a `FontFace` added to `document.fonts`. */
47
+ addFont?: (family: string, data: ArrayBuffer, descriptors?: FontFaceDescriptors) => Promise<void>;
48
+ }
49
+ export interface TilemapAssetOptions {
50
+ /** The texture key a tileset's image is loaded under (default: the tileset's name). */
51
+ textureKey?: (tileset: Tileset) => string;
52
+ }
53
+ export interface LoadProgress {
54
+ done: number;
55
+ total: number;
56
+ /** The asset that just finished. */
57
+ key: string;
58
+ }
59
+ /** `url` resolved against `base` the way a browser would (a bare file name sits beside its map). */
60
+ export declare function resolveUrl(url: string, base: string): string;
61
+ /**
62
+ * Loads a scene's assets before it starts: queue them, then `await load()`. Images become textures in the stage's
63
+ * registry (frames of a sprite sheet named 0, 1, 2…); JSON, text and Tiled maps are kept here by key; atlases register every frame under their key; fonts go to
64
+ * `document.fonts`; audio is decoded into `AudioBuffer`s (or kept as bytes until a context exists). A failed asset
65
+ * fails the whole load with its URL in the message.
66
+ *
67
+ * ```ts
68
+ * override async onEnter() {
69
+ * const assets = new AssetLoader(this.engine.stage.textures);
70
+ * assets.spritesheet('hero', 'art/hero.png', { frameWidth: 20, frameHeight: 24 }).tilemap('level', 'maps/level.tmj');
71
+ * await assets.load(({ done, total }) => bar.set(done / total));
72
+ * const map = assets.map('level');
73
+ * }
74
+ * ```
75
+ */
76
+ export declare class AssetLoader {
77
+ private readonly textures;
78
+ private readonly options;
79
+ private readonly queue;
80
+ private readonly data;
81
+ private readonly maps;
82
+ private readonly atlases;
83
+ /** Decoded audio by key; a key with bytes only waits for a context (`decodeAudio`). */
84
+ private readonly audioBuffers;
85
+ private readonly audioBytes;
86
+ private readonly decoding;
87
+ private readonly fetcher;
88
+ private readonly toCanvas;
89
+ private total;
90
+ private done;
91
+ constructor(textures: TextureSink, options?: AssetLoaderOptions);
92
+ image(key: string, url: string): this;
93
+ /** An image cut into equal frames named 0, 1, 2…, left to right, then row by row. */
94
+ spritesheet(key: string, url: string, size: {
95
+ frameWidth: number;
96
+ frameHeight: number;
97
+ }): this;
98
+ json(key: string, url: string): this;
99
+ text(key: string, url: string): this;
100
+ /** A Tiled JSON map, then every tileset image it names (resolved beside the map file). */
101
+ tilemap(key: string, url: string, options?: TilemapAssetOptions): this;
102
+ /**
103
+ * A TexturePacker (or Pixi) JSON atlas, hash or array format: its page image, and for a multipack atlas every page
104
+ * named in `meta.related_multi_packs` (each resolved beside the file naming it). The first page is the texture
105
+ * `key`, further pages `key~1`, `key~2`…, and every frame of every page is found as `textures.get(key, frameName)`.
106
+ * Counts as one asset in the progress.
107
+ */
108
+ atlas(key: string, url: string): this;
109
+ /**
110
+ * A web font (woff2, woff, ttf) under `family`, added to `document.fonts` once loaded so canvas text and the DOM can
111
+ * use it at once — load fonts before the first `Text` is drawn, or it measures with the fallback.
112
+ */
113
+ font(family: string, url: string, descriptors?: FontFaceDescriptors): this;
114
+ /**
115
+ * A sound file decoded into an `AudioBuffer` through the engine's audio context (`getAudio`). Before any context
116
+ * exists (browsers open one only after a gesture) the bytes are kept and decoded by `decodeAudio`, so a loading
117
+ * screen never has to wait for the player to click.
118
+ */
119
+ audio(key: string, url: string): this;
120
+ /** A loaded sound, decoded; null while it waits for an audio context (`decodeAudio`). */
121
+ getAudio(key: string): AudioBuffer | null;
122
+ /** A loaded sound, decoding its kept bytes through `ctx` (default: the loader's context) the first time. */
123
+ decodeAudio(key: string, ctx?: BaseAudioContext): Promise<AudioBuffer>;
124
+ /** What a loaded atlas holds: its frame names and animations. */
125
+ getAtlas(key: string): AtlasInfo;
126
+ /** Runs everything queued; `onProgress` after each asset. Safe to call again after queueing more. */
127
+ load(onProgress?: (p: LoadProgress) => void): Promise<void>;
128
+ /** A loaded JSON value. */
129
+ getJson<T = unknown>(key: string): T;
130
+ /** A loaded text file. */
131
+ getText(key: string): string;
132
+ /** A loaded Tiled map. */
133
+ map(key: string): TileMap;
134
+ private add;
135
+ private request;
136
+ private blob;
137
+ private bytes;
138
+ private decode;
139
+ }
140
+ //# sourceMappingURL=AssetLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AssetLoader.d.ts","sourceRoot":"","sources":["../../../src/assets/AssetLoader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAc,KAAK,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAkD,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjG,0EAA0E;AAC1E,MAAM,WAAW,WAAW;IAC1B,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC;IAC3D,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,EAAE,IAAI,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC;IACnH,oEAAoE;IACpE,QAAQ,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS;QAAE,MAAM,EAAE,iBAAiB,CAAC;QAAC,MAAM,EAAE,SAAS,UAAU,EAAE,CAAA;KAAE,EAAE,GAAG,aAAa,GAAG,OAAO,CAAC;CACjI;AAED,uHAAuH;AACvH,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IACzB,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IACxB,WAAW,CAAC,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;CACtC;AAED,+FAA+F;AAC/F,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,UAA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,yFAAyF;IACzF,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI;IAOzC,4GAA4G;IAC5G,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,WAAW,CAAC;IAyBtE,iEAAiE;IACjE,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS;IAMhC,qGAAqG;IAC/F,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,YAAY,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAajE,2BAA2B;IAC3B,OAAO,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC;IAKpC,0BAA0B;IAC1B,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAI5B,0BAA0B;IAC1B,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAMzB,OAAO,CAAC,GAAG;YAMG,OAAO;YAYP,IAAI;YAIJ,KAAK;YAKL,MAAM;CAQrB"}
@@ -0,0 +1,27 @@
1
+ import type { AsepriteSheet } from '../anim/asepriteTypes.js';
2
+ import type { CanvasTexture } from '../core/TextureRegistry.js';
3
+ import { type AssetLoaderOptions } from './AssetLoader.js';
4
+ /** Where an Aseprite sheet's texture goes: the stage's `TextureRegistry` satisfies it. */
5
+ export interface AsepriteTextureSink {
6
+ addCanvas(key: string, canvas: HTMLCanvasElement): CanvasTexture;
7
+ }
8
+ /** Fetch and decode hooks, as `AssetLoader` takes them (tests, custom transports, a base URL). */
9
+ export type AsepriteLoadOptions = Pick<AssetLoaderOptions, 'baseUrl' | 'fetch' | 'toCanvas'>;
10
+ /**
11
+ * Registers `canvas` (the sheet image) under `key` with one frame per sheet frame, named by its index ("0", "1"…), so
12
+ * the clips `parseAseprite` returns play on an `Image` of that key as they are. A trimmed frame keeps its untrimmed
13
+ * size and offset (Pixi's `orig` and `trim`), so a sprite anchored at its feet does not jump as the trim changes.
14
+ */
15
+ export declare function addAsepriteTextures(textures: AsepriteTextureSink, key: string, canvas: HTMLCanvasElement, sheet: AsepriteSheet): CanvasTexture;
16
+ /**
17
+ * Loads an Aseprite export — the JSON, then the sheet image it names (resolved beside the JSON) — registers its
18
+ * frames under `key` and returns the parsed sheet (clips, slices, layers, cues).
19
+ *
20
+ * ```ts
21
+ * const [hero] = await Promise.all([loadAseprite(stage.textures, 'hero', 'art/hero.json'), assets.load()]);
22
+ * const sprite = stage.add.image(0, 0, 'hero', 0);
23
+ * const anim = new Animator(hero.clips, 'idle');
24
+ * ```
25
+ */
26
+ export declare function loadAseprite(textures: AsepriteTextureSink, key: string, jsonUrl: string, options?: AsepriteLoadOptions): Promise<AsepriteSheet>;
27
+ //# sourceMappingURL=loadAseprite.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loadAseprite.d.ts","sourceRoot":"","sources":["../../../src/assets/loadAseprite.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAc,KAAK,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEpE,0FAA0F;AAC1F,MAAM,WAAW,mBAAmB;IAClC,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,GAAG,aAAa,CAAC;CAClE;AAED,kGAAkG;AAClG,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,kBAAkB,EAAE,SAAS,GAAG,OAAO,GAAG,UAAU,CAAC,CAAC;AAE7F;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,mBAAmB,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,EAAE,KAAK,EAAE,aAAa,GAAG,aAAa,CAoB9I;AAED;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAAC,QAAQ,EAAE,mBAAmB,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAwB,GAAG,OAAO,CAAC,aAAa,CAAC,CAmBzJ"}
@@ -0,0 +1,35 @@
1
+ import type { PackedFrame } from '../core/TextureRegistry.js';
2
+ /**
3
+ * Reads TexturePacker's JSON atlases — the "JSON (Hash)" and "JSON (Array)" exports, which Pixi's own `Spritesheet`
4
+ * also reads — into plain numbers, with no Pixi or DOM, so the parsing is tested under node. A multipack atlas lists
5
+ * its other pages' JSON files in `meta.related_multi_packs`; the loader follows them and registers every frame of
6
+ * every page under one key.
7
+ */
8
+ /** One frame as the registry needs it: where it lies on its page and how it is trimmed or turned. */
9
+ export type AtlasFrame = PackedFrame;
10
+ /** One page of an atlas: its image and its frames. */
11
+ export interface PackedAtlasPage {
12
+ /** The page image as named in `meta.image`, relative to the JSON file. */
13
+ image: string;
14
+ frames: AtlasFrame[];
15
+ /** Animations by name, each a list of frame names (`animations` in Pixi-flavoured JSON). */
16
+ animations: Record<string, string[]>;
17
+ /** Further pages' JSON files (`meta.related_multi_packs`), relative to this one. */
18
+ related: string[];
19
+ /** Pixels per unit the page was exported at (`meta.scale`, default 1). */
20
+ scale: number;
21
+ }
22
+ /** Parses one atlas JSON file; throws naming `where` (its URL) when it is not one. */
23
+ export declare function parseAtlas(json: unknown, where?: string): PackedAtlasPage;
24
+ /**
25
+ * Every page of a multipack atlas, the first first, each JSON fetched once however the pages name each other
26
+ * (TexturePacker lists every other page in each page). `load(url)` returns a page's parsed JSON; `resolve` turns a
27
+ * related name into a URL beside the file naming it.
28
+ */
29
+ export declare function collectAtlasPages(url: string, load: (url: string) => Promise<PackedAtlasPage>, resolve: (name: string, base: string) => string): Promise<{
30
+ url: string;
31
+ page: PackedAtlasPage;
32
+ }[]>;
33
+ /** Frame names that appear on more than one page: the later page's frame wins, which is almost always a mistake. */
34
+ export declare function duplicateFrames(pages: readonly PackedAtlasPage[]): string[];
35
+ //# sourceMappingURL=textureAtlas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"textureAtlas.d.ts","sourceRoot":"","sources":["../../../src/assets/textureAtlas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;;;;GAKG;AAEH,qGAAqG;AACrG,MAAM,MAAM,UAAU,GAAG,WAAW,CAAC;AAErC,sDAAsD;AACtD,MAAM,WAAW,eAAe;IAC9B,0EAA0E;IAC1E,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,4FAA4F;IAC5F,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACrC,oFAAoF;IACpF,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,0EAA0E;IAC1E,KAAK,EAAE,MAAM,CAAC;CACf;AAsDD,sFAAsF;AACtF,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,SAAU,GAAG,eAAe,CAqB1E;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,eAAe,CAAC,EAC/C,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,GAC9C,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,eAAe,CAAA;CAAE,EAAE,CAAC,CAgBnD;AAED,oHAAoH;AACpH,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,eAAe,EAAE,GAAG,MAAM,EAAE,CAK3E"}
@@ -0,0 +1,33 @@
1
+ /** What a surface sounds like underfoot: a step, and a beat of hooves (a mount) if it differs. */
2
+ export interface SurfaceSounds {
3
+ step: string;
4
+ hoof?: string;
5
+ }
6
+ export interface FootstepOptions {
7
+ /** Per surface name (`'grass'`, `'stone'`, `'wood'`…), the sounds a foot makes on it. */
8
+ sounds: Record<string, SurfaceSounds>;
9
+ /** The surface of anywhere `surfaceAt` does not name. */
10
+ fallback: string;
11
+ /** Weight of a step against other sounds (default 0.5). */
12
+ gain?: number;
13
+ /** Beyond this (world px) nobody else's steps are heard (default 200). */
14
+ range?: number;
15
+ }
16
+ /**
17
+ * Footsteps by the ground under the feet. The game says what a point is made of (`surfaceAt`: a tile's surface, a
18
+ * Tiled property, a floor collider), and calls `step` on each beat of a walk or a gait; the sound is the surface's,
19
+ * through `sound` at the feet, quieter and muffled with distance like every other sound, and dropped first when too
20
+ * many sounds play at once.
21
+ */
22
+ export declare class Footsteps {
23
+ private readonly options;
24
+ private surfaceAt;
25
+ constructor(options: FootstepOptions);
26
+ /** Where the surface of a world point comes from; `undefined` is the fallback surface. */
27
+ setSurfaceAt(surfaceAt: (x: number, y: number) => string | undefined): void;
28
+ /** The surface at a world point. */
29
+ surface(x: number, y: number): string;
30
+ /** One step (or a beat of hooves when `mounted`) at the feet, world x/y; `local` is the player's own. */
31
+ step(x: number, y: number, local: boolean, mounted?: boolean): void;
32
+ }
33
+ //# sourceMappingURL=Footsteps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Footsteps.d.ts","sourceRoot":"","sources":["../../../src/audio/Footsteps.ts"],"names":[],"mappings":"AAEA,kGAAkG;AAClG,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,yFAAyF;IACzF,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACtC,yDAAyD;IACzD,QAAQ,EAAE,MAAM,CAAC;IACjB,2DAA2D;IAC3D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;GAKG;AACH,qBAAa,SAAS;IAGR,OAAO,CAAC,QAAQ,CAAC,OAAO;IAFpC,OAAO,CAAC,SAAS,CAAiE;gBAErD,OAAO,EAAE,eAAe;IAErD,0FAA0F;IAC1F,YAAY,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,GAAG,IAAI;IAI3E,oCAAoC;IACpC,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM;IAIrC,yGAAyG;IACzG,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,UAAQ,GAAG,IAAI;CAMlE"}
@@ -0,0 +1,65 @@
1
+ import { MusicChannel, type PlayOptions } from './music/MusicChannel.js';
2
+ export type { PlayOptions } from './music/MusicChannel.js';
3
+ /**
4
+ * How music reaches the speaker: `'element'` on the `<audio>` element's own volume (nothing in between; a file from
5
+ * another origin plays as it is), `'graph'` through a Web Audio gain (the only way where that volume is read-only),
6
+ * `'auto'` (default) the graph only where it has to be (iOS).
7
+ */
8
+ export type MusicRoute = 'auto' | 'element' | 'graph';
9
+ export interface MusicOptions {
10
+ route?: MusicRoute;
11
+ /** Stop the music while the page is hidden (an app sent to the background). Default: on touch devices. */
12
+ pauseInBackground?: boolean;
13
+ }
14
+ /**
15
+ * Background music in layers: each named channel (`'music'` by default, `'ambience'`, any other) plays one looping
16
+ * track at a time, crossfaded when it changes, all at `engineSettings.musicVolume`. Tracks stream through `<audio>`
17
+ * elements (no decoding a whole song into memory).
18
+ *
19
+ * Browsers start sound only after a user gesture: a track played before one starts on the first tap or key. On iOS the
20
+ * graph's context is woken inside that gesture too, and again after the app comes back from the background.
21
+ *
22
+ * ```ts
23
+ * music.play('music/forest.ogg'); // the 'music' channel
24
+ * music.channel('ambience').play('amb/wind.ogg', { volume: 0.5 }); // a second layer under it
25
+ * music.play('music/boss.ogg', { fadeMs: 600 }); // crossfades the first only
26
+ * music.stop(2000);
27
+ * ```
28
+ */
29
+ export declare class MusicPlayer {
30
+ private readonly channels;
31
+ private route;
32
+ private graph;
33
+ private graphLocked;
34
+ private pauseInBackground;
35
+ private installed;
36
+ /** Picks the route and background behaviour; call before the first track for the route to apply to every track. */
37
+ configure(options: MusicOptions): this;
38
+ /** The channel named `name`, made on first use. */
39
+ channel(name?: string): MusicChannel;
40
+ /** The url the `'music'` channel plays, if any. */
41
+ get current(): string | null;
42
+ /** Plays `url` on the `'music'` channel. */
43
+ play(url: string, options?: PlayOptions): void;
44
+ /** Fades every channel out. */
45
+ stop(fadeMs?: number): void;
46
+ pause(): void;
47
+ resume(): void;
48
+ destroy(): void;
49
+ private voiceFor;
50
+ private throughGraph;
51
+ private context;
52
+ /** Retries every refused start and follows the volume; the graph's context resumes inside the gesture that called it. */
53
+ private wake;
54
+ private install;
55
+ }
56
+ /** A fade's value at `now`: linear from `from` to `to` over `ms`. */
57
+ export declare function fadeValue(f: {
58
+ from: number;
59
+ to: number;
60
+ start: number;
61
+ ms: number;
62
+ }, now: number): number;
63
+ /** The shared music player. */
64
+ export declare const music: MusicPlayer;
65
+ //# sourceMappingURL=MusicPlayer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MusicPlayer.d.ts","sourceRoot":"","sources":["../../../src/audio/MusicPlayer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGtE,YAAY,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAEtD,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,0GAA0G;IAC1G,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;;;;;;;;;;GAcG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmC;IAC5D,OAAO,CAAC,KAAK,CAAsB;IACnC,OAAO,CAAC,KAAK,CAA6B;IAC1C,OAAO,CAAC,WAAW,CAAwB;IAC3C,OAAO,CAAC,iBAAiB,CAAwB;IACjD,OAAO,CAAC,SAAS,CAAS;IAE1B,mHAAmH;IACnH,SAAS,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI;IAMtC,mDAAmD;IACnD,OAAO,CAAC,IAAI,SAAU,GAAG,YAAY;IAUrC,mDAAmD;IACnD,IAAI,OAAO,IAAI,MAAM,GAAG,IAAI,CAE3B;IAED,4CAA4C;IAC5C,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,IAAI;IAI9C,+BAA+B;IAC/B,IAAI,CAAC,MAAM,SAAO,GAAG,IAAI;IAIzB,KAAK,IAAI,IAAI;IAIb,MAAM,IAAI,IAAI;IAId,OAAO,IAAI,IAAI;IAOf,OAAO,CAAC,QAAQ;IAKhB,OAAO,CAAC,YAAY;IAKpB,OAAO,CAAC,OAAO;IAQf,yHAAyH;IACzH,OAAO,CAAC,IAAI;IAMZ,OAAO,CAAC,OAAO;CAahB;AAED,qEAAqE;AACrE,wBAAgB,SAAS,CAAC,CAAC,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAIzG;AAED,+BAA+B;AAC/B,eAAO,MAAM,KAAK,aAAoB,CAAC"}
@@ -0,0 +1,47 @@
1
+ export interface SoundOptions {
2
+ /** Where it happened in the world; absent for what happens to or is done by the local player. */
3
+ x?: number;
4
+ y?: number;
5
+ /** Done by (or to) the local player: full weight. */
6
+ local?: boolean;
7
+ /** Extra weight (default 1). */
8
+ gain?: number;
9
+ /** How far away it can be heard (px), when nearer than `HEARING`. */
10
+ range?: number;
11
+ /** Skipped when the mix is busy (footsteps). */
12
+ minor?: boolean;
13
+ /** Cut off after this long (ms), faded over `CUT_FADE_MS`: a cast's sound ends with the cast. */
14
+ maxMs?: number;
15
+ }
16
+ export declare class SoundEngine {
17
+ private ctx;
18
+ private master;
19
+ private readonly buffers;
20
+ private readonly samples;
21
+ private readonly lastAt;
22
+ private voices;
23
+ /** Where the local player stands, set by the world scene; null off the world screens. */
24
+ listener: () => {
25
+ x: number;
26
+ y: number;
27
+ } | null;
28
+ private onRunning;
29
+ constructor();
30
+ /**
31
+ * The effects' audio context once something opened it (the first gesture does), else null: never created here, so
32
+ * asking does not open a context the browser would hold suspended. `AssetLoader.audio` decodes through it.
33
+ */
34
+ get audioContext(): AudioContext | null;
35
+ play(name: string | undefined, opts?: SoundOptions): void;
36
+ private level;
37
+ private context;
38
+ /**
39
+ * Starts decoding every recorded take and renders every recipe not rendered yet, one per task, once the context
40
+ * first runs — so the first swing of a fight does not pay for its sound in that frame.
41
+ */
42
+ private prerender;
43
+ /** Rendered on first use or by `prerender` (a few ms each), then kept. */
44
+ private buffer;
45
+ }
46
+ export declare const sound: SoundEngine;
47
+ //# sourceMappingURL=SoundEngine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SoundEngine.d.ts","sourceRoot":"","sources":["../../../src/audio/SoundEngine.ts"],"names":[],"mappings":"AAqCA,MAAM,WAAW,YAAY;IAC3B,iGAAiG;IACjG,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,qDAAqD;IACrD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,gCAAgC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,iGAAiG;IACjG,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,WAAW;IACtB,OAAO,CAAC,GAAG,CAA6B;IACxC,OAAO,CAAC,MAAM,CAAyB;IACvC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyC;IACjE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoB;IAC5C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA6B;IACpD,OAAO,CAAC,MAAM,CAAK;IACnB,yFAAyF;IACzF,QAAQ,EAAE,MAAM;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAc;IAC7D,OAAO,CAAC,SAAS,CAAwC;;IAmCzD;;;OAGG;IACH,IAAI,YAAY,IAAI,YAAY,GAAG,IAAI,CAEtC;IAED,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,GAAE,YAAiB,GAAG,IAAI;IA0D7D,OAAO,CAAC,KAAK;IAIb,OAAO,CAAC,OAAO;IA0Bf;;;OAGG;IACH,OAAO,CAAC,SAAS;IAajB,0EAA0E;IAC1E,OAAO,CAAC,MAAM;CAaf;AAED,eAAO,MAAM,KAAK,aAAoB,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** The cleaned mono samples, or null for a take that is silence. */
2
+ export declare function cleanSamples(channels: Float32Array[], sampleRate: number): Float32Array | null;
3
+ //# sourceMappingURL=cleanTake.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cleanTake.d.ts","sourceRoot":"","sources":["../../../src/audio/cleanTake.ts"],"names":[],"mappings":"AAoBA,oEAAoE;AACpE,wBAAgB,YAAY,CAAC,QAAQ,EAAE,YAAY,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI,CA6B9F"}
@@ -0,0 +1,14 @@
1
+ import { type MusicVoice } from './musicVoice.js';
2
+ /** A track on the `<audio>` element's own volume, faded frame by frame: nothing between the file and the speaker. */
3
+ export declare class ElementVoice implements MusicVoice {
4
+ readonly el: HTMLAudioElement;
5
+ private fading;
6
+ constructor(el: HTMLAudioElement);
7
+ level(): number;
8
+ set(level: number): void;
9
+ fade(to: number, ms: number, done?: () => void): void;
10
+ get busy(): boolean;
11
+ dispose(): void;
12
+ private stopFade;
13
+ }
14
+ //# sourceMappingURL=ElementVoice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ElementVoice.d.ts","sourceRoot":"","sources":["../../../../src/audio/music/ElementVoice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAExD,qHAAqH;AACrH,qBAAa,YAAa,YAAW,UAAU;IAGjC,QAAQ,CAAC,EAAE,EAAE,gBAAgB;IAFzC,OAAO,CAAC,MAAM,CAAuB;gBAEhB,EAAE,EAAE,gBAAgB;IAEzC,KAAK,IAAI,MAAM;IAIf,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAKxB,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,IAAI,GAAG,IAAI;IAgBrD,IAAI,IAAI,IAAI,OAAO,CAElB;IAED,OAAO,IAAI,IAAI;IAOf,OAAO,CAAC,QAAQ;CAIjB"}
@@ -0,0 +1,22 @@
1
+ import { type MusicVoice } from './musicVoice.js';
2
+ /**
3
+ * A track routed `<audio>` → MediaElementSource → gain → speakers, so its volume and crossfades work where the
4
+ * element's own `volume` is read-only (iOS). The fade is scheduled on the audio clock (a ramp), so it runs even while
5
+ * the page draws no frames. A cross-origin file without CORS headers plays silent this way: serve music from the
6
+ * game's own origin, or keep `ElementVoice` where volume works.
7
+ */
8
+ export declare class GraphVoice implements MusicVoice {
9
+ readonly el: HTMLAudioElement;
10
+ private readonly graph;
11
+ private readonly gain;
12
+ private readonly source;
13
+ private timer;
14
+ constructor(el: HTMLAudioElement, graph: AudioContext);
15
+ level(): number;
16
+ set(level: number): void;
17
+ fade(to: number, ms: number, done?: () => void): void;
18
+ get busy(): boolean;
19
+ dispose(): void;
20
+ private stopFade;
21
+ }
22
+ //# sourceMappingURL=GraphVoice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GraphVoice.d.ts","sourceRoot":"","sources":["../../../../src/audio/music/GraphVoice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAExD;;;;;GAKG;AACH,qBAAa,UAAW,YAAW,UAAU;IAMzC,QAAQ,CAAC,EAAE,EAAE,gBAAgB;IAC7B,OAAO,CAAC,QAAQ,CAAC,KAAK;IANxB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAW;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA8B;IACrD,OAAO,CAAC,KAAK,CAA8C;gBAGhD,EAAE,EAAE,gBAAgB,EACZ,KAAK,EAAE,YAAY;IAQtC,KAAK,IAAI,MAAM;IAIf,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAOxB,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,IAAI,GAAG,IAAI;IAarD,IAAI,IAAI,IAAI,OAAO,CAElB;IAED,OAAO,IAAI,IAAI;IAOf,OAAO,CAAC,QAAQ;CAIjB"}