Skip to content

Is the type definition of your DynamicPromptsFunction wrong? #467

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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