I am trying to understand how to "un-index".
Given:
type Example = {
sayHi: {
name: string;
} | {
sayHi: string;
};
cure: {
bool: boolean;
} | {
cure: string;
};
}
How do I get:
({name: string; } | { sayHi: string; }) & ({bool: boolean } | { cure: string })
I've tried but it flattens everything to a union.
type Example2 = Example[keyof Example]