/**
 * OwlCoda — Interactive History Search (Ctrl+R)
 *
 * Reverse incremental search through readline history.
 * Architecture: intercepts raw keypress events on stdin,
 * renders inline search UI, restores readline on exit.
 *
 * Upstream uses a React hook (useHistorySearch) with Ink TextInput.
 * We use direct ANSI rendering with raw stdin mode — same behavior,
 * completely different implementation.
 */
import type * as readline from 'node:readline';
export interface HistorySearchState {
    active: boolean;
    query: string;
    matchIndex: number;
    match: string | null;
    failed: boolean;
}
/**
 * HistorySearch — attaches to a readline interface to provide Ctrl+R search.
 *
 * Usage:
 *   const hs = new HistorySearch(rl)
 *   hs.install()  // hooks keypress events
 *   // ... when rl is closed:
 *   hs.uninstall()
 */
export declare class HistorySearch {
    private rl;
    private state;
    private keypressHandler;
    private stashedLine;
    private stashedCursor;
    constructor(rl: readline.Interface);
    /** Hook into stdin keypress events. */
    install(): void;
    /** Remove keypress hook. */
    uninstall(): void;
    /** Get current history entries from readline (undocumented but stable API). */
    private getHistory;
    /** Activate search mode. */
    private activate;
    /** Search history for current query. */
    private search;
    /** Search further back from current match. */
    private searchNext;
    /** Cancel search — restore stashed line. */
    private cancel;
    /** Accept current match — put it in the readline buffer. */
    private accept;
    /** Render the search prompt inline. */
    private render;
    /** Highlight the query within a match string. */
    private highlightMatch;
    /** Clear the search line. */
    private clearSearchLine;
    /** Check if search is currently active (used by REPL to skip line processing). */
    get isActive(): boolean;
}
