Skip to content

Commit c215fa5

Browse files
committed
Fix SelectPrompt options type
1 parent ef7d414 commit c215fa5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/core/src/prompts/select.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
import { NonEmptyArray } from '../utility-types';
12
import Prompt, { PromptOptions } from './prompt';
23

34
interface SelectOptions<T extends { value: any }> extends PromptOptions<SelectPrompt<T>> {
4-
options: T[];
5+
options: NonEmptyArray<T>;
56
initialValue?: T['value'];
67
}
78
export default class SelectPrompt<T extends { value: any }> extends Prompt {
8-
options: T[];
9+
options: SelectOptions<T>['options'];
910
cursor: number = 0;
1011

1112
private get _value() {

packages/core/src/utility-types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export type NonEmptyArray<T> = [T, ...T[]];

0 commit comments

Comments
 (0)