my-swiss-knife: - v1.9.9
    Preparing search index...

    Type Alias UnionFromArray<T>

    UnionFromArray: T[number]

    Extracts a union type from a tuple or readonly array.

    For example: UnionFromArray<['a', 'b', 'c']> -> 'a' | 'b' | 'c'

    Type Parameters

    • T extends readonly any[]

      A readonly array or tuple of values

    A union of the array's element types

    export type UnionFromArray<T extends readonly any[]> = T[number];