/**
 * Helpers for temporarily taking ownership of TTY input.
 *
 * Interactive wrappers, dashboards, and mode pickers often need raw stdin.
 * They must restore only the terminal state they changed; otherwise nested
 * tmux/WSL sessions can lose visible input or stay in raw mode after exit.
 */
export interface TerminalInputLike {
    isTTY?: boolean;
    isRaw?: boolean;
    readableFlowing: boolean | null;
    setRawMode?: (mode: boolean) => unknown;
    resume(): unknown;
    pause(): unknown;
    listenerCount(eventName: string | symbol): number;
}
export interface TerminalInputState {
    readonly wasTTY: boolean;
    readonly rawMode?: boolean;
    readonly readableFlowing: boolean | null;
    readonly dataListenerCount: number;
}
export declare function captureTerminalInputState(input?: TerminalInputLike): TerminalInputState;
export declare function enableRawTerminalInput(input?: TerminalInputLike): TerminalInputState;
/**
 * Defensive re-validation of interactive stdin before a fresh readline takes
 * ownership of the TTY.
 *
 * The first-run GitHub-star prompt (maybeAskForGitHubStarAtChatStart) and the
 * update prompt (maybePromptForOmkUpdate) use @inquirer/prompts, which take
 * over raw mode and run their own readline on process.stdin. On completion they
 * can leave the shared interactive stdin explicitly paused
 * (readableFlowing === false). A freshly created readline then observes an
 * immediate EOF/'close' and the native chat loop exits with "Session ended".
 *
 * This helper only resumes a real TTY that was explicitly paused. Non-TTY
 * stdin (pipes/EOF, CI, non-interactive callers) is intentionally left
 * untouched so existing exit/EOF behavior is preserved. A fresh, never-started
 * stream (readableFlowing === null) is also left alone so readline can manage
 * its own initial resume without racing for the first byte.
 *
 * Returns true only when it actually resumed a paused interactive stream.
 */
export declare function resumeInteractiveInput(input?: TerminalInputLike): boolean;
export declare function restoreTerminalInputState(input: TerminalInputLike | undefined, state: TerminalInputState): void;
