import { AssertionError } from 'node:assert'; import { type PromptChoice, type ListPromptOptions, type TextPromptOptions, type TogglePromptOptions, type ChoicePromptOptions, type BooleanPromptOptions, type MultiplePromptOptions, type AutoCompletePromptOptions } from './types.js'; import { MockedPrompt } from './mocked_prompt.js'; /** * Base prompt class exposes the public API for triggering prompts. The * implementations just need to implement a single prompt method. */ export declare abstract class BasePrompt { #private; traps: { prompts: Map; verify: () => void; }; protected abstract prompt(options: any): Promise; /** * Prompts for text input */ ask(title: string, options?: TextPromptOptions): Promise; /** * Prompt to accept a list of comma separated values */ list(title: string, options?: ListPromptOptions): Promise; /** * Prompts for text input but masks the output (for password) */ secure(title: string, options?: TextPromptOptions): Promise; /** * Asks for `Y/n` */ confirm(title: string, options?: BooleanPromptOptions): Promise; /** * Similar to [[this.confirm]] but with custom names for the `Y/n` options */ toggle(title: string, choices: [string, string], options?: TogglePromptOptions): Promise; /** * Prompt to select a value from the list of options */ choice(title: string, choices: readonly (Choice | PromptChoice)[], options?: ChoicePromptOptions): Promise; /** * Prompt to select multiple values from the list of options */ multiple(title: string, choices: readonly (Choice | PromptChoice)[], options?: MultiplePromptOptions): Promise; /** * Prompt to select one or multiple values from the list of searchable * options. */ autocomplete(title: string, choices: readonly Choice[], options?: AutoCompletePromptOptions): Promise; /** * Trap a prompt by its message or unique name */ trap(message: string): MockedPrompt; }