import type { HostComponent, ViewProps } from 'react-native'; import type { DirectEventHandler, Double, } from 'react-native/Libraries/Types/CodegenTypes'; import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands'; import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; export interface InternalCardConfig { showPayButton: boolean; paymentButtonAction: string; } interface NativeComponentDimensions { width: Double; height: Double; } interface NativeProps extends ViewProps { config: InternalCardConfig; onDimensionsChanged: DirectEventHandler | null; } type CardComponentType = HostComponent; interface CardNativeCommands { submit: (viewRef: React.ElementRef) => void; tokenize: (viewRef: React.ElementRef) => void; } export const Commands: CardNativeCommands = codegenNativeCommands({ supportedCommands: ['submit', 'tokenize'], }); export default codegenNativeComponent('Card') as CardComponentType;