Enhance & update type support
Types were originally implemented with JSdoc before typescript proper supported this for type generation. This led to the kind of funky setup here.
The js first + JSdocs approach has been working well in a number of my other projects and it's time to update that over c'here 😃
Todo:
- [ ] Use
tsc --noEmit false --emitDeclarationOnly truefor cleaner typegen - [ ] Update variadic functions like
identityref
Related:
- https://github.com/DavidWells/analytics/issues/172
Reference material:
- https://gils-blog.tayar.org/posts/jsdoc-typings-all-the-benefits-none-of-the-drawbacks/
- https://github.com/giltayar/jsdoc-typing
The docs are currently saying that typescript is fully supported:
https://github.com/DavidWells/analytics#typescript-support
If the TypeScript support isn't coming soon, I wonder if the README should be updated.
Any reason not to just convert everything to TypeScript? Then you get the benefits of TypeScript and generating types becomes easier as well.
agreed, that snippet in the README makes it a bit confusing that e.g. @analytics/segment does not bundle types