Generic type variables
The `Error` object generic type variables
Error<
Id
>
Error<
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 Error
instance.
class Error<
Id extends string // <--- Declare generic type variable Id.
> extends CommonError<Id> {
...
constructor(
problem: string,
fix: string,
id?: Id, // <--- Capture generic type variable Id.
template = Error.template
) { ... }
...
}
Last updated
Was this helpful?