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 | Description |
|---|---|---|
G extends GunshiParamsConstraint | DefaultGunshiParams | A type extending GunshiParams to specify the shape of command context. |
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
