export declare const COPERNICUS_BASE_URL = "https://copernicus-dem-30m.s3.amazonaws.com"; export declare const COPERNICUS_ATTRIBUTION: string; export interface DemWindowRequest { /** Plan AABB in scene metres: [[minX, minZ], [maxX, maxZ]]. x = east, z = SOUTH (z = -northing). */ boundsXZ: [[number, number], [number, number]]; /** Scene metres -> [lonDeg, latDeg]. Supplied by the caller (local transverse Mercator); this module has no projection of its own. */ toLonLat(x: number, z: number): [number, number]; /** Square lattice spacing of the output in metres. Default 30. */ metresPerSample?: number; /** Extra metres around boundsXZ so edge consumers can interpolate. Default 2 * metresPerSample. */ marginM?: number; /** Directory for cached tile headers + fetched byte ranges (so reruns are offline-capable and polite). Optional. */ cacheDir?: string; /** Injectable for tests. Default globalThis.fetch. */ fetch?: typeof fetch; /** Override the bucket base URL (tests use a local http server). Default https://copernicus-dem-30m.s3.amazonaws.com */ baseUrl?: string; /** Bounded retry with exponential backoff on 5xx/429/network errors. Default 4 attempts. */ retries?: number; /** First backoff delay in ms (doubles per attempt, capped at 8 s). Default 250; tests lower it. */ backoffBaseMs?: number; } export interface DemTileReport { id: string; url: string; /** Bytes pulled over the network for this tile in this run (0 when served from the cache). */ bytesFetched: number; /** sha256 over the byte ranges this build read from the object, in ascending offset order; absent for a missing tile. */ sha256OfFetchedRanges?: string; /** Set when the bucket has no such tile (open ocean) and it was read as 0 m. */ note?: string; } export interface DemWindow { /** Samples per row / number of rows; row 0 is the NORTH edge (smallest z, since z = -northing) and x increases east. */ samplesX: number; samplesZ: number; metresPerSample: number; /** Scene metres [x, z] of sample (0,0) (the north-west corner sample). Sample (i,j) sits at (x0 + i*mps, z0 + j*mps). */ originXZ: [number, number]; /** Orthometric metres (Copernicus GLO-30 is a DSM on EGM2008), row-major, X fastest, Float32Array. NaN never appears: nodata is filled (nearest valid, ocean void = 0) and counted in stats. */ heights: Float32Array; min: number; max: number; tiles: DemTileReport[]; stats: { requests: number; bytesFetched: number; nodataFilled: number; cacheHits: number; /** Byte ranges this window needed, whether they came from the network or the cache: the figure that does not vary with a warm cache. */ rangesUsed: number; bytesUsed: number; }; /** Bilinear lookup at scene metres; clamps to the window edge. */ sampleAt(x: number, z: number): number; } export declare function fetchCopernicusWindow(req: DemWindowRequest): Promise;