Jelani Hill Jelani Hill - 1 year ago 154
TypeScript Question

How do I include an unofficial typescript definition file in my project?

I'm trying to include a typings definition file that is not located on the definitelytyped github repo so I don't think I can install it using typings from my terminal. Does anyone know how I'm supposed to include this in my Angular 2 typescript project?

The definition file I'm trying to include is one for the paper.js library located here

Answer Source

Actually you can install it using typings directly from github:

typings install github:sqwk/paper.d.ts/paper.d.ts --save --global

More information on typings valid locations here

sqwk/paper.d.ts - is org/repo.

/paper.d.ts - is the path.

You can also define specific commit by adding #commit-id to the path:

typings install github:sqwk/paper.d.ts/paper.d.ts#0c45e2c25d3190fbedfcee998074356e58a392a9 --save --global
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download