/** * Pure translation from engine layers and basemap config to MapLibre style objects. * Generic visualization only — nothing here knows what an object represents. */ import type { BasemapConfig, MapLayer, StyleRule, StyleTokens, TerrainConfig } from '../core/types.js'; /** Font name used in `text-font` when the basemap supplies a label font. */ export declare const LABEL_FONT = "me-label"; export interface RendererTheme { markerColor: string; lineColor: string; fillColor: string; selectionColor: string; hoverColor: string; background: string; labelColor: string; labelHalo: string; clusterColor: string; clusterRing: string; clusterText: string; heatLow: string; heatMid: string; heatHigh: string; heatMax: string; trackColor: string; /** Sky and horizon when the camera tilts or the map is a globe (phase 3B). */ skyColor: string; horizonColor: string; hillshadeShadow: string; hillshadeHighlight: string; contourColor: string; } export declare const DEFAULT_THEME: RendererTheme; /** Source options for an engine layer: clustering is a GeoJSON source option. */ export declare function sourceSpecFor(layer: MapLayer): Record; /** Source and layer ids of the terrain the renderer adds under the engine's layers (phase 3B). */ export declare const TERRAIN_SOURCE = "me:terrain-dem"; export declare const HILLSHADE_SOURCE = "me:hillshade-dem"; export declare const HILLSHADE_LAYER = "me:hillshade"; /** A raster-dem source for a terrain config (one for the 3D surface, one for hillshade: MapLibre advises two). */ /** A `pmtiles://` archive is one URL (MapLibre reads its tiles through the pmtiles protocol), not a tile template. */ export declare const isPmtiles: (url: string | undefined) => boolean; export declare function demSourceFor(terrain: TerrainConfig): Record; /** Relief shading from the terrain, drawn under every engine layer. */ export declare function hillshadeLayer(theme: RendererTheme): Record; export declare const CONTOUR_SOURCE = "me:contours"; export declare const CONTOUR_LINES = "me:contour-lines"; export declare const CONTOUR_LABELS = "me:contour-labels"; /** Contour lines (doc 28 G11) from a vector source of `contours` features with `ele` and `level` (1 = index line). */ export declare function contourLayers(theme: RendererTheme, color: string | undefined, hasFont: boolean): Array>; /** Images a layer needs registered before its symbol layers render. */ export declare function imagesFor(layer: MapLayer): Array<{ id: string; shape?: NonNullable['shape']; url?: string; }>; /** Prefix for every source and style layer the engine owns, so basemap layers are never touched. */ export declare const PREFIX = "me"; export declare const sourceId: (layerId: string) => string; export declare const OBJECT_ID_PROP = "__oid"; export declare const LAYER_ID_PROP = "__lid"; /** Marks the one label point an area gets in its own source (so a large area is labelled once, not once per tile). */ export declare const LABEL_POINT_PROP = "__lp"; /** Area layers with a label carry a label point per object next to the shape. */ export declare function needsLabelPoints(layer: MapLayer): boolean; /** Data-driven dashes (StyleTokens.dash), first matching rule wins; null when no rule asks for dashes. */ export declare function dashExpression(rules: StyleRule[] | undefined): unknown; export type StyleLayerSpec = Record & { id: string; type: string; source?: string; }; /** MapLibre style for the configured basemap. 'none' needs no network at all. */ export declare function basemapStyle(basemap: BasemapConfig, theme: RendererTheme): string | Record; /** * A fetched street-map style with the engine's label font added (MapLibre v6 font-faces) and its relative URLs * made absolute, so it can be passed as an object. */ export declare function withLabelFont(style: Record, styleUrl: string, fontUrl: string): Record; /** The MapLibre condition for one rule, or null when the rule cannot be expressed (it is then skipped). */ export declare function ruleCondition(rule: StyleRule): unknown | null; /** A token's expression: a continuous scale's per-object value (`$s:`) first, then the rules. */ export declare function tokenExpression(rules: StyleRule[] | undefined, key: K, fallback: NonNullable): unknown; /** The MapLibre style layers for one engine layer, bottom to top. Labels need a label font (`hasFont`). */ export declare function styleLayersFor(layer: MapLayer, theme: RendererTheme, hasFont?: boolean): StyleLayerSpec[];