Creates a readonly array type that is guaranteed to have at least N elements of type Elm.
N
Elm
The minimum length of the array (must be a non-negative integer literal).
The type of elements in the array.
A readonly array type readonly [Elm, ..., Elm, ...Elm[]] with at least N elements.
readonly [Elm, ..., Elm, ...Elm[]]
type AtLeast3Strings = ArrayAtLeastLen<3, string>; // readonly [string, string, string, ...string[]]const valid: AtLeast3Strings = ["a", "b", "c"];const alsoValid: AtLeast3Strings = ["a", "b", "c", "d"];// const invalid: AtLeast3Strings = ["a", "b"]; // Error Copy
type AtLeast3Strings = ArrayAtLeastLen<3, string>; // readonly [string, string, string, ...string[]]const valid: AtLeast3Strings = ["a", "b", "c"];const alsoValid: AtLeast3Strings = ["a", "b", "c", "d"];// const invalid: AtLeast3Strings = ["a", "b"]; // Error
Creates a readonly array type that is guaranteed to have at least
Nelements of typeElm.