a common misconception is that TypeScript[TS] will provide runtime safety; it won't unless you specifically add functions for it, like the type casts presented in the article.
The typecast approach presented in the article can be combined with TS to provide runtime type safety; They are not entirely opposite/alternative approaches but complementary.
There's a library called runtypes (https://github.com/pelotom/runtypes) that integrates TS and Typecasting quite nicely