Generic type variables

The `RangeError` object generic type variables

RangeError<Id,Min,Max>

​A generic type variable constrained by the stringarrow-up-right, by default of the value captured from the provided id indicates the identification type of a new RangeError 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>

​A generic type variable constrained by the numberarrow-up-right and undefinedarrow-up-right, by default of the value captured from the provided min indicates the minimum range type of a new RangeError instance.

RangeError<Id,Min,Max>

​A generic type variable constrained by the numberarrow-up-right and undefinedarrow-up-right by default of the value captured from the provided max indicates the maximum range type of a new RangeError instance.

Last updated