Chapter 7. Using TypeScript and JavaScript in the same project
This chapter covers
- Enjoying TypeScript’s benefits when working with a JavaScript library
- The role of type definition files
- Upgrading an existing JavaScript app to TypeScript
In this chapter, we’ll show how you can benefit from TypeScript features such as getting compilation errors and autocomplete even while using third-party libraries written in JavaScript. We’ll start by explaining the role of type definition files, and then we’ll discuss a concrete use case where an app written in TypeScript uses a JavaScript library. Finally, we’ll discuss the things you should consider before implementing a gradual upgrade of your app from JavaScript to TypeScript.
7.1. Type definition ...
Get TypeScript Quickly now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.