/**
 * OwlCoda TUI Fuzzy Picker
 *
 * Interactive searchable list picker for terminal UIs.
 * Clean-room implementation — imperative ANSI rendering,
 * no React/Ink dependency.
 *
 * Features:
 * - Fuzzy text search filtering
 * - Arrow key / j/k navigation
 * - Optional preview pane
 * - Configurable visible rows (auto-fits terminal)
 * - Enter to select, Esc to cancel
 */
export interface PickerItem<T = unknown> {
    /** Display label (may contain ANSI). */
    label: string;
    /** Optional description (shown dimmed after label). */
    description?: string;
    /** The underlying value returned on selection. */
    value: T;
    /**
     * Per-variant metadata used by `InkPicker`'s typed grids:
     *   - `tag`      → small uppercase pill on the right (file/dir, fast/default/max, current).
     *   - `shortcut` → keyboard shortcut text on the right (slash picker).
     *   - `meta`     → secondary descriptor (model: "200k ctx · $3.00/M").
     * All are optional so the generic picker keeps working with two-field items.
     */
    tag?: string;
    shortcut?: string;
    meta?: string;
}
export interface PickerOptions<T = unknown> {
    /** Title shown above the search box. */
    title?: string;
    /** Items to pick from. */
    items: PickerItem<T>[];
    /** Max visible items (auto-capped to terminal height). Default: 10. */
    visibleCount?: number;
    /** Optional preview renderer. Returns lines of text for focused item. */
    renderPreview?: (item: PickerItem<T>) => string[];
    /** Placeholder text for empty search box. */
    placeholder?: string;
    /** Initial search query. */
    initialQuery?: string;
    /** Stream for output. Default: stderr. */
    stream?: NodeJS.WriteStream;
    /** Readline interface to pause/resume around picker (prevents input collision). */
    readline?: import('readline').Interface;
}
export interface PickerResult<T = unknown> {
    /** Selected item, or null if cancelled. */
    item: PickerItem<T> | null;
    /** Whether the user cancelled (Esc). */
    cancelled: boolean;
}
export declare function resetReadlineInputState(rl?: import('readline').Interface): void;
export declare function isReadlinePickerSettling(rl?: import('readline').Interface): boolean;
/**
 * Simple fuzzy match: every character in the query must appear
 * in order within the target string (case-insensitive).
 * Returns match score (lower = tighter match) or -1 for no match.
 */
export declare function fuzzyMatch(query: string, target: string): number;
/**
 * Highlight matched characters in a label.
 * Returns the label with matched chars in theme accent color.
 */
export declare function highlightMatch(label: string, query: string): string;
/**
 * Isolation hook: any host (e.g. the Ink REPL) that needs to yield the
 * terminal to an imperative picker registers enter/exit callbacks here.
 * showPicker invokes them around its lifecycle — no per-command whitelist
 * required; every call to showPicker gets isolation automatically.
 *
 * A null value means "no host registered" (e.g. running under a test harness
 * or CI without a live TTY); showPicker then operates without isolation.
 */
export interface PickerIsolationHooks {
    enter: () => void;
    exit: () => void;
}
export declare function registerPickerIsolation(hooks: PickerIsolationHooks | null): void;
/** Test helper — inspect / reset the currently registered hooks. */
export declare function __getPickerIsolationForTests(): PickerIsolationHooks | null;
/**
 * Show an interactive fuzzy picker in the terminal.
 *
 * Takes over stdin/stdout for the duration. Returns a promise
 * that resolves when the user selects or cancels.
 */
export declare function showPicker<T>(opts: PickerOptions<T>): Promise<PickerResult<T>>;
