bob-core 3.0.0-beta.11 → 3.0.0-beta.13
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 +31 -31
- package/dist/cjs/flags/boolean.d.ts +5 -5
- package/dist/cjs/flags/custom.d.ts +2 -2
- package/dist/cjs/flags/directory.d.ts +7 -7
- package/dist/cjs/flags/file.d.ts +7 -7
- package/dist/cjs/flags/index.d.ts +36 -36
- package/dist/cjs/flags/number.d.ts +7 -7
- package/dist/cjs/flags/option.d.ts +26 -3
- package/dist/cjs/flags/string.d.ts +5 -5
- package/dist/cjs/flags/url.d.ts +5 -5
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/lib/types.d.ts +9 -9
- package/dist/cjs/shared/ask-helpers.d.ts +1 -1
- package/dist/cjs/shared/flagsUtils.d.ts +0 -2
- package/dist/esm/HelpFlag.d.ts +4 -4
- package/dist/esm/args/index.d.ts +31 -31
- package/dist/esm/flags/boolean.d.ts +5 -5
- package/dist/esm/flags/custom.d.ts +2 -2
- package/dist/esm/flags/directory.d.ts +7 -7
- package/dist/esm/flags/file.d.ts +7 -7
- package/dist/esm/flags/index.d.ts +36 -36
- package/dist/esm/flags/number.d.ts +7 -7
- package/dist/esm/flags/option.d.ts +26 -3
- package/dist/esm/flags/string.d.ts +5 -5
- package/dist/esm/flags/url.d.ts +5 -5
- package/dist/esm/index.js +3 -5
- package/dist/esm/lib/types.d.ts +9 -9
- package/dist/esm/shared/ask-helpers.d.ts +1 -1
- package/dist/esm/shared/flagsUtils.d.ts +0 -2
- 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>) => 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>) => 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>) => {
|
|
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>> & {
|
|
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,41 +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: <
|
|
10
|
+
string: <const O extends Partial<import('../index.js').FlagDefinition<string, import('../index.js').CustomOptions>> = Partial<import('../index.js').FlagDefinition<string, import('../index.js').CustomOptions>>>(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>) => 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>) => 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>) => {
|
|
23
23
|
shouldStop: boolean;
|
|
24
24
|
} | void) | undefined;
|
|
25
|
-
} & Partial<import('../index.js').FlagDefinition<string, import('../index.js').CustomOptions
|
|
26
|
-
number: <
|
|
25
|
+
} & Partial<import('../index.js').FlagDefinition<string, import('../index.js').CustomOptions>> & O;
|
|
26
|
+
number: <const O extends Partial<import('../index.js').FlagDefinition<number, {
|
|
27
27
|
min?: number;
|
|
28
28
|
max?: number;
|
|
29
|
-
}
|
|
29
|
+
}>> = Partial<import('../index.js').FlagDefinition<number, {
|
|
30
30
|
min?: number;
|
|
31
31
|
max?: number;
|
|
32
|
-
}
|
|
32
|
+
}>>>(overrides?: O | undefined) => {
|
|
33
33
|
min?: number | undefined;
|
|
34
34
|
max?: number | undefined;
|
|
35
35
|
} & {
|
|
36
36
|
parse: (input: any, opts: import('../index.js').FlagOpts<number, {
|
|
37
37
|
min?: number;
|
|
38
38
|
max?: number;
|
|
39
|
-
}
|
|
39
|
+
}>) => number;
|
|
40
40
|
type?: import('../index.js').FlagKind;
|
|
41
41
|
ask?: ((opts: import('../index.js').FlagOpts<number, {
|
|
42
42
|
min?: number;
|
|
43
43
|
max?: number;
|
|
44
|
-
}
|
|
44
|
+
}>) => Promise<any>) | undefined;
|
|
45
45
|
description?: string;
|
|
46
46
|
required?: boolean;
|
|
47
47
|
default?: number | number[] | (() => number | number[] | null) | (() => Promise<number | number[] | null>) | null | undefined;
|
|
@@ -51,28 +51,28 @@ export declare const Args: {
|
|
|
51
51
|
handler?: ((value: number, opts: import('../index.js').FlagOpts<number, {
|
|
52
52
|
min?: number;
|
|
53
53
|
max?: number;
|
|
54
|
-
}
|
|
54
|
+
}>) => {
|
|
55
55
|
shouldStop: boolean;
|
|
56
56
|
} | void) | undefined;
|
|
57
57
|
} & Partial<import('../index.js').FlagDefinition<number, {
|
|
58
58
|
min?: number;
|
|
59
59
|
max?: number;
|
|
60
|
-
}
|
|
60
|
+
}>> & O;
|
|
61
61
|
option: typeof optionFlag;
|
|
62
|
-
file: <
|
|
62
|
+
file: <const O extends Partial<import('../index.js').FlagDefinition<string, {
|
|
63
63
|
exists?: boolean;
|
|
64
|
-
}
|
|
64
|
+
}>> = Partial<import('../index.js').FlagDefinition<string, {
|
|
65
65
|
exists?: boolean;
|
|
66
|
-
}
|
|
66
|
+
}>>>(overrides?: O | undefined) => {
|
|
67
67
|
exists?: boolean | undefined;
|
|
68
68
|
} & {
|
|
69
69
|
parse: (input: any, opts: import('../index.js').FlagOpts<string, {
|
|
70
70
|
exists?: boolean;
|
|
71
|
-
}
|
|
71
|
+
}>) => string;
|
|
72
72
|
type?: import('../index.js').FlagKind;
|
|
73
73
|
ask?: ((opts: import('../index.js').FlagOpts<string, {
|
|
74
74
|
exists?: boolean;
|
|
75
|
-
}
|
|
75
|
+
}>) => Promise<any>) | undefined;
|
|
76
76
|
description?: string;
|
|
77
77
|
required?: boolean;
|
|
78
78
|
default?: string | string[] | (() => string | string[] | null) | (() => Promise<string | string[] | null>) | null | undefined;
|
|
@@ -81,26 +81,26 @@ export declare const Args: {
|
|
|
81
81
|
alias?: string | readonly string[];
|
|
82
82
|
handler?: ((value: string, opts: import('../index.js').FlagOpts<string, {
|
|
83
83
|
exists?: boolean;
|
|
84
|
-
}
|
|
84
|
+
}>) => {
|
|
85
85
|
shouldStop: boolean;
|
|
86
86
|
} | void) | undefined;
|
|
87
87
|
} & Partial<import('../index.js').FlagDefinition<string, {
|
|
88
88
|
exists?: boolean;
|
|
89
|
-
}
|
|
90
|
-
directory: <
|
|
89
|
+
}>> & O;
|
|
90
|
+
directory: <const O extends Partial<import('../index.js').FlagDefinition<string, {
|
|
91
91
|
exists?: boolean;
|
|
92
|
-
}
|
|
92
|
+
}>> = Partial<import('../index.js').FlagDefinition<string, {
|
|
93
93
|
exists?: boolean;
|
|
94
|
-
}
|
|
94
|
+
}>>>(overrides?: O | undefined) => {
|
|
95
95
|
exists?: boolean | undefined;
|
|
96
96
|
} & {
|
|
97
97
|
parse: (input: any, opts: import('../index.js').FlagOpts<string, {
|
|
98
98
|
exists?: boolean;
|
|
99
|
-
}
|
|
99
|
+
}>) => string;
|
|
100
100
|
type?: import('../index.js').FlagKind;
|
|
101
101
|
ask?: ((opts: import('../index.js').FlagOpts<string, {
|
|
102
102
|
exists?: boolean;
|
|
103
|
-
}
|
|
103
|
+
}>) => Promise<any>) | undefined;
|
|
104
104
|
description?: string;
|
|
105
105
|
required?: boolean;
|
|
106
106
|
default?: string | string[] | (() => string | string[] | null) | (() => Promise<string | string[] | null>) | null | undefined;
|
|
@@ -109,27 +109,27 @@ export declare const Args: {
|
|
|
109
109
|
alias?: string | readonly string[];
|
|
110
110
|
handler?: ((value: string, opts: import('../index.js').FlagOpts<string, {
|
|
111
111
|
exists?: boolean;
|
|
112
|
-
}
|
|
112
|
+
}>) => {
|
|
113
113
|
shouldStop: boolean;
|
|
114
114
|
} | void) | undefined;
|
|
115
115
|
} & Partial<import('../index.js').FlagDefinition<string, {
|
|
116
116
|
exists?: boolean;
|
|
117
|
-
}
|
|
118
|
-
url: <
|
|
117
|
+
}>> & O;
|
|
118
|
+
url: <const O extends Partial<import('../index.js').FlagDefinition<URL, import('../index.js').CustomOptions>> = Partial<import('../index.js').FlagDefinition<URL, import('../index.js').CustomOptions>>>(overrides?: O | undefined) => {
|
|
119
119
|
[x: string]: unknown;
|
|
120
120
|
} & {
|
|
121
|
-
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>) => URL;
|
|
122
122
|
type?: import('../index.js').FlagKind;
|
|
123
|
-
ask?: ((opts: import('../index.js').FlagOpts<URL, import('../index.js').CustomOptions
|
|
123
|
+
ask?: ((opts: import('../index.js').FlagOpts<URL, import('../index.js').CustomOptions>) => Promise<any>) | undefined;
|
|
124
124
|
description?: string;
|
|
125
125
|
required?: boolean;
|
|
126
126
|
default?: URL | URL[] | (() => URL | URL[] | null) | (() => Promise<URL | URL[] | null>) | null | undefined;
|
|
127
127
|
multiple?: boolean;
|
|
128
128
|
help?: string;
|
|
129
129
|
alias?: string | readonly string[];
|
|
130
|
-
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>) => {
|
|
131
131
|
shouldStop: boolean;
|
|
132
132
|
} | void) | undefined;
|
|
133
|
-
} & Partial<import('../index.js').FlagDefinition<URL, import('../index.js').CustomOptions
|
|
133
|
+
} & Partial<import('../index.js').FlagDefinition<URL, import('../index.js').CustomOptions>> & O;
|
|
134
134
|
custom: typeof custom;
|
|
135
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: <
|
|
3
|
+
export declare const booleanFlag: <const O extends Partial<import('../lib/types.js').FlagDefinition<boolean, import('../lib/types.js').CustomOptions>> = Partial<import('../lib/types.js').FlagDefinition<boolean, import('../lib/types.js').CustomOptions>>>(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>) => 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>) => 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>) => {
|
|
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>> & O;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CustomOptions, FlagDefinition, InitFlagDefinition } from '../lib/types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Escape hatch for declaring arbitrary parameter types. Returns a builder
|
|
4
4
|
* function — call it with overrides to produce a `FlagDefinition`.
|
|
@@ -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,
|
|
12
|
+
export declare function custom<T = string, C extends CustomOptions = CustomOptions, const D extends InitFlagDefinition<T, C> = InitFlagDefinition<T, C>>(defaults?: D): <const O extends InitFlagDefinition<T, C> = InitFlagDefinition<T, C>>(overrides?: O) => FlagDefinition<T, C> & D & O;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/** Filesystem directory flag. Pass `exists: true` to require the directory to exist at parse time. */
|
|
2
|
-
export declare const directoryFlag: <
|
|
2
|
+
export declare const directoryFlag: <const O extends Partial<import('../index.js').FlagDefinition<string, {
|
|
3
3
|
exists?: boolean;
|
|
4
|
-
}
|
|
4
|
+
}>> = Partial<import('../index.js').FlagDefinition<string, {
|
|
5
5
|
exists?: boolean;
|
|
6
|
-
}
|
|
6
|
+
}>>>(overrides?: O | undefined) => {
|
|
7
7
|
exists?: boolean | undefined;
|
|
8
8
|
} & {
|
|
9
9
|
parse: (input: any, opts: import('../index.js').FlagOpts<string, {
|
|
10
10
|
exists?: boolean;
|
|
11
|
-
}
|
|
11
|
+
}>) => string;
|
|
12
12
|
type?: import('../index.js').FlagKind;
|
|
13
13
|
ask?: ((opts: import('../index.js').FlagOpts<string, {
|
|
14
14
|
exists?: boolean;
|
|
15
|
-
}
|
|
15
|
+
}>) => 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;
|
|
@@ -21,9 +21,9 @@ export declare const directoryFlag: <Ctx extends unknown = any, const O extends
|
|
|
21
21
|
alias?: string | readonly string[];
|
|
22
22
|
handler?: ((value: string, opts: import('../index.js').FlagOpts<string, {
|
|
23
23
|
exists?: boolean;
|
|
24
|
-
}
|
|
24
|
+
}>) => {
|
|
25
25
|
shouldStop: boolean;
|
|
26
26
|
} | void) | undefined;
|
|
27
27
|
} & Partial<import('../index.js').FlagDefinition<string, {
|
|
28
28
|
exists?: boolean;
|
|
29
|
-
}
|
|
29
|
+
}>> & O;
|
package/dist/cjs/flags/file.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/** Filesystem file flag. Pass `exists: true` to require the path to exist at parse time. */
|
|
2
|
-
export declare const fileFlag: <
|
|
2
|
+
export declare const fileFlag: <const O extends Partial<import('../index.js').FlagDefinition<string, {
|
|
3
3
|
exists?: boolean;
|
|
4
|
-
}
|
|
4
|
+
}>> = Partial<import('../index.js').FlagDefinition<string, {
|
|
5
5
|
exists?: boolean;
|
|
6
|
-
}
|
|
6
|
+
}>>>(overrides?: O | undefined) => {
|
|
7
7
|
exists?: boolean | undefined;
|
|
8
8
|
} & {
|
|
9
9
|
parse: (input: any, opts: import('../index.js').FlagOpts<string, {
|
|
10
10
|
exists?: boolean;
|
|
11
|
-
}
|
|
11
|
+
}>) => string;
|
|
12
12
|
type?: import('../index.js').FlagKind;
|
|
13
13
|
ask?: ((opts: import('../index.js').FlagOpts<string, {
|
|
14
14
|
exists?: boolean;
|
|
15
|
-
}
|
|
15
|
+
}>) => 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;
|
|
@@ -21,9 +21,9 @@ export declare const fileFlag: <Ctx extends unknown = any, const O extends Parti
|
|
|
21
21
|
alias?: string | readonly string[];
|
|
22
22
|
handler?: ((value: string, opts: import('../index.js').FlagOpts<string, {
|
|
23
23
|
exists?: boolean;
|
|
24
|
-
}
|
|
24
|
+
}>) => {
|
|
25
25
|
shouldStop: boolean;
|
|
26
26
|
} | void) | undefined;
|
|
27
27
|
} & Partial<import('../index.js').FlagDefinition<string, {
|
|
28
28
|
exists?: boolean;
|
|
29
|
-
}
|
|
29
|
+
}>> & O;
|
|
@@ -17,41 +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: <
|
|
20
|
+
string: <const O extends Partial<import('../index.js').FlagDefinition<string, import('../index.js').CustomOptions>> = Partial<import('../index.js').FlagDefinition<string, import('../index.js').CustomOptions>>>(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>) => 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>) => 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>) => {
|
|
33
33
|
shouldStop: boolean;
|
|
34
34
|
} | void) | undefined;
|
|
35
|
-
} & Partial<import('../index.js').FlagDefinition<string, import('../index.js').CustomOptions
|
|
36
|
-
number: <
|
|
35
|
+
} & Partial<import('../index.js').FlagDefinition<string, import('../index.js').CustomOptions>> & O;
|
|
36
|
+
number: <const O extends Partial<import('../index.js').FlagDefinition<number, {
|
|
37
37
|
min?: number;
|
|
38
38
|
max?: number;
|
|
39
|
-
}
|
|
39
|
+
}>> = Partial<import('../index.js').FlagDefinition<number, {
|
|
40
40
|
min?: number;
|
|
41
41
|
max?: number;
|
|
42
|
-
}
|
|
42
|
+
}>>>(overrides?: O | undefined) => {
|
|
43
43
|
min?: number | undefined;
|
|
44
44
|
max?: number | undefined;
|
|
45
45
|
} & {
|
|
46
46
|
parse: (input: any, opts: import('../index.js').FlagOpts<number, {
|
|
47
47
|
min?: number;
|
|
48
48
|
max?: number;
|
|
49
|
-
}
|
|
49
|
+
}>) => number;
|
|
50
50
|
type?: import('../index.js').FlagKind;
|
|
51
51
|
ask?: ((opts: import('../index.js').FlagOpts<number, {
|
|
52
52
|
min?: number;
|
|
53
53
|
max?: number;
|
|
54
|
-
}
|
|
54
|
+
}>) => Promise<any>) | undefined;
|
|
55
55
|
description?: string;
|
|
56
56
|
required?: boolean;
|
|
57
57
|
default?: number | number[] | (() => number | number[] | null) | (() => Promise<number | number[] | null>) | null | undefined;
|
|
@@ -61,44 +61,44 @@ export declare const Flags: {
|
|
|
61
61
|
handler?: ((value: number, opts: import('../index.js').FlagOpts<number, {
|
|
62
62
|
min?: number;
|
|
63
63
|
max?: number;
|
|
64
|
-
}
|
|
64
|
+
}>) => {
|
|
65
65
|
shouldStop: boolean;
|
|
66
66
|
} | void) | undefined;
|
|
67
67
|
} & Partial<import('../index.js').FlagDefinition<number, {
|
|
68
68
|
min?: number;
|
|
69
69
|
max?: number;
|
|
70
|
-
}
|
|
71
|
-
boolean: <
|
|
70
|
+
}>> & O;
|
|
71
|
+
boolean: <const O extends Partial<import('../index.js').FlagDefinition<boolean, import('../index.js').CustomOptions>> = Partial<import('../index.js').FlagDefinition<boolean, import('../index.js').CustomOptions>>>(overrides?: O | undefined) => {
|
|
72
72
|
[x: string]: unknown;
|
|
73
73
|
} & {
|
|
74
|
-
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>) => boolean;
|
|
75
75
|
type?: import('../index.js').FlagKind;
|
|
76
|
-
ask?: ((opts: import('../index.js').FlagOpts<boolean, import('../index.js').CustomOptions
|
|
76
|
+
ask?: ((opts: import('../index.js').FlagOpts<boolean, import('../index.js').CustomOptions>) => Promise<any>) | undefined;
|
|
77
77
|
description?: string;
|
|
78
78
|
required?: boolean;
|
|
79
79
|
default?: boolean | boolean[] | (() => boolean | boolean[] | null) | (() => Promise<boolean | boolean[] | null>) | null | undefined;
|
|
80
80
|
multiple?: boolean;
|
|
81
81
|
help?: string;
|
|
82
82
|
alias?: string | readonly string[];
|
|
83
|
-
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>) => {
|
|
84
84
|
shouldStop: boolean;
|
|
85
85
|
} | void) | undefined;
|
|
86
|
-
} & Partial<import('../index.js').FlagDefinition<boolean, import('../index.js').CustomOptions
|
|
86
|
+
} & Partial<import('../index.js').FlagDefinition<boolean, import('../index.js').CustomOptions>> & O;
|
|
87
87
|
option: typeof optionFlag;
|
|
88
|
-
file: <
|
|
88
|
+
file: <const O extends Partial<import('../index.js').FlagDefinition<string, {
|
|
89
89
|
exists?: boolean;
|
|
90
|
-
}
|
|
90
|
+
}>> = Partial<import('../index.js').FlagDefinition<string, {
|
|
91
91
|
exists?: boolean;
|
|
92
|
-
}
|
|
92
|
+
}>>>(overrides?: O | undefined) => {
|
|
93
93
|
exists?: boolean | undefined;
|
|
94
94
|
} & {
|
|
95
95
|
parse: (input: any, opts: import('../index.js').FlagOpts<string, {
|
|
96
96
|
exists?: boolean;
|
|
97
|
-
}
|
|
97
|
+
}>) => string;
|
|
98
98
|
type?: import('../index.js').FlagKind;
|
|
99
99
|
ask?: ((opts: import('../index.js').FlagOpts<string, {
|
|
100
100
|
exists?: boolean;
|
|
101
|
-
}
|
|
101
|
+
}>) => Promise<any>) | undefined;
|
|
102
102
|
description?: string;
|
|
103
103
|
required?: boolean;
|
|
104
104
|
default?: string | string[] | (() => string | string[] | null) | (() => Promise<string | string[] | null>) | null | undefined;
|
|
@@ -107,26 +107,26 @@ export declare const Flags: {
|
|
|
107
107
|
alias?: string | readonly string[];
|
|
108
108
|
handler?: ((value: string, opts: import('../index.js').FlagOpts<string, {
|
|
109
109
|
exists?: boolean;
|
|
110
|
-
}
|
|
110
|
+
}>) => {
|
|
111
111
|
shouldStop: boolean;
|
|
112
112
|
} | void) | undefined;
|
|
113
113
|
} & Partial<import('../index.js').FlagDefinition<string, {
|
|
114
114
|
exists?: boolean;
|
|
115
|
-
}
|
|
116
|
-
directory: <
|
|
115
|
+
}>> & O;
|
|
116
|
+
directory: <const O extends Partial<import('../index.js').FlagDefinition<string, {
|
|
117
117
|
exists?: boolean;
|
|
118
|
-
}
|
|
118
|
+
}>> = Partial<import('../index.js').FlagDefinition<string, {
|
|
119
119
|
exists?: boolean;
|
|
120
|
-
}
|
|
120
|
+
}>>>(overrides?: O | undefined) => {
|
|
121
121
|
exists?: boolean | undefined;
|
|
122
122
|
} & {
|
|
123
123
|
parse: (input: any, opts: import('../index.js').FlagOpts<string, {
|
|
124
124
|
exists?: boolean;
|
|
125
|
-
}
|
|
125
|
+
}>) => string;
|
|
126
126
|
type?: import('../index.js').FlagKind;
|
|
127
127
|
ask?: ((opts: import('../index.js').FlagOpts<string, {
|
|
128
128
|
exists?: boolean;
|
|
129
|
-
}
|
|
129
|
+
}>) => Promise<any>) | undefined;
|
|
130
130
|
description?: string;
|
|
131
131
|
required?: boolean;
|
|
132
132
|
default?: string | string[] | (() => string | string[] | null) | (() => Promise<string | string[] | null>) | null | undefined;
|
|
@@ -135,28 +135,28 @@ export declare const Flags: {
|
|
|
135
135
|
alias?: string | readonly string[];
|
|
136
136
|
handler?: ((value: string, opts: import('../index.js').FlagOpts<string, {
|
|
137
137
|
exists?: boolean;
|
|
138
|
-
}
|
|
138
|
+
}>) => {
|
|
139
139
|
shouldStop: boolean;
|
|
140
140
|
} | void) | undefined;
|
|
141
141
|
} & Partial<import('../index.js').FlagDefinition<string, {
|
|
142
142
|
exists?: boolean;
|
|
143
|
-
}
|
|
144
|
-
url: <
|
|
143
|
+
}>> & O;
|
|
144
|
+
url: <const O extends Partial<import('../index.js').FlagDefinition<URL, import('../index.js').CustomOptions>> = Partial<import('../index.js').FlagDefinition<URL, import('../index.js').CustomOptions>>>(overrides?: O | undefined) => {
|
|
145
145
|
[x: string]: unknown;
|
|
146
146
|
} & {
|
|
147
|
-
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>) => URL;
|
|
148
148
|
type?: import('../index.js').FlagKind;
|
|
149
|
-
ask?: ((opts: import('../index.js').FlagOpts<URL, import('../index.js').CustomOptions
|
|
149
|
+
ask?: ((opts: import('../index.js').FlagOpts<URL, import('../index.js').CustomOptions>) => Promise<any>) | undefined;
|
|
150
150
|
description?: string;
|
|
151
151
|
required?: boolean;
|
|
152
152
|
default?: URL | URL[] | (() => URL | URL[] | null) | (() => Promise<URL | URL[] | null>) | null | undefined;
|
|
153
153
|
multiple?: boolean;
|
|
154
154
|
help?: string;
|
|
155
155
|
alias?: string | readonly string[];
|
|
156
|
-
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>) => {
|
|
157
157
|
shouldStop: boolean;
|
|
158
158
|
} | void) | undefined;
|
|
159
|
-
} & Partial<import('../index.js').FlagDefinition<URL, import('../index.js').CustomOptions
|
|
159
|
+
} & Partial<import('../index.js').FlagDefinition<URL, import('../index.js').CustomOptions>> & O;
|
|
160
160
|
custom: typeof custom;
|
|
161
161
|
};
|
|
162
162
|
export { Args } from '../args/index.js';
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
/** Numeric flag. Optional `min`/`max` clamp the accepted range and surface as `BadCommandFlag`. */
|
|
2
|
-
export declare const numberFlag: <
|
|
2
|
+
export declare const numberFlag: <const O extends Partial<import('../index.js').FlagDefinition<number, {
|
|
3
3
|
min?: number;
|
|
4
4
|
max?: number;
|
|
5
|
-
}
|
|
5
|
+
}>> = Partial<import('../index.js').FlagDefinition<number, {
|
|
6
6
|
min?: number;
|
|
7
7
|
max?: number;
|
|
8
|
-
}
|
|
8
|
+
}>>>(overrides?: O | undefined) => {
|
|
9
9
|
min?: number | undefined;
|
|
10
10
|
max?: number | undefined;
|
|
11
11
|
} & {
|
|
12
12
|
parse: (input: any, opts: import('../index.js').FlagOpts<number, {
|
|
13
13
|
min?: number;
|
|
14
14
|
max?: number;
|
|
15
|
-
}
|
|
15
|
+
}>) => number;
|
|
16
16
|
type?: import('../index.js').FlagKind;
|
|
17
17
|
ask?: ((opts: import('../index.js').FlagOpts<number, {
|
|
18
18
|
min?: number;
|
|
19
19
|
max?: number;
|
|
20
|
-
}
|
|
20
|
+
}>) => Promise<any>) | undefined;
|
|
21
21
|
description?: string;
|
|
22
22
|
required?: boolean;
|
|
23
23
|
default?: number | number[] | (() => number | number[] | null) | (() => Promise<number | number[] | null>) | null | undefined;
|
|
@@ -27,10 +27,10 @@ export declare const numberFlag: <Ctx extends unknown = any, const O extends Par
|
|
|
27
27
|
handler?: ((value: number, opts: import('../index.js').FlagOpts<number, {
|
|
28
28
|
min?: number;
|
|
29
29
|
max?: number;
|
|
30
|
-
}
|
|
30
|
+
}>) => {
|
|
31
31
|
shouldStop: boolean;
|
|
32
32
|
} | void) | undefined;
|
|
33
33
|
} & Partial<import('../index.js').FlagDefinition<number, {
|
|
34
34
|
min?: number;
|
|
35
35
|
max?: number;
|
|
36
|
-
}
|
|
36
|
+
}>> & O;
|
|
@@ -1,8 +1,31 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InitFlagDefinition } from '../lib/types.js';
|
|
2
2
|
export declare function optionFlag<const T extends readonly string[], const O extends Partial<InitFlagDefinition<T[number], {
|
|
3
3
|
options: T;
|
|
4
4
|
}>>>(opts: {
|
|
5
5
|
options: T;
|
|
6
|
-
} & O):
|
|
6
|
+
} & O): {
|
|
7
7
|
options: T;
|
|
8
|
-
}
|
|
8
|
+
} & {
|
|
9
|
+
parse: (input: any, opts: import('../lib/types.js').FlagOpts<T[number], {
|
|
10
|
+
options: T;
|
|
11
|
+
}>) => T[number];
|
|
12
|
+
type?: import('../lib/types.js').FlagKind;
|
|
13
|
+
ask?: ((opts: import('../lib/types.js').FlagOpts<T[number], {
|
|
14
|
+
options: T;
|
|
15
|
+
}>) => Promise<any>) | undefined;
|
|
16
|
+
description?: string;
|
|
17
|
+
required?: boolean;
|
|
18
|
+
default?: T[number] | T[number][] | (() => T[number] | T[number][] | null) | (() => Promise<T[number] | T[number][] | null>) | null | undefined;
|
|
19
|
+
multiple?: boolean;
|
|
20
|
+
help?: string;
|
|
21
|
+
alias?: string | readonly string[];
|
|
22
|
+
handler?: ((value: T[number], opts: import('../lib/types.js').FlagOpts<T[number], {
|
|
23
|
+
options: T;
|
|
24
|
+
}>) => {
|
|
25
|
+
shouldStop: boolean;
|
|
26
|
+
} | void) | undefined;
|
|
27
|
+
} & Partial<import('../lib/types.js').FlagDefinition<T[number], {
|
|
28
|
+
options: T;
|
|
29
|
+
}>> & {
|
|
30
|
+
options: T;
|
|
31
|
+
} & 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: <
|
|
2
|
+
export declare const stringFlag: <const O extends Partial<import('../index.js').FlagDefinition<string, import('../index.js').CustomOptions>> = Partial<import('../index.js').FlagDefinition<string, import('../index.js').CustomOptions>>>(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>) => 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>) => 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>) => {
|
|
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>> & 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: <
|
|
2
|
+
export declare const urlFlag: <const O extends Partial<import('../index.js').FlagDefinition<URL, import('../index.js').CustomOptions>> = Partial<import('../index.js').FlagDefinition<URL, import('../index.js').CustomOptions>>>(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>) => 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>) => 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>) => {
|
|
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>> & O;
|