gunshi / default / CommandDecorator
Type Alias: CommandDecorator()<G>
ts
type CommandDecorator<G> = (baseRunner) => (ctx) => Awaitable<void | string>;
Command decorator. A function that wraps a command runner to add or modify its behavior.
Type Parameters
Type Parameter | Default type |
---|---|
G extends GunshiParams <any > | DefaultGunshiParams |
Parameters
Parameter | Type | Description |
---|---|---|
baseRunner | (ctx ) => Awaitable <void | string > | The base command runner to decorate |
Returns
The decorated command runner
ts
(ctx): Awaitable<void | string>;
Parameters
Parameter | Type |
---|---|
ctx | Readonly <CommandContext <G >> |
Returns
Awaitable
<void
| string
>