/** * Raw input handling for terminal * Handles keypresses, special keys, and line editing */ export interface KeyEvent { key: string; ctrl: boolean; alt: boolean; shift: boolean; raw: string; isPaste?: boolean; } export type KeyHandler = (event: KeyEvent) => void; export declare class Input { private handlers; private dataHandler; /** * Start listening for input */ start(): void; /** * Stop listening */ stop(): void; /** * Add key handler */ onKey(handler: KeyHandler): () => void; /** * Emit key event to all handlers */ private emit; /** * Parse raw input into KeyEvent */ private parseKey; } /** * Simple line editor with cursor support */ export declare class LineEditor { private value; private cursorPos; private history; private historyIndex; private tempValue; getValue(): string; getCursorPos(): number; setValue(value: string): void; clear(): void; /** * Insert text at cursor position */ insert(text: string): void; /** * Set cursor position */ setCursorPos(pos: number): void; /** * Check if character is a word boundary (space, path separator, punctuation) */ private isWordBoundary; /** * Move cursor to previous word boundary (Ctrl+Left) */ wordLeft(): void; /** * Move cursor to next word boundary (Ctrl+Right) */ wordRight(): void; /** * Delete word backward (Ctrl+W) — respects path separators */ deleteWordBackward(): void; /** * Delete to end of line (Ctrl+K) */ deleteToEnd(): void; addToHistory(value: string): void; /** * Handle key event, returns true if value changed */ handleKey(event: KeyEvent): boolean; }