How to use typings to install cordova from github DefinitelyTyped?

@stefanhuber, ah, yes, the hash references to the commit. It’s helpful if I want to change to other commits.

Finally, I found a solution to get the StatusBar resovled by TypeScript. Just install cordova is not enough, I have to install the corresponding plugins as well.

$ typings install cordova --ambient --save
$ typings install cordova/plugins/statusbar --ambient --save

It will add the followings to the typings.json

{
  "ambientDependencies": {
    "cordova": "registry:dt/cordova#0.0.0+20160316155526",
    "cordova/plugins/statusbar": "registry:dt/cordova/plugins/statusbar#0.0.0+20160316155526"
  }
}

And another interesting thing I found is that, they do link to the DefinitelyTyped repo. I was fooled by the strange registry:dt/cordova#0.0.0+20160316155526.

If I type https://api.typings.org/entries/dt/cordova%2Fplugins%2Fstatusbar/versions/latest into the browser, I will get the following json. And the location property points to the DefinitelyTyped.

{
  "tag":"0.0.0+20160316155526",
  "version":"0.0.0",
  "description":null,
  "compiler":null,
  "location":"github:DefinitelyTyped/DefinitelyTyped/cordova/plugins/StatusBar.d.ts#56295f5058cac7ae458540423c50ac2dcf9fc711",
  "updated":"2016-03-16T15:55:26.000Z",
  "deprecated":null}

Now, I can use the StatusBar to modify its styles for iOS. :slight_smile: And I am using Visual Code too.