O'Reilly logo

Mastering TypeScript by Nathan Rozentals

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Writing and Using Declaration Files

One of the most appealing facets of JavaScript development is the myriad of external JavaScript libraries that have already been published, such as jQuery, Knockout, and Underscore. The TypeScript designers knew that introducing "syntactic sugar" to the TypeScript language would bring a range of benefits to the developer experience. These benefits include IDE features such as Intellisense, as well as detailed compile time error messages. We have already seen how to use this syntax for most of the TypeScript language features such as classes, interfaces, and generics, but how do we apply this "sugar" to existing JavaScript libraries? The answer is relatively simple—declaration files.

A declaration file ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required