bob-core 3.0.0-beta.10 → 3.0.0-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/HelpFlag.d.ts +4 -4
- package/dist/cjs/args/index.d.ts +35 -28
- package/dist/cjs/flags/boolean.d.ts +5 -5
- package/dist/cjs/flags/custom.d.ts +1 -1
- package/dist/cjs/flags/directory.d.ts +8 -6
- package/dist/cjs/flags/file.d.ts +8 -6
- package/dist/cjs/flags/index.d.ts +40 -33
- package/dist/cjs/flags/number.d.ts +9 -6
- package/dist/cjs/flags/string.d.ts +5 -5
- package/dist/cjs/flags/url.d.ts +5 -5
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/lib/types.d.ts +1 -1
- package/dist/esm/HelpFlag.d.ts +4 -4
- package/dist/esm/args/index.d.ts +35 -28
- package/dist/esm/flags/boolean.d.ts +5 -5
- package/dist/esm/flags/custom.d.ts +1 -1
- package/dist/esm/flags/directory.d.ts +8 -6
- package/dist/esm/flags/file.d.ts +8 -6
- package/dist/esm/flags/index.d.ts +40 -33
- package/dist/esm/flags/number.d.ts +9 -6
- package/dist/esm/flags/string.d.ts +5 -5
- package/dist/esm/flags/url.d.ts +5 -5
- package/dist/esm/index.js +1 -1
- package/dist/esm/lib/types.d.ts +1 -1
- package/package.json +1 -1
package/dist/cjs/HelpFlag.d.ts
CHANGED
|
@@ -2,19 +2,19 @@ import { FlagDefinition, FlagOpts } from './lib/types.js';
|
|
|
2
2
|
export declare const HelpCommandFlag: {
|
|
3
3
|
[x: string]: unknown;
|
|
4
4
|
} & {
|
|
5
|
-
parse: (input: any, opts: FlagOpts<boolean, import('./lib/types.js').CustomOptions,
|
|
5
|
+
parse: (input: any, opts: FlagOpts<boolean, import('./lib/types.js').CustomOptions, unknown>) => boolean;
|
|
6
6
|
type?: import('./lib/types.js').FlagKind;
|
|
7
|
-
ask?: ((opts: FlagOpts<boolean, import('./lib/types.js').CustomOptions,
|
|
7
|
+
ask?: ((opts: FlagOpts<boolean, import('./lib/types.js').CustomOptions, unknown>) => Promise<any>) | undefined;
|
|
8
8
|
description?: string;
|
|
9
9
|
required?: boolean;
|
|
10
10
|
default?: boolean | boolean[] | (() => boolean | boolean[] | null) | (() => Promise<boolean | boolean[] | null>) | null | undefined;
|
|
11
11
|
multiple?: boolean;
|
|
12
12
|
help?: string;
|
|
13
13
|
alias?: string | readonly string[];
|
|
14
|
-
handler?: ((value: boolean, opts: FlagOpts<boolean, import('./lib/types.js').CustomOptions,
|
|
14
|
+
handler?: ((value: boolean, opts: FlagOpts<boolean, import('./lib/types.js').CustomOptions, unknown>) => {
|
|
15
15
|
shouldStop: boolean;
|
|
16
16
|
} | void) | undefined;
|
|
17
|
-
} & Partial<FlagDefinition<boolean, import('./lib/types.js').CustomOptions,
|
|
17
|
+
} & Partial<FlagDefinition<boolean, import('./lib/types.js').CustomOptions, unknown>> & {
|
|
18
18
|
readonly alias: readonly ["h"];
|
|
19
19
|
readonly description: "Displays help information about the command";
|
|
20
20
|
readonly handler: (value: boolean, opts: FlagOpts) => {
|
package/dist/cjs/args/index.d.ts
CHANGED
|
@@ -7,38 +7,41 @@ import { optionFlag } from '../flags/option.js';
|
|
|
7
7
|
* positional inputs and the `ArgsSchema` type rejects them at compile time.
|
|
8
8
|
*/
|
|
9
9
|
export declare const Args: {
|
|
10
|
-
string: <const O extends Partial<import('../index.js').FlagDefinition<string, import('../index.js').CustomOptions,
|
|
10
|
+
string: <OCtx extends import('../index.js').ContextDefinition = unknown, const O extends Partial<import('../index.js').FlagDefinition<string, import('../index.js').CustomOptions, OCtx>> = Partial<import('../index.js').FlagDefinition<string, import('../index.js').CustomOptions, OCtx>>>(overrides?: O | undefined) => {
|
|
11
11
|
[x: string]: unknown;
|
|
12
12
|
} & {
|
|
13
|
-
parse: (input: any, opts: import('../index.js').FlagOpts<string, import('../index.js').CustomOptions,
|
|
13
|
+
parse: (input: any, opts: import('../index.js').FlagOpts<string, import('../index.js').CustomOptions, OCtx>) => string;
|
|
14
14
|
type?: import('../index.js').FlagKind;
|
|
15
|
-
ask?: ((opts: import('../index.js').FlagOpts<string, import('../index.js').CustomOptions,
|
|
15
|
+
ask?: ((opts: import('../index.js').FlagOpts<string, import('../index.js').CustomOptions, OCtx>) => Promise<any>) | undefined;
|
|
16
16
|
description?: string;
|
|
17
17
|
required?: boolean;
|
|
18
18
|
default?: string | string[] | (() => string | string[] | null) | (() => Promise<string | string[] | null>) | null | undefined;
|
|
19
19
|
multiple?: boolean;
|
|
20
20
|
help?: string;
|
|
21
21
|
alias?: string | readonly string[];
|
|
22
|
-
handler?: ((value: string, opts: import('../index.js').FlagOpts<string, import('../index.js').CustomOptions,
|
|
22
|
+
handler?: ((value: string, opts: import('../index.js').FlagOpts<string, import('../index.js').CustomOptions, OCtx>) => {
|
|
23
23
|
shouldStop: boolean;
|
|
24
24
|
} | void) | undefined;
|
|
25
|
-
} & Partial<import('../index.js').FlagDefinition<string, import('../index.js').CustomOptions,
|
|
26
|
-
number: <const O extends Partial<import('../index.js').FlagDefinition<number, {
|
|
25
|
+
} & Partial<import('../index.js').FlagDefinition<string, import('../index.js').CustomOptions, unknown>> & O;
|
|
26
|
+
number: <OCtx extends import('../index.js').ContextDefinition = unknown, const O extends Partial<import('../index.js').FlagDefinition<number, {
|
|
27
27
|
min?: number;
|
|
28
28
|
max?: number;
|
|
29
|
-
},
|
|
29
|
+
}, OCtx>> = Partial<import('../index.js').FlagDefinition<number, {
|
|
30
|
+
min?: number;
|
|
31
|
+
max?: number;
|
|
32
|
+
}, OCtx>>>(overrides?: O | undefined) => {
|
|
30
33
|
min?: number | undefined;
|
|
31
34
|
max?: number | undefined;
|
|
32
35
|
} & {
|
|
33
36
|
parse: (input: any, opts: import('../index.js').FlagOpts<number, {
|
|
34
37
|
min?: number;
|
|
35
38
|
max?: number;
|
|
36
|
-
},
|
|
39
|
+
}, OCtx>) => number;
|
|
37
40
|
type?: import('../index.js').FlagKind;
|
|
38
41
|
ask?: ((opts: import('../index.js').FlagOpts<number, {
|
|
39
42
|
min?: number;
|
|
40
43
|
max?: number;
|
|
41
|
-
},
|
|
44
|
+
}, OCtx>) => Promise<any>) | undefined;
|
|
42
45
|
description?: string;
|
|
43
46
|
required?: boolean;
|
|
44
47
|
default?: number | number[] | (() => number | number[] | null) | (() => Promise<number | number[] | null>) | null | undefined;
|
|
@@ -48,26 +51,28 @@ export declare const Args: {
|
|
|
48
51
|
handler?: ((value: number, opts: import('../index.js').FlagOpts<number, {
|
|
49
52
|
min?: number;
|
|
50
53
|
max?: number;
|
|
51
|
-
},
|
|
54
|
+
}, OCtx>) => {
|
|
52
55
|
shouldStop: boolean;
|
|
53
56
|
} | void) | undefined;
|
|
54
57
|
} & Partial<import('../index.js').FlagDefinition<number, {
|
|
55
58
|
min?: number;
|
|
56
59
|
max?: number;
|
|
57
|
-
},
|
|
60
|
+
}, unknown>> & O;
|
|
58
61
|
option: typeof optionFlag;
|
|
59
|
-
file: <const O extends Partial<import('../index.js').FlagDefinition<string, {
|
|
62
|
+
file: <OCtx extends import('../index.js').ContextDefinition = unknown, const O extends Partial<import('../index.js').FlagDefinition<string, {
|
|
60
63
|
exists?: boolean;
|
|
61
|
-
},
|
|
64
|
+
}, OCtx>> = Partial<import('../index.js').FlagDefinition<string, {
|
|
65
|
+
exists?: boolean;
|
|
66
|
+
}, OCtx>>>(overrides?: O | undefined) => {
|
|
62
67
|
exists?: boolean | undefined;
|
|
63
68
|
} & {
|
|
64
69
|
parse: (input: any, opts: import('../index.js').FlagOpts<string, {
|
|
65
70
|
exists?: boolean;
|
|
66
|
-
},
|
|
71
|
+
}, OCtx>) => string;
|
|
67
72
|
type?: import('../index.js').FlagKind;
|
|
68
73
|
ask?: ((opts: import('../index.js').FlagOpts<string, {
|
|
69
74
|
exists?: boolean;
|
|
70
|
-
},
|
|
75
|
+
}, OCtx>) => Promise<any>) | undefined;
|
|
71
76
|
description?: string;
|
|
72
77
|
required?: boolean;
|
|
73
78
|
default?: string | string[] | (() => string | string[] | null) | (() => Promise<string | string[] | null>) | null | undefined;
|
|
@@ -76,24 +81,26 @@ export declare const Args: {
|
|
|
76
81
|
alias?: string | readonly string[];
|
|
77
82
|
handler?: ((value: string, opts: import('../index.js').FlagOpts<string, {
|
|
78
83
|
exists?: boolean;
|
|
79
|
-
},
|
|
84
|
+
}, OCtx>) => {
|
|
80
85
|
shouldStop: boolean;
|
|
81
86
|
} | void) | undefined;
|
|
82
87
|
} & Partial<import('../index.js').FlagDefinition<string, {
|
|
83
88
|
exists?: boolean;
|
|
84
|
-
},
|
|
85
|
-
directory: <const O extends Partial<import('../index.js').FlagDefinition<string, {
|
|
89
|
+
}, unknown>> & O;
|
|
90
|
+
directory: <OCtx extends import('../index.js').ContextDefinition = unknown, const O extends Partial<import('../index.js').FlagDefinition<string, {
|
|
91
|
+
exists?: boolean;
|
|
92
|
+
}, OCtx>> = Partial<import('../index.js').FlagDefinition<string, {
|
|
86
93
|
exists?: boolean;
|
|
87
|
-
},
|
|
94
|
+
}, OCtx>>>(overrides?: O | undefined) => {
|
|
88
95
|
exists?: boolean | undefined;
|
|
89
96
|
} & {
|
|
90
97
|
parse: (input: any, opts: import('../index.js').FlagOpts<string, {
|
|
91
98
|
exists?: boolean;
|
|
92
|
-
},
|
|
99
|
+
}, OCtx>) => string;
|
|
93
100
|
type?: import('../index.js').FlagKind;
|
|
94
101
|
ask?: ((opts: import('../index.js').FlagOpts<string, {
|
|
95
102
|
exists?: boolean;
|
|
96
|
-
},
|
|
103
|
+
}, OCtx>) => Promise<any>) | undefined;
|
|
97
104
|
description?: string;
|
|
98
105
|
required?: boolean;
|
|
99
106
|
default?: string | string[] | (() => string | string[] | null) | (() => Promise<string | string[] | null>) | null | undefined;
|
|
@@ -102,27 +109,27 @@ export declare const Args: {
|
|
|
102
109
|
alias?: string | readonly string[];
|
|
103
110
|
handler?: ((value: string, opts: import('../index.js').FlagOpts<string, {
|
|
104
111
|
exists?: boolean;
|
|
105
|
-
},
|
|
112
|
+
}, OCtx>) => {
|
|
106
113
|
shouldStop: boolean;
|
|
107
114
|
} | void) | undefined;
|
|
108
115
|
} & Partial<import('../index.js').FlagDefinition<string, {
|
|
109
116
|
exists?: boolean;
|
|
110
|
-
},
|
|
111
|
-
url: <const O extends Partial<import('../index.js').FlagDefinition<URL, import('../index.js').CustomOptions,
|
|
117
|
+
}, unknown>> & O;
|
|
118
|
+
url: <OCtx extends import('../index.js').ContextDefinition = unknown, const O extends Partial<import('../index.js').FlagDefinition<URL, import('../index.js').CustomOptions, OCtx>> = Partial<import('../index.js').FlagDefinition<URL, import('../index.js').CustomOptions, OCtx>>>(overrides?: O | undefined) => {
|
|
112
119
|
[x: string]: unknown;
|
|
113
120
|
} & {
|
|
114
|
-
parse: (input: any, opts: import('../index.js').FlagOpts<URL, import('../index.js').CustomOptions,
|
|
121
|
+
parse: (input: any, opts: import('../index.js').FlagOpts<URL, import('../index.js').CustomOptions, OCtx>) => URL;
|
|
115
122
|
type?: import('../index.js').FlagKind;
|
|
116
|
-
ask?: ((opts: import('../index.js').FlagOpts<URL, import('../index.js').CustomOptions,
|
|
123
|
+
ask?: ((opts: import('../index.js').FlagOpts<URL, import('../index.js').CustomOptions, OCtx>) => Promise<any>) | undefined;
|
|
117
124
|
description?: string;
|
|
118
125
|
required?: boolean;
|
|
119
126
|
default?: URL | URL[] | (() => URL | URL[] | null) | (() => Promise<URL | URL[] | null>) | null | undefined;
|
|
120
127
|
multiple?: boolean;
|
|
121
128
|
help?: string;
|
|
122
129
|
alias?: string | readonly string[];
|
|
123
|
-
handler?: ((value: URL, opts: import('../index.js').FlagOpts<URL, import('../index.js').CustomOptions,
|
|
130
|
+
handler?: ((value: URL, opts: import('../index.js').FlagOpts<URL, import('../index.js').CustomOptions, OCtx>) => {
|
|
124
131
|
shouldStop: boolean;
|
|
125
132
|
} | void) | undefined;
|
|
126
|
-
} & Partial<import('../index.js').FlagDefinition<URL, import('../index.js').CustomOptions,
|
|
133
|
+
} & Partial<import('../index.js').FlagDefinition<URL, import('../index.js').CustomOptions, unknown>> & O;
|
|
127
134
|
custom: typeof custom;
|
|
128
135
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { FlagOpts } from '../lib/types.js';
|
|
2
2
|
/** Boolean flag (`--debug` / `--no-debug`). Defaults to `false` when omitted. */
|
|
3
|
-
export declare const booleanFlag: <const O extends Partial<import('../lib/types.js').FlagDefinition<boolean, import('../lib/types.js').CustomOptions,
|
|
3
|
+
export declare const booleanFlag: <OCtx extends import('../lib/types.js').ContextDefinition = unknown, const O extends Partial<import('../lib/types.js').FlagDefinition<boolean, import('../lib/types.js').CustomOptions, OCtx>> = Partial<import('../lib/types.js').FlagDefinition<boolean, import('../lib/types.js').CustomOptions, OCtx>>>(overrides?: O | undefined) => {
|
|
4
4
|
[x: string]: unknown;
|
|
5
5
|
} & {
|
|
6
|
-
parse: (input: any, opts: FlagOpts<boolean, import('../lib/types.js').CustomOptions,
|
|
6
|
+
parse: (input: any, opts: FlagOpts<boolean, import('../lib/types.js').CustomOptions, OCtx>) => boolean;
|
|
7
7
|
type?: import('../lib/types.js').FlagKind;
|
|
8
|
-
ask?: ((opts: FlagOpts<boolean, import('../lib/types.js').CustomOptions,
|
|
8
|
+
ask?: ((opts: FlagOpts<boolean, import('../lib/types.js').CustomOptions, OCtx>) => Promise<any>) | undefined;
|
|
9
9
|
description?: string;
|
|
10
10
|
required?: boolean;
|
|
11
11
|
default?: boolean | boolean[] | (() => boolean | boolean[] | null) | (() => Promise<boolean | boolean[] | null>) | null | undefined;
|
|
12
12
|
multiple?: boolean;
|
|
13
13
|
help?: string;
|
|
14
14
|
alias?: string | readonly string[];
|
|
15
|
-
handler?: ((value: boolean, opts: FlagOpts<boolean, import('../lib/types.js').CustomOptions,
|
|
15
|
+
handler?: ((value: boolean, opts: FlagOpts<boolean, import('../lib/types.js').CustomOptions, OCtx>) => {
|
|
16
16
|
shouldStop: boolean;
|
|
17
17
|
} | void) | undefined;
|
|
18
|
-
} & Partial<import('../lib/types.js').FlagDefinition<boolean, import('../lib/types.js').CustomOptions,
|
|
18
|
+
} & Partial<import('../lib/types.js').FlagDefinition<boolean, import('../lib/types.js').CustomOptions, unknown>> & O;
|
|
@@ -9,4 +9,4 @@ import { ContextDefinition, CustomOptions, FlagDefinition, InitFlagDefinition }
|
|
|
9
9
|
* The `type` literal supplied in `defaults` is preserved in the returned shape
|
|
10
10
|
* so downstream consumers can rely on it (e.g. for help rendering).
|
|
11
11
|
*/
|
|
12
|
-
export declare function custom<T, C extends CustomOptions = CustomOptions, Ctx extends ContextDefinition = ContextDefinition, const D extends InitFlagDefinition<T, C, Ctx> = InitFlagDefinition<T, C, Ctx>>(defaults?: D): <const O extends InitFlagDefinition<T, C,
|
|
12
|
+
export declare function custom<T, C extends CustomOptions = CustomOptions, Ctx extends ContextDefinition = ContextDefinition, const D extends InitFlagDefinition<T, C, Ctx> = InitFlagDefinition<T, C, Ctx>>(defaults?: D): <OCtx extends ContextDefinition = Ctx, const O extends InitFlagDefinition<T, C, OCtx> = InitFlagDefinition<T, C, OCtx>>(overrides?: O) => FlagDefinition<T, C, OCtx> & D & O;
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
/** Filesystem directory flag. Pass `exists: true` to require the directory to exist at parse time. */
|
|
2
|
-
export declare const directoryFlag: <const O extends Partial<import('../index.js').FlagDefinition<string, {
|
|
2
|
+
export declare const directoryFlag: <OCtx extends import('../index.js').ContextDefinition = unknown, const O extends Partial<import('../index.js').FlagDefinition<string, {
|
|
3
3
|
exists?: boolean;
|
|
4
|
-
},
|
|
4
|
+
}, OCtx>> = Partial<import('../index.js').FlagDefinition<string, {
|
|
5
|
+
exists?: boolean;
|
|
6
|
+
}, OCtx>>>(overrides?: O | undefined) => {
|
|
5
7
|
exists?: boolean | undefined;
|
|
6
8
|
} & {
|
|
7
9
|
parse: (input: any, opts: import('../index.js').FlagOpts<string, {
|
|
8
10
|
exists?: boolean;
|
|
9
|
-
},
|
|
11
|
+
}, OCtx>) => string;
|
|
10
12
|
type?: import('../index.js').FlagKind;
|
|
11
13
|
ask?: ((opts: import('../index.js').FlagOpts<string, {
|
|
12
14
|
exists?: boolean;
|
|
13
|
-
},
|
|
15
|
+
}, OCtx>) => Promise<any>) | undefined;
|
|
14
16
|
description?: string;
|
|
15
17
|
required?: boolean;
|
|
16
18
|
default?: string | string[] | (() => string | string[] | null) | (() => Promise<string | string[] | null>) | null | undefined;
|
|
@@ -19,9 +21,9 @@ export declare const directoryFlag: <const O extends Partial<import('../index.js
|
|
|
19
21
|
alias?: string | readonly string[];
|
|
20
22
|
handler?: ((value: string, opts: import('../index.js').FlagOpts<string, {
|
|
21
23
|
exists?: boolean;
|
|
22
|
-
},
|
|
24
|
+
}, OCtx>) => {
|
|
23
25
|
shouldStop: boolean;
|
|
24
26
|
} | void) | undefined;
|
|
25
27
|
} & Partial<import('../index.js').FlagDefinition<string, {
|
|
26
28
|
exists?: boolean;
|
|
27
|
-
},
|
|
29
|
+
}, unknown>> & O;
|
package/dist/cjs/flags/file.d.ts
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
/** Filesystem file flag. Pass `exists: true` to require the path to exist at parse time. */
|
|
2
|
-
export declare const fileFlag: <const O extends Partial<import('../index.js').FlagDefinition<string, {
|
|
2
|
+
export declare const fileFlag: <OCtx extends import('../index.js').ContextDefinition = unknown, const O extends Partial<import('../index.js').FlagDefinition<string, {
|
|
3
3
|
exists?: boolean;
|
|
4
|
-
},
|
|
4
|
+
}, OCtx>> = Partial<import('../index.js').FlagDefinition<string, {
|
|
5
|
+
exists?: boolean;
|
|
6
|
+
}, OCtx>>>(overrides?: O | undefined) => {
|
|
5
7
|
exists?: boolean | undefined;
|
|
6
8
|
} & {
|
|
7
9
|
parse: (input: any, opts: import('../index.js').FlagOpts<string, {
|
|
8
10
|
exists?: boolean;
|
|
9
|
-
},
|
|
11
|
+
}, OCtx>) => string;
|
|
10
12
|
type?: import('../index.js').FlagKind;
|
|
11
13
|
ask?: ((opts: import('../index.js').FlagOpts<string, {
|
|
12
14
|
exists?: boolean;
|
|
13
|
-
},
|
|
15
|
+
}, OCtx>) => Promise<any>) | undefined;
|
|
14
16
|
description?: string;
|
|
15
17
|
required?: boolean;
|
|
16
18
|
default?: string | string[] | (() => string | string[] | null) | (() => Promise<string | string[] | null>) | null | undefined;
|
|
@@ -19,9 +21,9 @@ export declare const fileFlag: <const O extends Partial<import('../index.js').Fl
|
|
|
19
21
|
alias?: string | readonly string[];
|
|
20
22
|
handler?: ((value: string, opts: import('../index.js').FlagOpts<string, {
|
|
21
23
|
exists?: boolean;
|
|
22
|
-
},
|
|
24
|
+
}, OCtx>) => {
|
|
23
25
|
shouldStop: boolean;
|
|
24
26
|
} | void) | undefined;
|
|
25
27
|
} & Partial<import('../index.js').FlagDefinition<string, {
|
|
26
28
|
exists?: boolean;
|
|
27
|
-
},
|
|
29
|
+
}, unknown>> & O;
|
|
@@ -17,38 +17,41 @@ import { optionFlag } from './option.js';
|
|
|
17
17
|
* default, multiple, ask, handler, help) plus its builder-specific extras.
|
|
18
18
|
*/
|
|
19
19
|
export declare const Flags: {
|
|
20
|
-
string: <const O extends Partial<import('../index.js').FlagDefinition<string, import('../index.js').CustomOptions,
|
|
20
|
+
string: <OCtx extends import('../index.js').ContextDefinition = unknown, const O extends Partial<import('../index.js').FlagDefinition<string, import('../index.js').CustomOptions, OCtx>> = Partial<import('../index.js').FlagDefinition<string, import('../index.js').CustomOptions, OCtx>>>(overrides?: O | undefined) => {
|
|
21
21
|
[x: string]: unknown;
|
|
22
22
|
} & {
|
|
23
|
-
parse: (input: any, opts: import('../index.js').FlagOpts<string, import('../index.js').CustomOptions,
|
|
23
|
+
parse: (input: any, opts: import('../index.js').FlagOpts<string, import('../index.js').CustomOptions, OCtx>) => string;
|
|
24
24
|
type?: import('../index.js').FlagKind;
|
|
25
|
-
ask?: ((opts: import('../index.js').FlagOpts<string, import('../index.js').CustomOptions,
|
|
25
|
+
ask?: ((opts: import('../index.js').FlagOpts<string, import('../index.js').CustomOptions, OCtx>) => Promise<any>) | undefined;
|
|
26
26
|
description?: string;
|
|
27
27
|
required?: boolean;
|
|
28
28
|
default?: string | string[] | (() => string | string[] | null) | (() => Promise<string | string[] | null>) | null | undefined;
|
|
29
29
|
multiple?: boolean;
|
|
30
30
|
help?: string;
|
|
31
31
|
alias?: string | readonly string[];
|
|
32
|
-
handler?: ((value: string, opts: import('../index.js').FlagOpts<string, import('../index.js').CustomOptions,
|
|
32
|
+
handler?: ((value: string, opts: import('../index.js').FlagOpts<string, import('../index.js').CustomOptions, OCtx>) => {
|
|
33
33
|
shouldStop: boolean;
|
|
34
34
|
} | void) | undefined;
|
|
35
|
-
} & Partial<import('../index.js').FlagDefinition<string, import('../index.js').CustomOptions,
|
|
36
|
-
number: <const O extends Partial<import('../index.js').FlagDefinition<number, {
|
|
35
|
+
} & Partial<import('../index.js').FlagDefinition<string, import('../index.js').CustomOptions, unknown>> & O;
|
|
36
|
+
number: <OCtx extends import('../index.js').ContextDefinition = unknown, const O extends Partial<import('../index.js').FlagDefinition<number, {
|
|
37
37
|
min?: number;
|
|
38
38
|
max?: number;
|
|
39
|
-
},
|
|
39
|
+
}, OCtx>> = Partial<import('../index.js').FlagDefinition<number, {
|
|
40
|
+
min?: number;
|
|
41
|
+
max?: number;
|
|
42
|
+
}, OCtx>>>(overrides?: O | undefined) => {
|
|
40
43
|
min?: number | undefined;
|
|
41
44
|
max?: number | undefined;
|
|
42
45
|
} & {
|
|
43
46
|
parse: (input: any, opts: import('../index.js').FlagOpts<number, {
|
|
44
47
|
min?: number;
|
|
45
48
|
max?: number;
|
|
46
|
-
},
|
|
49
|
+
}, OCtx>) => number;
|
|
47
50
|
type?: import('../index.js').FlagKind;
|
|
48
51
|
ask?: ((opts: import('../index.js').FlagOpts<number, {
|
|
49
52
|
min?: number;
|
|
50
53
|
max?: number;
|
|
51
|
-
},
|
|
54
|
+
}, OCtx>) => Promise<any>) | undefined;
|
|
52
55
|
description?: string;
|
|
53
56
|
required?: boolean;
|
|
54
57
|
default?: number | number[] | (() => number | number[] | null) | (() => Promise<number | number[] | null>) | null | undefined;
|
|
@@ -58,42 +61,44 @@ export declare const Flags: {
|
|
|
58
61
|
handler?: ((value: number, opts: import('../index.js').FlagOpts<number, {
|
|
59
62
|
min?: number;
|
|
60
63
|
max?: number;
|
|
61
|
-
},
|
|
64
|
+
}, OCtx>) => {
|
|
62
65
|
shouldStop: boolean;
|
|
63
66
|
} | void) | undefined;
|
|
64
67
|
} & Partial<import('../index.js').FlagDefinition<number, {
|
|
65
68
|
min?: number;
|
|
66
69
|
max?: number;
|
|
67
|
-
},
|
|
68
|
-
boolean: <const O extends Partial<import('../index.js').FlagDefinition<boolean, import('../index.js').CustomOptions,
|
|
70
|
+
}, unknown>> & O;
|
|
71
|
+
boolean: <OCtx extends import('../index.js').ContextDefinition = unknown, const O extends Partial<import('../index.js').FlagDefinition<boolean, import('../index.js').CustomOptions, OCtx>> = Partial<import('../index.js').FlagDefinition<boolean, import('../index.js').CustomOptions, OCtx>>>(overrides?: O | undefined) => {
|
|
69
72
|
[x: string]: unknown;
|
|
70
73
|
} & {
|
|
71
|
-
parse: (input: any, opts: import('../index.js').FlagOpts<boolean, import('../index.js').CustomOptions,
|
|
74
|
+
parse: (input: any, opts: import('../index.js').FlagOpts<boolean, import('../index.js').CustomOptions, OCtx>) => boolean;
|
|
72
75
|
type?: import('../index.js').FlagKind;
|
|
73
|
-
ask?: ((opts: import('../index.js').FlagOpts<boolean, import('../index.js').CustomOptions,
|
|
76
|
+
ask?: ((opts: import('../index.js').FlagOpts<boolean, import('../index.js').CustomOptions, OCtx>) => Promise<any>) | undefined;
|
|
74
77
|
description?: string;
|
|
75
78
|
required?: boolean;
|
|
76
79
|
default?: boolean | boolean[] | (() => boolean | boolean[] | null) | (() => Promise<boolean | boolean[] | null>) | null | undefined;
|
|
77
80
|
multiple?: boolean;
|
|
78
81
|
help?: string;
|
|
79
82
|
alias?: string | readonly string[];
|
|
80
|
-
handler?: ((value: boolean, opts: import('../index.js').FlagOpts<boolean, import('../index.js').CustomOptions,
|
|
83
|
+
handler?: ((value: boolean, opts: import('../index.js').FlagOpts<boolean, import('../index.js').CustomOptions, OCtx>) => {
|
|
81
84
|
shouldStop: boolean;
|
|
82
85
|
} | void) | undefined;
|
|
83
|
-
} & Partial<import('../index.js').FlagDefinition<boolean, import('../index.js').CustomOptions,
|
|
86
|
+
} & Partial<import('../index.js').FlagDefinition<boolean, import('../index.js').CustomOptions, unknown>> & O;
|
|
84
87
|
option: typeof optionFlag;
|
|
85
|
-
file: <const O extends Partial<import('../index.js').FlagDefinition<string, {
|
|
88
|
+
file: <OCtx extends import('../index.js').ContextDefinition = unknown, const O extends Partial<import('../index.js').FlagDefinition<string, {
|
|
86
89
|
exists?: boolean;
|
|
87
|
-
},
|
|
90
|
+
}, OCtx>> = Partial<import('../index.js').FlagDefinition<string, {
|
|
91
|
+
exists?: boolean;
|
|
92
|
+
}, OCtx>>>(overrides?: O | undefined) => {
|
|
88
93
|
exists?: boolean | undefined;
|
|
89
94
|
} & {
|
|
90
95
|
parse: (input: any, opts: import('../index.js').FlagOpts<string, {
|
|
91
96
|
exists?: boolean;
|
|
92
|
-
},
|
|
97
|
+
}, OCtx>) => string;
|
|
93
98
|
type?: import('../index.js').FlagKind;
|
|
94
99
|
ask?: ((opts: import('../index.js').FlagOpts<string, {
|
|
95
100
|
exists?: boolean;
|
|
96
|
-
},
|
|
101
|
+
}, OCtx>) => Promise<any>) | undefined;
|
|
97
102
|
description?: string;
|
|
98
103
|
required?: boolean;
|
|
99
104
|
default?: string | string[] | (() => string | string[] | null) | (() => Promise<string | string[] | null>) | null | undefined;
|
|
@@ -102,24 +107,26 @@ export declare const Flags: {
|
|
|
102
107
|
alias?: string | readonly string[];
|
|
103
108
|
handler?: ((value: string, opts: import('../index.js').FlagOpts<string, {
|
|
104
109
|
exists?: boolean;
|
|
105
|
-
},
|
|
110
|
+
}, OCtx>) => {
|
|
106
111
|
shouldStop: boolean;
|
|
107
112
|
} | void) | undefined;
|
|
108
113
|
} & Partial<import('../index.js').FlagDefinition<string, {
|
|
109
114
|
exists?: boolean;
|
|
110
|
-
},
|
|
111
|
-
directory: <const O extends Partial<import('../index.js').FlagDefinition<string, {
|
|
115
|
+
}, unknown>> & O;
|
|
116
|
+
directory: <OCtx extends import('../index.js').ContextDefinition = unknown, const O extends Partial<import('../index.js').FlagDefinition<string, {
|
|
117
|
+
exists?: boolean;
|
|
118
|
+
}, OCtx>> = Partial<import('../index.js').FlagDefinition<string, {
|
|
112
119
|
exists?: boolean;
|
|
113
|
-
},
|
|
120
|
+
}, OCtx>>>(overrides?: O | undefined) => {
|
|
114
121
|
exists?: boolean | undefined;
|
|
115
122
|
} & {
|
|
116
123
|
parse: (input: any, opts: import('../index.js').FlagOpts<string, {
|
|
117
124
|
exists?: boolean;
|
|
118
|
-
},
|
|
125
|
+
}, OCtx>) => string;
|
|
119
126
|
type?: import('../index.js').FlagKind;
|
|
120
127
|
ask?: ((opts: import('../index.js').FlagOpts<string, {
|
|
121
128
|
exists?: boolean;
|
|
122
|
-
},
|
|
129
|
+
}, OCtx>) => Promise<any>) | undefined;
|
|
123
130
|
description?: string;
|
|
124
131
|
required?: boolean;
|
|
125
132
|
default?: string | string[] | (() => string | string[] | null) | (() => Promise<string | string[] | null>) | null | undefined;
|
|
@@ -128,28 +135,28 @@ export declare const Flags: {
|
|
|
128
135
|
alias?: string | readonly string[];
|
|
129
136
|
handler?: ((value: string, opts: import('../index.js').FlagOpts<string, {
|
|
130
137
|
exists?: boolean;
|
|
131
|
-
},
|
|
138
|
+
}, OCtx>) => {
|
|
132
139
|
shouldStop: boolean;
|
|
133
140
|
} | void) | undefined;
|
|
134
141
|
} & Partial<import('../index.js').FlagDefinition<string, {
|
|
135
142
|
exists?: boolean;
|
|
136
|
-
},
|
|
137
|
-
url: <const O extends Partial<import('../index.js').FlagDefinition<URL, import('../index.js').CustomOptions,
|
|
143
|
+
}, unknown>> & O;
|
|
144
|
+
url: <OCtx extends import('../index.js').ContextDefinition = unknown, const O extends Partial<import('../index.js').FlagDefinition<URL, import('../index.js').CustomOptions, OCtx>> = Partial<import('../index.js').FlagDefinition<URL, import('../index.js').CustomOptions, OCtx>>>(overrides?: O | undefined) => {
|
|
138
145
|
[x: string]: unknown;
|
|
139
146
|
} & {
|
|
140
|
-
parse: (input: any, opts: import('../index.js').FlagOpts<URL, import('../index.js').CustomOptions,
|
|
147
|
+
parse: (input: any, opts: import('../index.js').FlagOpts<URL, import('../index.js').CustomOptions, OCtx>) => URL;
|
|
141
148
|
type?: import('../index.js').FlagKind;
|
|
142
|
-
ask?: ((opts: import('../index.js').FlagOpts<URL, import('../index.js').CustomOptions,
|
|
149
|
+
ask?: ((opts: import('../index.js').FlagOpts<URL, import('../index.js').CustomOptions, OCtx>) => Promise<any>) | undefined;
|
|
143
150
|
description?: string;
|
|
144
151
|
required?: boolean;
|
|
145
152
|
default?: URL | URL[] | (() => URL | URL[] | null) | (() => Promise<URL | URL[] | null>) | null | undefined;
|
|
146
153
|
multiple?: boolean;
|
|
147
154
|
help?: string;
|
|
148
155
|
alias?: string | readonly string[];
|
|
149
|
-
handler?: ((value: URL, opts: import('../index.js').FlagOpts<URL, import('../index.js').CustomOptions,
|
|
156
|
+
handler?: ((value: URL, opts: import('../index.js').FlagOpts<URL, import('../index.js').CustomOptions, OCtx>) => {
|
|
150
157
|
shouldStop: boolean;
|
|
151
158
|
} | void) | undefined;
|
|
152
|
-
} & Partial<import('../index.js').FlagDefinition<URL, import('../index.js').CustomOptions,
|
|
159
|
+
} & Partial<import('../index.js').FlagDefinition<URL, import('../index.js').CustomOptions, unknown>> & O;
|
|
153
160
|
custom: typeof custom;
|
|
154
161
|
};
|
|
155
162
|
export { Args } from '../args/index.js';
|
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
/** Numeric flag. Optional `min`/`max` clamp the accepted range and surface as `BadCommandFlag`. */
|
|
2
|
-
export declare const numberFlag: <const O extends Partial<import('../index.js').FlagDefinition<number, {
|
|
2
|
+
export declare const numberFlag: <OCtx extends import('../index.js').ContextDefinition = unknown, const O extends Partial<import('../index.js').FlagDefinition<number, {
|
|
3
3
|
min?: number;
|
|
4
4
|
max?: number;
|
|
5
|
-
},
|
|
5
|
+
}, OCtx>> = Partial<import('../index.js').FlagDefinition<number, {
|
|
6
|
+
min?: number;
|
|
7
|
+
max?: number;
|
|
8
|
+
}, OCtx>>>(overrides?: O | undefined) => {
|
|
6
9
|
min?: number | undefined;
|
|
7
10
|
max?: number | undefined;
|
|
8
11
|
} & {
|
|
9
12
|
parse: (input: any, opts: import('../index.js').FlagOpts<number, {
|
|
10
13
|
min?: number;
|
|
11
14
|
max?: number;
|
|
12
|
-
},
|
|
15
|
+
}, OCtx>) => number;
|
|
13
16
|
type?: import('../index.js').FlagKind;
|
|
14
17
|
ask?: ((opts: import('../index.js').FlagOpts<number, {
|
|
15
18
|
min?: number;
|
|
16
19
|
max?: number;
|
|
17
|
-
},
|
|
20
|
+
}, OCtx>) => Promise<any>) | undefined;
|
|
18
21
|
description?: string;
|
|
19
22
|
required?: boolean;
|
|
20
23
|
default?: number | number[] | (() => number | number[] | null) | (() => Promise<number | number[] | null>) | null | undefined;
|
|
@@ -24,10 +27,10 @@ export declare const numberFlag: <const O extends Partial<import('../index.js').
|
|
|
24
27
|
handler?: ((value: number, opts: import('../index.js').FlagOpts<number, {
|
|
25
28
|
min?: number;
|
|
26
29
|
max?: number;
|
|
27
|
-
},
|
|
30
|
+
}, OCtx>) => {
|
|
28
31
|
shouldStop: boolean;
|
|
29
32
|
} | void) | undefined;
|
|
30
33
|
} & Partial<import('../index.js').FlagDefinition<number, {
|
|
31
34
|
min?: number;
|
|
32
35
|
max?: number;
|
|
33
|
-
},
|
|
36
|
+
}, unknown>> & O;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/** Text input flag. Pass `secret: true` to mask the prompt as a password. */
|
|
2
|
-
export declare const stringFlag: <const O extends Partial<import('../index.js').FlagDefinition<string, import('../index.js').CustomOptions,
|
|
2
|
+
export declare const stringFlag: <OCtx extends import('../index.js').ContextDefinition = unknown, const O extends Partial<import('../index.js').FlagDefinition<string, import('../index.js').CustomOptions, OCtx>> = Partial<import('../index.js').FlagDefinition<string, import('../index.js').CustomOptions, OCtx>>>(overrides?: O | undefined) => {
|
|
3
3
|
[x: string]: unknown;
|
|
4
4
|
} & {
|
|
5
|
-
parse: (input: any, opts: import('../index.js').FlagOpts<string, import('../index.js').CustomOptions,
|
|
5
|
+
parse: (input: any, opts: import('../index.js').FlagOpts<string, import('../index.js').CustomOptions, OCtx>) => string;
|
|
6
6
|
type?: import('../index.js').FlagKind;
|
|
7
|
-
ask?: ((opts: import('../index.js').FlagOpts<string, import('../index.js').CustomOptions,
|
|
7
|
+
ask?: ((opts: import('../index.js').FlagOpts<string, import('../index.js').CustomOptions, OCtx>) => Promise<any>) | undefined;
|
|
8
8
|
description?: string;
|
|
9
9
|
required?: boolean;
|
|
10
10
|
default?: string | string[] | (() => string | string[] | null) | (() => Promise<string | string[] | null>) | null | undefined;
|
|
11
11
|
multiple?: boolean;
|
|
12
12
|
help?: string;
|
|
13
13
|
alias?: string | readonly string[];
|
|
14
|
-
handler?: ((value: string, opts: import('../index.js').FlagOpts<string, import('../index.js').CustomOptions,
|
|
14
|
+
handler?: ((value: string, opts: import('../index.js').FlagOpts<string, import('../index.js').CustomOptions, OCtx>) => {
|
|
15
15
|
shouldStop: boolean;
|
|
16
16
|
} | void) | undefined;
|
|
17
|
-
} & Partial<import('../index.js').FlagDefinition<string, import('../index.js').CustomOptions,
|
|
17
|
+
} & Partial<import('../index.js').FlagDefinition<string, import('../index.js').CustomOptions, unknown>> & O;
|
package/dist/cjs/flags/url.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/** URL flag — parses the input with `new URL()` and returns the resulting `URL` object. */
|
|
2
|
-
export declare const urlFlag: <const O extends Partial<import('../index.js').FlagDefinition<URL, import('../index.js').CustomOptions,
|
|
2
|
+
export declare const urlFlag: <OCtx extends import('../index.js').ContextDefinition = unknown, const O extends Partial<import('../index.js').FlagDefinition<URL, import('../index.js').CustomOptions, OCtx>> = Partial<import('../index.js').FlagDefinition<URL, import('../index.js').CustomOptions, OCtx>>>(overrides?: O | undefined) => {
|
|
3
3
|
[x: string]: unknown;
|
|
4
4
|
} & {
|
|
5
|
-
parse: (input: any, opts: import('../index.js').FlagOpts<URL, import('../index.js').CustomOptions,
|
|
5
|
+
parse: (input: any, opts: import('../index.js').FlagOpts<URL, import('../index.js').CustomOptions, OCtx>) => URL;
|
|
6
6
|
type?: import('../index.js').FlagKind;
|
|
7
|
-
ask?: ((opts: import('../index.js').FlagOpts<URL, import('../index.js').CustomOptions,
|
|
7
|
+
ask?: ((opts: import('../index.js').FlagOpts<URL, import('../index.js').CustomOptions, OCtx>) => Promise<any>) | undefined;
|
|
8
8
|
description?: string;
|
|
9
9
|
required?: boolean;
|
|
10
10
|
default?: URL | URL[] | (() => URL | URL[] | null) | (() => Promise<URL | URL[] | null>) | null | undefined;
|
|
11
11
|
multiple?: boolean;
|
|
12
12
|
help?: string;
|
|
13
13
|
alias?: string | readonly string[];
|
|
14
|
-
handler?: ((value: URL, opts: import('../index.js').FlagOpts<URL, import('../index.js').CustomOptions,
|
|
14
|
+
handler?: ((value: URL, opts: import('../index.js').FlagOpts<URL, import('../index.js').CustomOptions, OCtx>) => {
|
|
15
15
|
shouldStop: boolean;
|
|
16
16
|
} | void) | undefined;
|
|
17
|
-
} & Partial<import('../index.js').FlagDefinition<URL, import('../index.js').CustomOptions,
|
|
17
|
+
} & Partial<import('../index.js').FlagDefinition<URL, import('../index.js').CustomOptions, unknown>> & O;
|