import type { ColorToken, LatLng, MapFeatureRef } from './map.types'; import { type MapDataLayer, type MapLayerVisibility } from './map-layers-model'; export interface MapGeometryBase { id: string; /** Semantic token. Wins over the literal color fields. */ colorToken?: ColorToken; /** Literal escape hatch, kept for parity with the singular `circle`/`polygon`. */ fillColor?: string; strokeColor?: string; /** @default 0.2 */ fillOpacity?: number; /** @default 0.8 */ strokeOpacity?: number; /** @default 2 */ strokeWeight?: number; /** Ties the shape to a `dataLayers` entry. */ layerId?: string; zIndex?: number; /** Multiplied with the layer's opacity. @default 1 */ opacity?: number; /** Native tooltip text shown on hover. */ title?: string; data?: unknown; } export interface MapPolygonShape extends MapGeometryBase { /** A single ring, or a ring plus holes. */ paths: LatLng[][] | LatLng[]; } export interface MapCircleShape extends MapGeometryBase { center: LatLng; radiusMeters: number; } /** * An antenna coverage wedge: vertex on the site, opening `beamWidth` degrees * around `azimuth` and reaching `radiusMeters`. */ export interface MapSectorShape extends MapGeometryBase { center: LatLng; /** Degrees clockwise from north. */ azimuth: number; /** Angular width of the beam, in degrees. 360 or more draws a full circle. */ beamWidth: number; radiusMeters: number; /** Arc resolution. Raise it for very wide beams. @default 24 */ steps?: number; } /** A line through arbitrary coordinates — not a Directions route. */ export interface MapPolylineShape extends MapGeometryBase { path: LatLng[]; /** Stroke width in pixels. @default 2.5 */ weightPx?: number; /** * Dash pattern as `"dash gap"` in pixels, e.g. `"6 5"`. Rendered with Maps * symbol icons, since Polyline has no native dash support. */ dash?: string; } export interface UseMapGeometryOptions { map: google.maps.Map | null; isLoaded: boolean; polygons?: MapPolygonShape[]; circles?: MapCircleShape[]; sectors?: MapSectorShape[]; polylines?: MapPolylineShape[]; /** Resolved literal colors keyed by token name. */ colors: Record; defaultPolygonColor: string; defaultCircleColor: string; dataLayers?: MapDataLayer[]; layerVisibility: MapLayerVisibility; onSelect?: (id: string, feature: MapFeatureRef) => void; onHover?: (id: string | null, feature: MapFeatureRef | null) => void; } /** * Renders any number of polygons and circles onto the map. * * @description * Replaces the one-polygon / one-circle limit. Applications need antenna * coverage sectors per station, a geofence and convergence circles on screen at * the same time — with a single slot each, they could not. * * Instances are reconciled by `id` rather than torn down and rebuilt, so a * change to one shape does not make every other shape flicker, and Google's * event listeners survive unrelated re-renders. */ export declare function useMapGeometry({ map, isLoaded, polygons, circles, sectors, polylines, colors, defaultPolygonColor, defaultCircleColor, dataLayers, layerVisibility, onSelect, onHover, }: UseMapGeometryOptions): void;