import type { GeoJsonPosition } from "../../core/types"; /** * Fires `onPreload` when the given `entityId` has been hovered continuously * for `debounceMs` milliseconds. Rapid mouse passes are filtered out. * * The consumer owns hover state — source `entityId` from * `layers.interaction.hoveredEntity?.id ?? null`. */ export type HoverPanelPreloadInitiator = Readonly<{ type: "hover"; entityId: string | null; /** * Milliseconds to wait before firing `onPreload` after hover starts. * Default: 150. */ debounceMs?: number; }>; /** * Fires `onPreload` for the `count` entities nearest to `referenceEntityId` * whenever the reference changes or the map viewport moves. * * When `referenceEntityId` is `null` the initiator is skipped — pass the * currently-selected entity id to pre-warm data for adjacent assets. */ export type ProximityPanelPreloadInitiator = Readonly<{ type: "proximity"; /** * ID of the entity to compute proximity from. * `null` disables the initiator until a selection is made. */ referenceEntityId: string | null; /** All visible entities with their positions for proximity ranking. */ entities: ReadonlyArray>; /** * Maximum number of nearest entities to preload. * Default: 5. */ count?: number; }>; export type PanelPreloadInitiator = HoverPanelPreloadInitiator | ProximityPanelPreloadInitiator; export type PanelPreloadInitiatorType = PanelPreloadInitiator["type"];