@yandex/ymaps3-types
Version:
Types for ymaps3 maps library
45 lines (44 loc) • 1.96 kB
TypeScript
import type TReact from "react";
import type { LngLat, YMapEntity } from "../../../..";
import type { CustomReactify, OverrideProps, Prettify } from "../../../../reactify/reactify";
import type { Feature } from "../interface";
import type { YMapClusterer as YMapClustererI, YMapClustererProps } from "../YMapClusterer";
/**
* Create reactified version of YMapCluster module
*
* @example
* ```jsx
* <YMap location={LOCATION} ref={x => map = x}>
* <YMapDefaultSchemeLayer />
* <YMapFeatureDataSource id="my-source"/>
* <YMapLayer source="my-source" type="markers" zIndex={1800}/>
* <YMapClusterer
* marker={(feature) => <YMapMarker
* coordinates={feature.geometry.coordinates}
* source={'my-source'} >
* <img src={'./pin.svg'}/>
* </YMapMarker>}
* cluster={(coordinates, features) => <YMapMarker
* coordinates={coordinates}
* source={'my-source'} >
* <div className="circle">
* <div className="circle-content">
* <span className="circle-text">{features.length}</span>
* </div>
* </div>
* </YMapMarker>}
* method={gridSizedMethod}
* features={points}
* />
* </YMap>
* ```
*/
type YMapClustererReactifiedProps = Prettify<OverrideProps<YMapClustererProps, {
/** Function that returns YMapMarker react component to render marker*/
marker: (feature: Feature) => TReact.ReactElement;
/** Function that returns YMapMarker react component to render cluster*/
cluster: (coordinates: LngLat, features: Feature[]) => TReact.ReactElement;
}>>;
type YMapClustererR = TReact.ForwardRefExoticComponent<Prettify<YMapClustererReactifiedProps & React.RefAttributes<YMapEntity<YMapClustererReactifiedProps>>>>;
export declare const YMapClustererReactifyOverride: CustomReactify<YMapClustererI, YMapClustererR>;
export {};