import { GamepadDevice, GamepadInputState } from "../../interfaces/input.d.ts"; /** * Callback type for gamepad device connection events */ export type GamepadDeviceCallback = (device: GamepadDevice) => void; /** * Callback type for gamepad input events */ export type GamepadInputCallback = (device: GamepadDevice, state: GamepadInputState) => void; /** * Responsible for tracking gamepad state and notifying subscribers of changes. */ export declare class GamepadInputPlugin { private _gamepadDevices; private _buttonStates; private _axesStates; private _onDeviceConnected?; private _onDeviceDisconnected?; private _onInputChanged?; /** * Create a new GamepadInputPlugin */ constructor(); /** * Register a callback for device connected events * * @param callback */ onDeviceConnected(callback: GamepadDeviceCallback): void; /** * Register a callback for device disconnected events * * @param callback */ onDeviceDisconnected(callback: GamepadDeviceCallback): void; /** * Register a callback for input changed events * * @param callback */ onInputChanged(callback: GamepadInputCallback): void; /** * Get all connected gamepad devices */ getDevices(): GamepadDevice[]; /** * Get all connected gamepad states */ getStates(): Record; /** * Get a specific gamepad device by index * * @param index */ getDevice(index: number): GamepadDevice | null; /** * Get a specific gamepad state by index * * @param index */ getState(index: number): GamepadInputState | null; /** * Poll for gamepad state updates - call this in your game loop */ pollGamepads(): void; /** * Tears down the gamepad resource access and cleans up event listeners */ $teardown(): Promise; /** * Set up gamepad event listeners */ private _setupGamepadEvents; /** * Handle gamepad connected event */ private _handleGamepadConnected; /** * Handle gamepad disconnected event */ private _handleGamepadDisconnected; /** * Notify subscribers of device connected event */ private _notifyDeviceConnected; /** * Notify subscribers of device disconnected event */ private _notifyDeviceDisconnected; /** * Notify subscribers of input changed event */ private _notifyInputChanged; }