/** * Basemap preset registry (spec: "Basemap presets & switching") — the sixth * plugin surface, alongside registerLayer/Widget/Action/Source/Format. * Deliberately maplibre-free: validation, html-data generation, and om-map * all consult it without pulling the ~326 KB gz maplibre chunk; only * basemap.ts (already inside that chunk) consumes the resolved style. * * A MapTiler key is a PUBLISHABLE, origin-restricted client key — it ships * in page source by design, so unlike data credentials (configureData) it * may appear in markup (`basemap-key`) or be configured once * (`OmMap.configureBasemap({ maptilerKey })`). */ /** A MapLibre style: a URL string (possibly with a `{key}` placeholder) or an inline style-spec object. */ export type BasemapStyle = string | Record; export interface BasemapPreset { style: BasemapStyle; /** Extra attribution line beyond what the style's tile sources declare (MapLibre renders source attributions automatically). */ attribution?: string; /** Display name for the basemap-switcher widget (falls back to the preset name). */ label?: string; /** Which key `{key}` substitutes — currently only "maptiler". */ requiresKey?: "maptiler"; } /** MapLibre's own official, freely-hosted demo style — the zero-config `basemap="maplibre"` default (back-compat). */ export declare const MAPLIBRE_DEMO_STYLE = "https://demotiles.maplibre.org/style.json"; /** * Is this `basemap` value a bring-your-own style URL rather than a preset * name? Any URL scheme counts, not just http(s) — desktop webviews serve * styles over custom protocols (Tauri `asset://` / `nika-file://`, Electron * equivalents), and a query string must not defeat the `.json` path form * (`nika-file:///styles/dark.json?v=2`). */ export declare function isStyleUrl(raw: string): boolean; export declare function registerBasemap(name: string, preset: BasemapPreset): void; export declare function getBasemap(name: string): BasemapPreset | undefined; export declare function getAllBasemaps(): ReadonlyMap; /** Provider keys for keyed presets — one call covers every layer of the app. */ export declare function configureBasemap(config: { maptilerKey?: string; }): void; /** Static-validation support: is a key available for this provider (from configureBasemap)? */ export declare function hasConfiguredKey(provider: "maptiler"): boolean; /** The configured key itself — terrain presets substitute it the way resolveBasemapStyle does (publishable client key, internal use). */ export declare function getConfiguredKey(provider: "maptiler"): string | undefined; export interface ResolvedBasemap { style: BasemapStyle; attribution?: string; /** Resolution problem (unknown name / missing key) — the caller decides how loudly to fail; `style` is always usable (demo fallback). */ error?: string; } /** * `basemap` attribute value → concrete style. Precedence: explicit URL / * `.json` path passes through untouched (bring-your-own, keys inline); * `maplibre` / `maplibre-*` → the demo style (back-compat); anything else * is a registry lookup. Unknown names and keyless keyed presets resolve to * the demo style WITH an `error` — the live path logs it, validation turns * it into a structured entry, and the map still renders something. */ export declare function resolveBasemapStyle(raw: string, keyAttr?: string): ResolvedBasemap;