@codexo/exojs 0.7.12 → 0.8.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 (219) hide show
  1. package/CHANGELOG.md +737 -0
  2. package/dist/esm/core/Application.d.ts +3 -1
  3. package/dist/esm/core/Application.js +7 -6
  4. package/dist/esm/core/Application.js.map +1 -1
  5. package/dist/esm/core/Scene.d.ts +30 -0
  6. package/dist/esm/core/Scene.js +56 -0
  7. package/dist/esm/core/Scene.js.map +1 -1
  8. package/dist/esm/core/SceneManager.js +2 -2
  9. package/dist/esm/core/SceneManager.js.map +1 -1
  10. package/dist/esm/debug/DebugOverlay.js +2 -2
  11. package/dist/esm/debug/DebugOverlay.js.map +1 -1
  12. package/dist/esm/debug/PointerStackLayer.js +1 -1
  13. package/dist/esm/debug/PointerStackLayer.js.map +1 -1
  14. package/dist/esm/index.js +32 -10
  15. package/dist/esm/index.js.map +1 -1
  16. package/dist/esm/input/ArcadeStickGamepadMapping.js +18 -19
  17. package/dist/esm/input/ArcadeStickGamepadMapping.js.map +1 -1
  18. package/dist/esm/input/Gamepad.d.ts +164 -62
  19. package/dist/esm/input/Gamepad.js +290 -134
  20. package/dist/esm/input/Gamepad.js.map +1 -1
  21. package/dist/esm/input/GamepadAxis.d.ts +120 -0
  22. package/dist/esm/input/GamepadAxis.js +106 -0
  23. package/dist/esm/input/GamepadAxis.js.map +1 -0
  24. package/dist/esm/input/GamepadButton.d.ts +110 -0
  25. package/dist/esm/input/GamepadButton.js +99 -0
  26. package/dist/esm/input/GamepadButton.js.map +1 -0
  27. package/dist/esm/input/GamepadDefinitions.js +4 -0
  28. package/dist/esm/input/GamepadDefinitions.js.map +1 -1
  29. package/dist/esm/input/GamepadMapping.d.ts +28 -24
  30. package/dist/esm/input/GamepadMapping.js +33 -16
  31. package/dist/esm/input/GamepadMapping.js.map +1 -1
  32. package/dist/esm/input/GamepadPromptLayouts.d.ts +10 -8
  33. package/dist/esm/input/GamepadPromptLayouts.js +21 -20
  34. package/dist/esm/input/GamepadPromptLayouts.js.map +1 -1
  35. package/dist/esm/input/GenericDualAnalogGamepadMapping.d.ts +6 -3
  36. package/dist/esm/input/GenericDualAnalogGamepadMapping.js +55 -46
  37. package/dist/esm/input/GenericDualAnalogGamepadMapping.js.map +1 -1
  38. package/dist/esm/input/InputBinding.d.ts +74 -0
  39. package/dist/esm/input/InputBinding.js +100 -0
  40. package/dist/esm/input/InputBinding.js.map +1 -0
  41. package/dist/esm/input/InputManager.d.ts +79 -33
  42. package/dist/esm/input/InputManager.js +229 -104
  43. package/dist/esm/input/InputManager.js.map +1 -1
  44. package/dist/esm/input/InteractionManager.d.ts +1 -1
  45. package/dist/esm/input/InteractionManager.js +13 -13
  46. package/dist/esm/input/InteractionManager.js.map +1 -1
  47. package/dist/esm/input/JoyConLeftGamepadMapping.d.ts +14 -9
  48. package/dist/esm/input/JoyConLeftGamepadMapping.js +39 -9
  49. package/dist/esm/input/JoyConLeftGamepadMapping.js.map +1 -1
  50. package/dist/esm/input/JoyConRightGamepadMapping.d.ts +14 -9
  51. package/dist/esm/input/JoyConRightGamepadMapping.js +35 -9
  52. package/dist/esm/input/JoyConRightGamepadMapping.js.map +1 -1
  53. package/dist/esm/input/Pointer.d.ts +84 -71
  54. package/dist/esm/input/Pointer.js +71 -71
  55. package/dist/esm/input/Pointer.js.map +1 -1
  56. package/dist/esm/input/SteamDeckGamepadMapping.d.ts +18 -0
  57. package/dist/esm/input/SteamDeckGamepadMapping.js +76 -0
  58. package/dist/esm/input/SteamDeckGamepadMapping.js.map +1 -0
  59. package/dist/esm/input/index.d.ts +7 -4
  60. package/dist/esm/input/types.d.ts +0 -76
  61. package/dist/esm/input/types.js +1 -80
  62. package/dist/esm/input/types.js.map +1 -1
  63. package/dist/esm/particles/ParticleSystem.d.ts +180 -83
  64. package/dist/esm/particles/ParticleSystem.js +446 -133
  65. package/dist/esm/particles/ParticleSystem.js.map +1 -1
  66. package/dist/esm/particles/distributions/BoxArea.d.ts +17 -0
  67. package/dist/esm/particles/distributions/BoxArea.js +48 -0
  68. package/dist/esm/particles/distributions/BoxArea.js.map +1 -0
  69. package/dist/esm/particles/distributions/CircleArea.d.ts +19 -0
  70. package/dist/esm/particles/distributions/CircleArea.js +33 -0
  71. package/dist/esm/particles/distributions/CircleArea.js.map +1 -0
  72. package/dist/esm/particles/distributions/ConeDirection.d.ts +28 -0
  73. package/dist/esm/particles/distributions/ConeDirection.js +44 -0
  74. package/dist/esm/particles/distributions/ConeDirection.js.map +1 -0
  75. package/dist/esm/particles/distributions/Constant.d.ts +17 -0
  76. package/dist/esm/particles/distributions/Constant.js +35 -0
  77. package/dist/esm/particles/distributions/Constant.js.map +1 -0
  78. package/dist/esm/particles/distributions/Curve.d.ts +30 -0
  79. package/dist/esm/particles/distributions/Curve.js +53 -0
  80. package/dist/esm/particles/distributions/Curve.js.map +1 -0
  81. package/dist/esm/particles/distributions/Distribution.d.ts +45 -0
  82. package/dist/esm/particles/distributions/Gradient.d.ts +40 -0
  83. package/dist/esm/particles/distributions/Gradient.js +72 -0
  84. package/dist/esm/particles/distributions/Gradient.js.map +1 -0
  85. package/dist/esm/particles/distributions/LineSegment.d.ts +15 -0
  86. package/dist/esm/particles/distributions/LineSegment.js +27 -0
  87. package/dist/esm/particles/distributions/LineSegment.js.map +1 -0
  88. package/dist/esm/particles/distributions/Range.d.ts +12 -0
  89. package/dist/esm/particles/distributions/Range.js +19 -0
  90. package/dist/esm/particles/distributions/Range.js.map +1 -0
  91. package/dist/esm/particles/distributions/VectorRange.d.ts +20 -0
  92. package/dist/esm/particles/distributions/VectorRange.js +31 -0
  93. package/dist/esm/particles/distributions/VectorRange.js.map +1 -0
  94. package/dist/esm/particles/distributions/index.d.ts +12 -0
  95. package/dist/esm/particles/gpu/ParticleGpuState.d.ts +57 -0
  96. package/dist/esm/particles/gpu/ParticleGpuState.js +508 -0
  97. package/dist/esm/particles/gpu/ParticleGpuState.js.map +1 -0
  98. package/dist/esm/particles/index.d.ts +2 -10
  99. package/dist/esm/particles/modules/AlphaFadeOverLifetime.d.ts +24 -0
  100. package/dist/esm/particles/modules/AlphaFadeOverLifetime.js +60 -0
  101. package/dist/esm/particles/modules/AlphaFadeOverLifetime.js.map +1 -0
  102. package/dist/esm/particles/modules/ApplyForce.d.ts +20 -0
  103. package/dist/esm/particles/modules/ApplyForce.js +48 -0
  104. package/dist/esm/particles/modules/ApplyForce.js.map +1 -0
  105. package/dist/esm/particles/modules/AttractToPoint.d.ts +27 -0
  106. package/dist/esm/particles/modules/AttractToPoint.js +73 -0
  107. package/dist/esm/particles/modules/AttractToPoint.js.map +1 -0
  108. package/dist/esm/particles/modules/BurstSpawn.d.ts +53 -0
  109. package/dist/esm/particles/modules/BurstSpawn.js +94 -0
  110. package/dist/esm/particles/modules/BurstSpawn.js.map +1 -0
  111. package/dist/esm/particles/modules/ColorOverLifetime.d.ts +22 -0
  112. package/dist/esm/particles/modules/ColorOverLifetime.js +65 -0
  113. package/dist/esm/particles/modules/ColorOverLifetime.js.map +1 -0
  114. package/dist/esm/particles/modules/ColorOverSpeed.d.ts +27 -0
  115. package/dist/esm/particles/modules/ColorOverSpeed.js +86 -0
  116. package/dist/esm/particles/modules/ColorOverSpeed.js.map +1 -0
  117. package/dist/esm/particles/modules/DeathModule.d.ts +24 -0
  118. package/dist/esm/particles/modules/DeathModule.js +25 -0
  119. package/dist/esm/particles/modules/DeathModule.js.map +1 -0
  120. package/dist/esm/particles/modules/Drag.d.ts +20 -0
  121. package/dist/esm/particles/modules/Drag.js +45 -0
  122. package/dist/esm/particles/modules/Drag.js.map +1 -0
  123. package/dist/esm/particles/modules/OrbitalForce.d.ts +28 -0
  124. package/dist/esm/particles/modules/OrbitalForce.js +65 -0
  125. package/dist/esm/particles/modules/OrbitalForce.js.map +1 -0
  126. package/dist/esm/particles/modules/RateSpawn.d.ts +41 -0
  127. package/dist/esm/particles/modules/RateSpawn.js +76 -0
  128. package/dist/esm/particles/modules/RateSpawn.js.map +1 -0
  129. package/dist/esm/particles/modules/RepelFromPoint.d.ts +24 -0
  130. package/dist/esm/particles/modules/RepelFromPoint.js +76 -0
  131. package/dist/esm/particles/modules/RepelFromPoint.js.map +1 -0
  132. package/dist/esm/particles/modules/RotateOverLifetime.d.ts +20 -0
  133. package/dist/esm/particles/modules/RotateOverLifetime.js +43 -0
  134. package/dist/esm/particles/modules/RotateOverLifetime.js.map +1 -0
  135. package/dist/esm/particles/modules/ScaleOverLifetime.d.ts +26 -0
  136. package/dist/esm/particles/modules/ScaleOverLifetime.js +59 -0
  137. package/dist/esm/particles/modules/ScaleOverLifetime.js.map +1 -0
  138. package/dist/esm/particles/modules/SpawnModule.d.ts +30 -0
  139. package/dist/esm/particles/modules/SpawnModule.js +31 -0
  140. package/dist/esm/particles/modules/SpawnModule.js.map +1 -0
  141. package/dist/esm/particles/modules/SpawnOnDeath.d.ts +24 -0
  142. package/dist/esm/particles/modules/SpawnOnDeath.js +47 -0
  143. package/dist/esm/particles/modules/SpawnOnDeath.js.map +1 -0
  144. package/dist/esm/particles/modules/Turbulence.d.ts +30 -0
  145. package/dist/esm/particles/modules/Turbulence.js +122 -0
  146. package/dist/esm/particles/modules/Turbulence.js.map +1 -0
  147. package/dist/esm/particles/modules/UpdateModule.d.ts +95 -0
  148. package/dist/esm/particles/modules/UpdateModule.js +66 -0
  149. package/dist/esm/particles/modules/UpdateModule.js.map +1 -0
  150. package/dist/esm/particles/modules/VelocityOverLifetime.d.ts +30 -0
  151. package/dist/esm/particles/modules/VelocityOverLifetime.js +84 -0
  152. package/dist/esm/particles/modules/VelocityOverLifetime.js.map +1 -0
  153. package/dist/esm/particles/modules/WgslContribution.d.ts +81 -0
  154. package/dist/esm/particles/modules/WgslContribution.js +34 -0
  155. package/dist/esm/particles/modules/WgslContribution.js.map +1 -0
  156. package/dist/esm/particles/modules/index.d.ts +22 -0
  157. package/dist/esm/rendering/webgl2/WebGl2ParticleRenderer.d.ts +9 -14
  158. package/dist/esm/rendering/webgl2/WebGl2ParticleRenderer.js +90 -61
  159. package/dist/esm/rendering/webgl2/WebGl2ParticleRenderer.js.map +1 -1
  160. package/dist/esm/rendering/webgl2/glsl/particle.vert.js +1 -1
  161. package/dist/esm/rendering/webgpu/WebGpuParticleRenderer.d.ts +9 -0
  162. package/dist/esm/rendering/webgpu/WebGpuParticleRenderer.js +107 -23
  163. package/dist/esm/rendering/webgpu/WebGpuParticleRenderer.js.map +1 -1
  164. package/dist/esm/rendering/webgpu/compute/WebGpuComputePipeline.d.ts +52 -0
  165. package/dist/esm/rendering/webgpu/compute/WebGpuStorageBuffer.d.ts +29 -0
  166. package/dist/esm/rendering/webgpu/compute/index.d.ts +3 -0
  167. package/dist/esm/resources/CacheFirstStrategy.d.ts +7 -4
  168. package/dist/esm/resources/CacheFirstStrategy.js +11 -8
  169. package/dist/esm/resources/CacheFirstStrategy.js.map +1 -1
  170. package/dist/esm/resources/CacheStrategy.d.ts +14 -6
  171. package/dist/esm/resources/Loader.d.ts +8 -3
  172. package/dist/esm/resources/Loader.js +19 -37
  173. package/dist/esm/resources/Loader.js.map +1 -1
  174. package/dist/esm/resources/NetworkOnlyStrategy.d.ts +3 -0
  175. package/dist/esm/resources/NetworkOnlyStrategy.js +8 -3
  176. package/dist/esm/resources/NetworkOnlyStrategy.js.map +1 -1
  177. package/dist/esm/resources/factories/ImageFactory.d.ts +2 -2
  178. package/dist/esm/resources/factories/ImageFactory.js.map +1 -1
  179. package/dist/esm/resources/factories/TextureFactory.d.ts +2 -2
  180. package/dist/esm/resources/factories/TextureFactory.js.map +1 -1
  181. package/dist/esm/resources/factories/VttFactory.d.ts +3 -3
  182. package/dist/esm/resources/factories/VttFactory.js +83 -6
  183. package/dist/esm/resources/factories/VttFactory.js.map +1 -1
  184. package/dist/exo.esm.js +4028 -1518
  185. package/dist/exo.esm.js.map +1 -1
  186. package/package.json +2 -1
  187. package/dist/esm/input/GamepadChannels.d.ts +0 -47
  188. package/dist/esm/input/GamepadChannels.js +0 -53
  189. package/dist/esm/input/GamepadChannels.js.map +0 -1
  190. package/dist/esm/input/GamepadControl.d.ts +0 -33
  191. package/dist/esm/input/GamepadControl.js +0 -42
  192. package/dist/esm/input/GamepadControl.js.map +0 -1
  193. package/dist/esm/input/Input.d.ts +0 -52
  194. package/dist/esm/input/Input.js +0 -90
  195. package/dist/esm/input/Input.js.map +0 -1
  196. package/dist/esm/particles/Particle.d.ts +0 -77
  197. package/dist/esm/particles/Particle.js +0 -143
  198. package/dist/esm/particles/Particle.js.map +0 -1
  199. package/dist/esm/particles/ParticleProperties.d.ts +0 -29
  200. package/dist/esm/particles/affectors/ColorAffector.d.ts +0 -30
  201. package/dist/esm/particles/affectors/ColorAffector.js +0 -55
  202. package/dist/esm/particles/affectors/ColorAffector.js.map +0 -1
  203. package/dist/esm/particles/affectors/ForceAffector.d.ts +0 -24
  204. package/dist/esm/particles/affectors/ForceAffector.js +0 -39
  205. package/dist/esm/particles/affectors/ForceAffector.js.map +0 -1
  206. package/dist/esm/particles/affectors/ParticleAffector.d.ts +0 -19
  207. package/dist/esm/particles/affectors/ScaleAffector.d.ts +0 -23
  208. package/dist/esm/particles/affectors/ScaleAffector.js +0 -38
  209. package/dist/esm/particles/affectors/ScaleAffector.js.map +0 -1
  210. package/dist/esm/particles/affectors/TorqueAffector.d.ts +0 -23
  211. package/dist/esm/particles/affectors/TorqueAffector.js +0 -37
  212. package/dist/esm/particles/affectors/TorqueAffector.js.map +0 -1
  213. package/dist/esm/particles/emitters/ParticleEmitter.d.ts +0 -19
  214. package/dist/esm/particles/emitters/ParticleOptions.d.ts +0 -62
  215. package/dist/esm/particles/emitters/ParticleOptions.js +0 -120
  216. package/dist/esm/particles/emitters/ParticleOptions.js.map +0 -1
  217. package/dist/esm/particles/emitters/UniversalEmitter.d.ts +0 -40
  218. package/dist/esm/particles/emitters/UniversalEmitter.js +0 -68
  219. package/dist/esm/particles/emitters/UniversalEmitter.js.map +0 -1
