Collapses a union type into a single object type by merging all members.
Each property becomes:
This effectively removes the relationship between fields (i.e. "unbinds" discriminated unions), making all properties independent.
The target union type
type Result = Unbind< | { kind: "success"; data: string } | { kind: "error"; error: Error }>;// ^?// {// kind: "success" | "error";// data?: string;// error?: Error;// } Copy
type Result = Unbind< | { kind: "success"; data: string } | { kind: "error"; error: Error }>;// ^?// {// kind: "success" | "error";// data?: string;// error?: Error;// }
Collapses a union type into a single object type by merging all members.
Each property becomes:
This effectively removes the relationship between fields (i.e. "unbinds" discriminated unions), making all properties independent.