import { o as TerminalIO } from "./renderer-DZNelBoQ.js"; declare const namedKeys: { readonly return: "\r"; readonly enter: "\r"; readonly backspace: ""; readonly delete: "[3~"; readonly up: ""; readonly down: ""; readonly right: ""; readonly left: ""; readonly home: ""; readonly end: ""; readonly tab: "\t"; readonly space: " "; readonly escape: ""; }; export type NamedKey = keyof typeof namedKeys; /** * Key argument for `keys()` / {@link encodeKey}: named keys get editor * autocomplete; `ctrl+` and single printable characters stay legal. */ export type Key = NamedKey | `ctrl+${string}` | (string & {}); /** * Encode a named terminal key as its raw input sequence. * * Accepts names from the key table, `ctrl+` combinations, and single * printable characters. Anything else throws — silently typing a misspelled * key name (e.g. `"pageup"`) into the prompt would corrupt the test input. */ export declare function encodeKey(key: Key): string; export interface PromptTestIO { readonly io: Required>; type(text: string): void; keys(...namedKeys: Key[]): void; screen(): string; } /** Create fake TTY streams for testing prompts or applications that render prompts. */ export declare function createPromptIO({ isTTY }?: { isTTY?: boolean; }): PromptTestIO; export interface RenderedPrompt { type(text: string): void; keys(...namedKeys: Key[]): void; screen(): string; readonly answer: Promise; } /** Run a prompt function against fake TTY streams and expose terminal-style controls. */ export declare function renderPrompt(prompt: (options: Options, io?: TerminalIO) => Promise, options: Options): RenderedPrompt; export {};