How to install .d.ts file from github:DefinitelyTypes using typings

15.8k Views Asked by At

I used tsd which is now deprecated and am trying to use typings. The typings repository is very small, and I can't find any of the d.ts files I need. All the files I need are in GitHub DefinitelyTyped repository, but I can't find a way to install them using typings.

Here is a command I tried:

typings install github:DefinitelyTyped/DefinitelyTyped/angular-formly/angular-formly.d.ts

I receive the error:

typings ERR! message Attempted to compile "angular-formly" as a dependency, 
but it contains some ambient module declarations
("AngularFormly", "angular-formly").

Any clue?

3

There are 3 best solutions below

6
On BEST ANSWER

To install angular-formly definitions from DefinitelyTyped, use the following command:

typings install angular-formly --ambient

It's taken directly from here: Quick Start

EDIT: Because this is the accepted answer and syntax has changed, as of typings 1.0:

typings install dt~angular-formly --global
0
On

I use the following:

./node_modules/.bin/typings install whatever --save --global --source dt

Seems to be the way to do it in v1.3.1.

3
On

As of version 1.X of typings the syntax has changed and is now:

typings install dt~angular-formly --global

update: As of typescript 2.0 types are installed using npm: npm install @types/angular-formly