import type { Vec2 } from '../core/types';
import { EventBus } from '../core/EventBus';
export type GamepadButton = 'A' | 'B' | 'X' | 'Y' | 'LB' | 'RB' | 'LT' | 'RT' | 'Back' | 'Start' | 'LS' | 'RS' | 'DpadUp' | 'DpadDown' | 'DpadLeft' | 'DpadRight' | 'Home';
export type GamepadAxis = 'LeftX' | 'LeftY' | 'RightX' | 'RightY';
export interface ActionState {
    pressed: boolean;
    justPressed: boolean;
    justReleased: boolean;
    value: number;
}
export interface ActionBinding {
    /** Keyboard keys */
    keys?: string[];
    /** Gamepad buttons */
    gamepadButtons?: GamepadButton[];
    /** Gamepad axis + direction */
    gamepadAxis?: {
        axis: GamepadAxis;
        direction: 'positive' | 'negative';
    };
    /** Mouse buttons (0=left, 1=middle, 2=right) */
    mouseButtons?: number[];
}
export interface InputPreset {
    name: string;
    actions: Record<string, ActionBinding>;
}
export declare class InputManager {
    deadzone: number;
    readonly events: EventBus;
    private _deadzone;
    private _actions;
    private _keys;
    private _keysJustPressed;
    private _keysJustReleased;
    private _mousePos;
    private _mouseButtons;
    private _mouseButtonsJustPressed;
    private _mouseButtonsJustReleased;
    private _mouseWheel;
    private _gamepads;
    private _touches;
    private _cleanup;
    constructor(deadzone?: number);
    /**
     * Attach DOM event listeners. Call once when engine starts.
     * Pass the target element (usually the canvas container).
     */
    attach(target?: HTMLElement | Window): void;
    detach(): void;
    /** Define an action binding. */
    defineAction(name: string, binding: ActionBinding): void;
    /** Define multiple action bindings at once. */
    defineActions(actions: Record<string, ActionBinding>): void;
    /** Load a preset (e.g. platformer, fps, rpg). */
    loadPreset(preset: InputPreset): void;
    /** Query an action state for a specific player. */
    getAction(name: string, playerIndex?: number): ActionState;
    isKeyDown(code: string): boolean;
    isKeyJustPressed(code: string): boolean;
    get mousePosition(): Vec2;
    get mouseWheelDelta(): number;
    isMouseDown(button?: number): boolean;
    getGamepadAxis(playerIndex: number, axis: GamepadAxis): number;
    getGamepadButton(playerIndex: number, button: GamepadButton): boolean;
    isGamepadConnected(index: number): boolean;
    get connectedGamepads(): number;
    /** Vibrate a gamepad. */
    vibrate(playerIndex: number, duration: number, weak?: number, strong?: number): void;
    update(): void;
    /** Clear frame-edge states. Call AFTER game logic. */
    lateUpdate(): void;
    private pollGamepads;
}
export declare const PRESET_PLATFORMER: InputPreset;
export declare const PRESET_TOPDOWN: InputPreset;
export declare const PRESET_TWIN_STICK: InputPreset;
