From 93fc16a25b2988b47b9f451a11b6b241b33bca6b Mon Sep 17 00:00:00 2001 From: kevduc Date: Thu, 17 Aug 2023 04:42:05 +0200 Subject: [PATCH] Fix select option type --- packages/core/src/index.ts | 1 + packages/prompts/src/index.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index db26c399..3b1f8102 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -8,3 +8,4 @@ export { default as SelectPrompt } from './prompts/select'; export { default as SelectKeyPrompt } from './prompts/select-key'; export { default as TextPrompt } from './prompts/text'; export { block } from './utils'; +export type { NonEmptyArray } from './utility-types'; diff --git a/packages/prompts/src/index.ts b/packages/prompts/src/index.ts index 42451cc8..61f9cb54 100644 --- a/packages/prompts/src/index.ts +++ b/packages/prompts/src/index.ts @@ -4,6 +4,7 @@ import { GroupMultiSelectPrompt, isCancel, MultiSelectPrompt, + NonEmptyArray, PasswordPrompt, SelectKeyPrompt, SelectPrompt, @@ -176,7 +177,7 @@ type Option = Value extends Primitive export interface SelectOptions { message: string; - options: Option[]; + options: NonEmptyArray>; initialValue?: Value; maxItems?: number; }