Skip to content

Is the type definition of your DynamicPromptsFunction wrong? #467

@lovelyJason

Description

@lovelyJason

我看你们代码有一段

/**
 * 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions