import type { AddProtocolAction as MapLibreAddProtocolAction, CircleLayerSpecification as MapLibreCircleLayerSpecification, ExpressionSpecification as MapLibreExpressionSpecification, FillLayerSpecification as MapLibreFillLayerSpecification, FilterSpecification as MapLibreFilterSpecification, GeoJSONSourceSpecification as MapLibreGeoJSONSourceSpecification, LineLayerSpecification as MapLibreLineLayerSpecification, LngLatBoundsLike as MapLibreLngLatBoundsLike, LngLatLike as MapLibreLngLatLike, Map as MapLibreMap, MapEventType as MapLibreMapEventType, MapMouseEvent as MapLibreMapMouseEvent, MapOptions as MapLibreMapOptions, Popup as MapLibrePopup, PopupOptions as MapLibrePopupOptions, ProjectionSpecification as MapLibreProjectionSpecification, StyleSpecification as MapLibreStyleSpecification, SymbolLayerSpecification as MapLibreSymbolLayerSpecification } from "maplibre-gl"; import type { IGeoLngLatBounds } from "../../types/common/coordinates.js"; export type Map = MapLibreMap; export type Popup = MapLibrePopup; /** * MapLibre style specification. * * @public */ export type StyleSpecification = MapLibreStyleSpecification; export type ProjectionSpecification = MapLibreProjectionSpecification; export type GeoJSONSourceSpecification = MapLibreGeoJSONSourceSpecification; export type FilterSpecification = MapLibreFilterSpecification; export type ExpressionSpecification = MapLibreExpressionSpecification; export type CircleLayerSpecification = MapLibreCircleLayerSpecification; export type SymbolLayerSpecification = MapLibreSymbolLayerSpecification; export type FillLayerSpecification = MapLibreFillLayerSpecification; export type LineLayerSpecification = MapLibreLineLayerSpecification; export type LngLatLike = MapLibreLngLatLike; export type LngLatBoundsLike = MapLibreLngLatBoundsLike; export type MapOptions = MapLibreMapOptions; export type PopupOptions = MapLibrePopupOptions; export type MapMouseEvent = MapLibreMapMouseEvent; /** * Signature of a handler registered through `maplibregl.addProtocol`. */ export type AddProtocolAction = MapLibreAddProtocolAction; /** * Name of a map-level MapLibre event. * * @internal */ export type MapEventName = keyof MapLibreMapEventType; /** * Listener of one map-level MapLibre event, typed by the event name. * * @internal */ export type MapEventListener = (event: MapLibreMapEventType[T]) => void; type AddSourceArgs = Parameters; type AddLayerArgs = Parameters; type GetLayerArgs = Parameters; type GetSourceArgs = Parameters; type RemoveLayerArgs = Parameters; type RemoveSourceArgs = Parameters; type ResizeArgs = Parameters; type CameraForBoundsArgs = Parameters; type CameraForBoundsResult = ReturnType; type FlyToArgs = Parameters; type JumpToArgs = Parameters; type PanToArgs = Parameters; type ZoomToArgs = Parameters; type QueryRenderedFeaturesArgs = Parameters; type QueryRenderedFeaturesResult = ReturnType; type SetLayoutPropertyArgs = Parameters; type SetFilterArgs = Parameters; type StyleResult = ReturnType; type CenterResult = ReturnType; type ZoomResult = ReturnType; type LoadedResult = ReturnType; type TilesLoadedResult = ReturnType; /** * Minimal subset of MapLibre map APIs used across Geo logic and tests. * * @internal */ export declare const MAP_FACADE_SOURCE: unique symbol; export interface IMapFacade { isStyleLoaded(): boolean; once(type: T, listener: MapEventListener): IMapFacade; on(type: T, listener: MapEventListener): IMapFacade; off(type: T, listener: MapEventListener): IMapFacade; addSource(...args: AddSourceArgs): IMapFacade; addLayer(...args: AddLayerArgs): IMapFacade; getLayer(...args: GetLayerArgs): ReturnType; getSource(...args: GetSourceArgs): ReturnType; removeLayer(...args: RemoveLayerArgs): IMapFacade; removeSource(...args: RemoveSourceArgs): IMapFacade; resize(...args: ResizeArgs): IMapFacade; cameraForBounds(...args: CameraForBoundsArgs): CameraForBoundsResult; flyTo(...args: FlyToArgs): IMapFacade; jumpTo(...args: JumpToArgs): IMapFacade; panTo(...args: PanToArgs): IMapFacade; zoomTo(...args: ZoomToArgs): IMapFacade; getBounds(): IGeoLngLatBounds; getCenter(...args: []): CenterResult; getZoom(...args: []): ZoomResult; getStyle(): StyleResult; getCanvas(): HTMLCanvasElement; project(lnglat: LngLatLike): { x: number; y: number; }; loaded(): LoadedResult; areTilesLoaded(): TilesLoadedResult; queryRenderedFeatures(...args: QueryRenderedFeaturesArgs): QueryRenderedFeaturesResult; setLayoutProperty(...args: SetLayoutPropertyArgs): IMapFacade; setFilter(...args: SetFilterArgs): IMapFacade; keyboard: { enable(): void; disable(): void; disableRotation(): void; }; readonly [MAP_FACADE_SOURCE]?: MapLibreMap; } type SetLngLatArgs = Parameters; type SetHtmlArgs = Parameters; type SetMaxWidthArgs = Parameters; /** * Minimal subset of MapLibre popup APIs required by tooltip handlers. * * @internal */ export interface IPopupFacade { setLngLat(...args: SetLngLatArgs): IPopupFacade; setHTML(...args: SetHtmlArgs): IPopupFacade; setMaxWidth(...args: SetMaxWidthArgs): IPopupFacade; setAnchor(anchor: PopupOptions["anchor"]): IPopupFacade; addTo(map: IMapFacade): IPopupFacade; remove(): void; isOpen(): boolean; getElement(): HTMLElement | undefined; } /** * Wraps a MapLibre map into a lightweight facade with the subset of APIs used by Geo logic. * * @param map - MapLibre map instance * @returns Facade object delegating calls to the underlying map * * @internal */ export declare function createMapFacade(map: MapLibreMap): IMapFacade; /** * Converts a MapLibre popup into the facade used by tooltip handlers. * * @param popup - MapLibre popup instance * @returns Facade delegating operations to the underlying popup * * @internal */ export declare function createPopupFacade(popup: Popup): IPopupFacade; /** * Extracts the underlying MapLibre map from a facade instance (if available). * * @param map - Facade instance * @returns MapLibre map or undefined when the facade wraps a mock implementation * * @internal */ export declare function getUnderlyingMap(map: IMapFacade): MapLibreMap | undefined; export {}; //# sourceMappingURL=mapFacade.d.ts.map