Hi! I've got a code where I have defined class Opt<T> {...} and class Group<...> { ... }. Group contains other Groups and Opts. I also have a plain object that does not use these classes and I want to convert it to instances of these classes while preserving types.
I know that code is worth more than 1000 words, so here is the example - I want to write a function which transforms input to output. The body of the function does not matter, I have trouble with expressing the type signature. Is it somehow possible?
The Playground lets you write TypeScript or JavaScript online in a safe and sharable way.