StringOfLength

StringOfLength<Min, Max, Type>

A stringarrow-up-right type or an instance of Stringarrow-up-right of length between a specified range takes generic type variable Min and Max constrained by numberarrow-up-right type as length, and takes generic type variable Type constrained by generic type AnyString as the type.

string-of-length.type.ts
type StringOfLength<
  Min extends number,
  Max extends number,
  Type extends AnyString = string
> = Type & MinMax<Min, Max>;

Generic type variables

Minextendsnumber

A generic type variable Min constrained by the numberarrow-up-right type indicates the minimum length of the generic type variable Type.

Maxextendsnumber

A generic type variable Max constrained by the numberarrow-up-right type indicates the maximum length of the generic type variable Type.

TypeextendsAnyString=string

A generic type variable Type constrained by generic type AnyString indicates stringarrow-up-right type.

Last updated