/** * Inquirer.js * A collection of common interactive command line user interfaces. */ import { Separator } from '@inquirer/prompts'; import type { Prettify } from '@inquirer/type'; import { default as PromptsRunner } from './ui/prompt.js'; import type { LegacyPromptConstructor, PromptFn } from './ui/prompt.js'; import type { Answers, CustomQuestion, UnnamedDistinctQuestion, StreamOptions } from './types.js'; import { Observable } from 'rxjs'; export type { QuestionMap, Question, DistinctQuestion, Answers, PromptSession, } from './types.js'; type PromptReturnType = Promise> & { ui: PromptsRunner>; }; /** * Create a new self-contained prompt module. */ export declare function createPromptModule> = never>(opt?: StreamOptions): { (questions: ((UnnamedDistinctQuestion | CustomQuestion) & { name: Extract | Extract; })[], answers?: PrefilledAnswers): PromptReturnType>; (questions: { [name in keyof A]: UnnamedDistinctQuestion | CustomQuestion; }, answers?: PrefilledAnswers): PromptReturnType>>>; (questions: Observable<(UnnamedDistinctQuestion | CustomQuestion) & { name: Extract | Extract; }>, answers?: PrefilledAnswers): PromptReturnType>; (questions: (UnnamedDistinctQuestion | CustomQuestion) & { name: Extract | Extract; }, answers?: PrefilledAnswers): PromptReturnType; prompts: { [x: string]: LegacyPromptConstructor | PromptFn; }; /** * Register a prompt type */ registerPrompt(name: string, prompt: LegacyPromptConstructor | PromptFn): any; /** * Register the defaults provider prompts */ restoreDefaultPrompts(): void; }; declare function registerPrompt(name: string, newPrompt: LegacyPromptConstructor): void; declare function restoreDefaultPrompts(): void; declare const inquirer: { prompt: { (questions: (UnnamedDistinctQuestion & { name: Extract | Extract; })[], answers?: PrefilledAnswers | undefined): PromptReturnType; (questions: { [name in keyof A]: UnnamedDistinctQuestion; }, answers?: PrefilledAnswers | undefined): PromptReturnType> extends infer T_1 ? { [K_1 in keyof T_1]: (PrefilledAnswers & Answers>)[K_1]; } : never>; (questions: Observable & { name: Extract | Extract; }>, answers?: PrefilledAnswers | undefined): PromptReturnType; (questions: UnnamedDistinctQuestion & { name: Extract | Extract; }, answers?: PrefilledAnswers | undefined): PromptReturnType; prompts: { [x: string]: LegacyPromptConstructor | PromptFn; }; /** * Register a prompt type */ registerPrompt(name: string, prompt: LegacyPromptConstructor | PromptFn): any; /** * Register the defaults provider prompts */ restoreDefaultPrompts(): void; }; ui: { Prompt: typeof PromptsRunner; }; createPromptModule: typeof createPromptModule; registerPrompt: typeof registerPrompt; restoreDefaultPrompts: typeof restoreDefaultPrompts; Separator: typeof Separator; }; export default inquirer;