This repository was archived by the owner on Aug 22, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +36
-1
lines changed Expand file tree Collapse file tree 1 file changed +36
-1
lines changed Original file line number Diff line number Diff line change 1
1
import { IConfig } from './config'
2
+ import { IPlugin } from './plugin'
2
3
3
4
export interface ICachedCommand {
4
5
_base : string
@@ -9,15 +10,49 @@ export interface ICachedCommand {
9
10
usage ?: string
10
11
pluginName ?: string
11
12
help ?: string
13
+ flags : { [ name : string ] : ICachedFlag }
14
+ args : ICachedArg [ ]
12
15
load ( ) : Promise < ICommand >
13
16
}
14
17
18
+ export interface IConvertToCachedOptions {
19
+ id ?: string
20
+ plugin ?: IPlugin
21
+ }
22
+
15
23
export interface ICommand extends ICachedCommand {
16
24
run ( argv : string [ ] , opts ?: ICommandOptions ) : Promise < void >
17
- convertToCached ( ) : ICachedCommand
25
+ convertToCached ( opts ?: IConvertToCachedOptions ) : ICachedCommand
18
26
}
19
27
20
28
export interface ICommandOptions {
21
29
root ?: string
22
30
config ?: IConfig
23
31
}
32
+
33
+ export interface ICachedArg {
34
+ name : string
35
+ description ?: string
36
+ required ?: boolean
37
+ hidden ?: boolean
38
+ }
39
+
40
+ export interface ICachedBooleanFlag {
41
+ type : 'boolean'
42
+ name : string
43
+ required ?: boolean
44
+ char ?: string
45
+ hidden ?: boolean
46
+ description ?: string
47
+ }
48
+
49
+ export interface ICachedOptionFlag {
50
+ type : 'option'
51
+ name : string
52
+ required ?: boolean
53
+ char ?: string
54
+ hidden ?: boolean
55
+ description ?: string
56
+ }
57
+
58
+ export type ICachedFlag = ICachedBooleanFlag | ICachedOptionFlag
You can’t perform that action at this time.
0 commit comments