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

pierrebo picture pierrebo · Feb 4, 2016 · Viewed 15.7k times · Source

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?

Answer

Amid picture Amid · Feb 4, 2016

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