bob-core 3.0.0-beta.2 → 3.0.0-beta.3

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.
@@ -1,42 +1,67 @@
1
1
  import { custom } from '../flags/custom.js';
2
2
  import { optionFlag } from '../flags/option.js';
3
3
  export declare const Args: {
4
- string: <const U extends import('../index.js').FlagProps<string> = {}>(overrides?: (U & Record<Exclude<keyof U, "required" | "type" | "default" | "description" | "help" | "multiple" | "parse" | "ask" | "alias" | "handler">, never>) | undefined) => import('../index.js').FlagProps<string> & U & {
5
- parse(input: any, opts: import('../index.js').ParameterOpts): string;
4
+ string: {
5
+ (): import('../index.js').FlagProps<string> & import('../index.js').CustomOptions & {
6
+ parse(input: any, opts: import('../index.js').ParameterOpts): string;
7
+ };
8
+ <const U extends import('../index.js').FlagProps<string> & Partial<import('../index.js').CustomOptions>>(overrides: U & Record<Exclude<keyof U, string>, never>): import('../index.js').FlagProps<string> & import('../index.js').CustomOptions & U & {
9
+ parse(input: any, opts: import('../index.js').ParameterOpts): string;
10
+ };
6
11
  };
7
- number: <const U extends import('../index.js').FlagProps<number> & Partial<{
8
- min?: number;
9
- max?: number;
10
- }> = import('../index.js').FlagProps<number> & Partial<{
11
- min?: number;
12
- max?: number;
13
- }>>(overrides?: (U & Record<Exclude<keyof U, keyof import('../index.js').FlagProps<T> | "min" | "max">, never>) | undefined) => import('../index.js').FlagProps<number> & {
14
- min?: number;
15
- max?: number;
16
- } & U & {
17
- parse(input: any, opts: import('../index.js').ParameterOpts): number;
12
+ number: {
13
+ (): import('../index.js').FlagProps<number> & {
14
+ min?: number;
15
+ max?: number;
16
+ } & {
17
+ parse(input: any, opts: import('../index.js').ParameterOpts): number;
18
+ };
19
+ <const U extends import('../index.js').FlagProps<number> & Partial<{
20
+ min?: number;
21
+ max?: number;
22
+ }>>(overrides: U & Record<Exclude<keyof U, keyof import('../index.js').FlagProps<T> | "min" | "max">, never>): import('../index.js').FlagProps<number> & {
23
+ min?: number;
24
+ max?: number;
25
+ } & U & {
26
+ parse(input: any, opts: import('../index.js').ParameterOpts): number;
27
+ };
18
28
  };
19
29
  option: typeof optionFlag;
20
- file: <const U extends import('../index.js').FlagProps<string> & Partial<{
21
- exists?: boolean;
22
- }> = import('../index.js').FlagProps<string> & Partial<{
23
- exists?: boolean;
24
- }>>(overrides?: (U & Record<Exclude<keyof U, keyof import('../index.js').FlagProps<T> | "exists">, never>) | undefined) => import('../index.js').FlagProps<string> & {
25
- exists?: boolean;
26
- } & U & {
27
- parse(input: any, opts: import('../index.js').ParameterOpts): string;
30
+ file: {
31
+ (): import('../index.js').FlagProps<string> & {
32
+ exists?: boolean;
33
+ } & {
34
+ parse(input: any, opts: import('../index.js').ParameterOpts): string;
35
+ };
36
+ <const U extends import('../index.js').FlagProps<string> & Partial<{
37
+ exists?: boolean;
38
+ }>>(overrides: U & Record<Exclude<keyof U, keyof import('../index.js').FlagProps<T> | "exists">, never>): import('../index.js').FlagProps<string> & {
39
+ exists?: boolean;
40
+ } & U & {
41
+ parse(input: any, opts: import('../index.js').ParameterOpts): string;
42
+ };
28
43
  };
29
- directory: <const U extends import('../index.js').FlagProps<string> & Partial<{
30
- exists?: boolean;
31
- }> = import('../index.js').FlagProps<string> & Partial<{
32
- exists?: boolean;
33
- }>>(overrides?: (U & Record<Exclude<keyof U, keyof import('../index.js').FlagProps<T> | "exists">, never>) | undefined) => import('../index.js').FlagProps<string> & {
34
- exists?: boolean;
35
- } & U & {
36
- parse(input: any, opts: import('../index.js').ParameterOpts): string;
44
+ directory: {
45
+ (): import('../index.js').FlagProps<string> & {
46
+ exists?: boolean;
47
+ } & {
48
+ parse(input: any, opts: import('../index.js').ParameterOpts): string;
49
+ };
50
+ <const U extends import('../index.js').FlagProps<string> & Partial<{
51
+ exists?: boolean;
52
+ }>>(overrides: U & Record<Exclude<keyof U, keyof import('../index.js').FlagProps<T> | "exists">, never>): import('../index.js').FlagProps<string> & {
53
+ exists?: boolean;
54
+ } & U & {
55
+ parse(input: any, opts: import('../index.js').ParameterOpts): string;
56
+ };
37
57
  };
38
- url: <const U extends import('../index.js').FlagProps<URL> = {}>(overrides?: (U & Record<Exclude<keyof U, "required" | "type" | "default" | "description" | "help" | "multiple" | "parse" | "ask" | "alias" | "handler">, never>) | undefined) => import('../index.js').FlagProps<URL> & U & {
39
- parse(input: any, opts: import('../index.js').ParameterOpts): URL;
58
+ url: {
59
+ (): import('../index.js').FlagProps<URL> & import('../index.js').CustomOptions & {
60
+ parse(input: any, opts: import('../index.js').ParameterOpts): URL;
61
+ };
62
+ <const U extends import('../index.js').FlagProps<URL> & Partial<import('../index.js').CustomOptions>>(overrides: U & Record<Exclude<keyof U, string>, never>): import('../index.js').FlagProps<URL> & import('../index.js').CustomOptions & U & {
63
+ parse(input: any, opts: import('../index.js').ParameterOpts): URL;
64
+ };
40
65
  };
41
66
  custom: typeof custom;
42
67
  };
@@ -0,0 +1,9 @@
1
+ import { Logger } from '../Logger.js';
2
+ export type ErrorDetail = [label: string, value: string];
3
+ export type RenderErrorOptions = {
4
+ title: string;
5
+ details?: ErrorDetail[];
6
+ hint?: string;
7
+ };
8
+ export declare function quote(name: string): string;
9
+ export declare function renderError(logger: Logger, opts: RenderErrorOptions): void;
@@ -1,4 +1,9 @@
1
1
  import { ParameterOpts } from '../lib/types.js';
2
- export declare const booleanFlag: <const U extends import('../lib/types.js').FlagProps<boolean> = {}>(overrides?: (U & Record<Exclude<keyof U, "required" | "type" | "default" | "description" | "help" | "multiple" | "parse" | "ask" | "alias" | "handler">, never>) | undefined) => import('../lib/types.js').FlagProps<boolean> & U & {
3
- parse(input: any, opts: ParameterOpts): boolean;
2
+ export declare const booleanFlag: {
3
+ (): import('../lib/types.js').FlagProps<boolean> & import('../lib/types.js').CustomOptions & {
4
+ parse(input: any, opts: ParameterOpts): boolean;
5
+ };
6
+ <const U extends import('../lib/types.js').FlagProps<boolean> & Partial<import('../lib/types.js').CustomOptions>>(overrides: U & Record<Exclude<keyof U, string>, never>): import('../lib/types.js').FlagProps<boolean> & import('../lib/types.js').CustomOptions & U & {
7
+ parse(input: any, opts: ParameterOpts): boolean;
8
+ };
4
9
  };
@@ -1,7 +1,9 @@
1
1
  import { CustomOptions, FlagProps, ParameterOpts } from '../lib/types.js';
2
- export declare function custom<T, const D extends FlagProps<any> = FlagProps<T>>(defaults?: D): <const U extends FlagProps<T> = {}>(overrides?: U & Record<Exclude<keyof U, keyof FlagProps<T> | keyof D>, never>) => D & U & {
3
- parse(input: any, opts: ParameterOpts): T;
4
- };
5
- export declare function custom<T, P extends CustomOptions = CustomOptions>(defaults?: FlagProps<T> & Partial<P>): <const U extends FlagProps<T> & Partial<P> = FlagProps<T> & Partial<P>>(overrides?: U & Record<Exclude<keyof U, keyof FlagProps<T> | keyof P>, never>) => FlagProps<T> & P & U & {
6
- parse(input: any, opts: ParameterOpts): T;
2
+ export declare function custom<T, P extends CustomOptions = CustomOptions>(defaults?: FlagProps<T> & Partial<P>): {
3
+ (): FlagProps<T> & P & {
4
+ parse(input: any, opts: ParameterOpts): T;
5
+ };
6
+ <const U extends FlagProps<T> & Partial<P>>(overrides: U & Record<Exclude<keyof U, keyof FlagProps<T> | keyof P>, never>): FlagProps<T> & P & U & {
7
+ parse(input: any, opts: ParameterOpts): T;
8
+ };
7
9
  };
@@ -1,9 +1,14 @@
1
- export declare const directoryFlag: <const U extends import('../index.js').FlagProps<string> & Partial<{
2
- exists?: boolean;
3
- }> = import('../index.js').FlagProps<string> & Partial<{
4
- exists?: boolean;
5
- }>>(overrides?: (U & Record<Exclude<keyof U, keyof import('../index.js').FlagProps<T> | "exists">, never>) | undefined) => import('../index.js').FlagProps<string> & {
6
- exists?: boolean;
7
- } & U & {
8
- parse(input: any, opts: import('../index.js').ParameterOpts): string;
1
+ export declare const directoryFlag: {
2
+ (): import('../index.js').FlagProps<string> & {
3
+ exists?: boolean;
4
+ } & {
5
+ parse(input: any, opts: import('../index.js').ParameterOpts): string;
6
+ };
7
+ <const U extends import('../index.js').FlagProps<string> & Partial<{
8
+ exists?: boolean;
9
+ }>>(overrides: U & Record<Exclude<keyof U, keyof import('../index.js').FlagProps<T> | "exists">, never>): import('../index.js').FlagProps<string> & {
10
+ exists?: boolean;
11
+ } & U & {
12
+ parse(input: any, opts: import('../index.js').ParameterOpts): string;
13
+ };
9
14
  };
@@ -1,9 +1,14 @@
1
- export declare const fileFlag: <const U extends import('../index.js').FlagProps<string> & Partial<{
2
- exists?: boolean;
3
- }> = import('../index.js').FlagProps<string> & Partial<{
4
- exists?: boolean;
5
- }>>(overrides?: (U & Record<Exclude<keyof U, keyof import('../index.js').FlagProps<T> | "exists">, never>) | undefined) => import('../index.js').FlagProps<string> & {
6
- exists?: boolean;
7
- } & U & {
8
- parse(input: any, opts: import('../index.js').ParameterOpts): string;
1
+ export declare const fileFlag: {
2
+ (): import('../index.js').FlagProps<string> & {
3
+ exists?: boolean;
4
+ } & {
5
+ parse(input: any, opts: import('../index.js').ParameterOpts): string;
6
+ };
7
+ <const U extends import('../index.js').FlagProps<string> & Partial<{
8
+ exists?: boolean;
9
+ }>>(overrides: U & Record<Exclude<keyof U, keyof import('../index.js').FlagProps<T> | "exists">, never>): import('../index.js').FlagProps<string> & {
10
+ exists?: boolean;
11
+ } & U & {
12
+ parse(input: any, opts: import('../index.js').ParameterOpts): string;
13
+ };
9
14
  };
@@ -1,2 +1,3 @@
1
1
  import { FlagDefinition } from '../lib/types.js';
2
2
  export declare function formatPromptMessage(name: string, definition: FlagDefinition): string;
3
+ export declare function normalizeAliases(alias: string | readonly string[] | undefined): readonly string[];
@@ -1,45 +1,75 @@
1
1
  import { custom } from './custom.js';
2
2
  import { optionFlag } from './option.js';
3
3
  export declare const Flags: {
4
- string: <const U extends import('../index.js').FlagProps<string> = {}>(overrides?: (U & Record<Exclude<keyof U, "required" | "type" | "default" | "description" | "help" | "multiple" | "parse" | "ask" | "alias" | "handler">, never>) | undefined) => import('../index.js').FlagProps<string> & U & {
5
- parse(input: any, opts: import('../index.js').ParameterOpts): string;
4
+ string: {
5
+ (): import('../index.js').FlagProps<string> & import('../index.js').CustomOptions & {
6
+ parse(input: any, opts: import('../index.js').ParameterOpts): string;
7
+ };
8
+ <const U extends import('../index.js').FlagProps<string> & Partial<import('../index.js').CustomOptions>>(overrides: U & Record<Exclude<keyof U, string>, never>): import('../index.js').FlagProps<string> & import('../index.js').CustomOptions & U & {
9
+ parse(input: any, opts: import('../index.js').ParameterOpts): string;
10
+ };
6
11
  };
7
- number: <const U extends import('../index.js').FlagProps<number> & Partial<{
8
- min?: number;
9
- max?: number;
10
- }> = import('../index.js').FlagProps<number> & Partial<{
11
- min?: number;
12
- max?: number;
13
- }>>(overrides?: (U & Record<Exclude<keyof U, keyof import('../index.js').FlagProps<T> | "min" | "max">, never>) | undefined) => import('../index.js').FlagProps<number> & {
14
- min?: number;
15
- max?: number;
16
- } & U & {
17
- parse(input: any, opts: import('../index.js').ParameterOpts): number;
12
+ number: {
13
+ (): import('../index.js').FlagProps<number> & {
14
+ min?: number;
15
+ max?: number;
16
+ } & {
17
+ parse(input: any, opts: import('../index.js').ParameterOpts): number;
18
+ };
19
+ <const U extends import('../index.js').FlagProps<number> & Partial<{
20
+ min?: number;
21
+ max?: number;
22
+ }>>(overrides: U & Record<Exclude<keyof U, keyof import('../index.js').FlagProps<T> | "min" | "max">, never>): import('../index.js').FlagProps<number> & {
23
+ min?: number;
24
+ max?: number;
25
+ } & U & {
26
+ parse(input: any, opts: import('../index.js').ParameterOpts): number;
27
+ };
18
28
  };
19
- boolean: <const U extends import('../index.js').FlagProps<boolean> = {}>(overrides?: (U & Record<Exclude<keyof U, "required" | "type" | "default" | "description" | "help" | "multiple" | "parse" | "ask" | "alias" | "handler">, never>) | undefined) => import('../index.js').FlagProps<boolean> & U & {
20
- parse(input: any, opts: import('../index.js').ParameterOpts): boolean;
29
+ boolean: {
30
+ (): import('../index.js').FlagProps<boolean> & import('../index.js').CustomOptions & {
31
+ parse(input: any, opts: import('../index.js').ParameterOpts): boolean;
32
+ };
33
+ <const U extends import('../index.js').FlagProps<boolean> & Partial<import('../index.js').CustomOptions>>(overrides: U & Record<Exclude<keyof U, string>, never>): import('../index.js').FlagProps<boolean> & import('../index.js').CustomOptions & U & {
34
+ parse(input: any, opts: import('../index.js').ParameterOpts): boolean;
35
+ };
21
36
  };
22
37
  option: typeof optionFlag;
23
- file: <const U extends import('../index.js').FlagProps<string> & Partial<{
24
- exists?: boolean;
25
- }> = import('../index.js').FlagProps<string> & Partial<{
26
- exists?: boolean;
27
- }>>(overrides?: (U & Record<Exclude<keyof U, keyof import('../index.js').FlagProps<T> | "exists">, never>) | undefined) => import('../index.js').FlagProps<string> & {
28
- exists?: boolean;
29
- } & U & {
30
- parse(input: any, opts: import('../index.js').ParameterOpts): string;
38
+ file: {
39
+ (): import('../index.js').FlagProps<string> & {
40
+ exists?: boolean;
41
+ } & {
42
+ parse(input: any, opts: import('../index.js').ParameterOpts): string;
43
+ };
44
+ <const U extends import('../index.js').FlagProps<string> & Partial<{
45
+ exists?: boolean;
46
+ }>>(overrides: U & Record<Exclude<keyof U, keyof import('../index.js').FlagProps<T> | "exists">, never>): import('../index.js').FlagProps<string> & {
47
+ exists?: boolean;
48
+ } & U & {
49
+ parse(input: any, opts: import('../index.js').ParameterOpts): string;
50
+ };
31
51
  };
32
- directory: <const U extends import('../index.js').FlagProps<string> & Partial<{
33
- exists?: boolean;
34
- }> = import('../index.js').FlagProps<string> & Partial<{
35
- exists?: boolean;
36
- }>>(overrides?: (U & Record<Exclude<keyof U, keyof import('../index.js').FlagProps<T> | "exists">, never>) | undefined) => import('../index.js').FlagProps<string> & {
37
- exists?: boolean;
38
- } & U & {
39
- parse(input: any, opts: import('../index.js').ParameterOpts): string;
52
+ directory: {
53
+ (): import('../index.js').FlagProps<string> & {
54
+ exists?: boolean;
55
+ } & {
56
+ parse(input: any, opts: import('../index.js').ParameterOpts): string;
57
+ };
58
+ <const U extends import('../index.js').FlagProps<string> & Partial<{
59
+ exists?: boolean;
60
+ }>>(overrides: U & Record<Exclude<keyof U, keyof import('../index.js').FlagProps<T> | "exists">, never>): import('../index.js').FlagProps<string> & {
61
+ exists?: boolean;
62
+ } & U & {
63
+ parse(input: any, opts: import('../index.js').ParameterOpts): string;
64
+ };
40
65
  };
41
- url: <const U extends import('../index.js').FlagProps<URL> = {}>(overrides?: (U & Record<Exclude<keyof U, "required" | "type" | "default" | "description" | "help" | "multiple" | "parse" | "ask" | "alias" | "handler">, never>) | undefined) => import('../index.js').FlagProps<URL> & U & {
42
- parse(input: any, opts: import('../index.js').ParameterOpts): URL;
66
+ url: {
67
+ (): import('../index.js').FlagProps<URL> & import('../index.js').CustomOptions & {
68
+ parse(input: any, opts: import('../index.js').ParameterOpts): URL;
69
+ };
70
+ <const U extends import('../index.js').FlagProps<URL> & Partial<import('../index.js').CustomOptions>>(overrides: U & Record<Exclude<keyof U, string>, never>): import('../index.js').FlagProps<URL> & import('../index.js').CustomOptions & U & {
71
+ parse(input: any, opts: import('../index.js').ParameterOpts): URL;
72
+ };
43
73
  };
44
74
  custom: typeof custom;
45
75
  };
@@ -1,12 +1,17 @@
1
- export declare const numberFlag: <const U extends import('../index.js').FlagProps<number> & Partial<{
2
- min?: number;
3
- max?: number;
4
- }> = import('../index.js').FlagProps<number> & Partial<{
5
- min?: number;
6
- max?: number;
7
- }>>(overrides?: (U & Record<Exclude<keyof U, keyof import('../index.js').FlagProps<T> | "min" | "max">, never>) | undefined) => import('../index.js').FlagProps<number> & {
8
- min?: number;
9
- max?: number;
10
- } & U & {
11
- parse(input: any, opts: import('../index.js').ParameterOpts): number;
1
+ export declare const numberFlag: {
2
+ (): import('../index.js').FlagProps<number> & {
3
+ min?: number;
4
+ max?: number;
5
+ } & {
6
+ parse(input: any, opts: import('../index.js').ParameterOpts): number;
7
+ };
8
+ <const U extends import('../index.js').FlagProps<number> & Partial<{
9
+ min?: number;
10
+ max?: number;
11
+ }>>(overrides: U & Record<Exclude<keyof U, keyof import('../index.js').FlagProps<T> | "min" | "max">, never>): import('../index.js').FlagProps<number> & {
12
+ min?: number;
13
+ max?: number;
14
+ } & U & {
15
+ parse(input: any, opts: import('../index.js').ParameterOpts): number;
16
+ };
12
17
  };
@@ -1,3 +1,8 @@
1
- export declare const stringFlag: <const U extends import('../index.js').FlagProps<string> = {}>(overrides?: (U & Record<Exclude<keyof U, "required" | "type" | "default" | "description" | "help" | "multiple" | "parse" | "ask" | "alias" | "handler">, never>) | undefined) => import('../index.js').FlagProps<string> & U & {
2
- parse(input: any, opts: import('../index.js').ParameterOpts): string;
1
+ export declare const stringFlag: {
2
+ (): import('../index.js').FlagProps<string> & import('../index.js').CustomOptions & {
3
+ parse(input: any, opts: import('../index.js').ParameterOpts): string;
4
+ };
5
+ <const U extends import('../index.js').FlagProps<string> & Partial<import('../index.js').CustomOptions>>(overrides: U & Record<Exclude<keyof U, string>, never>): import('../index.js').FlagProps<string> & import('../index.js').CustomOptions & U & {
6
+ parse(input: any, opts: import('../index.js').ParameterOpts): string;
7
+ };
3
8
  };
@@ -1,3 +1,8 @@
1
- export declare const urlFlag: <const U extends import('../index.js').FlagProps<URL> = {}>(overrides?: (U & Record<Exclude<keyof U, "required" | "type" | "default" | "description" | "help" | "multiple" | "parse" | "ask" | "alias" | "handler">, never>) | undefined) => import('../index.js').FlagProps<URL> & U & {
2
- parse(input: any, opts: import('../index.js').ParameterOpts): URL;
1
+ export declare const urlFlag: {
2
+ (): import('../index.js').FlagProps<URL> & import('../index.js').CustomOptions & {
3
+ parse(input: any, opts: import('../index.js').ParameterOpts): URL;
4
+ };
5
+ <const U extends import('../index.js').FlagProps<URL> & Partial<import('../index.js').CustomOptions>>(overrides: U & Record<Exclude<keyof U, string>, never>): import('../index.js').FlagProps<URL> & import('../index.js').CustomOptions & U & {
6
+ parse(input: any, opts: import('../index.js').ParameterOpts): URL;
7
+ };
3
8
  };