Cordova plugins & TypeScript
-
I have a TypeScript project going on right now, and I’ve installed a couple of Cordova plugins,
StatusBar and NavigationBar coloring namely.As per the documentation, Quasar takes care of making sure these plugins are loaded into the global namespace once the Vue instance starts.
Typescript doesn’t know this, however, and still thinks that these objects are undefined, meaning I don’t have tooling or IntelliSense.
Is there any way this problem could be fixed? Thanks for taking the time to read this!
-
Update: I managed to fix it by just adding types to the cordova plugin folders! I just whipped up some really quick type definitions for NavigationBar (and StatusBar already had typedefs, which is cool) and no more horrible red lines. Leaving this here for anyone who might be having the same problem!