Description
Is your feature request related to a problem? Please describe.
I'm always frustrated when... a module doesn't have clear typescript instructions and/or doesn't have typings
Describe the solution you'd like
A guide to module authors on the best way to implement typings into a module.
Describe alternatives you've considered
Dealing with it and figuring it out myself for each package.
Additional context
I'm currently trying to add types to the auth-module, pull request
I'm basing this PR off of the axios-module, but it would be nice if we had a bit more of a step by step process for module authors to take.
-
It would be nice to link to a typescript specific guide from here (or maybe just include it on that page too) - https://nuxtjs.org/guide/modules
-
Steps would look something like
- Add a types/index.d.ts file
- Create your types (cover a few scenarios - component options, component instance etc. Some of which are already covered)
- Add
"types": "types/index.d.ts",
to your package.json - Add the types directory to your NPM file, this varies, but something like
"files": [
"lib",
"types"
],
- Include an example! - create an example boilerplate for module authors to copy and paste
...anything else?