The history of the TypeScript typing management ecosystem is quite expansive.
Initially, there existed a monolithic repository known as DefinitelyTyped, serving as a central hub for developers looking to contribute typings for various libraries.
From this repository emerged a typings manager named tsd
, which directly fetched typings from DefinitelyTyped and stored them locally in projects.
As the DT repository outgrew its scalability, discussions arose around its restructuring, particularly focusing on the format of d.ts.
files and the challenges of versioning libraries and the TypeScript compiler.
Subsequently, Blake Embrey introduced a new typings manager called typings
, which supported DefinitelyTyped and the proposed d.ts structure. This new approach catered to two module types - global and encapsulated.
Microsoft later announced TypeScript 2.0 Beta, acknowledging the necessity for revised typing file handling. This led to the introduction of the @types
npm scope, declared as the new standard for managing typings with TypeScript 2.0.
Declaration files (.d.ts files) play a vital role in using JavaScript libraries in TypeScript, and we recognized the need for simplification in obtaining them. With TypeScript 2.0, acquiring type declarations will be seamless with npm as the only required tool.
Therefore, to address your question:
If using TypeScript prior to version 2.0, stick with typings
; for version 2.0 and beyond, opt for @types