Open
Description
Currently now when you have an interface or type that use an union, is really hard to access to the desired property.
In the example below you could see how is not possible to access to a specific property from an union (at least you force the type). However defining generics in the root object and make programmers define the expected union is more much friendly programming experience.
The generation process could be something like:
- Check for Unions in the object, generate as many generic as unions in the root object and start from A to Z.
- Generate each type of an union separately.
- Do conditional type until check all types in the union.
Follow the same process with Unions that have nested Unions.
You could find a full example here: https://gist.github.com/j0nl1/22dde0ef0bfaf1c0bea870a0a39e039e
Metadata
Metadata
Assignees
Labels
No labels