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