Merge a union of object types into a single object type.
Union of object types
All properties from all union members are combined. Properties not present in every member become optional.
This is a structural merge and may lose discriminant information.
type U = { a: string } | { b: number };type M = UnionMerge< U >;// { a?: string; b?: number } Copy
type U = { a: string } | { b: number };type M = UnionMerge< U >;// { a?: string; b?: number }
Merge a union of object types into a single object type.