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