import { Readable, Writable } from 'stream'; import { AutocompleteQuestion, CheckboxQuestion, ConfirmQuestion, JsonQuestion, ListQuestion, NumberQuestion, OptionValue, PasswordQuestion, Question, TextQuestion, Validation } from './question'; import { DefaultResolverRegistry } from './resolvers'; export interface ManPageInfo { commandName: string; questions: Question[]; author?: string; description?: string; } export interface PromptOptions { usageText?: string; manPageInfo?: ManPageInfo; mutateArgs?: boolean; } export declare function reorderQuestionsByDeps(questions: Question[]): Question[]; declare class PromptContext { numTries: number; needsInput: boolean; validation: Validation; constructor(); tryAgain(validation: Partial): void; nextQuestion(): void; process(validation: Validation | boolean): Validation; } export interface InquirererOptions { noTty?: boolean; input?: Readable; output?: Writable; useDefaults?: boolean; globalMaxLines?: number; mutateArgs?: boolean; resolverRegistry?: DefaultResolverRegistry; } export declare class Inquirerer { private rl; private keypress; private noTty; private output; private input; private useDefaults; private globalMaxLines; private mutateArgs; private resolverRegistry; private handledKeys; constructor(options?: InquirererOptions); private clearScreen; private write; private log; private getInput; private getPrompt; private displayPrompt; generateManPage(opts: ManPageInfo): string; private isValidatableAnswer; private validateAnswer; private isValid; private validateAnswerPattern; private isEmptyAnswer; private sanitizeAnswer; exit(): void; prompt(argv: T, questions: Question[], options?: PromptOptions): Promise; private handleMissingArgsError; private hasMissingRequiredArgs; /** * Resolves the default value for a question using the resolver system. * Priority: defaultFrom > default > undefined */ private resolveQuestionDefault; /** * Resolves dynamic defaults for all questions that have defaultFrom specified. * Updates the question.default property with the resolved value. */ private resolveDynamicDefaults; /** * Resolves setFrom values for all questions that have setFrom specified. * Sets the value directly in obj, bypassing the prompt entirely. */ private resolveSetValues; /** * Expands aliases for all questions that have alias specified. * If an alias key exists in obj but the main name doesn't, copies the value to the main name. * This allows users to use short flags like -w instead of --workspace. */ private expandAliases; /** * Resolves optionsFrom values for all questions that have optionsFrom specified. * Updates the question.options property with the resolved array. */ private resolveOptionsFrom; /** * Extracts positional arguments from obj._ and assigns them to questions marked with _: true. * * Rules: * 1. Named arguments take precedence - if a question already has a value in obj, skip it * 2. Positional questions consume from obj._ left-to-right in declaration order * 3. Returns the count of consumed positionals so caller can strip them from obj._ * 4. Missing positional values leave questions unset (for prompting/validation) * * This effectively allows "naming positional parameters" - users can pass values * without flags and they'll be assigned to the appropriate question names. * * @returns The number of positional arguments consumed */ private extractPositionalArgs; private applyDefaultValues; private applyOverrides; private handleOverrides; private handleOverridesForCheckboxOptions; private handleOverridesWithOptions; private handleQuestionType; confirm(question: ConfirmQuestion, ctx: PromptContext): Promise; text(question: TextQuestion, ctx: PromptContext): Promise; json(question: JsonQuestion, ctx: PromptContext): Promise | null>; number(question: NumberQuestion, ctx: PromptContext): Promise; password(question: PasswordQuestion, ctx: PromptContext): Promise; checkbox(question: CheckboxQuestion, ctx: PromptContext): Promise; autocomplete(question: AutocompleteQuestion, ctx: PromptContext): Promise; list(question: ListQuestion, ctx: PromptContext): Promise; private getOptionValue; private sanitizeOptions; private filterOptions; private getMaxLines; close(): void; } export {};