I saw examples for angular 2 which use typings.json:
{
"globalDependencies": {
"core-js": "registry:dt/core-js#0.0.0+20160725163759",
"node": "registry:dt/node#6.0.0+20160831021119"
}
for installing necessary typescript files for certain packages.
Start from TypeScript 2.0 we can do it trough npm with '@types/...':
"devDependencies": {
"@types/es6-shim": "0.31.32",
"@types/node": "6.0.52"
}
From my perspective second approach is more clear.
1) Can someone explain it in more detail, how to use, what is the difference ?
2) People also use script in npm to install typings:":
"scripts": {
"postinstall": "typings install",
}
Is it necessary to use it for second approach if we put everything in npm packages, is "npm install" enough ?