import { ClusterMapper, Coords, MarkerClusterOptions, MarkerMapper } from "./types"; export type { MarkerClusterOptions, Coords, MarkerMapper, ClusterMapper }; declare class MarkerCluster { /** The points from the last executed {@link MarkerCluster.loadAsync loadAsync} or {@link MarkerCluster.load load} method */ points?: T[]; /** Indicates whether a loading operation is currently in progress */ isLoading: boolean; /** method from {@link MarkerClusterOptions.callback options}, you can use it to update ui after calling {@link MarkerCluster.setZoom setZoom} and/or {@link MarkerCluster.setBounds setBounds} */ callback: () => void; /** * [Worker](https://developer.mozilla.org/en-US/docs/Web/API/Worker/Worker) instance, inits at first {@link MarkerCluster.loadAsync loadAsync} call */ static worker?: Worker; /** * If {@link MarkerCluster.loadAsync loadAsync} was called, use this method to abandon {@link MarkerCluster.worker worker} if it needed */ static cleanup: () => void; /** * @param getLngLat - function to get the latitude and longitude coordinates of a marker * @param options - options for configuring the clustering */ constructor(getLngLat: (item: T) => Coords, options?: MarkerClusterOptions); /** * Loads the given points and clusters them for each zoom level from {@link MarkerClusterOptions.maxZoom maxZoom} to {@link MarkerClusterOptions.minZoom minZoom} * @param points - The points to be clustered */ load: (points: T[]) => this; /** * Loads the given points and asynchronously clusters them for each zoom level from {@link MarkerClusterOptions.maxZoom maxZoom} to {@link MarkerClusterOptions.minZoom minZoom} * @see {@link MarkerCluster.cleanup cleanup} * @description this method use [Worker](https://developer.mozilla.org/en-US/docs/Web/API/Worker/Worker) and fallbacks to {@link MarkerCluster.load load} if {@link MarkerCluster.worker worker} initializing was failed */ loadAsync: (points: T[]) => Promise; /** * Sets current zoom level for {@link MarkerCluster.getPoints getPoints} method */ setZoom: (zoom: number) => this; /** * Sets current bounds for {@link MarkerCluster.getPoints getPoints} method * @param westLng - west longitude boundary * @param southLat - south latitude boundary * @param eastLng - east longitude boundary * @param northLat - north latitude boundary */ setBounds: (westLng: number, southLat: number, eastLng: number, northLat: number) => this; /** * @param expand - for values in range `(0..1)` considered as percentage, otherwise as absolute pixels value to expand given {@link MarkerCluster.setBounds bounds} * @returns array of mapped clusters and points for the given {@link MarkerCluster.setZoom zoom} and {@link MarkerCluster.setBounds bounds} */ getPoints: (markerMapper: MarkerMapper, clusterMapper: ClusterMapper, expand?: number) => (M | C)[]; /** * @returns array with mapped children of cluster */ getChildren: (clusterId: number, markerMapper: MarkerMapper, clusterMapper: ClusterMapper) => (M | C)[]; private readonly _getLngLat; private readonly _minZoom; private readonly _maxZoom; private readonly _radius; private readonly _extent; private _store; private _xArr; private _yArr; private _clustersZoom; private _clustersCount; private _clustersFlat; private _clustersFlatNav; private _zoom; private _bounds?; private static _getWorker; private _getDataArgs; private _setStore; private _getPointsMutator; private _mutatePoints; } export default MarkerCluster;