We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ef7d414 commit c215fa5Copy full SHA for c215fa5
packages/core/src/prompts/select.ts
@@ -1,11 +1,12 @@
1
+import { NonEmptyArray } from '../utility-types';
2
import Prompt, { PromptOptions } from './prompt';
3
4
interface SelectOptions<T extends { value: any }> extends PromptOptions<SelectPrompt<T>> {
- options: T[];
5
+ options: NonEmptyArray<T>;
6
initialValue?: T['value'];
7
}
8
export default class SelectPrompt<T extends { value: any }> extends Prompt {
9
+ options: SelectOptions<T>['options'];
10
cursor: number = 0;
11
12
private get _value() {
packages/core/src/utility-types.ts
@@ -0,0 +1 @@
+export type NonEmptyArray<T> = [T, ...T[]];
0 commit comments