How can I "debug" complex TypeScript types?

Viewed 50

When creating complex types in TypeScript (e.g. recursive types, inferences, etc.) it's really hard to follow what TypeScript is doing inside it's Blackbox.

Too often I find myself having to do something like the following just to understand what happend:

Code example

I would like to be able to "debug" what TypeScript is doing and follow its logical path while it is evaluating my types, without substituting my code or commenting-out parts. It's like setting a breakpoint, but not at runtime...

Is there any course of action, or any tool, I could adopt to facilitate the creation of my types?

Thanks in advance, Shy Agam.

0 Answers
Related