TypeScript · Junior · Question 33 of 75
What is a .d.ts file?
- ✓Correct answer: A declaration file: it describes the types of existing JS code without implementation
- 2Compiled TypeScript for debugging in the browser via source maps
- 3A file with type tests run by
tsc --test
Explanation
Declarations let you use JS libraries with types. They're written by hand, generated by the compiler (declaration: true) or installed from DefinitelyTyped. A .d.ts file contains no executable code.