woocommerce/plugins/woocommerce-blocks/assets/js/base/components/cart-checkout/payment-method-icons
Raluca Stan 615b939383 Add Typescript to /blocks-registry/payment-methods (https://github.com/woocommerce/woocommerce-blocks/pull/4702)
* Type payment method under /block-registry

* Type assertions and add them back to PaymentMethodConfig

* Type ExpressPaymentMethodConfig

* Fix comment on payments types

* Fix CanMakePayment type

* Fix assertion for payment methods and the savedTokenComponent property

Because class properties come from the config object, they will never be null except if somebody explicitly adds them the the object with a value of null.
Which is not the case for savedTokenComponent for example, because it's optional and that's why we check it like this paymentMethods[ activePaymentMethod ]?.savedTokenComponent

* Add the complete CanMakePaymentReturnType and account for null for PaymentMethod.icons

- canMakePayment can also return a Promise and this was not included in the type definition
- in PaymentMethodConfig's constructor we also need to account for extensions passing {icons: null}.

* Revert Fix assertion for payment methods and the savedTokenComponent property

* Fix failing tests because of savedTokenComponent

I've reverted my changes and left the initialization of savedTokenComponent as it was.

* Rename types for more clarity

* Fix ExtensionNamespace and PaymentMethodName types

* Rename Supports and *PaymentMethodOptions type for better clarity
2021-09-15 18:36:02 +02:00
..
common-icons.ts Add Typescript to /blocks-registry/payment-methods (https://github.com/woocommerce/woocommerce-blocks/pull/4702) 2021-09-15 18:36:02 +02:00
index.tsx Add Typescript to /blocks-registry/payment-methods (https://github.com/woocommerce/woocommerce-blocks/pull/4702) 2021-09-15 18:36:02 +02:00
payment-method-icon.tsx Update `PaymentMethodIcons`, and `CheckoutButton` components to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/4376) 2021-08-20 07:55:30 -04:00
style.scss Make payment method icons display well even if theme tries to override their height/width (https://github.com/woocommerce/woocommerce-blocks/pull/4427) 2021-07-06 09:30:02 +01:00
utils.ts Add Typescript to /blocks-registry/payment-methods (https://github.com/woocommerce/woocommerce-blocks/pull/4702) 2021-09-15 18:36:02 +02:00