1 | export declare enum Interfaces {
|
2 | Terminal = "terminal",
|
3 | Slack = "slack"
|
4 | }
|
5 | export interface APIError {
|
6 | }
|
7 | export interface APIResponse<T> {
|
8 | data: T;
|
9 | error?: APIError[];
|
10 | }
|
11 | export declare type Questions<A extends Answers = Answers> = Question<A> | Question<A>[] | ReadonlyArray<Question<A>>;
|
12 | export declare type Answers = Record<string, any>;
|
13 | interface QuestionCommon<A> {
|
14 | |
15 |
|
16 |
|
17 |
|
18 | name: string;
|
19 | |
20 |
|
21 |
|
22 |
|
23 |
|
24 | message: string;
|
25 | flag?: string;
|
26 | }
|
27 | export declare type Question<A extends Answers = Answers> = InputQuestion<A> | NumberQuestion<A> | SecretQuestion<A> | PasswordQuestion<A> | ConfirmQuestion<A> | ListQuestion<A> | AutoCompleteQuestion<A> | CheckboxQuestion<A> | EditorQuestion<A> | DateTimeQuestion<A>;
|
28 | interface InputQuestion<A> extends QuestionCommon<A> {
|
29 | type: 'input';
|
30 | default?: string;
|
31 | allowEmpty?: boolean;
|
32 | }
|
33 | interface NumberQuestion<A> extends QuestionCommon<A> {
|
34 | type: 'number';
|
35 | default?: number;
|
36 | minimum?: number;
|
37 | maximum?: number;
|
38 | }
|
39 | interface SecretQuestion<A> extends QuestionCommon<A> {
|
40 | type: 'secret';
|
41 | }
|
42 | interface PasswordQuestion<A> extends QuestionCommon<A> {
|
43 | type: 'password';
|
44 | confirm?: boolean;
|
45 | }
|
46 | interface ConfirmQuestion<A> extends QuestionCommon<A> {
|
47 | type: 'confirm';
|
48 | default?: boolean;
|
49 | }
|
50 | interface ListQuestion<A> extends QuestionCommon<A> {
|
51 | type: 'list';
|
52 | choices: string[];
|
53 | default?: string | number;
|
54 | }
|
55 | interface AutoCompleteQuestion<A> extends QuestionCommon<A> {
|
56 | type: 'autocomplete';
|
57 | choices: string[];
|
58 | default?: string | number;
|
59 | }
|
60 | interface CheckboxQuestion<A> extends QuestionCommon<A> {
|
61 | type: 'checkbox';
|
62 | choices: string[];
|
63 | }
|
64 | interface EditorQuestion<A> extends QuestionCommon<A> {
|
65 | type: 'editor';
|
66 | default?: string | number;
|
67 | }
|
68 | interface DateTimeQuestion<A> extends QuestionCommon<A> {
|
69 | type: 'datetime';
|
70 | variant?: 'date' | 'time' | 'datetime';
|
71 | default?: string | Date;
|
72 | minimum?: string | Date;
|
73 | maximum?: string | Date;
|
74 | }
|
75 | export {};
|