A generic type variable constrained by the , by default of the value captured from the provided indicates the type of a new instance.
range-error.class.ts
class RangeError<
Id extends string, // <--- Declare generic type variable Id.
Min extends number | undefined = undefined,
Max extends number | undefined = undefined
> extends CommonError<Id> {
...
constructor(
problem: string,
fix: string,
id?: Id, // <--- Capture generic type variable Id.
min?: Min,
max?: Max,
template = RangeError.template
) { ... }
...
}
RangeError<Id,Min,Max>
range-error.class.ts
class RangeError<
Id extends string,
Min extends number | undefined = undefined, // <--- Declare generic type variable Min.
Max extends number | undefined = undefined
> extends CommonError<Id> {
...
constructor(
problem: string,
fix: string,
id?: Id,
min?: Min, // <--- Capture generic type variable Min.
max?: Max,
template = RangeError.template
) { ... }
...
}
RangeError<Id,Min,Max>
range-error.class.ts
class RangeError<
Id extends string,
Min extends number | undefined = undefined,
Max extends number | undefined = undefined // <--- Declare generic type variable Max.
> extends CommonError<Id> {
...
constructor(
problem: string,
fix: string,
id?: Id,
min?: Min,
max?: Max, // <--- Capture generic type variable Max.
template = RangeError.template
) { ... }
...
}
Minextends|=
A generic type variable constrained by the and , by default of the value captured from the provided indicates the minimum range type of a new instance.
Maxextends|=
A generic type variable constrained by the and by default of the value captured from the provided indicates the maximum range type of a new instance.