/**
 * TTY Input Utilities
 * Handles stdin fallback to /dev/tty for piped environments
 */
import { Interface } from "node:readline";
import { ReadStream } from "node:tty";
export declare function fitOptionToLine(value: string, prefixColumns: number): string;
/**
 * Get a TTY-capable input stream
 * Falls back to /dev/tty when stdin is piped (e.g., from curl)
 */
export declare function getTTYInputStream(): typeof process.stdin | ReadStream;
/**
 * Check if we have TTY input available
 */
export declare function hasTTY(): boolean;
/**
 * Close the TTY stream if we opened one
 */
export declare function closeTTYStream(): void;
/**
 * Create a readline interface with TTY support
 */
export declare function createTTYInterface(options?: {
    prompt?: string;
    historySize?: number;
}): Interface;
/**
 * Prompt for input (single line)
 * Throws in non-TTY environments to prevent hanging.
 */
export declare function prompt(question: string): Promise<string>;
/**
 * Prompt for hidden input (password/API key).
 * Characters are not echoed to the terminal.
 *
 * `opts.openHotkeyUrl`: when set, the user can press lowercase `o` as the
 * very first key (no input typed yet) to launch the URL in their default
 * browser. Subsequent keys behave normally. Safe for our setup wizard
 * because every registered API-key prefix (`sk-`, `AIza`, `xai-`, `key_`,
 * `r8_`, `sk_`, etc.) starts with something other than `o`. Pressing `o`
 * after typing any character is treated as part of the value, not a hotkey.
 */
export interface PromptHiddenOptions {
    /** URL to launch in the default browser when the user presses `o` first. */
    openHotkeyUrl?: string;
}
export declare function promptHidden(question: string, opts?: PromptHiddenOptions): Promise<string>;
/**
 * Prompt for selection from a list (1-based index)
 */
export declare function promptSelect(_question: string, options: string[], defaultIndex?: number, opts?: {
    backIndex?: number;
}): Promise<number>;
/**
 * Prompt for yes/no confirmation.
 *
 * Renders an arrow-key Yes/No selector when a TTY is available (matching the
 * paradigm of `promptSelect` / `promptMultiSelect`), falling back to the
 * legacy `(Y/n)` text prompt for piped/CI input so scripts continue to work
 * unchanged.
 */
export declare function promptConfirm(question: string, defaultYes?: boolean): Promise<boolean>;
/**
 * Prompt for multi-select (checkbox) from a list.
 *
 * Returns the indexes selected (sorted ascending). ↑↓ navigates, space toggles,
 * enter confirms. `pickFocusedOnEnter` (formerly `enterSelectsFocusedWhenEmpty`)
 * makes Enter behave like a single-choice select **as long as the user has
 * not pressed space yet** — once any explicit toggle happens, Enter confirms
 * the current selection as-is. This lets a pre-checked default be overridden
 * by a single arrow + Enter while still allowing additive multi-pick via
 * space + Enter.
 * `preserveDefaultSelectionOnEnter` changes the no-toggle Enter shortcut from
 * replace to add when there are already checked rows. This is useful for setup
 * screens where previously configured choices should remain visible and sticky.
 * In non-TTY environments accepts comma-separated 1-based indices, the literal
 * "all", or empty/"none" for no selection.
 */
export declare function promptMultiSelect(_question: string, options: string[], defaultSelected?: boolean[], opts?: {
    pickFocusedOnEnter?: boolean;
    preserveDefaultSelectionOnEnter?: boolean;
    backIndex?: number;
    /** @deprecated Use pickFocusedOnEnter — same flag, broader semantics. */
    enterSelectsFocusedWhenEmpty?: boolean;
}): Promise<number[]>;
