-
Notifications
You must be signed in to change notification settings - Fork 2.7k
/
types.js
66 lines (56 loc) · 1.24 KB
/
types.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/* @flow */
/* global stream$Writable */
/* global stream$Readable */
/* global tty$ReadStream */
/* global tty$WriteStream */
export type Stdout = stream$Writable | tty$WriteStream;
export type Stdin = stream$Readable | tty$ReadStream;
export type Package = {
name: string,
version: string,
};
export type Tree = {
name: string,
children?: Trees,
hint?: ?string,
hidden?: boolean,
color?: ?string,
shadow?: ?String,
};
export type Trees = Array<Tree>;
export type ReporterSpinner = {
tick: (name: string) => void,
end: () => void,
};
export type ReporterSelectOption = {
name: string,
value: string,
};
export type ReporterSpinnerSet = {
spinners: Array<ReporterSetSpinner>,
end: () => void,
};
export type ReporterSetSpinner = {
clear: () => void,
setPrefix: (current: number, prefix: string) => void,
tick: (msg: string) => void,
end: () => void,
};
export type QuestionOptions = {
password?: boolean,
required?: boolean,
};
export type InquirerPromptTypes =
| 'list'
| 'rawlist'
| 'expand'
| 'checkbox'
| 'confirm'
| 'input'
| 'password'
| 'editor';
export type PromptOptions = {
name?: string,
type?: InquirerPromptTypes,
validate?: (input: string | Array<string>) => boolean | string,
};