Skip to content

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 ParameterDefault typeDescription
G extends GunshiParamsConstraintDefaultGunshiParamsA type extending GunshiParams to specify the shape of command context.

Parameters

ParameterTypeDescription
baseRunner(ctx) => Awaitable<string | void>The base command runner to decorate

Returns

The decorated command runner

(ctx) => Awaitable<string | void>

Since

v0.27.0

Released under the MIT License.