Generic type variables

The `TypeErrors` object generic type variables

TypeErrors<Id>

​A generic type variable constrained by the stringarrow-up-right, by default of the value captured from the provided rest parameterarrow-up-right id indicates the identification type of a new TypeErrors instance.

type-errors.class.ts
class TypeErrors<
  Id extends string // <--- Declare generic type variable Id.
> extends CommonErrors<Id> {
  constructor(
    ...id: Id[] // <--- Capture generic type variable Id.
  ) {
    super(...id);
  }
}

Last updated