Interface: CommandContextExtension<E>
Command context extension
Since
v0.27.0
Signature
ts
export interface CommandContextExtension<
E extends GunshiParams['extensions'] = DefaultGunshiParams['extensions']
>Type Parameters
| Name | Description |
|---|---|
E extends GunshiParams['extensions'] = DefaultGunshiParams['extensions'] | A type extending GunshiParams.extensions to specify the shape of the extension. |
Properties
| Name | Type | Description |
|---|---|---|
factory (readonly) | (ctx: CommandContextCore, cmd: Command) => Awaitable<E> | Plugin extension factory |
key (readonly) | symbol | Plugin identifier |
onFactory (optional, readonly) | (ctx: Readonly<CommandContext>, cmd: Readonly<Command>) => Awaitable<void> | Plugin extension factory after hook |
factory Parameters
| Name | Type | Description |
|---|---|---|
ctx | CommandContextCore | |
cmd | Command |
factory Returns
Awaitable<E>
onFactory Parameters
| Name | Type | Description |
|---|---|---|
ctx | Readonly<CommandContext> | |
cmd | Readonly<Command> |
onFactory Returns
Awaitable<void>
