6 advanced TypeScript tricks

TypeScript's type system can play DOOM. Surely we can make it do something useful for our projects too, right?