Type Alias: CommandDecorator<G>
Command decorator.
A function that wraps a command runner to add or modify its behavior.
Since
v0.27.0
Signature
ts
export type CommandDecorator<G extends GunshiParamsConstraint = DefaultGunshiParams> = (baseRunner: (ctx: Readonly<CommandContext<G>>) => Awaitable<string | void>) => (ctx: Readonly<CommandContext<G>>) => Awaitable<string | void>Type Parameters
| Name | Description |
|---|---|
G extends GunshiParamsConstraint = DefaultGunshiParams | A type extending GunshiParams to specify the shape of command context. |
Parameters
| Name | Type | Description |
|---|---|---|
baseRunner | (ctx: Readonly<CommandContext<G>>) => Awaitable<string | void> | The base command runner to decorate |
Returns
(ctx: Readonly<CommandContext<G>>) => Awaitable<string | void> — The decorated command runner
