import type { TurboModule } from 'react-native'; import { NativeModules, TurboModuleRegistry } from 'react-native'; export type CustomEndpoints = Object; export interface Spec extends TurboModule { initialise( publishableKey: string, platformPublishableKey: string, profileId: string, environment: string, customEndpoints: CustomEndpoints ): Promise; presentPaymentSheet(params: Object): Promise; getCustomerSavedPaymentMethods(params?: Object): Promise; getCustomerLastUsedPaymentMethodData(): Promise; getCustomerDefaultSavedPaymentMethodData(): Promise; getCustomerSavedPaymentMethodData(): Promise; confirmWithCustomerLastUsedPaymentMethod(reactTag: number): Promise; confirmWithCustomerDefaultPaymentMethod(reactTag: number): Promise; confirmWithCustomerPaymentToken( reactTag: number, token: string ): Promise; isGooglePaySupported(): Promise; isApplePaySupported(): Promise; getWalletSession(params?: Object): Promise; isWalletEligible(wallet: string): Promise; launchWallet(wallet: string): Promise; } /** * Use `TurboModuleRegistry.get` first for new-arch TurboModules, and fall back * to `NativeModules` for legacy/old-arch support. */ const NativeHyperswitchModule = TurboModuleRegistry.get('NativeHyperswitchModule') ?? NativeModules.NativeHyperswitchModule; export default NativeHyperswitchModule as Spec; export { NativeHyperswitchModule };