diff --git a/src/prompt.ts b/src/prompt.ts index ad6e7843..f8546140 100644 --- a/src/prompt.ts +++ b/src/prompt.ts @@ -21,7 +21,7 @@ export type ConfirmOptions = { export type SelectOptions = { type: "select"; initial?: string; - options: (SelectOption | string)[]; + options: (string | SelectOption)[]; }; export type MultiSelectOptions = { @@ -41,7 +41,11 @@ type inferPromptReturnType = T extends TextOptions ? string : T extends ConfirmOptions ? boolean - : string[]; + : T extends SelectOptions + ? T["options"][number] + : T extends MultiSelectOptions + ? T["options"] + : unknown; export async function prompt< _ = any,