New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert to TypeScript #20
Conversation
I'll take a look at this this weekend. |
Looking at it, I think everywhere you have e.g. getAll<T = OptionsSync.Options>(): Promise<T> {
...
} |
Is there a way to have the types associated with the instance instead of having each method generic? Also because |
I don't think you can get away without generics. I'd have to mess around with this a bit more once you're other branch is merged or up for review. Let me know when that is up or merged and I'll find some time to tinker. |
It looks like I can have a “generic class”, so the instance will return T = defaults, instead of specifying the type in the getter setter |
cc @nickytonline if you wanna take a look. The API hasn't changed yet, but we have a chance to fix the type of
Options
now, as talked about in refined-github/refined-github#1780 (comment)Most I'd like to know if there's a way to pass
typeof defaults
through to the defaults — this may be easier once the constructor accepts{defaults}