/** * Inquirer.js * A collection of common interactive command line user interfaces. */ import { Separator } from '@inquirer/prompts'; import type { Prettify } from '@inquirer/type'; import PromptsRunner from './ui/prompt.ts'; import type { PromptCollection, LegacyPromptConstructor, PromptFn } from './ui/prompt.ts'; import type { Answers, StreamOptions, QuestionMap, PromptSession, PromptModulePublicQuestion, PromptModuleSpecificQuestion, PromptModuleNamedQuestion, QuestionSequence, MergedAnswers, DictionaryAnswers } from './types.ts'; type PublicQuestions = QuestionSequence, A>>; type InternalQuestions>> = QuestionSequence, Prompts, A>>; type QuestionsDictionary>> = { [name in keyof A]: PromptModuleSpecificQuestion, Prompts>; }; type PromptModuleApi> = never> = { (questions: PublicQuestions | InternalQuestions, answers?: Prefilled): PromptReturnType>; (questions: QuestionsDictionary, answers?: Prefilled): PromptReturnType>; (questions: PromptSession, answers?: Partial): PromptReturnType; } & { prompts: PromptCollection; registerPrompt(name: string, prompt: LegacyPromptConstructor | PromptFn): PromptModuleApi; restoreDefaultPrompts(): void; }; export type { QuestionMap, Question, DistinctQuestion, Answers, PromptSession, } from './types.ts'; type PromptReturnType = Promise> & { ui: PromptsRunner>; }; /** * Create a new self-contained prompt module. */ export declare function createPromptModule> = never>(opt?: StreamOptions): PromptModuleApi; declare function registerPrompt(name: string, newPrompt: LegacyPromptConstructor): void; declare function restoreDefaultPrompts(): void; declare const inquirer: { prompt: PromptModuleApi>; ui: { Prompt: typeof PromptsRunner; }; createPromptModule: typeof createPromptModule; registerPrompt: typeof registerPrompt; restoreDefaultPrompts: typeof restoreDefaultPrompts; Separator: typeof Separator; }; export default inquirer;