#467·plop

Is the type definition of your DynamicPromptsFunction wrong?

Author: lovelyJasonCreated Jul 29, 2025Updated Jul 29, 2025

我看你们代码有一段

typescript
/**
 * A set of answers.
 */
export interface Answers extends Record<string, any> {}


export type PromptQuestion =
  | Question
  | CheckboxQuestion
  | ListQuestion
  | ExpandQuestion
  | ConfirmQuestion
  | EditorQuestion
  | RawListQuestion
  | PasswordQuestion
  | NumberQuestion
  | InputQuestion;
export type DynamicPromptsFunction = (inquirer: Inquirer) => Promise<Answers>;
export type Prompts = DynamicPromptsFunction | PromptQuestion[];

为什么这里不是export type DynamicPromptsFunction = (inquirer: Inquirer) => Promise<PromptQuestion[] >; Why not?