import type { LatLng } from './map.types'; export interface MapBoundsLiteral { north: number; south: number; east: number; west: number; } /** Either an explicit rectangle or a set of points to be enclosed. */ export type MapBounds = LatLng[] | MapBoundsLiteral; /** What the map should frame itself around. */ export type MapFitTarget = 'markers' | 'shapes' | 'all' | 'none'; /** A named camera position the user can jump back to. */ export interface MapView { id: string; label: string; center?: LatLng; zoom?: number; bounds?: MapBounds; } export interface UseMapFitOptions { map: google.maps.Map | null; /** Explicit frame. Takes precedence over `fitTo`. */ bounds?: MapBounds; /** @default 'none' — the map keeps whatever `center`/`zoom` say. */ fitTo?: MapFitTarget; /** Pixels of breathing room around the fitted content. @default 34 */ fitPadding?: number; /** Never zoom in past this level when fitting. */ maxZoomOnFit?: number; /** Positions contributed by `markers`. */ markerPositions: LatLng[]; /** Positions contributed by circles, polygons and other geometry. */ shapePositions: LatLng[]; views?: MapView[]; activeViewId?: string; } /** * Keeps the camera aligned with the data. * * @description * Seven of the sixteen surveyed applications re-frame the map on every filter * change and keep a "back to overview" button beside it. With only `center` and * `zoom` available, each filter change left the viewport pointing somewhere the * data no longer was. * * The effect re-runs when the fitted positions change, which is what makes * "filter the data, the map follows" work without any imperative call. An active * `views` entry always wins over automatic fitting — an explicit user choice * should not be overridden by the next data refresh. */ export declare function useMapFit({ map, bounds, fitTo, fitPadding, maxZoomOnFit, markerPositions, shapePositions, views, activeViewId, }: UseMapFitOptions): void;