import { GlyphDownloadStats } from './style-downloader.cjs'; import { TileDownloadStats } from './tile-downloader.cjs'; import { D as DownloadStream } from './types-yLQy3AKR.cjs'; import { BBox } from './utils/geo.cjs'; import 'ky'; import 'stream'; import '@maplibre/maplibre-gl-style-spec'; import './utils/fetch.cjs'; import './utils/streams.cjs'; import 'readable-stream'; import 'geojson'; import 'type-fest'; import 'events'; /** * @typedef {object} DownloadProgress * @property {import('./tile-downloader.js').TileDownloadStats & { done: boolean }} tiles * @property {{ done: boolean }} style * @property {{ downloaded: number, done: boolean }} sprites * @property {import('./style-downloader.js').GlyphDownloadStats & { done: boolean }} glyphs * @property {{ totalBytes: number, done: boolean }} output * @property {number} elapsedMs */ /** * Download a map style and its resources for a given bounding box and max zoom * level. Returns a readable stream of a "styled map package", a zip file * containing all the resources needed to serve the style offline. * * @param {object} opts * @param {import("./utils/geo.js").BBox} opts.bbox Bounding box to download tiles for * @param {number} opts.maxzoom Max zoom level to download tiles for * @param {string} opts.styleUrl URL of the style to download * @param { (progress: DownloadProgress) => void } [opts.onprogress] Optional callback for reporting progress * @param {string} [opts.accessToken] * @returns {import('./types.js').DownloadStream} Readable stream of the output styled map file */ declare function download({ bbox, maxzoom, styleUrl, onprogress, accessToken }: { bbox: BBox; maxzoom: number; styleUrl: string; onprogress?: ((progress: DownloadProgress) => void) | undefined; accessToken?: string | undefined; }): DownloadStream; type DownloadProgress = { tiles: TileDownloadStats & { done: boolean; }; style: { done: boolean; }; sprites: { downloaded: number; done: boolean; }; glyphs: GlyphDownloadStats & { done: boolean; }; output: { totalBytes: number; done: boolean; }; elapsedMs: number; }; export { type DownloadProgress, download };