-
-
Notifications
You must be signed in to change notification settings - Fork 473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export types #529
Comments
Do you mean literally prefixing each |
I'm afraid that this broke existing integrations and it's inconsistent with other Cordova plugins Without With As an example, StatusBar plugin does not use it https://github.com/apache/cordova-plugin-statusbar/blob/master/types/index.d.ts Not quite sure what the preferred approach is for all Cordova plugins, there doesn't seem to be big of a consensus, but from what I've seen they are usually not using Those seem to work for Also, before I've discovered built-in types I started working on this https://gist.github.com/kamilbrk/546e46dd93a34c4f63022ebdc98459fd and depending on time I'll be most likely working on a PR, although I don't know if you'd like to keep it up to date going forward. |
I have made a wrapper service for better integration with Angular and TypeScript. I converted almost all functions to real promises: To get this type safety I have added FirebasePlugin to my typings.d.ts: However, your issue is about how these interfaces are declared. You should pass the required arguments for getToken(). If you don't have any callbacks for getToken(), then just do the following:
|
Apologies, maybe that was not too clear. The first screenshot meant that I can get type definitions and it actually tells me that I need callbacks for The second screenshot meant that it couldn't detect any typings whatsoever, so it highlighted
The fact that you had to add this code to your own interface Window {
FirebasePlugin: FirebasePlugin;
} …into this plugin's Could you share a thought on how do you work with other plugins, perhaps official/core plugins from Apache org on GitHub? Do you also |
We've hit this one as well. It turns that putting the
The easiest way to fix is this move the declare var within a global scope like this:
|
Feature request
Export types for type hinting for better TypeScript support. Exporting these interfaces should be nice:
https://github.com/dpa99c/cordova-plugin-firebasex/blob/master/types/index.d.ts
The text was updated successfully, but these errors were encountered: