convoker 0.3.2 → 0.3.4

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.
Files changed (50) hide show
  1. package/dist/chunk-z5eko27R.mjs +13 -0
  2. package/dist/color-BuHvMolk.d.mts +158 -0
  3. package/dist/color-OlJQTTxb.mjs +172 -0
  4. package/dist/color.d.mts +2 -0
  5. package/dist/color.mjs +4 -0
  6. package/dist/command-BXmfoT-l.d.mts +331 -0
  7. package/dist/command-D2UiQBNA.mjs +583 -0
  8. package/dist/command.d.mts +5 -0
  9. package/dist/command.mjs +10 -0
  10. package/dist/error-C1S1gs8L.mjs +115 -0
  11. package/dist/error.d.mts +5 -0
  12. package/dist/error.mjs +3 -0
  13. package/dist/index-Dikc5KAP.d.mts +199 -0
  14. package/dist/index.d.mts +73 -0
  15. package/dist/index.mjs +10 -0
  16. package/dist/input-B12iaqb8.d.mts +187 -0
  17. package/dist/input-DRy_sVxZ.mjs +174 -0
  18. package/dist/input.d.mts +3 -0
  19. package/dist/input.mjs +5 -0
  20. package/dist/prompt/index.d.mts +5 -0
  21. package/dist/prompt/index.mjs +8 -0
  22. package/dist/prompt/raw.d.mts +2 -0
  23. package/dist/prompt/raw.mjs +4 -0
  24. package/dist/prompt-Cvufljin.mjs +248 -0
  25. package/dist/raw--889icsd.mjs +105 -0
  26. package/dist/raw-BqvlveTU.d.mts +37 -0
  27. package/dist/standard-schema-DBXbMy6L.mjs +17 -0
  28. package/dist/standard-schema-DLeKaehR.d.mts +58 -0
  29. package/dist/utils-ChmY93uA.mjs +45 -0
  30. package/package.json +24 -19
  31. package/dist/color.d.ts +0 -153
  32. package/dist/color.js +0 -143
  33. package/dist/command.d.ts +0 -218
  34. package/dist/command.js +0 -531
  35. package/dist/error.d.ts +0 -107
  36. package/dist/error.js +0 -100
  37. package/dist/index.d.ts +0 -6
  38. package/dist/index.js +0 -6
  39. package/dist/input.d.ts +0 -182
  40. package/dist/input.js +0 -185
  41. package/dist/log.d.ts +0 -61
  42. package/dist/log.js +0 -216
  43. package/dist/prompt/index.d.ts +0 -193
  44. package/dist/prompt/index.js +0 -273
  45. package/dist/prompt/raw.d.ts +0 -32
  46. package/dist/prompt/raw.js +0 -105
  47. package/dist/standard-schema.d.ts +0 -62
  48. package/dist/standard-schema.js +0 -16
  49. package/dist/utils.d.ts +0 -30
  50. package/dist/utils.js +0 -56
