import type { Interface as RLInterface } from 'node:readline';
/**
 * Keep the selector compact even in short terminals. The footer may add one
 * extra row, so this intentionally uses roughly half of the terminal height
 * instead of every available row.
 */
export declare function maxVisibleSuggestRows(termRows?: number): number;
export declare function buildInlineSuggestEraseSequence(dropdownRows: number): string;
export declare function buildInlineSuggestDropdownEraseSequence(dropdownRows: number): string;
export interface SuggestItem {
    /** The slash command, e.g. "/help". */
    command: string;
    /** Alternate slash command names that dispatch to the same handler. */
    aliases?: string[];
    /** Short syntax/category label, e.g. "Git" or "Model". */
    hint?: string;
    /** One-line description shown in the second column. */
    description: string;
}
export interface InlineSuggestOptions {
    /**
     * The styled prompt prefix to repaint at the start of every render
     * (includes any chalk codes). Defaults to "  ❯ " (no decorative).
     */
    promptPrefix?: string;
    /**
     * Visible character width of `promptPrefix` (i.e. its length minus
     * any ANSI escape sequences). Used to position the cursor at the
     * end of the filter after a render. Defaults to counting the
     * stripped prefix when omitted.
     */
    promptVisibleLen?: number;
}
export interface InlineSuggestResult {
    /** True if the user picked an item (Enter); false on Esc / Ctrl+C / Backspace-to-empty. */
    accepted: boolean;
    /** The chosen command, only set when accepted=true. */
    command?: string;
    /** The filter string at exit. Caller restores rl.line to this on
     * cancel so the user can keep typing the partial command. */
    filter: string;
}
export interface InlineSuggestAcceptedCommand {
    command: string;
    acceptedAtMs: number;
}
export type InlineSuggestQuestionOutcome = {
    kind: 'prefill';
    command: string;
} | {
    kind: 'submit';
    clearAccepted: boolean;
};
export declare function filterSuggestItems(items: SuggestItem[], filter: string): SuggestItem[];
export declare function visibleSuggestWindow<T>(items: T[], selected: number, maxRows?: number): {
    startIdx: number;
    endIdx: number;
    items: T[];
};
type InlineSuggestInput = {
    type: 'accept';
} | {
    type: 'append';
    text: string;
} | {
    type: 'backspace';
} | {
    type: 'cancel';
} | {
    type: 'ignore';
} | {
    type: 'jump';
    target: 'start' | 'end';
} | {
    type: 'move';
    delta: number;
};
export declare function parseInlineSuggestInput(buf: Buffer): InlineSuggestInput;
export declare function resolveInlineSuggestAccept(filter: string, visibleItems: SuggestItem[], selected: number): string | null;
export declare function resolveInlineSuggestQuestionInput(input: string, accepted: InlineSuggestAcceptedCommand | null | undefined, nowMs?: number, staleWindowMs?: number): InlineSuggestQuestionOutcome;
export declare function formatInlineSuggestFilterForPrompt(filter: string, promptVisibleLen: number, termCols?: number): {
    text: string;
    visibleLen: number;
};
/**
 * Show the inline suggest dropdown and resolve when the user picks
 * or cancels.
 *
 * The caller should have cleared rl.line and refreshed the prompt
 * before calling — we repaint the prompt line ourselves but the
 * cursor needs to be on a stable row (not mid-scroll).
 */
export declare function inlineSuggest(_rl: RLInterface, items: SuggestItem[], initialFilter?: string, opts?: InlineSuggestOptions): Promise<InlineSuggestResult>;
export {};
