Instructions to add cordova type definition and imports for ionic2 and typescript?


#1

Is there any instructions and exact steps to use cordova plugins with typescript and ionic2 so that there is no type errors:

  1. what definition files should I download and from where?
  2. what change should I make in configuration file(s)
  3. what import should I used in my code so that there is no type error.

I know there are few discussions out there but no definitive statement (just try this or that).

Thanks


#2

There’s a solid resource on this website:
http://definitelytyped.org/tsd/

The definition file you’re asking about is here:
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/cordova/cordova.d.ts


#3

Thanks, should I modify any config files and/or put import statements in the code?


#4

did you had any luck to import these into your project?


#5

I am using ionic-native for cordova plugins. After a few try it works…

Patrice