import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; import type { ViewProps } from 'react-native'; import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands'; import type { HostComponent } from 'react-native'; import type { BubblingEventHandler, Double, } from 'react-native/Libraries/Types/CodegenTypes'; import type { Coordinates } from './types'; export interface NativeProps extends ViewProps { onMapReady?: BubblingEventHandler< Readonly<{ success: boolean; }> >; // onMapReadyType; //(_: onMapReadyType) => void; onCameraMoveEnd?: BubblingEventHandler< Readonly<{ longitude: Double; latitude: Double; zoomLevel: Double; }> >; onCameraMoveBegin?: BubblingEventHandler>; onClickBuilding?: BubblingEventHandler< Readonly<{ buildingId: string; buildingHeight: Double; longitude: Double; latitude: Double; }> >; } export default codegenNativeComponent( 'Wrld3dView' ) as HostComponent; type Wrld3dViewNativeComponentType = HostComponent; interface NativeCommands { create: ( viewRef: React.ElementRef, viewId: string ) => void; setBuildingHighlight: ( viewRef: React.ElementRef, buildingId: string, color: string, buildingCoordinates: Coordinates ) => void; removeBuildingHighlight: ( viewRef: React.ElementRef, buildingId: string ) => void; } export const Commands: NativeCommands = codegenNativeCommands({ supportedCommands: [ 'create', 'setBuildingHighlight', 'removeBuildingHighlight', ], });