-
Notifications
You must be signed in to change notification settings - Fork 130
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
Stronger TS types for event handlers #2682
Comments
I personally would like to see a TS declarations repo, i.e. |
Hey @brodyd795, Thanks for the feedback. The good news is that we are revamping the whole typescript types for the next major release, which should happen in the following weeks, and there are improvements for the Could you share a bit more the details in how are you using this 'home-grown types' ? Maybe a code snippet showing how you are narrowing down and differentiating types. That can bring some insights for us. @ashrafnazar there is no intention to have a TS declaration repo, since the library is already typed and it also export the types. |
@ribeiroguilherme - could this prove to be a problem where the |
@ashrafnazar I don't understand your point. Can you elaborate better the issue? |
@ribeiroguilherme I think @ashrafnazar refers to when we set the The problem with this type of
This will gave a error, because the
This is But this is not related to this issue at all, I think it's better related to #363 that will be closed when V6 lands. |
Is there an ETA for v6? |
@ribeiroguilherme Sure! The type AdyenPaymentData = {
paymentMethod: {
type: string;
checkoutAttemptId: string;
};
// ...etc
};
type AdyenPaymentState = {
data: AdyenPaymentData;
errors: Record<string, unknown>;
valid: Record<string, unknown>;
isValid: boolean;
}; |
@brodyd795 thanks for sharing! You can already preview it here . We can provide types for most of the properties, except the ones available inside the Out of curiosity - why are you using the @ashrafnazar - we are aiming to release the beta version this month along with the migration guide/release notes. We will announce it on this thread . Feel free to subscribe for updates |
Hi guys - we released v6.0.0 which contains many improvements. One of them is improving the Typescript type definitions we have, so please check it out and let us know if you notice/miss something! Cheers |
Is your feature request related to a problem? Please describe.
The current TypeScript types for the
@adyen/adyen-web
package include someany
types, e.g. in theonChange
handler for theAdyenCheckout
component. This makes for a less-than-ideal developer experience.Describe the solution you'd like
I'd love to see stronger typing for this module.
Describe alternatives you've considered
We're currently creating home-grown types to work around this, but we'd prefer this to be native to the library.
Additional context
Here is an example of an
any
that I'd like to see typed more strongly.The text was updated successfully, but these errors were encountered: