Courses / TypeScript
11. Typing third-party libraries with @types
Installing and using @types packages and strategies when types are missing or incorrect.
JavaScript
Typing third-party libraries with @types
Installing and using @types gives your editor and TypeScript type-checker information about packages that otherwise lack types.
"I want autocomplete and safety for a library but it doesn't include types."
@types packages supply community-maintained TypeScript declarations for npm libraries; you install them when a package doesn't ship its own types or when its shipped types are missing/incorrect.
"I want autocomplete and safety for a library but it doesn't include types."
@types packages supply community-maintained TypeScript declarations for npm libraries; you install them when a package doesn't ship its own types or when its shipped types are missing/incorrect.