Add TypeScript type definitions
mihkeleidast opened this issue · comments
Mihkel Eidast commented
Hi again! As the tool can now be run programmatically, it would be good if there were also type definitions available for those of us trying to run this in a TS codebase.
The options are:
- Add type definitions as a separate package in DefinitelyTyped
- Add static type definitions in this repository - can be some maintenance burden.
- Add type annotations to the code / functions in JSDoc, then extract those with tsc for build/distribution - still a bit maintenance burden, but at least the types would be co-located with the source and would also give some code editor autocomplete helpers.
- Rewrite everything in TS (I wouldn't want to do that, seems like too much work TBH 😅).
Any preference towards some of these options?
Misha Moroshko commented
Hey @mihkeleidast,
- Sounds like a good start.
- Doesn't sound that bad to me.
- Meh...
- That would be great if anyone has the capacity to do it! The codebase is fairly small so shouldn't take too long.
Ágata Leuck commented
I would like to attempt the first option if that's alright.
Misha Moroshko commented
Thank you @Aleuck 🙏
Mihkel Eidast commented
Got notifications from here, which reminded me that I actually started on the full TS conversion a while ago, but never filed the PR. Did so now to get some early feedback, see #58. Sorry for forgetting, hope we aren't doing too much duplicate work.