You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2020/08/06 09:46:20 UTC

[GitHub] [cordova-plugin-file] breautek commented on issue #402: Adjust type definitions to work without type imports

breautek commented on issue #402:
URL: https://github.com/apache/cordova-plugin-file/issues/402#issuecomment-669829161


   > When I use cordova-sqlite-storage with the types from DefinitelyTyped, it works out of the box and without any imports:
   
   What's actually happening here is that when you install `@types/cordova-sqlite-storage` or any other typings from the `@types` organization, they get placed in `node_modules/@types/...` which typescript will automatically load by default.
   
   Typings that is provided by `cordova-plugin-file` I believe is only ever imported when you explicitly have an `import` statement (which doesn't make sense in this case as cordova plugins don't actually export anything, as they clobber the global namespace).
   
   Using `/// <reference types="cordova-plugin-file" />` like you said should work. You can also try messing with the [typeRoots](https://www.typescriptlang.org/tsconfig#typeRoots) TS compiler flag.
   
   There isn't anything Cordova can "adjust" to make this work out of the box. But I do believe this should be documented somewhere so I'll leave this issue open.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org