-
Notifications
You must be signed in to change notification settings - Fork 85
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
Typescript #46
Comments
It's not in our timeline right now, but we're happy to accept contributions! |
I would be willing to work on this. There are a couple options for doing this. You can create a types repo and publish it to TypeScript's |
Thanks @ElijahKotyluk, that’s be really cool. We would prefer the latter of those options. Let us know if you need any help! |
Sounds good, I'll get a PR going in the next couple days. Thank you! |
I've been looking into this a little today, and just wanted to say that while we are hoping to be able to auto-generate types from our Chec API documentation, at this stage I don't believe we have enough structured data to do that. This may mean (at least initially) that we publish types manually. |
I've created types for all our response models, and written some basic TS definitions for the "features" of the Commerce.js API - see here: https://github.com/chec/commerce.js/compare/feature/commerce.ts?expand=1 We could tidy these up and publish them as a standalone package via |
+1 on support for this |
+1 happy to help if needed. |
I've submitted this to DefinitelyTyped as suggested, there are still a lot of |
@PaitoAnderson thanks for taking the time to do this! We'll need to work out the best way to version Commerce.js and the corresponding types library against the date based versioning of the Chec API, but this is something we'll work out internally. It looks like the upstream types library matches the tags from this repo, which makes this easier to maintain going forwards. |
@robbieaverill No problem, thanks for getting it started. I was thinking about that too, it does seem complicated especially because the |
Just to be as open as possible, we've been thinking about switching our versioning system with Commerce.js so that we can include API date versions in the commerce.js version. This would then set a default We are considering some pretty major plans for a Commerce.js 3.0 though, so it might be bundled with that. So much to do and so little time! |
It's a good point though that if you use a custom version via request headers, your TS definitions are probably not going to match up. We'll need to consider an accessible way for people to install specific versions of the types to match. |
For now I'm going to close this issue. You can install Commerce.js types now thanks to @PaitoAnderson (🎉) and we will work on improving them as things change over time, as well as establishing a workable versioning system for both Commerce.js and the types that go with it, as breaking changes in the API happen. For now types are versioned according to Commerce.js versions, which is nice. Thanks again for your help here @PaitoAnderson |
Hi. Do you plan to release Typescript declarations for this library?
The text was updated successfully, but these errors were encountered: