Type Alias: RendererDecorator<T, G>
Renderer decorator type.
A function that wraps a base renderer to add or modify its behavior.
Since
v0.27.0
Signature
ts
export type RendererDecorator<T, G extends GunshiParamsConstraint = DefaultGunshiParams> = (baseRenderer: (ctx: Readonly<CommandContext<G>>) => Promise<T>, ctx: Readonly<CommandContext<G>>) => Promise<T>Type Parameters
| Name | Description |
|---|---|
T | The type of the rendered result. |
G extends GunshiParamsConstraint = DefaultGunshiParams | A type extending GunshiParams to specify the shape of command context. |
Parameters
| Name | Type | Description |
|---|---|---|
baseRenderer | (ctx: Readonly<CommandContext<G>>) => Promise<T> | The base renderer function to decorate |
ctx | Readonly<CommandContext<G>> | The command context |
Returns
Promise<T> — The decorated result
