import type { Screen } from '../Screen'; import type { MentionSuggestion } from '../../utils/mentions'; export interface MentionPickerState { open: boolean; index: number; items: MentionSuggestion[]; /** Index of the `@` in the editor value at the time the query started. */ atStart: number; /** Project root used to resolve suggestions (cached per update). */ root: string; } export declare function createMentionPickerState(): MentionPickerState; /** Set the picker to a fresh query result. */ export declare function openMentionPicker(state: MentionPickerState, items: MentionSuggestion[], atStart: number, root: string): MentionPickerState; /** Close the picker and clear its items. */ export declare function closeMentionPicker(state: MentionPickerState): MentionPickerState; /** Minimal key shape App's KeyEvent satisfies. */ export interface MentionPickerKeyEvent { key: string; } /** What App should do after a key press. */ export type MentionPickerAction = { type: 'none'; } | { type: 'close'; } | { type: 'navigate'; delta: -1 | 1; } | { type: 'select'; suggestion: MentionSuggestion; atStart: number; }; /** * Handle one key event while the mention picker is open. Returns the next * state plus an action; `select` carries the chosen suggestion and the * `@` index so App can rewrite the editor buffer. */ export declare function handleMentionPickerKey(state: MentionPickerState, event: MentionPickerKeyEvent): { state: MentionPickerState; action: MentionPickerAction; }; /** * Compute the editor buffer after applying a mention selection. Pure: * returns the next value + cursor position for App to set. * * `atStart` is the index OF the `@`, so the `before` slice EXCLUDES it — * the sigil is re-added or the completed path is no longer a mention and * the file never gets attached. */ export declare function applyMentionToBuffer(value: string, cursor: number, atStart: number, suggestion: MentionSuggestion): { value: string; cursor: number; }; /** * Paint the mention picker below the status bar. Mirrors the layout of the * `/` Autocomplete (separator → title → items → footer) but shows file * paths with their parent directory as the description, and an `@` prefix. */ export declare function renderMentionPicker(screen: Screen, state: MentionPickerState, startY: number): void;