import { DeviceValueReader, GamepadValueReaderDefinition, InputState } from "../../../interfaces/input.d.ts"; /** * Types of gamepad input sources */ export type GamepadSourceType = 'button' | 'axis'; /** * Options for configuring a gamepad value reader */ export interface GamepadReaderOptions { /** * Whether to use the analog value instead of boolean pressed state for buttons */ useAnalogValue?: boolean; /** * Deadzone value (0.0 - 1.0) for analog axes * Input values below this threshold will be treated as 0 */ deadzone?: number; /** * Whether to invert the axis values */ invert?: boolean; } /** * Reads values from gamepad input states */ export declare class GamepadValueReader implements DeviceValueReader { /** * Whether this reader targets a button or analog axis. */ readonly sourceType: GamepadSourceType; /** * Identifies the specific button or axis (e.g. "button-0", "axis-1") */ readonly sourceKey: string; /** * When true, returns the pressure-sensitive float value instead of boolean pressed state for buttons. */ private readonly useAnalogValue; /** * Axis values below this threshold are treated as 0 (default 10%) */ private readonly deadzone; /** * Multiplies axis values by -1 when true */ private readonly invert; /** * Creates a new GamepadValueReader * * @param sourceType * @param sourceKey - e.g. "button-0", "axis-1" * @param options */ constructor(sourceType: GamepadSourceType, sourceKey: string, options?: GamepadReaderOptions); /** * Gets the value of the input source. Returns undefined for non-gamepad input states. * * @param state */ getValue(state: InputState): boolean | number | undefined; /** * Creates a GamepadValueReader from a colon-delimited string (e.g. "button:0", "axis:1") * * @param sourceTypeString * @param options */ static fromString(sourceTypeString: string, options?: GamepadReaderOptions): GamepadValueReader; /** * Returns a JSON-serializable representation of this gamepad value reader. */ toJSON(): GamepadValueReaderDefinition; }