import { type Bbox, type RawOsm, type Tags } from './raw'; export declare const DEFAULT_OVERPASS_ENDPOINTS: string[]; /** Above this the public instances time out or refuse; a PBF extract is the right tool. */ export declare const OVERPASS_MAX_AREA_KM2 = 150; export interface OverpassPart { name: string; query: string; } /** * The importer's reads, split into small families that run one after another. A single union of all of them made the * public instances answer 504 "dispatcher timeout" for a 4 x 4 km box while each family alone returned in 3-25 s, so * the polite shape is several modest queries rather than one heavy one. `out body geom` returns each way's node ids AND * its coordinates, and each relation member way's coordinates, so there is no recursion round trip. */ export declare function buildOverpassQueries(bbox: Bbox, timeoutS?: number): OverpassPart[]; export declare function bboxAreaKm2(bbox: Bbox): number; export interface OverpassOptions { endpoints?: string[]; /** Directory for raw responses, keyed by the sha256 of each query. */ cacheDir?: string; fetch?: typeof fetch; attempts?: number; /** Base backoff in ms; doubled per attempt. Tests pass 0. */ backoffMs?: number; /** Pause between the family queries, ms. Tests pass 0. */ gapMs?: number; log?: (message: string) => void; userAgent?: string; } interface OverpassElement { type: 'node' | 'way' | 'relation'; id: number; lat?: number; lon?: number; nodes?: number[]; geometry?: Array<{ lat: number; lon: number; } | null>; members?: Array<{ type: 'node' | 'way' | 'relation'; ref: number; role: string; geometry?: Array<{ lat: number; lon: number; } | null>; lat?: number; lon?: number; }>; tags?: Tags; } interface OverpassResponse { osm3s?: { timestamp_osm_base?: string; }; elements: OverpassElement[]; remark?: string; } /** Fetches (or replays from cache) the Overpass responses for a bbox: bounded retries, mirror failover, merged by element id. */ export declare function fetchOverpass(bbox: Bbox, options?: OverpassOptions): Promise; /** Overpass JSON (`out body geom`) to the common shape. */ export declare function parseOverpass(response: OverpassResponse): RawOsm; export {};