Generic type variables
The `ValidationError` object generic type variables
ValidationError<Id>
ValidationError<Id>A generic type variable constrained by the string, by default of the value captured from the provided id indicates the identification type of a new ValidationError instance.
class ValidationError<
Id extends string // <--- Declare generic type variable Id.
> extends Error {
...
constructor(
problem: string,
fix: string,
id?: Id, // <--- Capture generic type variable Id.
template = ValidationError.template
) { ... }
...
}Last updated
Was this helpful?