Skip to content

Commit 93fc16a

Browse files
committed
Fix select option type
1 parent 5dbe785 commit 93fc16a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

packages/core/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ export { default as SelectPrompt } from './prompts/select';
88
export { default as SelectKeyPrompt } from './prompts/select-key';
99
export { default as TextPrompt } from './prompts/text';
1010
export { block } from './utils';
11+
export type { NonEmptyArray } from './utility-types';

packages/prompts/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
GroupMultiSelectPrompt,
55
isCancel,
66
MultiSelectPrompt,
7+
NonEmptyArray,
78
PasswordPrompt,
89
SelectKeyPrompt,
910
SelectPrompt,
@@ -176,7 +177,7 @@ type Option<Value> = Value extends Primitive
176177

177178
export interface SelectOptions<Value> {
178179
message: string;
179-
options: Option<Value>[];
180+
options: NonEmptyArray<Option<Value>>;
180181
initialValue?: Value;
181182
maxItems?: number;
182183
}

0 commit comments

Comments
 (0)