@@ -1,12 +1,13 @@
1
1
  import { Signal } from '@/core/Signal';
2
- import type { GamepadChannel } from './GamepadChannels';
2
+ import { InputBinding } from './InputBinding';
3
+ import type { GamepadAxis } from './GamepadAxis';
4
+ import type { GamepadButton } from './GamepadButton';
5
+ import type { GamepadButtonChannel } from './GamepadButton';
6
+ import type { GamepadAxisChannel } from './GamepadAxis';
3
7
  import type { BrowserGamepad, ResolvedGamepadDefinition } from './GamepadDefinitions';
4
8
  import type { GamepadMappingFamily, GamepadMapping } from './GamepadMapping';
5
- /**
6
- * Human-readable identity metadata for a connected gamepad.
7
- * Populated from a {@link ResolvedGamepadDefinition} on connect and available
8
- * through the matching getters on {@link Gamepad}.
9
- */
9
+ import type { InputBindingOptions, InputChannel } from './InputBinding';
10
+ /** Identity metadata for a connected gamepad. Populated from a {@link ResolvedGamepadDefinition}. */
10
11
  export interface GamepadInfo {
11
12
  name: string;
12
13
  label: string;
@@ -14,80 +15,181 @@ export interface GamepadInfo {
14
15
  productId: string | null;
15
16
  productKey: string | null;
16
17
  }
18
+ /** Effect parameters for {@link Gamepad.vibrate}. */
19
+ export interface GamepadVibrationOptions {
20
+ /** Duration in milliseconds. */
21
+ duration: number;
22
+ /** Low-frequency rumble intensity 0..1. Default 1. */
23
+ weakMagnitude?: number;
24
+ /** High-frequency rumble intensity 0..1. Default 1. */
25
+ strongMagnitude?: number;
26
+ /** Delay before rumble starts in ms. Default 0. */
27
+ startDelay?: number;
28
+ }
17
29
  /**
18
- * Runtime wrapper for a single browser gamepad slot.
30
+ * One of four stable gamepad slots. Lives for the entire `Application`
31
+ * lifetime even when no physical pad is attached — a "mailbox" that
32
+ * physical hardware moves into and out of.
19
33
  *
20
- * Owns the slot's {@link GamepadMapping}, reads raw button and axis values from
21
- * the browser's Gamepad API each frame via {@link update}, and writes transformed
22
- * values into the shared `Float32Array` channel buffer. Emits {@link onConnect},
23
- * {@link onDisconnect}, and per-channel {@link onUpdate} signals so consumers can
24
- * react without polling.
34
+ * Subscribe to {@link onConnect} / {@link onDisconnect} for hardware
35
+ * lifecycle, {@link onButtonDown} / {@link onButtonUp} / {@link onAxisChange}
36
+ * for granular per-event notifications, or call {@link onTrigger} /
37
+ * {@link onActive} / {@link onStart} / {@link onStop} to register
38
+ * stateful {@link InputBinding}s pinned to this slot.
39
+ *
40
+ * Listeners survive disconnect/reconnect cycles — a binding registered when
41
+ * the slot was empty will automatically activate when a pad connects.
25
42
  */
26
43
  export declare class Gamepad {
27
- readonly onConnect: Signal<[Gamepad]>;
28
- readonly onDisconnect: Signal<[Gamepad]>;
29
- readonly onUpdate: Signal<[GamepadChannel, number, Gamepad]>;
30
- private readonly indexValue;
31
- private readonly channelsValue;
32
- private readonly channelOffset;
33
- private mappingValue;
34
- private browserGamepad;
35
- private info;
36
- constructor(index: number, channels: Float32Array, mapping: GamepadMapping);
37
- constructor(gamepad: BrowserGamepad, channels: Float32Array, definition: ResolvedGamepadDefinition);
38
- get mapping(): GamepadMapping;
39
- set mapping(mapping: GamepadMapping);
40
- /** The {@link GamepadMappingFamily} of the currently active mapping. */
41
- get mappingFamily(): GamepadMappingFamily;
42
- get channels(): Float32Array;
43
- get gamepad(): BrowserGamepad | null;
44
- get index(): number;
45
- /** Whether a browser gamepad is currently attached to this slot. */
44
+ /** Fires when a physical pad connects to this slot. */
45
+ readonly onConnect: Signal<[]>;
46
+ /** Fires when the physical pad in this slot disconnects. */
47
+ readonly onDisconnect: Signal<[]>;
48
+ /** Fires for every button transition from inactive to active. */
49
+ readonly onButtonDown: Signal<[GamepadButton, number]>;
50
+ /** Fires for every button transition from active to inactive. */
51
+ readonly onButtonUp: Signal<[GamepadButton, number]>;
52
+ /** Fires whenever an axis crosses its activation threshold. */
53
+ readonly onAxisChange: Signal<[GamepadAxis, number]>;
54
+ /**
55
+ * Fires when this slot's physical pad has been replaced by a previously
56
+ * higher-numbered slot's pad, after a `'compact'`-strategy disconnect.
57
+ * Dispatched with the source slot index the pad came from. Listeners
58
+ * remain attached and the channel buffer is preserved across the move.
59
+ */
60
+ readonly onPadReassigned: Signal<[fromSlot: 0 | 1 | 2 | 3]>;
61
+ private readonly _slot;
62
+ private readonly _channels;
63
+ private readonly _bindings;
64
+ private readonly _detacher;
65
+ private readonly _channelOffset;
66
+ private _mapping;
67
+ private _info;
68
+ private _browserGamepad;
69
+ constructor(slot: 0 | 1 | 2 | 3, channels: Float32Array);
70
+ /** This pad's stable slot (0..3). */
71
+ get slot(): 0 | 1 | 2 | 3;
72
+ /** `true` while a physical pad is attached to this slot. */
46
73
  get connected(): boolean;
47
- get name(): string;
48
- get label(): string;
49
- get vendorId(): string | null;
50
- get productId(): string | null;
51
- get productKey(): string | null;
74
+ /** The active mapping, or `null` when disconnected. */
75
+ get mapping(): GamepadMapping | null;
76
+ /** The {@link GamepadMappingFamily}, or `null` when disconnected. */
77
+ get mappingFamily(): GamepadMappingFamily | null;
78
+ /** Identity metadata, or `null` when disconnected. */
79
+ get info(): GamepadInfo | null;
80
+ /** The underlying browser gamepad object, or `null` when disconnected. */
81
+ get browserGamepad(): BrowserGamepad | null;
82
+ /**
83
+ * Browser-assigned hardware index from `navigator.getGamepads()` (i.e.
84
+ * `Gamepad.index`), or `null` when no pad is attached. Stable for the
85
+ * lifetime of a single physical connection but may change across
86
+ * disconnect/reconnect. Low-level escape hatch for advanced consumers
87
+ * that need to correlate slots with the raw browser API; prefer
88
+ * {@link slot} for stable per-application pad identity.
89
+ */
90
+ get internalIndex(): number | null;
91
+ /** `true` when the connected pad supports rumble via the Web Gamepad API. */
92
+ get canVibrate(): boolean;
93
+ /**
94
+ * Returns `true` when this pad's mapping declares the requested channel.
95
+ * Use to gate listener registration on optional hardware (e.g. Joy-Con
96
+ * solo lacks a right stick — `pad.hasChannel(GamepadAxis.RightStickX)`
97
+ * returns `false`).
98
+ */
99
+ hasChannel(channel: GamepadButtonChannel | GamepadAxisChannel): boolean;
100
+ /**
101
+ * Trigger a rumble effect on this pad. Resolves when the effect finishes.
102
+ * Silent no-op when the pad is disconnected or the platform does not
103
+ * support haptic feedback. Use {@link canVibrate} to detect support.
104
+ */
105
+ vibrate(options: GamepadVibrationOptions): Promise<void>;
106
+ /** Stop any active rumble on this pad. Silent no-op when unsupported. */
107
+ stopVibration(): void;
108
+ /**
109
+ * Register a callback fired once when any of `channels` becomes active.
110
+ * Listener survives disconnect/reconnect; call `.unbind()` on the
111
+ * returned {@link InputBinding} to detach.
112
+ */
113
+ onStart(channel: InputChannel | ReadonlyArray<InputChannel>, callback: (value: number) => void, options?: InputBindingOptions): InputBinding;
114
+ /**
115
+ * Register a callback fired every frame while any of `channels` is active.
116
+ * Receives the channel value (0..1 for buttons, -1..1 for bipolar axes).
117
+ */
118
+ onActive(channel: InputChannel | ReadonlyArray<InputChannel>, callback: (value: number) => void, options?: InputBindingOptions): InputBinding;
119
+ /** Register a callback fired once when all of `channels` become inactive. */
120
+ onStop(channel: InputChannel | ReadonlyArray<InputChannel>, callback: (value: number) => void, options?: InputBindingOptions): InputBinding;
121
+ /**
122
+ * Register a callback fired when the input is released within
123
+ * {@link InputBindingOptions.threshold} ms of activation (a "tap").
124
+ */
125
+ onTrigger(channel: InputChannel | ReadonlyArray<InputChannel>, callback: (value: number) => void, options?: InputBindingOptions): InputBinding;
126
+ /**
127
+ * Attach a physical browser gamepad to this slot. Called by
128
+ * {@link InputManager} on connect.
129
+ *
130
+ * @internal
131
+ */
132
+ _bind(gamepad: BrowserGamepad, definition: ResolvedGamepadDefinition): void;
133
+ /**
134
+ * Detach the physical gamepad and clear its channels.
135
+ *
136
+ * @internal
137
+ */
138
+ _unbind(): void;
52
139
  /**
53
- * Replaces the gamepad's identity metadata.
54
- * Called automatically during construction when a {@link BrowserGamepad} is
55
- * provided; exposed publicly to allow runtime overrides.
140
+ * Detach the physical gamepad and clear channels without firing
141
+ * {@link onDisconnect}. Used by {@link InputManager} during the compact
142
+ * slot-shift to silently vacate a slot before another pad shifts into
143
+ * its place; the disconnect signal is fired separately on the slot that
144
+ * ends up empty after compaction.
145
+ *
146
+ * @internal
56
147
  */
57
- setInfo(info: GamepadInfo): this;
148
+ _silentUnbind(): void;
58
149
  /**
59
- * Attaches a live browser gamepad to this slot and dispatches {@link onConnect}
60
- * if the slot was previously disconnected.
150
+ * Dispatch this slot's {@link onDisconnect} signal without altering its
151
+ * state. Used by {@link InputManager} after a compact-mode shift, when a
152
+ * slot has already been emptied by {@link _rebindFrom} and now needs to
153
+ * notify subscribers that its mailbox is no longer occupied.
154
+ *
155
+ * @internal
61
156
  */
62
- connect(gamepad: BrowserGamepad): this;
157
+ _dispatchDisconnect(): void;
63
158
  /**
64
- * Detaches the browser gamepad, zeros all mapped channels, and dispatches
65
- * {@link onDisconnect}. No-op when already disconnected.
159
+ * Reassign this slot to take over another slot's physical gamepad without
160
+ * firing the full disconnect / connect cycle. Used by {@link InputManager}
161
+ * when the `'compact'` slot strategy shuffles pads after a disconnect.
162
+ *
163
+ * @internal
66
164
  */
67
- disconnect(): this;
165
+ _rebindFrom(other: Gamepad): void;
68
166
  /**
69
- * Samples the browser gamepad's current state and writes transformed values
70
- * into the shared channel buffer, dispatching {@link onUpdate} for each channel
71
- * whose value changed. Should be called once per frame by the engine's input loop.
72
- * No-op when disconnected.
167
+ * Sample the browser gamepad's current state and write transformed values
168
+ * into the shared channel buffer, dispatching transition events when
169
+ * channel activity crosses thresholds. Called once per frame by the
170
+ * engine's input loop. No-op when disconnected.
171
+ *
172
+ * @internal
73
173
  */
74
- update(): this;
75
- /** Zeroes all channel buffer entries that belong to this gamepad's mapping. */
76
- clearChannels(): this;
174
+ update(): void;
77
175
  /**
78
- * Disconnects the gamepad, clears its channels, and destroys all signals.
79
- * The instance must not be used after this call.
176
+ * Tear down this gamepad slot. Called on application shutdown.
80
177
  */
81
178
  destroy(): void;
82
179
  /**
83
- * Converts a {@link GamepadChannel} to its absolute index in the shared channel
84
- * buffer for this gamepad instance.
180
+ * Convert a slot-relative channel value to its absolute index in the
181
+ * shared channel buffer for this slot.
85
182
  */
86
- resolveChannelOffset(channel: GamepadChannel): number;
183
+ resolveChannelOffset(channel: GamepadButtonChannel | GamepadAxisChannel): number;
87
184
  /**
88
- * Converts a gamepad slot index and {@link GamepadChannel} to an absolute
89
- * channel buffer offset without requiring a {@link Gamepad} instance.
185
+ * Static counterpart to {@link Gamepad.resolveChannelOffset} resolves
186
+ * an absolute channel-buffer offset for a given slot index without
187
+ * requiring a Gamepad instance.
90
188
  */
91
- static resolveChannelOffset(gamepadIndex: number, channel: GamepadChannel): number;
92
- private clearMappedChannels;
189
+ static resolveChannelOffset(slot: number, channel: GamepadButtonChannel | GamepadAxisChannel): number;
190
+ private _resolveOffset;
191
+ private _clearMappedChannels;
192
+ private _createBinding;
193
+ private _resolveExternalChannel;
194
+ private _updateBindings;
93
195
  }