Ask Learn
Preview
Please sign in to use this experience.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
- To install TypeScript declarations files, at the beginning you had to install DefinitelyTyped packages using NuGet
- Then the node tool TSD followed and after that came Typings
- The next step in the evolution of type acquisition is @types
- @types only requires npm to be managed
- In enterprise environments, this means one tool less to manage and one proxy setting less to worry about (Typings doesn't use node proxy settings)
- Currently, as of 2016-09-23, the official Angular 2 tutorials use a Typings file to install the declaration files
- To use @types instead:
1. Make sure TypeScript 2 is installed in Visual Studio (if you are using it)
2. Make sure you are using "typescript": "^2.0.3"
(or newer) in the package.json file
3. Remove "typings"
from "devDependencies"
in the package.json file
4. Add the following to "devDependencies"
:
4a. "@types/core-js": "*"
4b. "@types/node": "*"
4c. If you want to run Jasmine tests, add: "@types/jasmine": "*"
5. Delete the "typings.json" file and "typings" folder
6. Run npm install
- Links:
NPMJS search Type search List of packages and versions
Note: You can also use the @types with specific version numbers, such as "@types/node": "^6.0.42"
. I only used "*" above for the sake of brevity.
Please sign in to use this experience.
Sign in