export interface SelectOption { label: string; /** Rendered dim after the label — the "why you would pick this" line. */ hint?: string; value: T; /** Marked as the recommended option and pre-selected. */ recommended?: boolean; } export interface SelectResult { value: T; /** True when the user cancelled with Esc, q or Ctrl-C. */ cancelled: boolean; } /** * Arrow-key menu with a numbered fallback. * * Returns the option's value, plus whether the user cancelled — those are two * different facts and collapsing them is how "user pressed Esc" became * "installation failed" in tools that get this wrong. */ export declare function select(title: string, options: SelectOption[]): Promise>; /** * Multi-select: space toggles, `a` toggles all, Enter confirms. * * `select()` above answers "which ONE", and that was the only question the * installer could ask. It is the wrong question for `--check`, whose whole * output is a list of N outdated installs: a user looking at ten rows wants * six of them, and single-pick forces ten runs of the command to get there. * * Returns the chosen values plus `cancelled`, for the same reason `select()` * does — "picked nothing" and "pressed Esc" are different facts, and a caller * that cannot tell them apart will treat a deliberate empty selection as an * abort. * * Long lists scroll. Without a viewport the redraw walks the cursor back * `options.length + 1` lines, which silently corrupts the screen the moment * the list is taller than the terminal — and the list here is "however many * installs this machine has", which is not a number we control. */ export declare function multiselect(title: string, options: SelectOption[], opts?: { initiallyAll?: boolean; }): Promise<{ values: T[]; cancelled: boolean; }>; /** Free-text question. Returns "" when there is no tty. */ export declare function ask(query: string): Promise; /** Yes/no. `defaultYes` is what a bare Enter means, and it is shown in the prompt. */ export declare function confirm(query: string, defaultYes?: boolean): Promise; //# sourceMappingURL=prompt.d.ts.map