bob-core 3.0.0-beta.9 → 3.0.0

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