import type { HostComponent, ViewProps } from 'react-native'; import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands'; import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; import { EmbeddedPaymentElementConfiguration } from '../types/EmbeddedPaymentElement'; import { IntentConfiguration } from '../types/PaymentSheet'; import type { UnsafeMixed } from './utils'; export interface NativeProps extends ViewProps { configuration: UnsafeMixed; intentConfiguration: UnsafeMixed; } export interface NativeCommands { confirm: (viewRef: React.ElementRef>) => void; clearPaymentOption: ( viewRef: React.ElementRef> ) => void; update: ( viewRef: React.ElementRef>, intentConfigurationJson: string ) => void; } export const Commands: NativeCommands = codegenNativeCommands({ supportedCommands: ['confirm', 'clearPaymentOption', 'update'], }); type ComponentType = HostComponent; export default codegenNativeComponent( 'EmbeddedPaymentElementView' ) as ComponentType;