43

In some cases typings is used for handling TypeScript definitions (e.g. angular/angular2-seed).

In other cases scoped NPM @types packages are used with no typings involved (e.g. AngularClass/angular2-webpack-starter).

What are the practical differences between them? Does one of them offer benefits for TypeScript development that the other doesn't?

Estus Flask
  • 206,104
  • 70
  • 425
  • 565

1 Answers1

62

@types is the new way to install the definitions in typescript 2.0. It unifies the management of definitions and packages. So that you do not need multiple tools and config files. Only going to need npm and package.json instead of having to have npm, package.json, typings, typings.json. It basically makes installing and managing definitions easier but it is the same as typings.

You can read more about it here: https://blogs.msdn.microsoft.com/typescript/2016/06/15/the-future-of-declaration-files/

ordepim
  • 806
  • 7
  • 9
  • Great answer! I have another question: Ap per DefinitelyTyped, if want to use type declaration then should put a line `/// ` in the front of file so that we can import it. But from the msdn blog, no need this reference line any more. So do we really need this line for using the type declaration? – zgcharley Dec 22 '16 at 17:38
  • @zgcharley Not in 2.x. DefinitelyTyped [says nothing like that](https://github.com/DefinitelyTyped/DefinitelyTyped#npm).TS is Microsoft's brainchild, they know what they talk about. – Estus Flask Dec 23 '16 at 11:03