import { Readable, Writable } from 'node:stream'; declare function isCancel(value: unknown): value is symbol; interface PromptOptions { render(this: Omit): string | void; placeholder?: string; initialValue?: any; validate?: ((value: any) => string | void) | undefined; input?: Readable; output?: Writable; debug?: boolean; } type State = 'initial' | 'active' | 'cancel' | 'submit' | 'error'; declare class Prompt { protected input: Readable; protected output: Writable; private rl; private opts; private _track; private _render; protected _cursor: number; state: State; value: any; error: string; constructor({ render, input, output, ...opts }: PromptOptions, trackValue?: boolean); prompt(): Promise; private subscribers; on(event: string, cb: (...args: any) => any): void; once(event: string, cb: (...args: any) => any): void; emit(event: string, ...data: any[]): void; private unsubscribe; private onKeypress; protected close(): void; private restoreCursor; private _prevFrame; private render; } interface ConfirmOptions extends PromptOptions { active: string; inactive: string; initialValue?: boolean; } declare class ConfirmPrompt extends Prompt { get cursor(): 0 | 1; private get _value(); constructor(opts: ConfirmOptions); } interface GroupMultiSelectOptions extends PromptOptions> { options: Record; initialValues?: T['value'][]; required?: boolean; cursorAt?: T['value']; } declare class GroupMultiSelectPrompt extends Prompt { options: (T & { group: string | boolean; })[]; cursor: number; getGroupItems(group: string): T[]; isGroupSelected(group: string): boolean; private toggleValue; constructor(opts: GroupMultiSelectOptions); } interface MultiSelectOptions extends PromptOptions> { options: T[]; initialValues?: T['value'][]; required?: boolean; cursorAt?: T['value']; } declare class MultiSelectPrompt extends Prompt { options: T[]; cursor: number; private get _value(); private toggleAll; private toggleValue; constructor(opts: MultiSelectOptions); } interface PasswordOptions extends PromptOptions { mask?: string; } declare class PasswordPrompt extends Prompt { valueWithCursor: string; private _mask; get cursor(): number; get masked(): any; constructor({ mask, ...opts }: PasswordOptions); } interface SelectOptions extends PromptOptions> { options: T[]; initialValue?: T['value']; } declare class SelectPrompt extends Prompt { options: T[]; cursor: number; private get _value(); private changeValue; constructor(opts: SelectOptions); } interface SelectKeyOptions extends PromptOptions> { options: T[]; } declare class SelectKeyPrompt extends Prompt { options: T[]; cursor: number; constructor(opts: SelectKeyOptions); } interface TextOptions extends PromptOptions { placeholder?: string; defaultValue?: string; } declare class TextPrompt extends Prompt { valueWithCursor: string; get cursor(): number; constructor(opts: TextOptions); } declare function block({ input, output, overwrite, hideCursor, }?: { input?: (NodeJS.ReadStream & { fd: 0; }) | undefined; output?: (NodeJS.WriteStream & { fd: 1; }) | undefined; overwrite?: boolean | undefined; hideCursor?: boolean | undefined; }): () => void; export { ConfirmPrompt, GroupMultiSelectPrompt, MultiSelectPrompt, PasswordPrompt, Prompt, SelectKeyPrompt, SelectPrompt, State, TextPrompt, block, isCancel };