import { input, select, number, confirm, rawlist, expand, checkbox, password, editor } from '@inquirer/prompts'; import type { Prettify, KeyUnion, DistributiveMerge, Pick } from '@inquirer/type'; import { Observable } from 'rxjs'; export type Answers = { [key in Key]: any; }; type AsyncCallbackFunction = (...args: [error: null | undefined, value: R] | [error: Error, value: undefined]) => void; type AsyncGetterFunction = (this: { async: () => AsyncCallbackFunction; }, answers: Partial) => void | R | Promise; export interface QuestionMap { input: Parameters[0]; select: Parameters[0]; /** @deprecated `list` is now named `select` */ list: Parameters[0]; number: Parameters[0]; confirm: Parameters[0]; rawlist: Parameters[0]; expand: Parameters[0]; checkbox: Parameters[0]; password: Parameters[0]; editor: Parameters[0]; } type PromptConfigMap = { [key in keyof QuestionMap]: Readonly; when?: AsyncGetterFunction> | boolean; askAnswered?: boolean; message: Pick | AsyncGetterFunction, Prettify>; choices?: Pick | string[] | AsyncGetterFunction | string[], Prettify>; default?: Pick | AsyncGetterFunction | string[], Prettify>; }>>; }; export type Question = PromptConfigMap[keyof PromptConfigMap]; export type QuestionAnswerMap = Readonly<{ [name in KeyUnion]: Omit, 'name'>; }> | never; export type QuestionArray = readonly Question[] | never; export type QuestionObservable = Observable> | never; export type StreamOptions = Prettify[1] & { skipTTYChecks?: boolean; }>; export {};