/** Return the length of an array. Equivalent to `T['length']` where `T` extends any array. Tuples resolve to numeric literals, while non-tuples resolve to the `number` type. @example ``` import type {ArrayLength} from 'type-fest'; type TupleLength = ArrayLength<[1, 2, 3]>; //=> 3 type TupleWithOptionalMembersLength = ArrayLength<[1, 2, number?]>; //=> 2 | 3 type NonTupleArrayLength = ArrayLength; //=> number type TupleWithRestElementLength = ArrayLength<[1, 2, ...string[]]>; //=> number // Distinguish between arrays with fixed and non-fixed lengths type IsFixedLengthArray = number extends ArrayLength ? false : true; type A = IsFixedLengthArray; //=> false type B = IsFixedLengthArray<[1, 2, 3]>; //=> true ``` @category Array */ export type ArrayLength = T['length']; export {};