-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.d.ts
59 lines (54 loc) · 1.55 KB
/
index.d.ts
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
export interface autoCompleteInterface {
T:{ data:() => Promise<Function> } | { data:Function} | Array<string>
}
export interface commandInterface {
commandString:string,
description?:string,
}
export interface commandOptionsInterface {
optionName:string,
description?:string,
autoComplete?:autoCompleteInterface
}
export interface optionInterface {
}
export interface vorpalCommandConfigInterface {
command:commandInterface,
action:(args:Object, cb?:Function) => void | Promise<void>,
description?:string,
alias?:string,
autocomplete?:autoCompleteInterface,
option?:commandOptionsInterface | Array<commandOptionsInterface>,
types?:Object,
hidden?:boolean,
parse?:(command:string, args:Object) => string,
help?:(args:Object) => void
validate?:(args:Object) => boolean | string,
cancel?:() => void,
use?:any;
}
export interface cliPropsExtensionsInterface {
[index: string]: {
"extFunc": Function;
options: Object;
};
}
export interface cliPropsInterface {
cliName?: string;
pathToCommandFiles?: string;
extensions?: cliPropsExtensionsInterface;
}
declare class DynamicCLI {
vorpal: any;
commandConfigCollection: Array<vorpalCommandConfigInterface>;
defalts: cliPropsInterface;
cliOptions: cliPropsInterface;
logger: any;
constructor(options: cliPropsInterface);
start(): void;
private initialiseVorpal();
private addExtensionsToVorpal();
private addCommandsToVorpal();
private loadCommands();
}
export default DynamicCLI;