thomasmunduchira / myq-api

An updated API to interface with myQ devices
https://www.npmjs.com/package/myq-api
MIT License
137 stars 38 forks source link

TS Support? #26

Closed JLuboff closed 3 years ago

JLuboff commented 3 years ago

Just curious if Typescript support (typings) will be added at any point or if I should consider creating them to and pushing to DefinitelyTyped?

thomasmunduchira commented 3 years ago

Thanks for bringing this up, @JLuboff. I fielded a similar question in #3: comment. Looping in @kn0ll who also graciously offered to add TypeScript support to this module.

I am pretty new to the TypeScript world so it would be great if one or both of you could make the initial contributions here. I would be more than happy to build on top of/maintain it for future versions.

I haven't heard of DefinitelyTyped before this, but based on https://stackoverflow.com/questions/56834190, I think adding the types to the module itself would provide a better experience. Happy to hear thoughts on this, however.

kn0ll commented 3 years ago

@thomasmunduchira

if your open to using TypeScript as your primary host language for this repository (whose main side effect will be a compilation step), that is definitely the right option to go.

the only reason to use DefinitelyTyped is if you can't get a project maintainer to support it natively. it sounds like you are on board though!

now that the dust has settled on the rewrite, i am happy to give it a shot. i can have some demonstrable results we can start discussing by the end of next week if you are interested. cheers!

kn0ll commented 3 years ago

started work here. while all the code has actually been converted already, the devil is in the details. necessary remaining items from my POV is:

my priority was to change as little code as possible. i think it would be smart to intend to release that way. but in future builds, we could take advantage of some typescript features like optional chaining, Enum and more to modernize some of the code.

JLuboff commented 3 years ago

Thank you to both. @kn0ll if I find some time, I'd like to contribute as well. If I do, would you want me to PR against your repo?

kn0ll commented 3 years ago

that would be awesome. let me know here what you plan to tackle so we don't overlap. but yeah, would love a hand, a PR on my fork (branch: typescript) sounds great. ✋