ionic-team / create-capacitor-plugin

Create a new Capacitor plugin ⚡️
Other
74 stars 11 forks source link

Extend interface by default #88

Closed SpongeBed81 closed 6 months ago

SpongeBed81 commented 10 months ago

Fixes addListener and any other types inside Plugin interface from "@capacitor/core" being not found inside definitions file.

Related to this issue

jcesarmobile commented 6 months ago

thanks for the PR, but the recommended way is adding addListener definitions in the definitions.ts file for every listener available, so the users can know the event name and what the callback returns instead of using the generic addListener that users just know that the event name is a string and the callback is a function and can make mistakes when typing the event name.

example capacitor-plugins/keyboard/src/definitions.ts at be3dd6889b5d147cd43ff17ae2cfdb936a146a34 · ionic-team/capacitor-plugins · GitHub