Skip to content

gunshi / default / RendererDecorator

Type Alias: RendererDecorator()<T, G>

ts
type RendererDecorator<T, G> = (baseRenderer, ctx) => Promise<T>;

Renderer decorator type.

A function that wraps a base renderer to add or modify its behavior.

Type Parameters

Type ParameterDefault typeDescription
T-The type of the rendered result.
G extends GunshiParamsConstraintDefaultGunshiParamsA type extending GunshiParams to specify the shape of command context.

Parameters

ParameterTypeDescription
baseRenderer(ctx) => Promise<T>The base renderer function to decorate
ctxReadonly<CommandContext<G>>The command context

Returns

Promise<T>

The decorated result

Since

v0.27.0

Released under the MIT License.