import { requireNativeComponent , UIManager , View , Platform , HostComponent , ViewProps } from 'react-native' ; import type { RNIContextMenuViewProps } from './RNIContextMenuView' ; export type RNIContextMenuButtonBaseProps = Pick < RNIContextMenuViewProps , 'menuConfig' | 'onMenuWillShow' | 'onMenuWillHide' | 'onMenuWillCancel' | 'onMenuDidShow' | 'onMenuDidHide' | 'onMenuDidCancel' | 'onPressMenuItem' > & { enableContextMenu ? : boolean ; isMenuPrimaryAction ? : boolean ; } ; export type RNIContextMenuButtonProps = ViewProps & RNIContextMenuButtonBaseProps ; type RNIContextMenuButtonCommandIDMap = { dismissMenu : number ; } ; const viewName = "RNIContextMenuButton" ; /**
 * Do not use `RNIContextMenuButton` if platform is not iOS.
 */ export const RNIContextMenuButton = Platform . select ( { ios : ( ) => requireNativeComponent ( viewName ) as any , default : ( ) => View , } ) ( ) ; /**
 * Do not use `RNIContextMenuButtonCommands` if platform is not iOS.
 */ export const RNIContextMenuButtonCommands = Platform . select ( { ios : ( ) => ( ( UIManager as any ) [ viewName ] ) ?. Commands , default : ( ) => ( { } ) } ) ( ) ;