Definition Files and Global Definition Files
In this lesson, you see what a global definition file is.
TypeScript works seamlessly with JavaScript code because of the concept of definition files. Definition files contain the type of each public function or variable that an external module not written in Typescript offers. The most popular definition file is probably lib.d.ts, which contains thousands of lines of definitions about the core functionalities of JavaScript. It comes with TypeScript, and you shouldn’t have to care about much else that it provides, except for Intellisense, because it contains the types of the ECMAScript core language functions and variables; for example, the definition of the function parseFloat
.
Get hands-on with 1400+ tech skills courses.