February 2019
Beginner
694 pages
18h 4m
English
As we have seen, TypeScript has the ability to annotate JavaScript, and bring strong typing to the JavaScript development experience. But how do we strongly type existing JavaScript libraries? The answer is surprisingly simple: by creating a definition file. TypeScript uses files with a .d.ts extension as a sort of header file, similar to languages such as C++, in order to superimpose strong typing on existing JavaScript libraries. These definition files hold information that describes each available function and or variables, along with their associated type annotations.
Let's have a quick look at what a definition would look like. As an example, consider a function from the popular Jasmine ...
Read now
Unlock full access