import type { Screen } from '../Screen'; export interface CommandAutocompleteState { open: boolean; index: number; items: string[]; } export declare function createCommandAutocompleteState(): CommandAutocompleteState; /** Set the picker to a fresh filter result (from filterCommands). */ export declare function setCommandAutocomplete(state: CommandAutocompleteState, items: string[], index: number): CommandAutocompleteState; /** Close the picker and clear its items. */ export declare function closeCommandAutocomplete(state: CommandAutocompleteState): CommandAutocompleteState; /** Minimal key shape App's KeyEvent satisfies. */ export interface CommandAutocompleteKeyEvent { key: string; } /** What App should do after a key press. */ export type CommandAutocompleteAction = { type: 'none'; } | { type: 'close'; } | { type: 'navigate'; delta: -1 | 1; } | { type: 'select'; command: string; }; /** * Handle one key event while the `/command` picker is open. Returns the * next state plus an action; `select` carries the chosen command name so * App can rewrite the editor buffer (`/ `). */ export declare function handleCommandAutocompleteKey(state: CommandAutocompleteState, event: CommandAutocompleteKeyEvent): { state: CommandAutocompleteState; action: CommandAutocompleteAction; }; /** * Compute the editor buffer after selecting a command. Pure: returns the * next value for App to set. */ export declare function commandToBuffer(command: string): string; /** * Paint the `/command` picker below the status bar. `descriptions` maps * command name → one-line description (App passes COMMAND_DESCRIPTIONS). */ export declare function renderCommandAutocomplete(screen: Screen, state: CommandAutocompleteState, startY: number, descriptions: Record): void;