@shell-shock/core 0.17.21 → 0.17.23
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 +16 -7
- package/dist/api.cjs +4 -5
- package/dist/api.d.cts +1 -1
- package/dist/api.d.mts +1 -1
- package/dist/api.mjs +2 -2
- package/dist/command-B6KYexlV.d.mts +308 -0
- package/dist/command-B6KYexlV.d.mts.map +1 -0
- package/dist/command-CtfR7hKM.d.cts +308 -0
- package/dist/command-CtfR7hKM.d.cts.map +1 -0
- package/dist/components/command-validation-logic.cjs +153 -216
- package/dist/components/command-validation-logic.d.cts +2 -1
- package/dist/components/command-validation-logic.d.cts.map +1 -1
- package/dist/components/command-validation-logic.d.mts +2 -1
- package/dist/components/command-validation-logic.mjs +153 -214
- package/dist/components/docs.cjs +6 -364
- package/dist/components/docs.d.cts +2 -3
- package/dist/components/docs.d.cts.map +1 -1
- package/dist/components/docs.d.mts +2 -3
- package/dist/components/docs.mjs +2 -356
- package/dist/components/exec-builtin.cjs +63 -100
- package/dist/components/exec-builtin.d.cts +1 -2
- package/dist/components/exec-builtin.d.cts.map +1 -1
- package/dist/components/exec-builtin.d.mts +1 -2
- package/dist/components/exec-builtin.mjs +7 -41
- package/dist/components/helpers.cjs +2 -52
- package/dist/components/helpers.d.cts +2 -1
- package/dist/components/helpers.d.cts.map +1 -1
- package/dist/components/helpers.d.mts +2 -1
- package/dist/components/helpers.mjs +2 -50
- package/dist/components/index.cjs +7 -23
- package/dist/components/index.mjs +9 -9
- package/dist/components/options-parser-logic.cjs +198 -420
- package/dist/components/options-parser-logic.d.cts +2 -5
- package/dist/components/options-parser-logic.d.cts.map +1 -1
- package/dist/components/options-parser-logic.d.mts +2 -5
- package/dist/components/options-parser-logic.mjs +192 -407
- package/dist/components/state-builtin.cjs +106 -164
- package/dist/components/state-builtin.d.cts +1 -2
- package/dist/components/state-builtin.d.cts.map +1 -1
- package/dist/components/state-builtin.d.mts +1 -2
- package/dist/components/state-builtin.mjs +12 -68
- package/dist/components/usage.cjs +4 -48
- package/dist/components/usage.d.cts +1 -2
- package/dist/components/usage.d.cts.map +1 -1
- package/dist/components/usage.d.mts +1 -2
- package/dist/components/usage.mjs +4 -46
- package/dist/components/utils-builtin.cjs +77 -144
- package/dist/components/utils-builtin.d.cts +1 -2
- package/dist/components/utils-builtin.d.cts.map +1 -1
- package/dist/components/utils-builtin.d.mts +1 -2
- package/dist/components/utils-builtin.mjs +9 -74
- package/dist/config-BIF9mEz0.d.cts +157 -0
- package/dist/config-BIF9mEz0.d.cts.map +1 -0
- package/dist/config-CnNYdfsL.d.mts +157 -0
- package/dist/config-CnNYdfsL.d.mts.map +1 -0
- package/dist/config.cjs +24 -58
- package/dist/config.d.cts +1 -2
- package/dist/config.d.cts.map +1 -1
- package/dist/config.d.mts +1 -2
- package/dist/config.mjs +23 -55
- package/dist/{plugin-utils/context-helpers.mjs → context-helpers-D3EJxwbq.mjs} +5 -83
- package/dist/context-helpers-D3EJxwbq.mjs.map +1 -0
- package/dist/{plugin-utils/context-helpers.cjs → context-helpers-_wUuFRB8.cjs} +63 -92
- package/dist/contexts/command.cjs +3 -9
- package/dist/contexts/command.d.cts +1 -2
- package/dist/contexts/command.d.cts.map +1 -1
- package/dist/contexts/command.d.mts +1 -2
- package/dist/contexts/command.mjs +2 -7
- package/dist/contexts/index.cjs +19 -1
- package/dist/contexts/index.d.cts +2 -1
- package/dist/contexts/index.d.mts +2 -1
- package/dist/contexts/index.mjs +2 -1
- package/dist/contexts/options.cjs +7 -30
- package/dist/contexts/options.d.cts +1 -2
- package/dist/contexts/options.d.cts.map +1 -1
- package/dist/contexts/options.d.mts +1 -2
- package/dist/contexts/options.mjs +7 -27
- package/dist/contexts/power-plant.cjs +19 -0
- package/dist/contexts/power-plant.d.cts +2 -0
- package/dist/contexts/power-plant.d.mts +2 -0
- package/dist/contexts/power-plant.mjs +5 -0
- package/dist/docs-C6ZvsVMu.cjs +278 -0
- package/dist/docs-CGQ2HtEY.mjs +249 -0
- package/dist/docs-CGQ2HtEY.mjs.map +1 -0
- package/dist/engine.cjs +5 -39
- package/dist/engine.d.cts +1 -2
- package/dist/engine.d.cts.map +1 -1
- package/dist/engine.d.mts +1 -2
- package/dist/engine.mjs +4 -37
- package/dist/generator.cjs +68 -0
- package/dist/generator.d.cts +15 -0
- package/dist/generator.d.cts.map +1 -0
- package/dist/generator.d.mts +15 -0
- package/dist/generator.d.mts.map +1 -0
- package/dist/generator.mjs +66 -0
- package/dist/generator.mjs.map +1 -0
- package/dist/{helpers/get-framework.cjs → get-framework-CxZc2krd.cjs} +7 -8
- package/dist/{helpers/get-framework.mjs → get-framework-Dlqz2hVZ.mjs} +3 -8
- package/dist/get-framework-Dlqz2hVZ.mjs.map +1 -0
- package/dist/helpers/power-plant.cjs +102 -0
- package/dist/helpers/power-plant.d.cts +61 -0
- package/dist/helpers/power-plant.d.cts.map +1 -0
- package/dist/helpers/power-plant.d.mts +61 -0
- package/dist/helpers/power-plant.d.mts.map +1 -0
- package/dist/helpers/power-plant.mjs +99 -0
- package/dist/helpers/power-plant.mjs.map +1 -0
- package/dist/index-D4klH_pj.d.mts +2 -0
- package/dist/index-DYOBadKY.d.cts +2 -0
- package/dist/index.cjs +1 -37
- package/dist/index.d.cts +4 -6
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +4 -6
- package/dist/index.mjs +0 -35
- package/dist/package-B7Vu265G.mjs +6 -0
- package/dist/package-B7Vu265G.mjs.map +1 -0
- package/dist/{package.cjs → package-BLC4qc8t.cjs} +2 -4
- package/dist/plugin-B-hM2twc.mjs +1458 -0
- package/dist/plugin-B-hM2twc.mjs.map +1 -0
- package/dist/plugin-Bhfq0DMC.cjs +1490 -0
- package/dist/plugin-utils/index.cjs +359 -26
- package/dist/plugin-utils/index.d.cts +273 -9
- package/dist/plugin-utils/index.d.cts.map +1 -0
- package/dist/plugin-utils/index.d.mts +273 -9
- package/dist/plugin-utils/index.d.mts.map +1 -0
- package/dist/plugin-utils/index.mjs +346 -10
- package/dist/plugin-utils/index.mjs.map +1 -0
- package/dist/plugin.cjs +3 -496
- package/dist/plugin.d.cts +1 -3
- package/dist/plugin.d.cts.map +1 -1
- package/dist/plugin.d.mts +1 -3
- package/dist/plugin.mjs +2 -491
- package/dist/power-plant-LgxcvlMN.d.cts +4 -0
- package/dist/power-plant-LgxcvlMN.d.mts +4 -0
- package/dist/reflect-CSiffeL9.cjs +27 -0
- package/dist/reflect-DXKSFgvS.mjs +23 -0
- package/dist/reflect-DXKSFgvS.mjs.map +1 -0
- package/dist/schemas/env.cjs +91 -0
- package/dist/schemas/env.d.cts +145 -0
- package/dist/schemas/env.d.cts.map +1 -0
- package/dist/schemas/env.d.mts +145 -0
- package/dist/{types → schemas}/env.d.mts.map +1 -1
- package/dist/schemas/env.mjs +91 -0
- package/dist/schemas/index.cjs +4 -0
- package/dist/schemas/index.d.cts +2 -0
- package/dist/schemas/index.d.mts +2 -0
- package/dist/schemas/index.mjs +3 -0
- package/dist/types/command.cjs +0 -402
- package/dist/types/command.d.cts +2 -309
- package/dist/types/command.d.mts +2 -309
- package/dist/types/command.mjs +1 -368
- package/dist/types/config.cjs +0 -175
- package/dist/types/config.d.cts +2 -126
- package/dist/types/config.d.mts +2 -126
- package/dist/types/config.mjs +1 -164
- package/dist/types/context.cjs +0 -45
- package/dist/types/context.d.cts +2 -31
- package/dist/types/context.d.mts +2 -31
- package/dist/types/context.mjs +1 -41
- package/dist/types/index.cjs +3 -53
- package/dist/types/index.d.cts +4 -5
- package/dist/types/index.d.mts +4 -5
- package/dist/types/index.mjs +4 -5
- package/package.json +106 -42
- package/dist/_virtual/_rolldown/runtime.cjs +0 -29
- package/dist/api.cjs.map +0 -1
- package/dist/components/command-validation-logic.cjs.map +0 -1
- package/dist/components/docs.cjs.map +0 -1
- package/dist/components/docs.mjs.map +0 -1
- package/dist/components/exec-builtin.cjs.map +0 -1
- package/dist/components/helpers.cjs.map +0 -1
- package/dist/components/options-parser-logic.cjs.map +0 -1
- package/dist/components/state-builtin.cjs.map +0 -1
- package/dist/components/usage.cjs.map +0 -1
- package/dist/components/utils-builtin.cjs.map +0 -1
- package/dist/config.cjs.map +0 -1
- package/dist/contexts/command.cjs.map +0 -1
- package/dist/contexts/options.cjs.map +0 -1
- package/dist/engine.cjs.map +0 -1
- package/dist/helpers/automd.cjs +0 -193
- package/dist/helpers/automd.cjs.map +0 -1
- package/dist/helpers/automd.mjs +0 -190
- package/dist/helpers/automd.mjs.map +0 -1
- package/dist/helpers/docs-helpers.cjs +0 -24
- package/dist/helpers/docs-helpers.cjs.map +0 -1
- package/dist/helpers/docs-helpers.mjs +0 -24
- package/dist/helpers/docs-helpers.mjs.map +0 -1
- package/dist/helpers/get-framework.cjs.map +0 -1
- package/dist/helpers/get-framework.mjs.map +0 -1
- package/dist/helpers/paths.cjs +0 -137
- package/dist/helpers/paths.cjs.map +0 -1
- package/dist/helpers/paths.mjs +0 -134
- package/dist/helpers/paths.mjs.map +0 -1
- package/dist/helpers/persistence.cjs +0 -114
- package/dist/helpers/persistence.cjs.map +0 -1
- package/dist/helpers/persistence.mjs +0 -113
- package/dist/helpers/persistence.mjs.map +0 -1
- package/dist/helpers/update-package-json.cjs +0 -65
- package/dist/helpers/update-package-json.cjs.map +0 -1
- package/dist/helpers/update-package-json.mjs +0 -64
- package/dist/helpers/update-package-json.mjs.map +0 -1
- package/dist/helpers/utilities.cjs +0 -95
- package/dist/helpers/utilities.cjs.map +0 -1
- package/dist/helpers/utilities.mjs +0 -94
- package/dist/helpers/utilities.mjs.map +0 -1
- package/dist/helpers/validations.cjs +0 -71
- package/dist/helpers/validations.cjs.map +0 -1
- package/dist/helpers/validations.mjs +0 -70
- package/dist/helpers/validations.mjs.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/package.cjs.map +0 -1
- package/dist/package.mjs +0 -6
- package/dist/package.mjs.map +0 -1
- package/dist/plugin-utils/compute-bin.cjs +0 -49
- package/dist/plugin-utils/compute-bin.cjs.map +0 -1
- package/dist/plugin-utils/compute-bin.d.cts +0 -13
- package/dist/plugin-utils/compute-bin.d.cts.map +0 -1
- package/dist/plugin-utils/compute-bin.d.mts +0 -13
- package/dist/plugin-utils/compute-bin.d.mts.map +0 -1
- package/dist/plugin-utils/compute-bin.mjs +0 -49
- package/dist/plugin-utils/compute-bin.mjs.map +0 -1
- package/dist/plugin-utils/context-helpers.cjs.map +0 -1
- package/dist/plugin-utils/context-helpers.d.cts +0 -106
- package/dist/plugin-utils/context-helpers.d.cts.map +0 -1
- package/dist/plugin-utils/context-helpers.d.mts +0 -106
- package/dist/plugin-utils/context-helpers.d.mts.map +0 -1
- package/dist/plugin-utils/context-helpers.mjs.map +0 -1
- package/dist/plugin-utils/deepkit.cjs +0 -70
- package/dist/plugin-utils/deepkit.cjs.map +0 -1
- package/dist/plugin-utils/deepkit.d.cts +0 -23
- package/dist/plugin-utils/deepkit.d.cts.map +0 -1
- package/dist/plugin-utils/deepkit.d.mts +0 -23
- package/dist/plugin-utils/deepkit.d.mts.map +0 -1
- package/dist/plugin-utils/deepkit.mjs +0 -69
- package/dist/plugin-utils/deepkit.mjs.map +0 -1
- package/dist/plugin-utils/description-helpers.cjs +0 -112
- package/dist/plugin-utils/description-helpers.cjs.map +0 -1
- package/dist/plugin-utils/description-helpers.d.cts +0 -44
- package/dist/plugin-utils/description-helpers.d.cts.map +0 -1
- package/dist/plugin-utils/description-helpers.d.mts +0 -44
- package/dist/plugin-utils/description-helpers.d.mts.map +0 -1
- package/dist/plugin-utils/description-helpers.mjs +0 -108
- package/dist/plugin-utils/description-helpers.mjs.map +0 -1
- package/dist/plugin-utils/get-command-tree.cjs +0 -118
- package/dist/plugin-utils/get-command-tree.cjs.map +0 -1
- package/dist/plugin-utils/get-command-tree.d.cts +0 -36
- package/dist/plugin-utils/get-command-tree.d.cts.map +0 -1
- package/dist/plugin-utils/get-command-tree.d.mts +0 -36
- package/dist/plugin-utils/get-command-tree.d.mts.map +0 -1
- package/dist/plugin-utils/get-command-tree.mjs +0 -115
- package/dist/plugin-utils/get-command-tree.mjs.map +0 -1
- package/dist/plugin-utils/reflect.cjs +0 -54
- package/dist/plugin-utils/reflect.cjs.map +0 -1
- package/dist/plugin-utils/reflect.d.cts +0 -14
- package/dist/plugin-utils/reflect.d.cts.map +0 -1
- package/dist/plugin-utils/reflect.d.mts +0 -14
- package/dist/plugin-utils/reflect.d.mts.map +0 -1
- package/dist/plugin-utils/reflect.mjs +0 -53
- package/dist/plugin-utils/reflect.mjs.map +0 -1
- package/dist/plugin-utils/traverse-command-tree.cjs +0 -65
- package/dist/plugin-utils/traverse-command-tree.cjs.map +0 -1
- package/dist/plugin-utils/traverse-command-tree.d.cts +0 -22
- package/dist/plugin-utils/traverse-command-tree.d.cts.map +0 -1
- package/dist/plugin-utils/traverse-command-tree.d.mts +0 -22
- package/dist/plugin-utils/traverse-command-tree.d.mts.map +0 -1
- package/dist/plugin-utils/traverse-command-tree.mjs +0 -63
- package/dist/plugin-utils/traverse-command-tree.mjs.map +0 -1
- package/dist/plugin-utils/type-checks.cjs +0 -222
- package/dist/plugin-utils/type-checks.cjs.map +0 -1
- package/dist/plugin-utils/type-checks.d.cts +0 -41
- package/dist/plugin-utils/type-checks.d.cts.map +0 -1
- package/dist/plugin-utils/type-checks.d.mts +0 -41
- package/dist/plugin-utils/type-checks.d.mts.map +0 -1
- package/dist/plugin-utils/type-checks.mjs +0 -218
- package/dist/plugin-utils/type-checks.mjs.map +0 -1
- package/dist/plugin.cjs.map +0 -1
- package/dist/plugin.mjs.map +0 -1
- package/dist/resolver/deepkit.cjs +0 -110
- package/dist/resolver/deepkit.cjs.map +0 -1
- package/dist/resolver/deepkit.mjs +0 -109
- package/dist/resolver/deepkit.mjs.map +0 -1
- package/dist/resolver/helpers.cjs +0 -184
- package/dist/resolver/helpers.cjs.map +0 -1
- package/dist/resolver/helpers.mjs +0 -180
- package/dist/resolver/helpers.mjs.map +0 -1
- package/dist/resolver/resolve.cjs +0 -473
- package/dist/resolver/resolve.cjs.map +0 -1
- package/dist/resolver/resolve.mjs +0 -473
- package/dist/resolver/resolve.mjs.map +0 -1
- package/dist/types/command.cjs.map +0 -1
- package/dist/types/command.d.cts.map +0 -1
- package/dist/types/command.d.mts.map +0 -1
- package/dist/types/command.mjs.map +0 -1
- package/dist/types/config.cjs.map +0 -1
- package/dist/types/config.d.cts.map +0 -1
- package/dist/types/config.d.mts.map +0 -1
- package/dist/types/config.mjs.map +0 -1
- package/dist/types/context.cjs.map +0 -1
- package/dist/types/context.d.cts.map +0 -1
- package/dist/types/context.d.mts.map +0 -1
- package/dist/types/context.mjs.map +0 -1
- package/dist/types/env.cjs +0 -53
- package/dist/types/env.cjs.map +0 -1
- package/dist/types/env.d.cts +0 -71
- package/dist/types/env.d.cts.map +0 -1
- package/dist/types/env.d.mts +0 -71
- package/dist/types/env.mjs +0 -51
- /package/dist/{types → schemas}/env.mjs.map +0 -0
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
import { JsonSchemaStringFormat, SchemaConfig } from "@power-plant/schema";
|
|
2
|
+
import { AnyFunction, RequiredKeys } from "@stryke/types/base";
|
|
3
|
+
import { ResolvedEntryFileReference } from "powerlines";
|
|
4
|
+
//#region src/types/command.d.ts
|
|
5
|
+
type CommandParameterType = "string" | "number" | "boolean";
|
|
6
|
+
interface BaseCommandParameter {
|
|
7
|
+
/**
|
|
8
|
+
* The option name.
|
|
9
|
+
*/
|
|
10
|
+
name: string;
|
|
11
|
+
/**
|
|
12
|
+
* The option kind.
|
|
13
|
+
*/
|
|
14
|
+
type: CommandParameterType;
|
|
15
|
+
/**
|
|
16
|
+
* The display title.
|
|
17
|
+
*/
|
|
18
|
+
title: string;
|
|
19
|
+
/**
|
|
20
|
+
* The option description.
|
|
21
|
+
*/
|
|
22
|
+
description: string;
|
|
23
|
+
/**
|
|
24
|
+
* Alternative option names.
|
|
25
|
+
*/
|
|
26
|
+
alias: string[];
|
|
27
|
+
/**
|
|
28
|
+
* The default value.
|
|
29
|
+
*/
|
|
30
|
+
default?: string | number | boolean | string[] | number[] | boolean[];
|
|
31
|
+
/**
|
|
32
|
+
* The environment variable name or false to disable.
|
|
33
|
+
*/
|
|
34
|
+
env: string | false;
|
|
35
|
+
/**
|
|
36
|
+
* Whether the option is required.
|
|
37
|
+
*/
|
|
38
|
+
required: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Whether the option accepts multiple values.
|
|
41
|
+
*/
|
|
42
|
+
variadic: boolean;
|
|
43
|
+
}
|
|
44
|
+
interface BaseSingleCommandParameter {
|
|
45
|
+
/**
|
|
46
|
+
* The default value.
|
|
47
|
+
*/
|
|
48
|
+
default?: string | number | boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Whether the option accepts multiple values.
|
|
51
|
+
*/
|
|
52
|
+
variadic: false;
|
|
53
|
+
}
|
|
54
|
+
interface BaseVariadicCommandParameter {
|
|
55
|
+
/**
|
|
56
|
+
* The default value.
|
|
57
|
+
*/
|
|
58
|
+
default?: string[] | number[] | boolean[];
|
|
59
|
+
/**
|
|
60
|
+
* Whether the option accepts multiple values.
|
|
61
|
+
*/
|
|
62
|
+
variadic: true;
|
|
63
|
+
}
|
|
64
|
+
interface BaseStringCommandParameter extends BaseCommandParameter {
|
|
65
|
+
/**
|
|
66
|
+
* The option kind.
|
|
67
|
+
*/
|
|
68
|
+
type: "string";
|
|
69
|
+
/**
|
|
70
|
+
* The default value.
|
|
71
|
+
*/
|
|
72
|
+
default?: string | string[];
|
|
73
|
+
/**
|
|
74
|
+
* A standard string format to validate the option value against.
|
|
75
|
+
*/
|
|
76
|
+
format?: JsonSchemaStringFormat | string;
|
|
77
|
+
/**
|
|
78
|
+
* The allowed choices for the option value.
|
|
79
|
+
*/
|
|
80
|
+
choices?: string[];
|
|
81
|
+
}
|
|
82
|
+
interface SingleStringCommandParameter extends BaseStringCommandParameter {
|
|
83
|
+
/**
|
|
84
|
+
* The default value.
|
|
85
|
+
*/
|
|
86
|
+
default?: string;
|
|
87
|
+
/**
|
|
88
|
+
* Whether the option accepts multiple values.
|
|
89
|
+
*/
|
|
90
|
+
variadic: false;
|
|
91
|
+
}
|
|
92
|
+
interface VariadicStringCommandParameter extends BaseStringCommandParameter {
|
|
93
|
+
/**
|
|
94
|
+
* The default value.
|
|
95
|
+
*/
|
|
96
|
+
default?: string[];
|
|
97
|
+
/**
|
|
98
|
+
* Whether the option accepts multiple values.
|
|
99
|
+
*/
|
|
100
|
+
variadic: true;
|
|
101
|
+
}
|
|
102
|
+
type StringCommandParameter = SingleStringCommandParameter | VariadicStringCommandParameter;
|
|
103
|
+
interface BaseNumberCommandParameter extends BaseCommandParameter {
|
|
104
|
+
/**
|
|
105
|
+
* The option kind.
|
|
106
|
+
*/
|
|
107
|
+
type: "number";
|
|
108
|
+
/**
|
|
109
|
+
* The default value.
|
|
110
|
+
*/
|
|
111
|
+
default?: number | number[];
|
|
112
|
+
/**
|
|
113
|
+
* The allowed choices for the option value.
|
|
114
|
+
*/
|
|
115
|
+
choices?: number[];
|
|
116
|
+
}
|
|
117
|
+
interface SingleNumberCommandParameter extends BaseNumberCommandParameter {
|
|
118
|
+
/**
|
|
119
|
+
* The default value.
|
|
120
|
+
*/
|
|
121
|
+
default?: number;
|
|
122
|
+
/**
|
|
123
|
+
* Whether the option accepts multiple values.
|
|
124
|
+
*/
|
|
125
|
+
variadic: false;
|
|
126
|
+
}
|
|
127
|
+
interface VariadicNumberCommandParameter extends BaseNumberCommandParameter {
|
|
128
|
+
/**
|
|
129
|
+
* The default value.
|
|
130
|
+
*/
|
|
131
|
+
default?: number[];
|
|
132
|
+
/**
|
|
133
|
+
* Whether the option accepts multiple values.
|
|
134
|
+
*/
|
|
135
|
+
variadic: true;
|
|
136
|
+
}
|
|
137
|
+
type NumberCommandParameter = SingleNumberCommandParameter | VariadicNumberCommandParameter;
|
|
138
|
+
interface BaseBooleanCommandParameter extends BaseCommandParameter {
|
|
139
|
+
/**
|
|
140
|
+
* The option kind.
|
|
141
|
+
*/
|
|
142
|
+
type: "boolean";
|
|
143
|
+
/**
|
|
144
|
+
* The default value.
|
|
145
|
+
*/
|
|
146
|
+
default?: boolean | boolean[];
|
|
147
|
+
}
|
|
148
|
+
interface SingleBooleanCommandParameter extends BaseBooleanCommandParameter {
|
|
149
|
+
/**
|
|
150
|
+
* The default value.
|
|
151
|
+
*/
|
|
152
|
+
default?: boolean;
|
|
153
|
+
/**
|
|
154
|
+
* Whether the option accepts multiple values.
|
|
155
|
+
*/
|
|
156
|
+
variadic: false;
|
|
157
|
+
}
|
|
158
|
+
interface VariadicBooleanCommandParameter extends BaseBooleanCommandParameter {
|
|
159
|
+
/**
|
|
160
|
+
* The default value.
|
|
161
|
+
*/
|
|
162
|
+
default?: boolean[];
|
|
163
|
+
/**
|
|
164
|
+
* Whether the option accepts multiple values.
|
|
165
|
+
*/
|
|
166
|
+
variadic: true;
|
|
167
|
+
}
|
|
168
|
+
type BooleanCommandParameter = SingleBooleanCommandParameter | VariadicBooleanCommandParameter;
|
|
169
|
+
type CommandParameter = StringCommandParameter | NumberCommandParameter | BooleanCommandParameter;
|
|
170
|
+
type AsCommandParameterConfig<T extends BaseCommandParameter> = Pick<T, "type"> & Partial<Omit<T, "type" | "alias">> & {
|
|
171
|
+
alias?: string | string[];
|
|
172
|
+
};
|
|
173
|
+
type StringCommandParameterConfig = AsCommandParameterConfig<StringCommandParameter>;
|
|
174
|
+
type NumberCommandParameterConfig = AsCommandParameterConfig<NumberCommandParameter>;
|
|
175
|
+
type BooleanCommandParameterConfig = AsCommandParameterConfig<BooleanCommandParameter>;
|
|
176
|
+
type CommandParameterConfig = StringCommandParameterConfig | NumberCommandParameterConfig | BooleanCommandParameterConfig;
|
|
177
|
+
interface BooleanCommandOption extends SingleBooleanCommandParameter {
|
|
178
|
+
/**
|
|
179
|
+
* The option this negates.
|
|
180
|
+
*/
|
|
181
|
+
isNegativeOf?: string;
|
|
182
|
+
/**
|
|
183
|
+
* Whether to skip adding a negative option.
|
|
184
|
+
*/
|
|
185
|
+
skipAddingNegative?: boolean;
|
|
186
|
+
}
|
|
187
|
+
type CommandOption = StringCommandParameter | NumberCommandParameter | BooleanCommandOption | VariadicBooleanCommandParameter;
|
|
188
|
+
type CommandOptionConfig = AsCommandParameterConfig<CommandOption>;
|
|
189
|
+
type CommandArgument = StringCommandParameter | NumberCommandParameter | BooleanCommandParameter;
|
|
190
|
+
type CommandArgumentConfig = AsCommandParameterConfig<CommandArgument>;
|
|
191
|
+
interface CommandMetadata {
|
|
192
|
+
/**
|
|
193
|
+
* The display name of the command.
|
|
194
|
+
*
|
|
195
|
+
* @remarks
|
|
196
|
+
* This value will be used in various displays of the user interface and documentation. If not provided, a formatted value of the command name will be used.
|
|
197
|
+
*/
|
|
198
|
+
title?: string;
|
|
199
|
+
/**
|
|
200
|
+
* A brief description of what the command does.
|
|
201
|
+
*
|
|
202
|
+
* @remarks
|
|
203
|
+
* This value will be used in various displays of the user interface and documentation. If not provided, a default message may be shown.
|
|
204
|
+
*/
|
|
205
|
+
description?: string;
|
|
206
|
+
/**
|
|
207
|
+
* One or more alternative names for the command.
|
|
208
|
+
*/
|
|
209
|
+
alias?: string | string[];
|
|
210
|
+
/**
|
|
211
|
+
* Optional tags for the command.
|
|
212
|
+
*
|
|
213
|
+
* @remarks
|
|
214
|
+
* Tags can be used to categorize and organize commands, and can also be utilized by plugins to provide additional functionality or filtering based on tags.
|
|
215
|
+
*/
|
|
216
|
+
tags?: string[];
|
|
217
|
+
/**
|
|
218
|
+
* An optional icon to visually represent the command in user interfaces.
|
|
219
|
+
*
|
|
220
|
+
* @remarks
|
|
221
|
+
* This can be a string containing an emoji, a Unicode character, or any other symbol that helps to visually identify the command. If not provided, no icon will be displayed.
|
|
222
|
+
*/
|
|
223
|
+
icon?: string;
|
|
224
|
+
/**
|
|
225
|
+
* A URL to the command documentation or reference.
|
|
226
|
+
*
|
|
227
|
+
* @remarks
|
|
228
|
+
* This URL can be used in various displays of the user interface and documentation to provide users with a reference for the command. It can also be used by plugins to link to the documentation in relevant contexts. If the token `{command}` is included in the URL, it will be replaced with the full command path to provide links to command specific documentation. For example, `myapp command subcommand` will be translated to `{docs}/command/subcommand`.
|
|
229
|
+
*/
|
|
230
|
+
docs?: string;
|
|
231
|
+
}
|
|
232
|
+
interface CommandBase extends CommandMetadata {
|
|
233
|
+
/**
|
|
234
|
+
* The command id.
|
|
235
|
+
*/
|
|
236
|
+
id: string | null;
|
|
237
|
+
/**
|
|
238
|
+
* The command name.
|
|
239
|
+
*/
|
|
240
|
+
name: string;
|
|
241
|
+
/**
|
|
242
|
+
* The full command path value.
|
|
243
|
+
*/
|
|
244
|
+
path: string | null;
|
|
245
|
+
/**
|
|
246
|
+
* The path segments.
|
|
247
|
+
*/
|
|
248
|
+
segments: string[];
|
|
249
|
+
/**
|
|
250
|
+
* Alternative command names.
|
|
251
|
+
*/
|
|
252
|
+
alias?: string[];
|
|
253
|
+
/**
|
|
254
|
+
* Whether the command is virtual.
|
|
255
|
+
*
|
|
256
|
+
* @remarks
|
|
257
|
+
* Virtual commands are considered forks in the command tree and are not directly executable. They are used to group related subcommands together without having an actual command handler or entry point.
|
|
258
|
+
*/
|
|
259
|
+
virtual: boolean;
|
|
260
|
+
}
|
|
261
|
+
interface CommandConfig extends CommandBase {
|
|
262
|
+
/**
|
|
263
|
+
* The command id.
|
|
264
|
+
*/
|
|
265
|
+
id: string;
|
|
266
|
+
/**
|
|
267
|
+
* The resolved entry definition.
|
|
268
|
+
*/
|
|
269
|
+
entry: ResolvedEntryFileReference;
|
|
270
|
+
tags?: CommandMetadata["tags"];
|
|
271
|
+
}
|
|
272
|
+
type CommandTree = RequiredKeys<CommandConfig, "title" | "description" | "alias" | "tags"> & {
|
|
273
|
+
/**
|
|
274
|
+
* The command options.
|
|
275
|
+
*/
|
|
276
|
+
options: Record<string, CommandOption>;
|
|
277
|
+
/**
|
|
278
|
+
* The positional arguments provided to the command.
|
|
279
|
+
*/
|
|
280
|
+
args: CommandArgument[];
|
|
281
|
+
/**
|
|
282
|
+
* The parent command.
|
|
283
|
+
*/
|
|
284
|
+
parent: null | CommandTree;
|
|
285
|
+
/**
|
|
286
|
+
* Child commands.
|
|
287
|
+
*/
|
|
288
|
+
children: Record<string, CommandTree>;
|
|
289
|
+
};
|
|
290
|
+
type SerializedCommandTree = Omit<CommandTree, "parent" | "children"> & {
|
|
291
|
+
/**
|
|
292
|
+
* The parent command id.
|
|
293
|
+
*/
|
|
294
|
+
parent: null | string;
|
|
295
|
+
/**
|
|
296
|
+
* Serialized child commands.
|
|
297
|
+
*/
|
|
298
|
+
children: Record<string, SerializedCommandTree>;
|
|
299
|
+
};
|
|
300
|
+
interface CommandModule {
|
|
301
|
+
metadata?: CommandMetadata;
|
|
302
|
+
options?: Record<string, CommandOptionConfig> | SchemaConfig;
|
|
303
|
+
args?: (CommandArgumentConfig | SchemaConfig)[];
|
|
304
|
+
default?: AnyFunction;
|
|
305
|
+
}
|
|
306
|
+
//#endregion
|
|
307
|
+
export { StringCommandParameterConfig as A, NumberCommandParameter as C, SingleNumberCommandParameter as D, SingleBooleanCommandParameter as E, VariadicNumberCommandParameter as M, VariadicStringCommandParameter as N, SingleStringCommandParameter as O, CommandTree as S, SerializedCommandTree as T, CommandOption as _, BaseSingleCommandParameter as a, CommandParameterConfig as b, BooleanCommandOption as c, CommandArgument as d, CommandArgumentConfig as f, CommandModule as g, CommandMetadata as h, BaseNumberCommandParameter as i, VariadicBooleanCommandParameter as j, StringCommandParameter as k, BooleanCommandParameter as l, CommandConfig as m, BaseBooleanCommandParameter as n, BaseStringCommandParameter as o, CommandBase as p, BaseCommandParameter as r, BaseVariadicCommandParameter as s, AsCommandParameterConfig as t, BooleanCommandParameterConfig as u, CommandOptionConfig as v, NumberCommandParameterConfig as w, CommandParameterType as x, CommandParameter as y };
|
|
308
|
+
//# sourceMappingURL=command-CtfR7hKM.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-CtfR7hKM.d.cts","names":[],"sources":["../src/types/command.ts"],"mappings":";;;;KAsBY;UAEK;;;;EAIf;;;;EAKA,MAAM;;;;EAKN;;;;EAKA;;;;EAKA;;;;EAKA;;;;EAKA;;;;EAKA;;;;EAKA;;UAGe;;;;EAIf;;;;EAKA;;UAGe;;;;EAIf;;;;EAKA;;UAGe,mCAAmC;;;;EAIlD;;;;EAKA;;;;EAKA,SAAS;;;;EAKT;;UAGe,qCAAqC;;;;EAIpD;;;;EAKA;;UAGe,uCAAuC;;;;EAItD;;;;EAKA;;KAGU,yBACV,+BAA+B;UAEhB,mCAAmC;;;;EAIlD;;;;EAKA;;;;EAKA;;UAGe,qCAAqC;;;;EAIpD;;;;EAKA;;UAGe,uCAAuC;;;;EAItD;;;;EAKA;;KAGU,yBACV,+BAA+B;UAEhB,oCAAoC;;;;EAInD;;;;EAKA;;UAGe,sCAAsC;;;;EAIrD;;;;EAKA;;UAGe,wCAAwC;;;;EAIvD;;;;EAKA;;KAGU,0BACV,gCAAgC;KAEtB,mBACV,yBAAyB,yBAAyB;KAExC,yBAAyB,UAAU,wBAAwB,KACrE,aAGA,QAAQ,KAAK;EACX;;KAGQ,+BACV,yBAAyB;KACf,+BACV,yBAAyB;KACf,gCACV,yBAAyB;KAEf,yBACR,+BACA,+BACA;UAEa,6BAA6B;;;;EAI5C;;;;EAKA;;KAGU,gBACR,yBACA,yBACA,uBACA;KACQ,sBAAsB,yBAAyB;KAE/C,kBACV,yBAAyB,yBAAyB;KACxC,wBAAwB,yBAAyB;UAE5C;;;;;;;EAOf;;;;;;;EAQA;;;;EAKA;;;;;;;EAQA;;;;;;;EAQA;;;;;;;EAQA;;UAGe,oBAAoB;;;;EAInC;;;;EAKA;;;;EAKA;;;;EAKA;;;;EAKA;;;;;;;EAQA;;UAGe,sBAAsB;;;;EAIrC;;;;EAKA,OAAO;EAEP,OAAO;;KAGG,cAAc,aACxB;;;;EAMA,SAAS,eAAe;;;;EAKxB,MAAM;;;;EAKN,eAAe;;;;EAKf,UAAU,eAAe;;KAGf,wBAAwB,KAAK;;;;EAIvC;;;;EAKA,UAAU,eAAe;;UAGV;EACf,WAAW;EACX,UAAU,eAAe,uBAAuB;EAChD,QAAQ,wBAAwB;EAChC,UAAU"}
|