import type { ParsedKey } from "./parse-keypress.js"; import type { RawMouseEvent } from "./parse-mouse.js"; export type KeyHandler = (key: ParsedKey) => void; export type MouseHandler = (event: RawMouseEvent) => void; export type PasteHandler = (text: string) => void; export interface InputBus { addKeyHandler(handler: KeyHandler): () => void; addMouseHandler(handler: MouseHandler): () => void; addPasteHandler(handler: PasteHandler): () => void; /** Signal that increments on each key event — for triggering reactive reads */ keySignal: () => number; /** The most recent key event */ lastKey: () => ParsedKey | null; } /** Internal dispatch methods — not exposed to components */ export interface InputBusInternal extends InputBus { _dispatchKey(key: ParsedKey): void; _dispatchMouse(event: RawMouseEvent): void; _dispatchPaste(text: string): void; } export declare function createInputBus(): InputBusInternal; export declare const InputContext: import("solid-js").Context; /** * Subscribe to key events. The handler is called for every keypress. * Automatically cleaned up when the component unmounts. */ export declare function useInput(handler: KeyHandler): void; /** * Subscribe to mouse events. * Automatically cleaned up when the component unmounts. */ export declare function useMouse(handler: MouseHandler): void; /** * Subscribe to paste events (decoded text). * Automatically cleaned up when the component unmounts. */ export declare function usePaste(handler: PasteHandler): void; //# sourceMappingURL=hooks.d.ts.map