Generic type variables

The `Errors` generic type variables

Errors<Id>

Idextendsstring

​A generic type variable constrained by the string, by default of the value captured from the provided rest parameter id indicates the identification type of a new Errors instance.

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

Last updated