import { SQLiteHTTPPool, VFSHTTP } from 'sqlite-wasm-http'; import { Options as ImageTileOptions } from 'ol/source/TileImage.js'; import { Options as OLVectorTileOptions } from 'ol/source/VectorTile.js'; import TileGrid from 'ol/tilegrid/TileGrid.js'; import { FeatureLike } from 'ol/Feature.js'; type IfAny = 0 extends 1 & T ? Y : N; type VectorTileOptions = IfAny, OLVectorTileOptions, OLVectorTileOptions>; /** * Options for creating a MBTilesRasterSource */ export interface MBTilesRasterOptions extends ImageTileOptions { /** * Number of parallel workers to use for retrieving tiles, @default 4 */ sqlWorkers?: number; /** * List of layer names to selectively include, @default everything */ layers?: string[]; tileUrlFunction?: never; tileLoadFunction?: never; /** * Alternative method of specifying minZoom, mutually exclusive with tileGrid, requires explicit projection. * This refers to the available zoom levels of the tiled data and it is different from the OpenLayers minZoom * parameter that applies to the layer. */ minZoom?: number; /** * Alternative method of specifying maxZoom, mutually exclusive with tileGrid, requires explicit projection * This refers to the available zoom levels of the tiled data and it is different from the OpenLayers maxZoom * parameter that applies to the layer. */ maxZoom?: number; /** * Optional tile grid, refer to the Openlayers manual */ tileGrid?: TileGrid; /** * Optional already open SQLiteHTTP pool (mutually exclusive with url) */ pool?: Promise; /** * Optional MIME type for loaded tiles (see https://github.com/mmomtchev/ol-mbtiles/issues/68) */ mime?: string; } /** * Options for creating a MBTilesVectorSource */ export interface MBTilesVectorOptions extends VectorTileOptions { /** * Number of parallel workers to use for retrieving tiles, @default 4 */ sqlWorkers?: number; /** * List of layer names to selectively include, @default everything */ layers?: string[]; /** * Minimum available zoom level. * This refers to the available zoom levels of the tiled data and it is different from the OpenLayers minZoom * parameter that applies to the layer. */ minZoom?: number; /** * Maximum available zoom level. * This refers to the available zoom levels of the tiled data and it is different from the OpenLayers maxZoom * parameter that applies to the layer. */ maxZoom?: number; /** * Optional already open SQLiteHTTP pool (mutually exclusive with url) */ pool?: Promise; tileUrlFunction?: never; tileLoadFunction?: never; format?: never; } /** * Shared options for all MBTiles */ export interface SQLOptions { /** * URL of the remote MBTiles source */ url: string; /** * Number of parallel workers to use for retrieving tiles, @default 4 */ sqlWorkers?: number; /** * Maximum expected page size in bytes for SQLite3 files, @default 4096 */ maxSqlPageSize?: number; /** * Memory to use for SQLite cache in KB, @default 4096 */ sqlCacheSize?: number; /** * Use a specific backend type, @default 'shared' */ backendType?: VFSHTTP.Options['backendType']; } export type MBTilesOptions = MBTilesVectorOptions | MBTilesRasterOptions; export declare function httpPoolOptions(options?: SQLOptions): { workers: number; httpOptions: VFSHTTP.Options; }; /** * Automatically import MBTiles metadata and return an options object * compatible with the source constructors. * * @param {(MBTilesRasterOptions | MBTilesVectorOptions) & SQLOptions} opt Any MBTiles{Raster|Vector}Source options to be overridden * @param {string} opt.url URL of the remote tileset * @returns {(MBTilesRasterOptions | MBTilesVectorOptions)} */ export declare function importMBTiles(opt: SQLOptions & T): Promise; export {};