/** * Query planner foundation (doc 13). Decides what to push to the provider and what to filter on the client. * * - Identical layer queries share one provider call (and one realtime subscription). * - Spatial predicates and the viewport boundary are pushed down when the provider supports spatial * queries; otherwise the call carries only the semantic part and the client filters exactly. */ import type { BoundingBox, MapLayer, SpatialQuery } from '../core/types.js'; import type { DataCapabilities } from '../data/contracts.js'; import { type QueryHints } from '../layers/layers.js'; export interface PlannedCall { key: string; /** What the provider is asked. */ query: SpatialQuery; layerIds: string[]; /** True when spatial parts were left to the client because the provider cannot evaluate them. */ localSpatial: boolean; } export interface QueryPlan { calls: PlannedCall[]; layers: number; /** Layers served by a call another layer already needed. */ deduplicated: number; pushedDown: boolean; } export declare function planQueries(layers: MapLayer[], bounds: BoundingBox | undefined, capabilities: DataCapabilities, hints?: QueryHints): QueryPlan;