import type { TurboModule } from 'react-native'; import { TurboModuleRegistry } from 'react-native'; export interface Spec extends TurboModule { configure(settings?: string): Promise; // Checkout methods showUniversalCheckoutWithClientToken(clientToken: string): Promise; showVaultManagerWithClientToken(clientToken: string): Promise; showPaymentMethod(paymentMethod: string, intent: string, clientToken: string): Promise; // Cleanup dismiss(): Promise; cleanUp(): Promise; // Tokenization handlers handleTokenizationNewClientToken(newClientToken: string): Promise; handleTokenizationSuccess(): Promise; handleTokenizationFailure(errorMessage: string): Promise; // Resume handlers handleResumeWithNewClientToken(newClientToken: string): Promise; handleResumeSuccess(): Promise; handleResumeFailure(errorMessage: string): Promise; // Payment creation handlers handlePaymentCreationAbort(errorMessage: string): Promise; handlePaymentCreationContinue(): Promise; // Error handling showErrorMessage(errorMessage: string): Promise; setImplementedRNCallbacks(implementedRNCallbacks: string): Promise; // Backward compat addListener(eventName?: string): void; removeListeners(count?: number): void; } // module name (NativePrimer) must be same in RCTNativePrimer.mm when exporting export default TurboModuleRegistry.getEnforcing('NativePrimer');