What are the primary advantages of using TypeScript over vanilla JavaScript in a large-scale enterprise application?