Is it possible to create a type which contains all possible keys in the discriminated union (instead of just shared keys)?
If I have a discriminated union, such as:
type Form =
| { name?: string }
| { name?: string; query: string };
type Keys = keyof Form;
Currently Keys here resolves to "name", as that is the only shared key, however I'd like it to resolve to "name" | "query" (being the superset of all possible keys).