import type { MapMarkerData } from './map-marker'; export interface MapClusterConfig { /** * Groups markers by a key you derive — a municipality, a unit, a case number. * Records sharing a key collapse into one marker carrying a count. */ by?: (marker: MapMarkerData, index: number) => string; /** Above this zoom the cluster splits back into individual markers. */ maxZoom?: number; /** * Proximity threshold in pixels. Markers closer than this merge even when * `by` did not group them. Requires a projection to be meaningful. */ radiusPx?: number; } /** A marker that stands for several records. */ export interface MapClusterResult { /** The marker to render — either the original, or a synthesized cluster. */ marker: MapMarkerData; /** Indices into the source array that this marker represents. */ memberIndices: number[]; } /** * Collapses co-located records into counted markers. * * @description * Several records at the same position used to draw several pins on top of each * other, which reads as one point and undercounts the data. A cluster carries a * `badge` with the number it stands for. * * This is also the anonymization hook: `minAggregation` forces grouping whenever * a group holds fewer than N records, so a single individual is never exposed as * an isolated point. That is **display** anonymization — it changes what the * screen shows, not what the payload contains. Coordinates precise enough to * identify someone must be withheld server-side; this cannot do that for you. * * @param minAggregation - Groups smaller than this are merged into the nearest * remaining group rather than plotted individually. `0` disables it. */ export declare function clusterMarkers(markers: MapMarkerData[], cluster: MapClusterConfig | undefined, minAggregation?: number): MapClusterResult[];