Comments (9)
@ribeiroguilherme I think @ashrafnazar refers to when we set the moduleResolution
to bundler
in .tsconfig.json
file, it's a new type of moduleResolution
that came with Typescript 5.
The problem with this type of moduleResolution
, is that it only looks to the files exposed through the exports
field of @adyen/adyen-web
library. When moduleResolution
is bundler
, then we cannot import the types directly with relative paths, for example:
import SecuredFieldsElement from '@adyen/adyen-web/dist/types/components/SecuredFields'
This will gave a error, because the exports
field of the package points to a ./dist/types/index.d.ts
with this content:
import { CoreOptions } from './core/types';
import Checkout from './core';
declare function AdyenCheckout(props: CoreOptions): Promise<Checkout>;
export default AdyenCheckout;
This is ./dist/index.d.ts
from @adyen/[email protected]
, the unique type available to import is the constructor of AdyenCheckout
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.
from adyen-web.
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.
@ribeiroguilherme Sure!
The AdyenCheckout
configuration has an onChange
handler that takes a single parameter of state
, which is currently typed as any
, so we've built this custom type until y'all get time to add stricter types for it.
type AdyenPaymentData = {
paymentMethod: {
type: string;
checkoutAttemptId: string;
};
// ...etc
};
type AdyenPaymentState = {
data: AdyenPaymentData;
errors: Record<string, unknown>;
valid: Record<string, unknown>;
isValid: boolean;
};
from adyen-web.
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
from adyen-web.
I personally would like to see a TS declarations repo, i.e. @types/adyen
from adyen-web.
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 any
types.
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.
from adyen-web.
@ribeiroguilherme - could this prove to be a problem where the moduleResolution
property in .tsconfig
files is Bundler
?
from adyen-web.
@ashrafnazar I don't understand your point. Can you elaborate better the issue?
from adyen-web.
Is there an ETA for v6?
from adyen-web.
@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 paymentMethod
field, as they are dynamic based on the payment type.
Out of curiosity - why are you using the onChange
handler and not relying on the onSubmit
?
@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
from adyen-web.
Related Issues (20)
- on 6.0.1 there is a bug with stencil build Property 'formatProps' in type 'UPI' is not assignable to the same property HOT 1
- Github stale bot test HOT 2
- Missing en-GB translation causes 404 error in console HOT 1
- You must specify a countryCode when initializing checkout
- Translations not found for SDK 6.0.3 HOT 8
- Cards - Submit errors (Web component) HOT 2
- Google pay express onPaymentDataChanged not stopping the user from trying to pay while running HOT 3
- Production build not working with @adyen/adyen-web/auto HOT 7
- Cannot read properties of undefined (reading 'origin') HOT 5
- PayPal Credit overrules PayPal Pay Later HOT 3
- 'stateOrProvince' field is not prefilled after a failed transaction
- Adyen Web Types are missing the TransactionInfo object HOT 1
- ariaLiveSRPane is not being removed from the DOM HOT 1
- How to use Klarna widget ? HOT 1
- countryCode is required?
- Apple Pay billingAddress missing some fields that exist in authorizedEvent.payment.billingContact HOT 1
- Dropin: You support the payment method 'scheme' but this component has not been configured. Make sure to import the Class 'Card' and then pass it in the Dropin's 'paymentMethodComponents' config property if you wish to offer this payment method. HOT 1
- Removing the 3DS from the test card HOT 1
- Adyen Web drop-in V5 missing issuer in payment method details HOT 3
- Unable to relate supported brand with the supported paymentMethodVariant in the web drop-in onBinLookup
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adyen-web.