Closed pdrhlik closed 3 years ago
The only thing that is not typed now is the Geolocation error. What is the structure of that error, @diachedelic? Does it return anything else than a code property with a NOT_AUTHORIZED value or not for now?
I would fix that right away, thanks.
I have some comments:
value
? removeWatcher(id: {id: string})
addWatcher
does not return a Promise.Sorry, actually I am not going to merge this. The changes introduce too much complexity and repetition. I was imagining it would simply be the addition of a single file containing type definitions.
I followed the official instructions for creating Capacitor plugins and all this complexity seems to be necessary. I put back all the files that where missing in this repo when you create a plugin (v2) using npx @capacitor/cli plugin:generate
.
value
to addWatcher()
, it didn't work. Is it possible that it's because of this line? String callbackId = call.getString("id");
in BackgroundGeolocation.java#L158?latitude
, longitude
and time
are always present. Is that right?I hope you will reconsider because every official and non-official @capacitor-community plugin have typescript definitions and they do it exactly like this.
I think that this plugin has a great potential and I would like to help make it better. Otherwise I'll just tend to my forked version.
Thanks for your work on this. I have slightly modified the definitions you wrote and release them in v0.3.7, please let me know if they are not satisfactory.
This PR creates typescript definitions and adds simple documentation to each function and property. It also modifies a README a bit to reflect the changes, though not extensively yet.
The naming conventions were inspired by https://developer.mozilla.org/en-US/docs/Web/API/Geolocation_API so it stays as close as possible.
Closes #2