Installing typings will give you access to d3 types so you can utilize typescript types. See commit for what was added at this step.
For a more indepth details about typings, visit their repo. Typings Documentation
In order to use typings in your project, you must first install typings to your computer. This is a one time installation.
// install typings globally
npm install typings -g
To have types for a specific library, run the following command.
- save - Persists the types within this project.
- global - Tells typings that we want this dependency to be globally available.
// install d3 typings
typings install --save --global dt~d3
You should now have a typings directory in your visual project.
Open your tsconfig.json
file and add your index.d.ts
to your list of files
Now you should be able to use types within your code.