import type { WebView, WebViewMessageEvent } from 'react-native-webview'; import type { Mappedin } from '../types'; import type { MapViewControl } from '../controls/map-view-control'; import type { EventControl } from '../controls/event-control'; import type { PubSub } from '@mappedin/mappedin-js'; import type { BaseExtensionState, ExtensionRegistry, ExtensionsObject } from '../extension-registry'; import type { useBridge } from './use-bridge'; interface WebViewMessageEventPayload { 'webview-message-received': WebViewMessageEvent; } export declare const MappedinContext: import("react").Context<{ mapData?: Mappedin.MapData; mapView?: MapViewControl; /** * Event control system for managing event callbacks. * @internal */ _events?: EventControl; /** * Container instance for bridge communication (WebView on native, HTMLIFrameElement on web). * @internal */ _webView?: WebView | HTMLIFrameElement | null; /** * PubSub instance for WebView message events. * @internal */ _webViewMessagePubSub?: PubSub; bridge?: ReturnType; /** * Extension state storage for various extensions. * Each extension can store its own state here. */ extensions: ExtensionsObject; /** * Function to update extension state. * @param name - The extension name (must be a registered extension) * @param stateOrUpdater - Either the new state directly, or a callback function that receives the previous state and returns the new state */ updateExtensionState: keyof ExtensionRegistry extends never ? (name: string, stateOrUpdater: BaseExtensionState | ((prevState: BaseExtensionState) => BaseExtensionState)) => void : (name: K, stateOrUpdater: Partial | ((prevState: ExtensionRegistry[K]) => Partial)) => void; }>; /** * Hook to get the MapData and MapView instances from the MapView context. * * This hook provides access to the mapData and mapView instances that are * created and managed by the MapView component. It ensures that the hook * is used within a MapView component context. * * @throws {MapViewNullError} When used outside of a MapView component or when mapData/mapView are not yet initialized * * @returns Object containing mapData and mapView instances * * @example * ```tsx * function MyMapComponent() { * const { mapData, mapView } = useMap(); * * useEffect(() => { * // Use mapView to interact with the map * mapView.Camera.animateTo({ center: mapData.getByType('space')[0] }); * }, [mapData, mapView]); * * return Map is ready!; * } * ``` */ export declare function useMap(): { mapData: Mappedin.MapData; mapView: MapViewControl; }; export {}; //# sourceMappingURL=use-map.d.ts.map