@@ -0,0 +1,5 @@
1
+ import "./color-BuHvMolk.mjs";
2
+ import "./standard-schema-DLeKaehR.mjs";
3
+ import "./input-B12iaqb8.mjs";
4
+ import { c as ConvokerError, d as MissingRequiredArgumentError, f as MissingRequiredOptionError, l as HelpAskedError, m as UnknownOptionError, p as TooManyArgumentsError, u as InputValidationError } from "./command-BXmfoT-l.mjs";
5
+ export { ConvokerError, HelpAskedError, InputValidationError, MissingRequiredArgumentError, MissingRequiredOptionError, TooManyArgumentsError, UnknownOptionError };
package/dist/error.mjs ADDED
@@ -0,0 +1,3 @@
1
+ import { a as MissingRequiredOptionError, i as MissingRequiredArgumentError, n as HelpAskedError, o as TooManyArgumentsError, r as InputValidationError, s as UnknownOptionError, t as ConvokerError } from "./error-C1S1gs8L.mjs";
2
+
3
+ export { ConvokerError, HelpAskedError, InputValidationError, MissingRequiredArgumentError, MissingRequiredOptionError, TooManyArgumentsError, UnknownOptionError };
@@ -0,0 +1,199 @@
1
+ import { n as Theme } from "./color-BuHvMolk.mjs";
2
+ import { t as StandardSchemaV1 } from "./standard-schema-DLeKaehR.mjs";
3
+ import { i as raw_d_exports } from "./raw-BqvlveTU.mjs";
4
+
5
+ //#region src/prompt/index.d.ts
6
+ declare namespace index_d_exports {
7
+ export { BaseOpts, ConfirmOpts, EditorOpts, PasswordOpts, SearchOpts, SelectOption, SelectOpts, TextOpts, confirm, editor, multiselect, password, raw_d_exports as raw, search, select, setTheme, text };
8
+ }
9
+ /**
10
+ * Sets the theme of the prompts.
11
+ * @param t The new theme.
12
+ */
13
+ declare function setTheme(t: Theme): void;
14
+ /**
15
+ * Base options for prompts.
16
+ */
17
+ interface BaseOpts<T> {
18
+ /**
19
+ * The message of the prompt.
20
+ */
21
+ message: string;
22
+ /**
23
+ * An `AbortSignal` to cancel the prompt.
24
+ */
25
+ signal?: AbortSignal;
26
+ /**
27
+ * The default value.
28
+ */
29
+ default?: T;
30
+ /**
31
+ * The theme of the prompt.
32
+ */
33
+ theme?: Theme;
34
+ /**
35
+ * A validator function, or a Standard Schema validator.
36
+ */
37
+ validate?: StandardSchemaV1<any, T> | ((value: T) => boolean | T);
38
+ }
39
+ /**
40
+ * Options for text input.
41
+ */
42
+ interface TextOpts extends BaseOpts<string> {
43
+ /**
44
+ * A placeholder, displayed when the user hasn't typed anything yet.
45
+ */
46
+ placeholder?: string;
47
+ /**
48
+ * Minimum length of the input.
49
+ */
50
+ minLength?: number;
51
+ /**
52
+ * Maximum length of the input.
53
+ */
54
+ maxLength?: number;
55
+ }
56
+ /**
57
+ * Prompts the user for text input.
58
+ * @param opts Options for text input.
59
+ * @returns The text the user typed in, or the default.
60
+ */
61
+ declare function text(opts: TextOpts): Promise<string>;
62
+ /**
63
+ * Options for password input.
64
+ */
65
+ interface PasswordOpts extends TextOpts {
66
+ /**
67
+ * The mask for the password input.
68
+ */
69
+ mask?: string;
70
+ /**
71
+ * If the user should be asked to confirm the password, by typing it again.
72
+ */
73
+ confirm?: boolean;
74
+ }
75
+ /**
76
+ * Prompts the user for a password.
77
+ * @param opts Options for password input.
78
+ * @returns The password.
79
+ */
80
+ declare function password(opts: PasswordOpts): Promise<string>;
81
+ /**
82
+ * An option for select input.
83
+ */
84
+ interface SelectOption<T> {
85
+ /**
86
+ * The label (what gets displayed) of the select option.
87
+ */
88
+ label: string;
89
+ /**
90
+ * The value (what gets returned) of the select option.
91
+ */
92
+ value: T;
93
+ /**
94
+ * A description of the option.
95
+ */
96
+ hint?: string;
97
+ /**
98
+ * If this option is disabled.
99
+ */
100
+ disabled?: boolean;
101
+ }
102
+ /**
103
+ * Options for select input.
104
+ */
105
+ interface SelectOpts<T> extends BaseOpts<T> {
106
+ /**
107
+ * Every option the user can pick from.
108
+ */
109
+ options: SelectOption<T>[];
110
+ /**
111
+ * The initial option selected.
112
+ */
113
+ initialIndex?: number;
114
+ }
115
+ /**
116
+ * Prompts the user to select a single option.
117
+ * @param opts Options for select input.
118
+ * @returns The selected option's value.
119
+ */
120
+ declare function select<T>(opts: SelectOpts<T>): Promise<T>;
121
+ /**
122
+ * Prompts the user to select multiple options.
123
+ * @param opts Options for select input.
124
+ * @returns The selected options.
125
+ */
126
+ declare function multiselect<T>(opts: SelectOpts<T>): Promise<T[]>;
127
+ /**
128
+ * Options for search input.
129
+ */
130
+ interface SearchOpts<T> extends BaseOpts<T> {
131
+ /**
132
+ * Every option the user can search through.
133
+ */
134
+ options: SelectOption<T>[];
135
+ /**
136
+ * Placeholder for the search input.
137
+ */
138
+ placeholder?: string;
139
+ /**
140
+ * Minimum length for a query string.
141
+ */
142
+ minQueryLength?: number;
143
+ /**
144
+ * Filters a single option.
145
+ * @param query The search query.
146
+ * @param option The option to filter.
147
+ */
148
+ filter?(query: string, option: SelectOption<T>): boolean;
149
+ }
150
+ /**
151
+ * Prompts the user to search through a list of options.
152
+ * @param opts Options for search input.
153
+ * @returns The selected option.
154
+ */
155
+ declare function search<T>(opts: SearchOpts<T>): Promise<T>;
156
+ /**
157
+ * Options for confirm input.
158
+ */
159
+ interface ConfirmOpts extends BaseOpts<boolean> {
160
+ /**
161
+ * What gets displayed for the Yes option.
162
+ */
163
+ yesLabel?: string;
164
+ /**
165
+ * What gets displayed for the No option.
166
+ */
167
+ noLabel?: string;
168
+ }
169
+ /**
170
+ * Prompts the user to confirm an action.
171
+ * @param opts Options for confirm input.
172
+ * @returns If the user picked Yes.
173
+ */
174
+ declare function confirm(opts: ConfirmOpts): Promise<boolean>;
175
+ /**
176
+ * Options for opening the system editor.
177
+ */
178
+ interface EditorOpts extends BaseOpts<string> {
179
+ /**
180
+ * The initial value.
181
+ */
182
+ initial?: string;
183
+ /**
184
+ * The language of the value.
185
+ */
186
+ language?: string;
187
+ /**
188
+ * If the input is required for continuing or not.
189
+ */
190
+ required?: boolean;
191
+ }
192
+ /**
193
+ * Opens the system editor, or asks for input in the terminal as fallback.
194
+ * @param opts Options for opening the system editor.
195
+ * @returns The result of the system editor.
196
+ */
197
+ declare function editor(opts: EditorOpts): Promise<string>;
198
+ //#endregion
199
+ export { text as _, SearchOpts as a, TextOpts as c, index_d_exports as d, multiselect as f, setTheme as g, select as h, PasswordOpts as i, confirm as l, search as m, ConfirmOpts as n, SelectOption as o, password as p, EditorOpts as r, SelectOpts as s, BaseOpts as t, editor as u };
@@ -0,0 +1,73 @@
1
+ import { C as color_d_exports, n as Theme } from "./color-BuHvMolk.mjs";
2
+ import "./standard-schema-DLeKaehR.mjs";
3
+ import { d as input_d_exports } from "./input-B12iaqb8.mjs";
4
+ import { a as ErrorFn, h as error_d_exports, i as CommandAlias, n as Builder, o as MiddlewareFn, r as Command, s as ParseResult, t as ActionFn } from "./command-BXmfoT-l.mjs";
5
+ import "./raw-BqvlveTU.mjs";
6
+ import { d as index_d_exports } from "./index-Dikc5KAP.mjs";
7
+
8
+ //#region src/log.d.ts
9
+ declare namespace log_d_exports {
10
+ export { LogConfig, error, fatal, info, setConfig, setTheme, setup, trace, warn };
11
+ }
12
+ /**
13
+ * The logger configuration.
14
+ */
15
+ interface LogConfig {
16
+ /**
17
+ * The format to print as.
18
+ */
19
+ format: "text" | "json" | "xml" | "yaml" | "csv";
20
+ /**
21
+ * Standard output.
22
+ */
23
+ stdout: WritableStream<string>;
24
+ /**
25
+ * Standard error.
26
+ */
27
+ stderr: WritableStream<string>;
28
+ /**
29
+ * Standard input.
30
+ */
31
+ stdin: ReadableStream<string>;
32
+ }
33
+ /**
34
+ * Sets a new theme.
35
+ * @param t The theme.
36
+ */
37
+ declare function setTheme(t: Theme): void;
38
+ /**
39
+ * Sets new configuration.
40
+ * @param c The config.
41
+ */
42
+ declare function setConfig(c: Partial<LogConfig>): Promise<void>;
43
+ /**
44
+ * Sets default configuration.
45
+ */
46
+ declare function setup(): Promise<void>;
47
+ /**
48
+ * Prints debug information.
49
+ * @param msgs The messages to write.
50
+ */
51
+ declare function trace(...msgs: any[]): Promise<void>;
52
+ /**
53
+ * Prints information.
54
+ * @param msgs The messages to write.
55
+ */
56
+ declare function info(...msgs: any[]): Promise<void>;
57
+ /**
58
+ * Prints warnings.
59
+ * @param msgs The messages to write.
60
+ */
61
+ declare function warn(...msgs: any[]): Promise<void>;
62
+ /**
63
+ * Prints errors.
64
+ * @param msgs The messages to write.
65
+ */
66
+ declare function error(...msgs: any[]): Promise<void>;
67
+ /**
68
+ * Prints errors and exits.
69
+ * @param msgs The messages to write.
70
+ */
71
+ declare function fatal(...msgs: any[]): Promise<void>;
72
+ //#endregion
73
+ export { ActionFn, Builder, Command, CommandAlias, ErrorFn, MiddlewareFn, ParseResult, color_d_exports as color, error_d_exports as error, input_d_exports as i, log_d_exports as log, index_d_exports as prompt };
package/dist/index.mjs ADDED
@@ -0,0 +1,10 @@
1
+ import "./utils-ChmY93uA.mjs";
2
+ import { S as color_exports } from "./color-OlJQTTxb.mjs";
3
+ import { c as error_exports } from "./error-C1S1gs8L.mjs";
4
+ import "./standard-schema-DBXbMy6L.mjs";
5
+ import "./raw--889icsd.mjs";
6
+ import { a as prompt_exports } from "./prompt-Cvufljin.mjs";
7
+ import { n as log_exports, t as Command } from "./command-D2UiQBNA.mjs";
8
+ import { a as input_exports } from "./input-DRy_sVxZ.mjs";
9
+
10
+ export { Command, color_exports as color, error_exports as error, input_exports as i, log_exports as log, prompt_exports as prompt };
@@ -0,0 +1,187 @@
1
+ import { t as StandardSchemaV1 } from "./standard-schema-DLeKaehR.mjs";
2
+
3
+ //#region src/input.d.ts
4
+ declare namespace input_d_exports {
5
+ export { BasicKind, InferEntry, InferInput, Input, Kind, Option, Positional, TypeOf, argument, convert, option, positional };
6
+ }
7
+ /**
8
+ * An input object.
9
+ */
10
+ interface Input {
11
+ [x: string]: Option<any, any, any> | Positional<any, any, any>;
12
+ }
13
+ /**
14
+ * A basic input type.
15
+ */
16
+ type BasicKind = "boolean" | "string" | "number" | "bigint";
17
+ /**
18
+ * An input type.
19
+ */
20
+ type Kind = BasicKind | StandardSchemaV1<any, any>;
21
+ /**
22
+ * Converts a Kind to a TypeScript type.
23
+ */
24
+ type TypeOf<T extends Kind> = T extends StandardSchemaV1<any, infer Out> ? Out : T extends "boolean" ? boolean : T extends "string" ? string : T extends "number" ? number : T extends "bigint" ? bigint : never;
25
+ /**
26
+ * Infers TypeScript types from an input object.
27
+ */
28
+ type InferInput<T extends Input> = { [K in keyof T]: InferEntry<T[K]> };
29
+ /**
30
+ * Infers a TypeScript type from an option or positional.
31
+ */
32
+ type InferEntry<T> = T extends {
33
+ $kind: infer TKind extends Kind;
34
+ $required: infer Required;
35
+ $list: infer List;
36
+ } ? List extends true ? Required extends true ? TypeOf<TKind>[] : TypeOf<TKind>[] | undefined : Required extends true ? TypeOf<TKind> : TypeOf<TKind> | undefined : never;
37
+ /**
38
+ * Converts a value from a Kind to a TypeScript type.
39
+ * @param kind The kind to convert to.
40
+ * @param value The value to convert.
41
+ * @returns The converted value.
42
+ */
43
+ declare function convert<TKind$1 extends Kind>(kind: TKind$1, value: string | string[]): Promise<TypeOf<TKind$1> | TypeOf<TKind$1>[]>;
44
+ /**
45
+ * An option.
46
+ */
47
+ declare class Option<TKind$1 extends Kind, TRequired extends boolean = true, TList extends boolean = false> {
48
+ /**
49
+ * The kind of this option.
50
+ */
51
+ $kind: TKind$1;
52
+ /**
53
+ * The aliases of this option.
54
+ */
55
+ $names: string[];
56
+ /**
57
+ * The description of this option.
58
+ */
59
+ $description: string | undefined;
60
+ /**
61
+ * The default value of this option.
62
+ */
63
+ $default: TypeOf<TKind$1> | undefined;
64
+ /**
65
+ * If this option is required.
66
+ */
67
+ $required: TRequired;
68
+ /**
69
+ * If this option is a list.
70
+ */
71
+ $list: TList;
72
+ /**
73
+ * A separator if this option is a list.
74
+ */
75
+ $separator: string | undefined;
76
+ /**
77
+ * Creates a new option.
78
+ * @param kind The type of this option.
79
+ * @param names The names of this option.
80
+ */
81
+ constructor(kind: TKind$1, names: string[]);
82
+ /**
83
+ * Makes this option a list.
84
+ * @returns this
85
+ */
86
+ list(separator?: string): Option<TKind$1, TRequired, true>;
87
+ /**
88
+ * Makes this option required.
89
+ * @returns this
90
+ */
91
+ required(): Option<TKind$1, true, TList>;
92
+ /**
93
+ * Makes this option optional.
94
+ * @returns this
95
+ */
96
+ optional(): Option<TKind$1, false, TList>;
97
+ /**
98
+ * Sets a default value.
99
+ * @param value The default value.
100
+ * @returns this
101
+ */
102
+ default(value: TypeOf<TKind$1>): this;
103
+ /**
104
+ * Sets a description.
105
+ * @param desc The description.
106
+ * @returns this
107
+ */
108
+ description(desc: string): this;
109
+ }
110
+ /**
111
+ * A positional argument.
112
+ */
113
+ declare class Positional<TKind$1 extends Kind, TRequired extends boolean = true, TList extends boolean = false> {
114
+ /**
115
+ * The type of this argument.
116
+ */
117
+ $kind: TKind$1;
118
+ /**
119
+ * The default value of this argument.
120
+ */
121
+ $default: TypeOf<TKind$1> | undefined;
122
+ /**
123
+ * The description of this argument.
124
+ */
125
+ $description: string | undefined;
126
+ /**
127
+ * If this argument is required.
128
+ */
129
+ $required: TRequired;
130
+ /**
131
+ * If this argument is a list.
132
+ */
133
+ $list: TList;
134
+ /**
135
+ * Creates a new positional argument.
136
+ * @param kind The positional argument.
137
+ */
138
+ constructor(kind: TKind$1);
139
+ /**
140
+ * Makes this argument a list.
141
+ * @returns this
142
+ */
143
+ list(): Positional<TKind$1, TRequired, true>;
144
+ /**
145
+ * Makes this argument required.
146
+ * @returns this
147
+ */
148
+ required(): Positional<TKind$1, true, TList>;
149
+ /**
150
+ * Makes this argument optional.
151
+ * @returns this
152
+ */
153
+ optional(): Positional<TKind$1, false, TList>;
154
+ /**
155
+ * Sets a default value.
156
+ * @param value The default value.
157
+ * @returns this
158
+ */
159
+ default(value: TypeOf<TKind$1>): this;
160
+ /**
161
+ * Sets a description.
162
+ * @param desc The description.
163
+ * @returns this
164
+ */
165
+ description(desc: string): this;
166
+ }
167
+ /**
168
+ * Creates a new option.
169
+ * @param kind The kind of option.
170
+ * @param names The names of the option.
171
+ * @returns A new option.
172
+ */
173
+ declare function option<T extends Kind>(kind: T, ...names: string[]): Option<T>;
174
+ /**
175
+ * Creates a new positional argument.
176
+ * @param kind The kind of positional argument.
177
+ * @returns A new positional argument.
178
+ */
179
+ declare function positional<T extends Kind>(kind: T): Positional<T>;
180
+ /**
181
+ * Creates a new positional argument.
182
+ * @param kind The kind of positional argument.
183
+ * @returns A new positional argument.
184
+ */
185
+ declare function argument<T extends Kind>(kind: T): Positional<T>;
186
+ //#endregion
187
+ export { Kind as a, TypeOf as c, input_d_exports as d, option as f, Input as i, argument as l, InferEntry as n, Option as o, positional as p, InferInput as r, Positional as s, BasicKind as t, convert as u };
@@ -0,0 +1,174 @@
1
+ import { t as __export } from "./chunk-z5eko27R.mjs";
2
+ import { t as validate } from "./standard-schema-DBXbMy6L.mjs";
3
+
4
+ //#region src/input.ts
5
+ var input_exports = /* @__PURE__ */ __export({
6
+ Option: () => Option,
7
+ Positional: () => Positional,
8
+ argument: () => argument,
9
+ convert: () => convert,
10
+ option: () => option,
11
+ positional: () => positional
12
+ });
13
+ /**
14
+ * Converts a value from a Kind to a TypeScript type.
15
+ * @param kind The kind to convert to.
16
+ * @param value The value to convert.
17
+ * @returns The converted value.
18
+ */
19
+ async function convert(kind, value) {
20
+ async function convertOne(val) {
21
+ if (typeof kind === "string") switch (kind) {
22
+ case "boolean": return val === "true";
23
+ case "bigint": return BigInt(val);
24
+ case "number": return parseFloat(val);
25
+ case "string": return val;
26
+ }
27
+ return validate(kind, val);
28
+ }
29
+ if (Array.isArray(value)) return await Promise.all(value.map((v) => convertOne(v)));
30
+ return convertOne(value);
31
+ }
32
+ /**
33
+ * An option.
34
+ */
35
+ var Option = class {
36
+ /**
37
+ * Creates a new option.
38
+ * @param kind The type of this option.
39
+ * @param names The names of this option.
40
+ */
41
+ constructor(kind, names) {
42
+ this.$required = true;
43
+ this.$list = false;
44
+ this.$kind = kind;
45
+ this.$names = names.map((name) => name.replace(/^-+/, ""));
46
+ }
47
+ /**
48
+ * Makes this option a list.
49
+ * @returns this
50
+ */
51
+ list(separator) {
52
+ this.$list = true;
53
+ this.$separator = separator ?? this.$separator;
54
+ return this;
55
+ }
56
+ /**
57
+ * Makes this option required.
58
+ * @returns this
59
+ */
60
+ required() {
61
+ this.$required = true;
62
+ return this;
63
+ }
64
+ /**
65
+ * Makes this option optional.
66
+ * @returns this
67
+ */
68
+ optional() {
69
+ this.$required = false;
70
+ return this;
71
+ }
72
+ /**
73
+ * Sets a default value.
74
+ * @param value The default value.
75
+ * @returns this
76
+ */
77
+ default(value) {
78
+ this.$default = value;
79
+ return this;
80
+ }
81
+ /**
82
+ * Sets a description.
83
+ * @param desc The description.
84
+ * @returns this
85
+ */
86
+ description(desc) {
87
+ this.$description = desc;
88
+ return this;
89
+ }
90
+ };
91
+ /**
92
+ * A positional argument.
93
+ */
94
+ var Positional = class {
95
+ /**
96
+ * Creates a new positional argument.
97
+ * @param kind The positional argument.
98
+ */
99
+ constructor(kind) {
100
+ this.$required = true;
101
+ this.$list = false;
102
+ this.$kind = kind;
103
+ }
104
+ /**
105
+ * Makes this argument a list.
106
+ * @returns this
107
+ */
108
+ list() {
109
+ this.$list = true;
110
+ return this;
111
+ }
112
+ /**
113
+ * Makes this argument required.
114
+ * @returns this
115
+ */
116
+ required() {
117
+ this.$required = true;
118
+ return this;
119
+ }
120
+ /**
121
+ * Makes this argument optional.
122
+ * @returns this
123
+ */
124
+ optional() {
125
+ this.$required = false;
126
+ return this;
127
+ }
128
+ /**
129
+ * Sets a default value.
130
+ * @param value The default value.
131
+ * @returns this
132
+ */
133
+ default(value) {
134
+ this.$default = value;
135
+ return this;
136
+ }
137
+ /**
138
+ * Sets a description.
139
+ * @param desc The description.
140
+ * @returns this
141
+ */
142
+ description(desc) {
143
+ this.$description = desc;
144
+ return this;
145
+ }
146
+ };
147
+ /**
148
+ * Creates a new option.
149
+ * @param kind The kind of option.
150
+ * @param names The names of the option.
151
+ * @returns A new option.
152
+ */
153
+ function option(kind, ...names) {
154
+ return new Option(kind, names);
155
+ }
156
+ /**
157
+ * Creates a new positional argument.
158
+ * @param kind The kind of positional argument.
159
+ * @returns A new positional argument.
160
+ */
161
+ function positional(kind) {
162
+ return new Positional(kind);
163
+ }
164
+ /**
165
+ * Creates a new positional argument.
166
+ * @param kind The kind of positional argument.
167
+ * @returns A new positional argument.
168
+ */
169
+ function argument(kind) {
170
+ return new Positional(kind);
171
+ }
172
+
173
+ //#endregion
174
+ export { input_exports as a, convert as i, Positional as n, option as o, argument as r, positional as s, Option as t };
@@ -0,0 +1,3 @@
1
+ import "./standard-schema-DLeKaehR.mjs";
2
+ import { a as Kind, c as TypeOf, f as option, i as Input, l as argument, n as InferEntry, o as Option, p as positional, r as InferInput, s as Positional, t as BasicKind, u as convert } from "./input-B12iaqb8.mjs";
3
+ export { BasicKind, InferEntry, InferInput, Input, Kind, Option, Positional, TypeOf, argument, convert, option, positional };
package/dist/input.mjs ADDED
@@ -0,0 +1,5 @@
1
+ import "./error-C1S1gs8L.mjs";
2
+ import "./standard-schema-DBXbMy6L.mjs";
3
+ import { i as convert, n as Positional, o as option, r as argument, s as positional, t as Option } from "./input-DRy_sVxZ.mjs";
4
+
5
+ export { Option, Positional, argument, convert, option, positional };
@@ -0,0 +1,5 @@
1
+ import "../color-BuHvMolk.mjs";
2
+ import "../standard-schema-DLeKaehR.mjs";
3
+ import { i as raw_d_exports } from "../raw-BqvlveTU.mjs";
4
+ import { _ as text, a as SearchOpts, c as TextOpts, f as multiselect, g as setTheme, h as select, i as PasswordOpts, l as confirm, m as search, n as ConfirmOpts, o as SelectOption, p as password, r as EditorOpts, s as SelectOpts, t as BaseOpts, u as editor } from "../index-Dikc5KAP.mjs";
5
+ export { BaseOpts, ConfirmOpts, EditorOpts, PasswordOpts, SearchOpts, SelectOption, SelectOpts, TextOpts, confirm, editor, multiselect, password, raw_d_exports as raw, search, select, setTheme, text };
@@ -0,0 +1,8 @@
1
+ import "../utils-ChmY93uA.mjs";
2
+ import "../color-OlJQTTxb.mjs";
3
+ import "../error-C1S1gs8L.mjs";
4
+ import "../standard-schema-DBXbMy6L.mjs";
5
+ import { i as raw_exports } from "../raw--889icsd.mjs";
6
+ import { c as setTheme, i as password, l as text, n as editor, o as search, r as multiselect, s as select, t as confirm } from "../prompt-Cvufljin.mjs";
7
+
8
+ export { confirm, editor, multiselect, password, raw_exports as raw, search, select, setTheme, text };
@@ -0,0 +1,2 @@
1
+ import { a as readKey, n as cursorDown, o as readLine, r as cursorUp, t as clearLines } from "../raw-BqvlveTU.mjs";
2
+ export { clearLines, cursorDown, cursorUp, readKey, readLine };
@@ -0,0 +1,4 @@
1
+ import "../utils-ChmY93uA.mjs";
2
+ import { a as readKey, n as cursorDown, o as readLine, r as cursorUp, t as clearLines } from "../raw--889icsd.mjs";
3
+
4
+ export { clearLines, cursorDown, cursorUp, readKey, readLine };