import type { FastifyPluginAsync } from "fastify"; import { type WorldAabb } from "@uptimizr/db"; import type { CollectorConfig } from "../config.js"; import type { CollectorStore } from "../store.js"; interface Options { store: CollectorStore; config: CollectorConfig; } /** * A parsed `region` querystring value: either an explicit box or the id of a * region registered in the scene registry (ADR 0051 §2), which the route * resolves to that region's stored bounds before the store ever sees it. */ export type RegionFilter = { kind: "box"; bounds: WorldAabb; } | { kind: "id"; id: string; }; /** Why a `region=` filter could not be resolved, for the 400 body. */ export type RegionResolutionError = { error: string; }; export declare function isRegionError(value: unknown): value is RegionResolutionError; /** * Resolve a parsed `region` filter to the world box the aggregations take. * * A box passes straight through. A **region id** is looked up in the scene * registry: regions are keyed by `(project, scene, region)`, so the request must * also name the `scene` the region belongs to, and an id the project has never * registered is a client error (`400`) rather than a silently unfiltered query — * an agent must never be told "no hits in the entrance" when it merely misspelt * the region. Returns the box, `undefined` when no filter was given, or an error * object the caller turns into a `400`. */ export declare function resolveRegionFilter(store: CollectorStore, projectId: string, scene: string | undefined, filter: RegionFilter | undefined): Promise; /** The resolution rule itself; see {@link resolveSpatialCellSize}. */ export declare function computeSpatialCellSize(store: CollectorStore, projectId: string, opts: { cellSize?: number; scene?: string; region?: WorldAabb; }): Promise; /** * Query API. All aggregations are computed at query time (v1). Every route is * scoped to the authenticated project. */ export declare const queryRoutes: FastifyPluginAsync; export {}; //# sourceMappingURL=query.d.ts.map