Skip to content

Type Alias: PluginExtension<T, G>

Plugin extension

Since

v0.27.0

Signature

ts
export type PluginExtension<
  T = Record<string, unknown>,
  G extends GunshiParams = DefaultGunshiParams
> = (ctx: CommandContextCore<G>, cmd: Command<G>) => Awaitable<T>

Type Parameters

NameDescription
T = Record<string, unknown>The type of the extension object returned by the plugin extension function.
G extends GunshiParams = DefaultGunshiParamsA type extending GunshiParams to specify the shape of CommandContextCore.

Parameters

NameTypeDescription
ctxCommandContextCore<G>The command context core
cmdCommand<G>The command to which the plugin is being applied

Returns

Awaitable<T> — An object of type T that represents the extension provided by the plugin

Released under the MIT License.