I'm wondering if there exists or someone could produce a formal specification of the TypeScript type system. It would be interesting to try different modifications of the system on paper before trying to tackle making extensions to the compiler. For example the Scala/Dotty type system is summarized here
The 1.8 version of the spec can be found at https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md
There isn't currently a formal specification for changes/features added after that, though many of them have fairly intuitive definitions. Each PR that introduced major features typically has a near-spec level of detail, so you can track those down for more information if needed.
I think the closest thing in the literature is this OOPLSA paper https://dl.acm.org/citation.cfm?id=3152284.3133872
This issue has been marked as 'Question' and has seen no recent activity. It has been automatically closed for house-keeping purposes. If you're still waiting on a response, questions are usually better suited to stackoverflow.