convoker 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +34 -0
- package/dist/chunks/__vite-browser-external-DQYBmsno.js +80 -0
- package/dist/chunks/color-CiruG_zQ.js +153 -0
- package/dist/chunks/error-Cj2qDfOl.js +95 -0
- package/dist/chunks/index-G2nVXKup.js +198 -0
- package/dist/chunks/input-COjWPD53.js +135 -0
- package/dist/chunks/standard-schema-Dn3nwAxU.js +12 -0
- package/dist/chunks/utils-DdmSEjLc.js +22 -0
- package/dist/color.d.ts +200 -0
- package/dist/color.js +49 -0
- package/dist/command.d.ts +527 -0
- package/dist/command.js +415 -0
- package/dist/error.d.ts +832 -0
- package/dist/error.js +10 -0
- package/dist/index.d.ts +1196 -0
- package/dist/index.js +13 -0
- package/dist/input.d.ts +248 -0
- package/dist/input.js +10 -0
- package/dist/prompt/raw.d.ts +32 -0
- package/dist/prompt/raw.js +9 -0
- package/dist/prompt.d.ts +258 -0
- package/dist/prompt.js +17 -0
- package/dist/raw.d.ts +38 -0
- package/package.json +70 -0
|
@@ -0,0 +1,527 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command action function.
|
|
3
|
+
*/
|
|
4
|
+
export declare type ActionFn<T extends Input> = (input: InferInput<T>) => void | Promise<void>;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A basic input type.
|
|
8
|
+
*/
|
|
9
|
+
declare type BasicKind = "boolean" | "string" | "number" | "bigint";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Builder for commands.
|
|
13
|
+
*/
|
|
14
|
+
export declare type Builder = (c: Command<any>) => Command<any> | void;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* A command.
|
|
18
|
+
*/
|
|
19
|
+
export declare class Command<T extends Input = Input> {
|
|
20
|
+
/**
|
|
21
|
+
* The names (aliases) of this command.
|
|
22
|
+
*/
|
|
23
|
+
$names: string[];
|
|
24
|
+
/**
|
|
25
|
+
* The description of this command.
|
|
26
|
+
*/
|
|
27
|
+
$description: string | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* The theme of this command
|
|
30
|
+
*/
|
|
31
|
+
$theme: Theme | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* The version of this command.
|
|
34
|
+
*/
|
|
35
|
+
$version: string | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* The children of this command.
|
|
38
|
+
*/
|
|
39
|
+
$children: Map<string, CommandAlias>;
|
|
40
|
+
/**
|
|
41
|
+
* The parent of this command.
|
|
42
|
+
*/
|
|
43
|
+
$parent: Command<any> | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* If this command allows unknown options.
|
|
46
|
+
*/
|
|
47
|
+
$allowUnknownOptions: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* The input this command takes.
|
|
50
|
+
*/
|
|
51
|
+
$input: T;
|
|
52
|
+
/**
|
|
53
|
+
* The action function of this command.
|
|
54
|
+
*/
|
|
55
|
+
$fn: ActionFn<T> | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* The error handler of this command.
|
|
58
|
+
*/
|
|
59
|
+
$errorFn: ErrorFn<T> | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* Creates a new command.
|
|
62
|
+
* @param names The names (aliases).
|
|
63
|
+
* @param desc The description.
|
|
64
|
+
* @param version The version.
|
|
65
|
+
*/
|
|
66
|
+
constructor(names: string | string[], desc?: string, version?: string);
|
|
67
|
+
/**
|
|
68
|
+
* Adds a set of aliases to this command.
|
|
69
|
+
* @param aliases The aliases to add.
|
|
70
|
+
* @returns this
|
|
71
|
+
*/
|
|
72
|
+
alias(...aliases: string[]): this;
|
|
73
|
+
/**
|
|
74
|
+
* Adds a description to this command.
|
|
75
|
+
* @param desc The description.
|
|
76
|
+
* @returns this
|
|
77
|
+
*/
|
|
78
|
+
description(desc: string): this;
|
|
79
|
+
/**
|
|
80
|
+
* Adds a version to this command.
|
|
81
|
+
* @param version The version.
|
|
82
|
+
* @returns this
|
|
83
|
+
*/
|
|
84
|
+
version(version: string): this;
|
|
85
|
+
/**
|
|
86
|
+
* Sets the input for this command.
|
|
87
|
+
* @param version The input.
|
|
88
|
+
* @returns this
|
|
89
|
+
*/
|
|
90
|
+
input<TInput extends Input>(input: TInput): Command<TInput>;
|
|
91
|
+
/**
|
|
92
|
+
* Sets the action function for this command.
|
|
93
|
+
* @param fn The action.
|
|
94
|
+
* @returns this
|
|
95
|
+
*/
|
|
96
|
+
action(fn: ActionFn<T>): this;
|
|
97
|
+
/**
|
|
98
|
+
* Sets the error function for this command.
|
|
99
|
+
* @param fn The error handler.
|
|
100
|
+
* @returns this
|
|
101
|
+
*/
|
|
102
|
+
error(fn: ErrorFn<T>): this;
|
|
103
|
+
/**
|
|
104
|
+
* Adds an existing command to this.
|
|
105
|
+
* @param command The command.
|
|
106
|
+
* @returns this
|
|
107
|
+
*/
|
|
108
|
+
add(command: Command<any>): this;
|
|
109
|
+
/**
|
|
110
|
+
* Creates a new subcommand and adds it.
|
|
111
|
+
* @param names The aliases of the subcommand.
|
|
112
|
+
* @param builder A builder to create the command.
|
|
113
|
+
*/
|
|
114
|
+
subCommand(names: string | string[], builder: Builder): this;
|
|
115
|
+
/**
|
|
116
|
+
* Creates a new subcommand and adds it.
|
|
117
|
+
* @param names The aliases of the subcommand.
|
|
118
|
+
* @param desc The description of the subcommand.
|
|
119
|
+
* @param version The version of the subcommand.
|
|
120
|
+
*/
|
|
121
|
+
subCommand(names: string | string[], desc?: string, version?: string): Command<any>;
|
|
122
|
+
/**
|
|
123
|
+
* Allows unknown options.
|
|
124
|
+
* @returns this
|
|
125
|
+
*/
|
|
126
|
+
allowUnknownOptions(): this;
|
|
127
|
+
/**
|
|
128
|
+
* Parses a set of command-line arguments.
|
|
129
|
+
* @param argv The arguments to parse.
|
|
130
|
+
* @returns A parse result.
|
|
131
|
+
*/
|
|
132
|
+
parse(argv: string[]): Promise<ParseResult<T>>;
|
|
133
|
+
private buildInputMap;
|
|
134
|
+
/**
|
|
135
|
+
* Gets the full command path (name including parents).
|
|
136
|
+
* @returns The full command path.
|
|
137
|
+
*/
|
|
138
|
+
fullCommandPath(): string;
|
|
139
|
+
/**
|
|
140
|
+
* The default error screen.
|
|
141
|
+
* @param errors The errors.
|
|
142
|
+
*/
|
|
143
|
+
defaultErrorScreen(errors: Error[]): void;
|
|
144
|
+
/**
|
|
145
|
+
* Handles a set of errors.
|
|
146
|
+
* @param errors The errors to handle.
|
|
147
|
+
* @param input The parsed input, if possible.
|
|
148
|
+
* @returns this
|
|
149
|
+
*/
|
|
150
|
+
handleErrors(errors: Error[], input?: Partial<InferInput<T>>): Promise<this>;
|
|
151
|
+
/**
|
|
152
|
+
* Runs a command.
|
|
153
|
+
* @param argv The arguments to run the command with. Defaults to your runtime's `argv` equivalent.
|
|
154
|
+
* @returns this
|
|
155
|
+
*/
|
|
156
|
+
run(argv?: string[]): Promise<this>;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* What the command is an alias for.
|
|
161
|
+
*/
|
|
162
|
+
export declare interface CommandAlias<T extends Input = Input> {
|
|
163
|
+
/**
|
|
164
|
+
* A pointer to the command.
|
|
165
|
+
*/
|
|
166
|
+
command: Command<T>;
|
|
167
|
+
/**
|
|
168
|
+
* The name of the command this is an alias for.
|
|
169
|
+
*/
|
|
170
|
+
alias?: string;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Command error handler.
|
|
175
|
+
*/
|
|
176
|
+
export declare type ErrorFn<T extends Input> = (command: Command<T>, errors: Error[], input: Partial<InferInput<T>>) => void | Promise<void>;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Infers a TypeScript type from an option or positional.
|
|
180
|
+
*/
|
|
181
|
+
declare type InferEntry<T> = T extends {
|
|
182
|
+
$kind: infer TKind extends Kind;
|
|
183
|
+
$required: infer Required;
|
|
184
|
+
$list: infer List;
|
|
185
|
+
} ? List extends true ? Required extends true ? TypeOf<TKind>[] : TypeOf<TKind>[] | undefined : Required extends true ? TypeOf<TKind> : TypeOf<TKind> | undefined : never;
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Infers TypeScript types from an input object.
|
|
189
|
+
*/
|
|
190
|
+
declare type InferInput<T extends Input> = {
|
|
191
|
+
[K in keyof T]: InferEntry<T[K]>;
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* An input object.
|
|
196
|
+
*/
|
|
197
|
+
declare interface Input {
|
|
198
|
+
[x: string]: Option_2<any, any, any> | Positional<any, any, any>;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* An input type.
|
|
203
|
+
*/
|
|
204
|
+
declare type Kind = BasicKind | StandardSchemaV1<any, any>;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* A LunarCLI-related error. These are usually handled by default.
|
|
208
|
+
*/
|
|
209
|
+
declare class LunarCLIError extends Error {
|
|
210
|
+
/**
|
|
211
|
+
* The command this error happened on.
|
|
212
|
+
*/
|
|
213
|
+
command: Command<any>;
|
|
214
|
+
/**
|
|
215
|
+
* Creates a new LunarCLI error.
|
|
216
|
+
* @param message The message.
|
|
217
|
+
* @param command The command.
|
|
218
|
+
*/
|
|
219
|
+
constructor(message: string, command: Command<any>);
|
|
220
|
+
/**
|
|
221
|
+
* Prints the error's message.
|
|
222
|
+
*/
|
|
223
|
+
print(): void;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* An option.
|
|
228
|
+
*/
|
|
229
|
+
declare class Option_2<TKind extends Kind, TRequired extends boolean = true, TList extends boolean = false> {
|
|
230
|
+
/**
|
|
231
|
+
* The kind of this option.
|
|
232
|
+
*/
|
|
233
|
+
$kind: TKind;
|
|
234
|
+
/**
|
|
235
|
+
* The aliases of this option.
|
|
236
|
+
*/
|
|
237
|
+
$names: string[];
|
|
238
|
+
/**
|
|
239
|
+
* The description of this option.
|
|
240
|
+
*/
|
|
241
|
+
$description: string | undefined;
|
|
242
|
+
/**
|
|
243
|
+
* The default value of this option.
|
|
244
|
+
*/
|
|
245
|
+
$default: TypeOf<TKind> | undefined;
|
|
246
|
+
/**
|
|
247
|
+
* If this option is required.
|
|
248
|
+
*/
|
|
249
|
+
$required: TRequired;
|
|
250
|
+
/**
|
|
251
|
+
* If this option is a list.
|
|
252
|
+
*/
|
|
253
|
+
$list: TList;
|
|
254
|
+
/**
|
|
255
|
+
* Creates a new option.
|
|
256
|
+
* @param kind The type of this option.
|
|
257
|
+
* @param names The names of this option.
|
|
258
|
+
*/
|
|
259
|
+
constructor(kind: TKind, names: string[]);
|
|
260
|
+
/**
|
|
261
|
+
* Makes this option a list.
|
|
262
|
+
* @returns this
|
|
263
|
+
*/
|
|
264
|
+
list(): Option_2<TKind, TRequired, true>;
|
|
265
|
+
/**
|
|
266
|
+
* Makes this option required.
|
|
267
|
+
* @returns this
|
|
268
|
+
*/
|
|
269
|
+
required(): Option_2<TKind, true, TList>;
|
|
270
|
+
/**
|
|
271
|
+
* Makes this option optional.
|
|
272
|
+
* @returns this
|
|
273
|
+
*/
|
|
274
|
+
optional(): Option_2<TKind, false, TList>;
|
|
275
|
+
/**
|
|
276
|
+
* Sets a default value.
|
|
277
|
+
* @param value The default value.
|
|
278
|
+
* @returns this
|
|
279
|
+
*/
|
|
280
|
+
default(value: TypeOf<TKind>): this;
|
|
281
|
+
/**
|
|
282
|
+
* Sets a description.
|
|
283
|
+
* @param desc The description.
|
|
284
|
+
* @returns this
|
|
285
|
+
*/
|
|
286
|
+
description(desc: string): this;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* The result of the `Command.parse` function.
|
|
291
|
+
*/
|
|
292
|
+
export declare interface ParseResult<T extends Input> {
|
|
293
|
+
/**
|
|
294
|
+
* A pointer to the command to run.
|
|
295
|
+
*/
|
|
296
|
+
command: Command<T>;
|
|
297
|
+
/**
|
|
298
|
+
* The input to pass into the command.
|
|
299
|
+
*/
|
|
300
|
+
input: InferInput<T>;
|
|
301
|
+
/**
|
|
302
|
+
* Errors collected during parsing.
|
|
303
|
+
*/
|
|
304
|
+
errors: LunarCLIError[];
|
|
305
|
+
/**
|
|
306
|
+
* If this should result in displaying the version of the command.
|
|
307
|
+
*/
|
|
308
|
+
isVersion: boolean;
|
|
309
|
+
/**
|
|
310
|
+
* If this should result in displaying a help screen.
|
|
311
|
+
*/
|
|
312
|
+
isHelp: boolean;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* A positional argument.
|
|
317
|
+
*/
|
|
318
|
+
declare class Positional<TKind extends Kind, TRequired extends boolean = true, TList extends boolean = false> {
|
|
319
|
+
/**
|
|
320
|
+
* The type of this argument.
|
|
321
|
+
*/
|
|
322
|
+
$kind: TKind;
|
|
323
|
+
/**
|
|
324
|
+
* The default value of this argument.
|
|
325
|
+
*/
|
|
326
|
+
$default: TypeOf<TKind> | undefined;
|
|
327
|
+
/**
|
|
328
|
+
* The description of this argument.
|
|
329
|
+
*/
|
|
330
|
+
$description: string | undefined;
|
|
331
|
+
/**
|
|
332
|
+
* If this argument is required.
|
|
333
|
+
*/
|
|
334
|
+
$required: TRequired;
|
|
335
|
+
/**
|
|
336
|
+
* If this argument is a list.
|
|
337
|
+
*/
|
|
338
|
+
$list: TList;
|
|
339
|
+
/**
|
|
340
|
+
* Creates a new positional argument.
|
|
341
|
+
* @param kind The positional argument.
|
|
342
|
+
*/
|
|
343
|
+
constructor(kind: TKind);
|
|
344
|
+
/**
|
|
345
|
+
* Makes this argument a list.
|
|
346
|
+
* @returns this
|
|
347
|
+
*/
|
|
348
|
+
list(): Positional<TKind, TRequired, true>;
|
|
349
|
+
/**
|
|
350
|
+
* Makes this argument required.
|
|
351
|
+
* @returns this
|
|
352
|
+
*/
|
|
353
|
+
required(): Positional<TKind, true, TList>;
|
|
354
|
+
/**
|
|
355
|
+
* Makes this argument optional.
|
|
356
|
+
* @returns this
|
|
357
|
+
*/
|
|
358
|
+
optional(): Positional<TKind, false, TList>;
|
|
359
|
+
/**
|
|
360
|
+
* Sets a default value.
|
|
361
|
+
* @param value The default value.
|
|
362
|
+
* @returns this
|
|
363
|
+
*/
|
|
364
|
+
default(value: TypeOf<TKind>): this;
|
|
365
|
+
/**
|
|
366
|
+
* Sets a description.
|
|
367
|
+
* @param desc The description.
|
|
368
|
+
* @returns this
|
|
369
|
+
*/
|
|
370
|
+
description(desc: string): this;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/** The Standard Schema interface. */
|
|
374
|
+
declare interface StandardSchemaV1<Input = unknown, Output = Input> {
|
|
375
|
+
/** The Standard Schema properties. */
|
|
376
|
+
readonly "~standard": StandardSchemaV1.Props<Input, Output>;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
declare namespace StandardSchemaV1 {
|
|
380
|
+
/** The Standard Schema properties interface. */
|
|
381
|
+
interface Props<Input = unknown, Output = Input> {
|
|
382
|
+
/** The version number of the standard. */
|
|
383
|
+
readonly version: 1;
|
|
384
|
+
/** The vendor name of the schema library. */
|
|
385
|
+
readonly vendor: string;
|
|
386
|
+
/** Validates unknown input values. */
|
|
387
|
+
readonly validate: (value: unknown) => Result<Output> | Promise<Result<Output>>;
|
|
388
|
+
/** Inferred types associated with the schema. */
|
|
389
|
+
readonly types?: Types<Input, Output> | undefined;
|
|
390
|
+
}
|
|
391
|
+
/** The result interface of the validate function. */
|
|
392
|
+
type Result<Output> = SuccessResult<Output> | FailureResult;
|
|
393
|
+
/** The result interface if validation succeeds. */
|
|
394
|
+
interface SuccessResult<Output> {
|
|
395
|
+
/** The typed output value. */
|
|
396
|
+
readonly value: Output;
|
|
397
|
+
/** The non-existent issues. */
|
|
398
|
+
readonly issues?: undefined;
|
|
399
|
+
}
|
|
400
|
+
/** The result interface if validation fails. */
|
|
401
|
+
interface FailureResult {
|
|
402
|
+
/** The issues of failed validation. */
|
|
403
|
+
readonly issues: ReadonlyArray<Issue>;
|
|
404
|
+
}
|
|
405
|
+
/** The issue interface of the failure output. */
|
|
406
|
+
interface Issue {
|
|
407
|
+
/** The error message of the issue. */
|
|
408
|
+
readonly message: string;
|
|
409
|
+
/** The path of the issue, if any. */
|
|
410
|
+
readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
|
|
411
|
+
}
|
|
412
|
+
/** The path segment interface of the issue. */
|
|
413
|
+
interface PathSegment {
|
|
414
|
+
/** The key representing a path segment. */
|
|
415
|
+
readonly key: PropertyKey;
|
|
416
|
+
}
|
|
417
|
+
/** The Standard Schema types interface. */
|
|
418
|
+
interface Types<Input = unknown, Output = Input> {
|
|
419
|
+
/** The input type of the schema. */
|
|
420
|
+
readonly input: Input;
|
|
421
|
+
/** The output type of the schema. */
|
|
422
|
+
readonly output: Output;
|
|
423
|
+
}
|
|
424
|
+
/** Infers the input type of a Standard Schema. */
|
|
425
|
+
type InferInput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["input"];
|
|
426
|
+
/** Infers the output type of a Standard Schema. */
|
|
427
|
+
type InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["output"];
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* A theme.
|
|
432
|
+
*/
|
|
433
|
+
declare interface Theme {
|
|
434
|
+
/**
|
|
435
|
+
* Wraps a string in a background ANSI code.
|
|
436
|
+
* @param a The string to wrap.
|
|
437
|
+
*/
|
|
438
|
+
background?(a: string): string;
|
|
439
|
+
/**
|
|
440
|
+
* Wraps a string in a foreground ANSI code.
|
|
441
|
+
* @param a The string to wrap.
|
|
442
|
+
*/
|
|
443
|
+
foreground?(a: string): string;
|
|
444
|
+
/**
|
|
445
|
+
* Wraps a string in a primary ANSI code.
|
|
446
|
+
* @param a The string to wrap.
|
|
447
|
+
*/
|
|
448
|
+
primary(a: string): string;
|
|
449
|
+
/**
|
|
450
|
+
* Wraps a string in a secondary ANSI code.
|
|
451
|
+
* @param a The string to wrap.
|
|
452
|
+
*/
|
|
453
|
+
secondary(a: string): string;
|
|
454
|
+
/**
|
|
455
|
+
* Wraps a string in a accent ANSI code.
|
|
456
|
+
* @param a The string to wrap.
|
|
457
|
+
*/
|
|
458
|
+
accent?(a: string): string;
|
|
459
|
+
/**
|
|
460
|
+
* Wraps a string in a success ANSI code.
|
|
461
|
+
* @param a The string to wrap.
|
|
462
|
+
*/
|
|
463
|
+
success(a: string): string;
|
|
464
|
+
/**
|
|
465
|
+
* Wraps a string in a warning ANSI code.
|
|
466
|
+
* @param a The string to wrap.
|
|
467
|
+
*/
|
|
468
|
+
warning(a: string): string;
|
|
469
|
+
/**
|
|
470
|
+
* Wraps a string in a error ANSI code.
|
|
471
|
+
* @param a The string to wrap.
|
|
472
|
+
*/
|
|
473
|
+
error(a: string): string;
|
|
474
|
+
/**
|
|
475
|
+
* Wraps a string in a info ANSI code.
|
|
476
|
+
* @param a The string to wrap.
|
|
477
|
+
*/
|
|
478
|
+
info?(a: string): string;
|
|
479
|
+
/**
|
|
480
|
+
* Set of symbols for logging.
|
|
481
|
+
*/
|
|
482
|
+
symbols?: {
|
|
483
|
+
/**
|
|
484
|
+
* Success message symbol.
|
|
485
|
+
*/
|
|
486
|
+
success: string;
|
|
487
|
+
/**
|
|
488
|
+
* Error message symbol.
|
|
489
|
+
*/
|
|
490
|
+
error: string;
|
|
491
|
+
/**
|
|
492
|
+
* Warning message symbol.
|
|
493
|
+
*/
|
|
494
|
+
warning: string;
|
|
495
|
+
/**
|
|
496
|
+
* Information message symbol.
|
|
497
|
+
*/
|
|
498
|
+
info?: string;
|
|
499
|
+
};
|
|
500
|
+
/**
|
|
501
|
+
* Optional styles.
|
|
502
|
+
*/
|
|
503
|
+
styles?: {
|
|
504
|
+
/**
|
|
505
|
+
* Wraps a string in a bold ANSI code.
|
|
506
|
+
* @param a The string to wrap.
|
|
507
|
+
*/
|
|
508
|
+
bold?(a: string): string;
|
|
509
|
+
/**
|
|
510
|
+
* Wraps a string in an italic ANSI code.
|
|
511
|
+
* @param a The string to wrap.
|
|
512
|
+
*/
|
|
513
|
+
italic?(a: string): string;
|
|
514
|
+
/**
|
|
515
|
+
* Wraps a string in an underline ANSI code.
|
|
516
|
+
* @param a The string to wrap.
|
|
517
|
+
*/
|
|
518
|
+
underline?(a: string): string;
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
/**
|
|
523
|
+
* Converts a Kind to a TypeScript type.
|
|
524
|
+
*/
|
|
525
|
+
declare 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;
|
|
526
|
+
|
|
527
|
+
export { }
|