@gunshi/definition 0.27.0-alpha.7 → 0.27.0-alpha.9
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/lib/index.d.ts +33 -1
- package/package.json +4 -4
package/lib/index.d.ts
CHANGED
|
@@ -443,6 +443,33 @@ interface CommandContext<G extends GunshiParamsConstraint = DefaultGunshiParams>
|
|
|
443
443
|
* @since v0.27.0
|
|
444
444
|
*/
|
|
445
445
|
|
|
446
|
+
/**
|
|
447
|
+
* Rendering control options
|
|
448
|
+
* @since v0.27.0
|
|
449
|
+
*/
|
|
450
|
+
interface RenderingOptions<G extends GunshiParamsConstraint = DefaultGunshiParams> {
|
|
451
|
+
/**
|
|
452
|
+
* Header rendering configuration
|
|
453
|
+
* - `null`: Disable rendering
|
|
454
|
+
* - `function`: Use custom renderer
|
|
455
|
+
* - `undefined` (when omitted): Use default renderer
|
|
456
|
+
*/
|
|
457
|
+
header?: ((ctx: Readonly<CommandContext<G>>) => Promise<string>) | null;
|
|
458
|
+
/**
|
|
459
|
+
* Usage rendering configuration
|
|
460
|
+
* - `null`: Disable rendering
|
|
461
|
+
* - `function`: Use custom renderer
|
|
462
|
+
* - `undefined` (when omitted): Use default renderer
|
|
463
|
+
*/
|
|
464
|
+
usage?: ((ctx: Readonly<CommandContext<G>>) => Promise<string>) | null;
|
|
465
|
+
/**
|
|
466
|
+
* Validation errors rendering configuration
|
|
467
|
+
* - `null`: Disable rendering
|
|
468
|
+
* - `function`: Use custom renderer
|
|
469
|
+
* - `undefined` (when omitted): Use default renderer
|
|
470
|
+
*/
|
|
471
|
+
validationErrors?: ((ctx: Readonly<CommandContext<G>>, error: AggregateError) => Promise<string>) | null;
|
|
472
|
+
}
|
|
446
473
|
/**
|
|
447
474
|
* Command interface.
|
|
448
475
|
*/
|
|
@@ -489,6 +516,11 @@ interface Command<G extends GunshiParamsConstraint = DefaultGunshiParams> {
|
|
|
489
516
|
* @since v0.27.0
|
|
490
517
|
*/
|
|
491
518
|
entry?: boolean;
|
|
519
|
+
/**
|
|
520
|
+
* Rendering control options
|
|
521
|
+
* @since v0.27.0
|
|
522
|
+
*/
|
|
523
|
+
rendering?: RenderingOptions<G>;
|
|
492
524
|
}
|
|
493
525
|
/**
|
|
494
526
|
* Lazy command interface.
|
|
@@ -633,4 +665,4 @@ declare function lazy<G extends GunshiParamsConstraint = DefaultGunshiParams>(lo
|
|
|
633
665
|
*/
|
|
634
666
|
declare function lazy<G extends GunshiParamsConstraint = DefaultGunshiParams>(loader: CommandLoader<G>, definition: Command<G>): LazyCommand<G>;
|
|
635
667
|
//#endregion
|
|
636
|
-
export { ArgSchema, ArgValues, Args, Command, CommandLoader, CommandRunner, DefaultGunshiParams, ExtendContext, GunshiParams, LazyCommand, define, lazy };
|
|
668
|
+
export { type ArgSchema, type ArgValues, type Args, type Command, type CommandLoader, type CommandRunner, type DefaultGunshiParams, type ExtendContext, type GunshiParams, type LazyCommand, define, lazy };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gunshi/definition",
|
|
3
3
|
"description": "utilities for gunshi command definition",
|
|
4
|
-
"version": "0.27.0-alpha.
|
|
4
|
+
"version": "0.27.0-alpha.9",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "kazuya kawaguchi",
|
|
7
7
|
"email": "kawakazu80@gmail.com"
|
|
@@ -52,12 +52,12 @@
|
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"deno": "^2.4.
|
|
55
|
+
"deno": "^2.4.2",
|
|
56
56
|
"jsr": "^0.13.5",
|
|
57
57
|
"jsr-exports-lint": "^0.4.1",
|
|
58
58
|
"publint": "^0.3.12",
|
|
59
|
-
"tsdown": "^0.
|
|
60
|
-
"gunshi": "0.27.0-alpha.
|
|
59
|
+
"tsdown": "^0.13.0",
|
|
60
|
+
"gunshi": "0.27.0-alpha.9"
|
|
61
61
|
},
|
|
62
62
|
"scripts": {
|
|
63
63
|
"build": "tsdown",
|