import type { GeoJsonPosition, MapApi } from "../core/types"; /** * A point entity that can be tested against the cursor. `position` is the * geographic anchor as `[lng, lat]`. */ export type EntityNearCursor = Readonly<{ id: string; position: GeoJsonPosition; }>; export type UseEntitiesNearCursorOptions = Readonly<{ /** The point entities to hit-test against the cursor on every move. */ entities: ReadonlyArray; /** Hit radius around the cursor, in CSS pixels. */ radiusPx: number; }>; /** * The **Entities Near Cursor** primitive: returns a referentially-stable * `ReadonlySet` of entity ids whose projected position is within * `radiusPx` CSS pixels of the projected cursor, nearest-first. * * It is the point-marker counterpart to **Shapes Under Cursor** and runs on the * same pure Web Mercator substrate (`@trackunit/geo-json-utils`) fed by * `useCameraState` + the RAF-throttled `pointermove` event — adapter-agnostic by * construction (see ADR-0025). The hook owns radius geometry only; consumers * decide why the ids are wanted (preload, highlight, …) and may cap the set to * the nearest N via iteration order. * * The returned Set keeps a stable identity until either its membership or its * nearest-first ordering changes, so wiring it straight into a memo or query * does not churn while the cursor drifts within the same cluster of dots at the * same relative distances. The host only re-renders when membership or ordering * actually changes: the cursor lives in a ref and recomputes commit through an * order-sensitive functional update that bails out (returns the previous Set) * when nothing changed. */ export declare const useEntitiesNearCursor: (api: MapApi, options: UseEntitiesNearCursorOptions) => ReadonlySet;