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