bob-core 3.0.0-beta.4 → 3.0.0-beta.6
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/README.md +3 -3
- package/dist/cjs/{src/Cli.d.ts → Cli.d.ts} +20 -0
- package/dist/cjs/Command.d.ts +91 -0
- package/dist/cjs/CommandParser.d.ts +122 -0
- package/dist/cjs/{src/CommandRegistry.d.ts → CommandRegistry.d.ts} +12 -0
- package/dist/cjs/ExceptionHandler.d.ts +14 -0
- package/dist/cjs/HelpFlag.d.ts +27 -0
- package/dist/cjs/StringSimilarity.d.ts +31 -0
- package/dist/cjs/args/index.d.ts +131 -0
- package/dist/{esm/src → cjs}/errors/BadCommandArgument.d.ts +4 -2
- package/dist/cjs/{src/errors → errors}/BadCommandFlag.d.ts +4 -2
- package/dist/cjs/errors/BobError.d.ts +13 -0
- package/dist/cjs/errors/CommandNotFoundError.d.ts +9 -0
- package/dist/{esm/src → cjs}/errors/InvalidFlag.d.ts +4 -2
- package/dist/cjs/errors/MissingRequiredArgumentValue.d.ts +9 -0
- package/dist/cjs/errors/MissingRequiredFlagValue.d.ts +9 -0
- package/dist/cjs/errors/TooManyArguments.d.ts +10 -0
- package/dist/cjs/errors/ValidationError.d.ts +10 -0
- package/dist/{esm/src → cjs}/errors/renderError.d.ts +2 -2
- package/dist/cjs/flags/boolean.d.ts +20 -0
- package/dist/cjs/flags/custom.d.ts +12 -0
- package/dist/cjs/flags/directory.d.ts +27 -0
- package/dist/cjs/flags/file.d.ts +27 -0
- package/dist/cjs/flags/helpers.d.ts +9 -0
- package/dist/cjs/flags/index.d.ts +160 -0
- package/dist/cjs/flags/number.d.ts +32 -0
- package/dist/cjs/flags/option.d.ts +8 -0
- package/dist/cjs/flags/string.d.ts +19 -0
- package/dist/cjs/flags/url.d.ts +19 -0
- package/dist/cjs/index.js +10 -0
- package/dist/cjs/{src/lib → lib}/helpers.d.ts +1 -1
- package/dist/cjs/lib/types.d.ts +99 -0
- package/dist/cjs/shared/ask-helpers.d.ts +7 -0
- package/dist/cjs/shared/flagsUtils.d.ts +5 -0
- package/dist/cjs/ux/askForConfirmation.d.ts +10 -0
- package/dist/cjs/{src/ux → ux}/askForToggle.d.ts +5 -1
- package/dist/cjs/ux/helpers.d.ts +6 -0
- package/dist/{esm/src → cjs}/ux/index.d.ts +30 -2
- package/dist/esm/{src/Cli.d.ts → Cli.d.ts} +20 -0
- package/dist/esm/Command.d.ts +91 -0
- package/dist/esm/CommandParser.d.ts +122 -0
- package/dist/esm/{src/CommandRegistry.d.ts → CommandRegistry.d.ts} +12 -0
- package/dist/esm/ExceptionHandler.d.ts +14 -0
- package/dist/esm/HelpFlag.d.ts +27 -0
- package/dist/esm/StringSimilarity.d.ts +31 -0
- package/dist/esm/args/index.d.ts +131 -0
- package/dist/{cjs/src → esm}/errors/BadCommandArgument.d.ts +4 -2
- package/dist/esm/{src/errors → errors}/BadCommandFlag.d.ts +4 -2
- package/dist/esm/errors/BobError.d.ts +13 -0
- package/dist/esm/errors/CommandNotFoundError.d.ts +9 -0
- package/dist/{cjs/src → esm}/errors/InvalidFlag.d.ts +4 -2
- package/dist/esm/errors/MissingRequiredArgumentValue.d.ts +9 -0
- package/dist/esm/errors/MissingRequiredFlagValue.d.ts +9 -0
- package/dist/esm/errors/TooManyArguments.d.ts +10 -0
- package/dist/esm/errors/ValidationError.d.ts +10 -0
- package/dist/{cjs/src → esm}/errors/renderError.d.ts +2 -2
- package/dist/esm/flags/boolean.d.ts +20 -0
- package/dist/esm/flags/custom.d.ts +12 -0
- package/dist/esm/flags/directory.d.ts +27 -0
- package/dist/esm/flags/file.d.ts +27 -0
- package/dist/esm/flags/helpers.d.ts +9 -0
- package/dist/esm/flags/index.d.ts +160 -0
- package/dist/esm/flags/number.d.ts +32 -0
- package/dist/esm/flags/option.d.ts +8 -0
- package/dist/esm/flags/string.d.ts +19 -0
- package/dist/esm/flags/url.d.ts +19 -0
- package/dist/esm/{src/index.js → index.js} +346 -267
- package/dist/esm/{src/lib → lib}/helpers.d.ts +1 -1
- package/dist/esm/lib/types.d.ts +99 -0
- package/dist/esm/shared/ask-helpers.d.ts +7 -0
- package/dist/esm/shared/flagsUtils.d.ts +5 -0
- package/dist/esm/ux/askForConfirmation.d.ts +10 -0
- package/dist/esm/{src/ux → ux}/askForToggle.d.ts +5 -1
- package/dist/esm/ux/helpers.d.ts +6 -0
- package/dist/{cjs/src → esm}/ux/index.d.ts +30 -2
- package/package.json +1 -1
- package/dist/cjs/package-BYPkkzPN.cjs +0 -1
- package/dist/cjs/src/Command.d.ts +0 -48
- package/dist/cjs/src/CommandParser.d.ts +0 -110
- package/dist/cjs/src/ExceptionHandler.d.ts +0 -6
- package/dist/cjs/src/HelpFlag.d.ts +0 -12
- package/dist/cjs/src/StringSimilarity.d.ts +0 -26
- package/dist/cjs/src/args/index.d.ts +0 -67
- package/dist/cjs/src/errors/BobError.d.ts +0 -5
- package/dist/cjs/src/errors/CommandNotFoundError.d.ts +0 -7
- package/dist/cjs/src/errors/MissingRequiredArgumentValue.d.ts +0 -7
- package/dist/cjs/src/errors/MissingRequiredFlagValue.d.ts +0 -7
- package/dist/cjs/src/errors/TooManyArguments.d.ts +0 -8
- package/dist/cjs/src/errors/ValidationError.d.ts +0 -3
- package/dist/cjs/src/flags/boolean.d.ts +0 -9
- package/dist/cjs/src/flags/custom.d.ts +0 -9
- package/dist/cjs/src/flags/directory.d.ts +0 -14
- package/dist/cjs/src/flags/file.d.ts +0 -14
- package/dist/cjs/src/flags/helpers.d.ts +0 -3
- package/dist/cjs/src/flags/index.d.ts +0 -76
- package/dist/cjs/src/flags/number.d.ts +0 -17
- package/dist/cjs/src/flags/option.d.ts +0 -6
- package/dist/cjs/src/flags/string.d.ts +0 -8
- package/dist/cjs/src/flags/url.d.ts +0 -8
- package/dist/cjs/src/index.js +0 -10
- package/dist/cjs/src/lib/types.d.ts +0 -59
- package/dist/cjs/src/shared/ask-helpers.d.ts +0 -7
- package/dist/cjs/src/ux/askForConfirmation.d.ts +0 -5
- package/dist/cjs/src/ux/helpers.d.ts +0 -1
- package/dist/esm/package-LkysKcR6.js +0 -60
- package/dist/esm/src/Command.d.ts +0 -48
- package/dist/esm/src/CommandParser.d.ts +0 -110
- package/dist/esm/src/ExceptionHandler.d.ts +0 -6
- package/dist/esm/src/HelpFlag.d.ts +0 -12
- package/dist/esm/src/StringSimilarity.d.ts +0 -26
- package/dist/esm/src/args/index.d.ts +0 -67
- package/dist/esm/src/errors/BobError.d.ts +0 -5
- package/dist/esm/src/errors/CommandNotFoundError.d.ts +0 -7
- package/dist/esm/src/errors/MissingRequiredArgumentValue.d.ts +0 -7
- package/dist/esm/src/errors/MissingRequiredFlagValue.d.ts +0 -7
- package/dist/esm/src/errors/TooManyArguments.d.ts +0 -8
- package/dist/esm/src/errors/ValidationError.d.ts +0 -3
- package/dist/esm/src/flags/boolean.d.ts +0 -9
- package/dist/esm/src/flags/custom.d.ts +0 -9
- package/dist/esm/src/flags/directory.d.ts +0 -14
- package/dist/esm/src/flags/file.d.ts +0 -14
- package/dist/esm/src/flags/helpers.d.ts +0 -3
- package/dist/esm/src/flags/index.d.ts +0 -76
- package/dist/esm/src/flags/number.d.ts +0 -17
- package/dist/esm/src/flags/option.d.ts +0 -6
- package/dist/esm/src/flags/string.d.ts +0 -8
- package/dist/esm/src/flags/url.d.ts +0 -8
- package/dist/esm/src/lib/types.d.ts +0 -59
- package/dist/esm/src/shared/ask-helpers.d.ts +0 -7
- package/dist/esm/src/ux/askForConfirmation.d.ts +0 -5
- package/dist/esm/src/ux/helpers.d.ts +0 -1
- /package/dist/cjs/{src/CommandSignatureParser.d.ts → CommandSignatureParser.d.ts} +0 -0
- /package/dist/cjs/{src/CommandWithSignature.d.ts → CommandWithSignature.d.ts} +0 -0
- /package/dist/cjs/{src/Logger.d.ts → Logger.d.ts} +0 -0
- /package/dist/cjs/{src/commands → commands}/HelpCommand.d.ts +0 -0
- /package/dist/cjs/{src/contracts → contracts}/LoggerContract.d.ts +0 -0
- /package/dist/cjs/{src/contracts → contracts}/index.d.ts +0 -0
- /package/dist/cjs/{src/errors → errors}/index.d.ts +0 -0
- /package/dist/cjs/{src/index.d.ts → index.d.ts} +0 -0
- /package/dist/cjs/{src/lib → lib}/string.d.ts +0 -0
- /package/dist/cjs/{src/shared → shared}/parsers.d.ts +0 -0
- /package/dist/cjs/{src/ux → ux}/askForCheckbox.d.ts +0 -0
- /package/dist/cjs/{src/ux → ux}/askForEditor.d.ts +0 -0
- /package/dist/cjs/{src/ux → ux}/askForExpand.d.ts +0 -0
- /package/dist/cjs/{src/ux → ux}/askForFileSelector.d.ts +0 -0
- /package/dist/cjs/{src/ux → ux}/askForInput.d.ts +0 -0
- /package/dist/cjs/{src/ux → ux}/askForList.d.ts +0 -0
- /package/dist/cjs/{src/ux → ux}/askForNumber.d.ts +0 -0
- /package/dist/cjs/{src/ux → ux}/askForPassword.d.ts +0 -0
- /package/dist/cjs/{src/ux → ux}/askForRawList.d.ts +0 -0
- /package/dist/cjs/{src/ux → ux}/askForSearch.d.ts +0 -0
- /package/dist/cjs/{src/ux → ux}/askForSelect.d.ts +0 -0
- /package/dist/cjs/{src/ux → ux}/keyValue.d.ts +0 -0
- /package/dist/cjs/{src/ux → ux}/loader.d.ts +0 -0
- /package/dist/cjs/{src/ux → ux}/progressBar.d.ts +0 -0
- /package/dist/cjs/{src/ux → ux}/table.d.ts +0 -0
- /package/dist/cjs/{src/ux → ux}/types.d.ts +0 -0
- /package/dist/esm/{src/CommandSignatureParser.d.ts → CommandSignatureParser.d.ts} +0 -0
- /package/dist/esm/{src/CommandWithSignature.d.ts → CommandWithSignature.d.ts} +0 -0
- /package/dist/esm/{src/Logger.d.ts → Logger.d.ts} +0 -0
- /package/dist/esm/{src/commands → commands}/HelpCommand.d.ts +0 -0
- /package/dist/esm/{src/contracts → contracts}/LoggerContract.d.ts +0 -0
- /package/dist/esm/{src/contracts → contracts}/index.d.ts +0 -0
- /package/dist/esm/{src/errors → errors}/index.d.ts +0 -0
- /package/dist/esm/{src/index.d.ts → index.d.ts} +0 -0
- /package/dist/esm/{src/lib → lib}/string.d.ts +0 -0
- /package/dist/esm/{src/shared → shared}/parsers.d.ts +0 -0
- /package/dist/esm/{src/ux → ux}/askForCheckbox.d.ts +0 -0
- /package/dist/esm/{src/ux → ux}/askForEditor.d.ts +0 -0
- /package/dist/esm/{src/ux → ux}/askForExpand.d.ts +0 -0
- /package/dist/esm/{src/ux → ux}/askForFileSelector.d.ts +0 -0
- /package/dist/esm/{src/ux → ux}/askForInput.d.ts +0 -0
- /package/dist/esm/{src/ux → ux}/askForList.d.ts +0 -0
- /package/dist/esm/{src/ux → ux}/askForNumber.d.ts +0 -0
- /package/dist/esm/{src/ux → ux}/askForPassword.d.ts +0 -0
- /package/dist/esm/{src/ux → ux}/askForRawList.d.ts +0 -0
- /package/dist/esm/{src/ux → ux}/askForSearch.d.ts +0 -0
- /package/dist/esm/{src/ux → ux}/askForSelect.d.ts +0 -0
- /package/dist/esm/{src/ux → ux}/keyValue.d.ts +0 -0
- /package/dist/esm/{src/ux → ux}/loader.d.ts +0 -0
- /package/dist/esm/{src/ux → ux}/progressBar.d.ts +0 -0
- /package/dist/esm/{src/ux → ux}/table.d.ts +0 -0
- /package/dist/esm/{src/ux → ux}/types.d.ts +0 -0
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Logger } from '../Logger.js';
|
|
2
|
-
import { BobError } from './BobError.js';
|
|
3
|
-
export declare class TooManyArguments extends BobError {
|
|
4
|
-
readonly expected: number;
|
|
5
|
-
readonly received: number;
|
|
6
|
-
constructor(expected: number, received: number);
|
|
7
|
-
pretty(logger: Logger): void;
|
|
8
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ParameterOpts } from '../lib/types.js';
|
|
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
|
-
};
|
|
9
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { CustomOptions, FlagProps, ParameterOpts } from '../lib/types.js';
|
|
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
|
-
};
|
|
9
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
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
|
-
};
|
|
14
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
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
|
-
};
|
|
14
|
-
};
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { custom } from './custom.js';
|
|
2
|
-
import { optionFlag } from './option.js';
|
|
3
|
-
export declare const Flags: {
|
|
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
|
-
};
|
|
11
|
-
};
|
|
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
|
-
};
|
|
28
|
-
};
|
|
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
|
-
};
|
|
36
|
-
};
|
|
37
|
-
option: typeof optionFlag;
|
|
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
|
-
};
|
|
51
|
-
};
|
|
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
|
-
};
|
|
65
|
-
};
|
|
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
|
-
};
|
|
73
|
-
};
|
|
74
|
-
custom: typeof custom;
|
|
75
|
-
};
|
|
76
|
-
export { Args } from '../args/index.js';
|
|
@@ -1,17 +0,0 @@
|
|
|
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
|
-
};
|
|
17
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { FlagProps, ParameterOpts } from '../lib/types.js';
|
|
2
|
-
export declare function optionFlag<const T extends readonly string[], const U extends Partial<FlagProps>>(opts: {
|
|
3
|
-
options: T;
|
|
4
|
-
} & U): U & FlagProps<T[number]> & {
|
|
5
|
-
parse(input: any, opts: ParameterOpts): T[number];
|
|
6
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
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
|
-
};
|
|
8
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
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
|
-
};
|
|
8
|
-
};
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { Command } from '../Command.js';
|
|
2
|
-
import { UX } from '../ux/index.js';
|
|
3
|
-
export type ContextDefinition = any;
|
|
4
|
-
export type CustomOptions = Record<string, unknown>;
|
|
5
|
-
export type ParameterOpts<C extends ContextDefinition = ContextDefinition> = {
|
|
6
|
-
name: string;
|
|
7
|
-
ux: UX;
|
|
8
|
-
ctx: C;
|
|
9
|
-
definition: FlagDefinition & Record<string, any>;
|
|
10
|
-
cmd: typeof Command;
|
|
11
|
-
};
|
|
12
|
-
export type FlagProps<T = any> = {
|
|
13
|
-
type?: 'string' | 'number' | 'boolean' | 'option' | 'file' | 'directory' | 'url' | 'custom';
|
|
14
|
-
parse?: (input: any, opts: ParameterOpts) => T;
|
|
15
|
-
ask?: (opts: ParameterOpts) => Promise<any>;
|
|
16
|
-
description?: string;
|
|
17
|
-
required?: boolean;
|
|
18
|
-
default?: T | T[] | null | (() => Promise<T | T[] | null>);
|
|
19
|
-
multiple?: boolean;
|
|
20
|
-
help?: string;
|
|
21
|
-
alias?: string | readonly string[];
|
|
22
|
-
handler?: (value: T, opts: ParameterOpts) => {
|
|
23
|
-
shouldStop: boolean;
|
|
24
|
-
} | void;
|
|
25
|
-
};
|
|
26
|
-
export type FlagDefinition = FlagProps & {
|
|
27
|
-
parse(input: any, opts: ParameterOpts): any;
|
|
28
|
-
};
|
|
29
|
-
export type FlagType<O> = O extends {
|
|
30
|
-
parse: (...args: any[]) => infer R;
|
|
31
|
-
} ? O extends {
|
|
32
|
-
multiple: true;
|
|
33
|
-
} ? [R] extends [Array<unknown>] ? R : R[] : R : never;
|
|
34
|
-
type IsGuaranteed<O> = O extends {
|
|
35
|
-
required: true;
|
|
36
|
-
} ? true : O extends {
|
|
37
|
-
multiple: true;
|
|
38
|
-
} ? true : O extends {
|
|
39
|
-
default: infer D;
|
|
40
|
-
} ? undefined extends D ? false : null extends D ? false : true : false;
|
|
41
|
-
export type FlagReturnType<O> = IsGuaranteed<O> extends true ? FlagType<O> : FlagType<O> | null;
|
|
42
|
-
export type FlagsSchema = {
|
|
43
|
-
[key: string]: FlagDefinition;
|
|
44
|
-
};
|
|
45
|
-
export type FlagsObject<Options extends FlagsSchema> = {
|
|
46
|
-
[Key in keyof Options]: FlagReturnType<Options[Key]>;
|
|
47
|
-
};
|
|
48
|
-
export type ArgsSchema = FlagsSchema;
|
|
49
|
-
export type InferFlags<T> = T extends {
|
|
50
|
-
flags: infer O extends FlagsSchema;
|
|
51
|
-
} ? O : FlagsSchema;
|
|
52
|
-
export type InferArgs<T> = T extends {
|
|
53
|
-
args: infer A extends ArgsSchema;
|
|
54
|
-
} ? A : ArgsSchema;
|
|
55
|
-
export type Parsed<T> = {
|
|
56
|
-
flags: FlagsObject<InferFlags<T>>;
|
|
57
|
-
args: FlagsObject<InferArgs<T>>;
|
|
58
|
-
};
|
|
59
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ParameterOpts } from '../lib/types.js';
|
|
2
|
-
export declare function buildStringAsk(builderOpts: ParameterOpts): Promise<any>;
|
|
3
|
-
export declare function buildNumberAsk(builderOpts: ParameterOpts): Promise<any>;
|
|
4
|
-
export declare function buildOptionAsk(builderOpts: ParameterOpts): Promise<any>;
|
|
5
|
-
export declare function buildFileAsk(builderOpts: ParameterOpts): Promise<any>;
|
|
6
|
-
export declare function buildDirectoryAsk(builderOpts: ParameterOpts): Promise<any>;
|
|
7
|
-
export declare function buildUrlAsk(builderOpts: ParameterOpts): Promise<any>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function withCancelHandling<T>(fn: () => Promise<T>, fallback: T): Promise<T>;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|