devtypes - v2.0.0
    Preparing search index...

    Type Alias UnionKeys<U>

    UnionKeys: U extends any ? keyof U : never

    Extract all keys from a union of object types.

    Type Parameters

    • U

      Union of object types

    Produces the union of keys that appear in at least one member of the union.

    type U = { a: string } | { b: number };
    type K = UnionKeys< U >; // 'a' | 'b'