devtypes - v1.1.0
    Preparing search index...

    Type Alias ElementOf<T>

    ElementOf: T extends readonly (infer E)[] ? E : never

    Extract the element type from an array or tuple.

    Type Parameters

    • T

      Array or tuple type

    Resolves to the contained element type of readonly or mutable arrays. Returns never for non-array inputs.

    type Arr = number[];
    type Elem = ElementOf< Arr >; // number