/** * Terminal prompts on `node:readline/promises` — the replacement for * `@inquirer/prompts` (06-ONESHOT.md §4). Streams are injectable so every * prompt is testable without a real TTY, and EOF resolves instead of hanging. */ export interface PromptStream extends NodeJS.ReadableStream { isTTY?: boolean | undefined; isRaw?: boolean | undefined; setRawMode?(mode: boolean): unknown; } export interface PromptIO { readonly input?: PromptStream | undefined; readonly output?: NodeJS.WritableStream | undefined; } /** Message used when a confirmation is impossible on a non-TTY stdin. */ export declare const CONFIRMATION_REQUIRED_MESSAGE = "confirmation required; re-run with -y or --permissions allow-all"; export declare function isInteractiveStdin(io?: PromptIO): boolean; /** * Re-assert raw mode AND resume stdin after a readline prompt. readline pauses * stdin and switches it to cooked mode when it closes; leaving it paused means * no `keypress`/`data` events reach the REPL's ESC/Ctrl+C abort handler, so a * tool launched right after a confirmation could no longer be aborted. */ export declare function restoreInteractiveStdin(io?: PromptIO): void; export declare function releaseInteractiveStdin(io?: PromptIO): void; export declare function askLine(prompt: string, io?: PromptIO): Promise; /** Read a value without displaying it; echo is suppressed only on a TTY. */ export declare function askSecret(prompt: string, io?: PromptIO): Promise; export declare function parseYesNo(answer: string): boolean | undefined; /** * y/n question. Empty input takes `defaultValue`; unparseable input re-asks. * EOF answers "no" rather than hanging. */ export declare function askYesNo(prompt: string, options?: PromptIO & { readonly defaultValue?: boolean; }): Promise; export interface PromptChoice { readonly name: string; readonly value: T; } /** * Numbered picker. Empty input takes the default choice; EOF or an invalid * selection after three tries resolves `undefined` so callers can cancel. */ export declare function askChoice(prompt: string, choices: readonly PromptChoice[], options?: PromptIO & { readonly defaultIndex?: number; }): Promise;