import type { HostComponent, ViewProps } from 'react-native'; import type { DirectEventHandler, Int32, WithDefault, } from 'react-native/Libraries/Types/CodegenTypes'; import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; import { ShippingContact, ShippingMethod } from '../types/PlatformPay'; import { UnsafeMixed } from './utils'; type OnShippingMethodSelectedActionEvent = { shippingMethod: UnsafeMixed; }; type OnShippingContactSelectedActionEvent = { shippingContact: UnsafeMixed; }; type OnCouponCodeEnteredActionEvent = { couponCode: string; }; type OnOrderTrackingActionEvent = {}; export interface NativeProps extends ViewProps { disabled: boolean; type: Int32; buttonStyle: Int32; buttonBorderRadius?: WithDefault; onShippingMethodSelectedAction?: DirectEventHandler; onShippingContactSelectedAction?: DirectEventHandler; onCouponCodeEnteredAction?: DirectEventHandler; onOrderTrackingAction?: DirectEventHandler; // Boolean flags to indicate which callbacks are provided hasShippingMethodCallback?: WithDefault; hasShippingContactCallback?: WithDefault; hasCouponCodeCallback?: WithDefault; hasOrderTrackingCallback?: WithDefault; } type ComponentType = HostComponent; export default codegenNativeComponent( 'ApplePayButton' ) as ComponentType;