import { type RefObject } from "react"; import type { IAnalyticalBackend } from "@gooddata/sdk-backend-spi"; import { type GoodDataSdkError } from "@gooddata/sdk-ui"; import { type IMapFacade, type IPopupFacade } from "../../layers/common/mapFacade.js"; import { type IGeoChartConfig } from "../../types/config/unified.js"; import { type IMapViewport } from "../../types/map/provider.js"; /** * Hook return value * * @internal */ export interface IUseMapInitializationResult { /** * Map facade instance (null until initialized) */ map: IMapFacade | null; /** * Tooltip popup instance (null until initialized) */ tooltip: IPopupFacade | null; /** * Whether map is ready for use */ isMapReady: boolean; /** * Error that occurred during initialization */ error: GoodDataSdkError | null; } /** * Initialize map instance * * @remarks * This hook handles map creation, loading state, and cleanup. * It creates the MapLibre map instance when the container is ready * and cleans it up on unmount. * * The map instance is returned along with loading/error states. * * Key behaviors: * - Accepts pre-calculated viewport to prevent initial world view * - Captures initial center/zoom on first render (prevents re-centering on config changes) * - Creates map instance asynchronously * - Handles race conditions with isMounted flag * - Cleans up resources on unmount or style change * - Supports cooperative gestures with localized messages * * @param containerRef - Ref to the map container element * @param config - Geo configuration (optional) * @param initialViewport - Pre-calculated viewport from data (optional) * @param backend - Backend used to resolve map style when not provided inline (optional) * @param locale - Locale string used to derive the map label language (optional) * @param mapInstructionsId - ID of screen-reader-only map instructions element (optional) * @param mapCanvasTitle - Optional title used for map canvas accessible name * @param legendPanelRef - Optional ref to legend root element rendered by React * @returns Map instance, tooltip, ready state, and error * * @internal */ export declare function useMapInitialization(containerRef: RefObject, config?: IGeoChartConfig, initialViewport?: Partial | null, backend?: IAnalyticalBackend, locale?: string, mapInstructionsId?: string, mapCanvasTitle?: string, legendPanelRef?: RefObject): IUseMapInitializationResult; //# sourceMappingURL=useMapInitialization.d.ts.map