woocommerce/packages/woocommerce-blocks/assets/js/blocks-registry/payment-methods/extensions-config.ts
2021-12-10 12:03:04 +00:00

24 lines
783 B
TypeScript

/**
* External dependencies
*/
import { CanMakePaymentExtensionCallback } from '@woocommerce/type-defs/payments';
type CanMakePaymentExtensionCallbacks = Record<
string,
CanMakePaymentExtensionCallback
>;
export type NamespacedCanMakePaymentExtensionsCallbacks = Record<
string,
CanMakePaymentExtensionCallbacks
>;
export type ExtensionNamespace = keyof NamespacedCanMakePaymentExtensionsCallbacks;
export type PaymentMethodName = keyof CanMakePaymentExtensionCallbacks;
// Keeps callbacks registered by extensions for different payment methods
// eslint-disable-next-line prefer-const
export const canMakePaymentExtensionsCallbacks: NamespacedCanMakePaymentExtensionsCallbacks = {};
export const extensionsConfig = {
canMakePayment: canMakePaymentExtensionsCallbacks,
};