/** * deck.gl inside the MapLibre map (ADR-027, phase 3C): the engine layers MapLibre cannot draw — points and lines at * their real height (with stems and ground shadows) and 3D models — rendered by deck.gl in the same WebGL context, * interleaved with MapLibre's layers and terrain. Loaded only when a map has such a layer. * * Heights follow ADR-028: the layer states the reference; heights scale with the terrain's exaggeration so an * aircraft keeps its true relation to the (exaggerated) mountains; `agl` stands on the ground under the object. * No deck.gl type crosses into the engine: the renderer talks to this host, the host to deck.gl. */ import type { MapLayer, SceneObject } from '../core/types.js'; import type { RendererTheme } from './style.js'; type LayerCtor = new (props: Record) => unknown; /** The slice of deck.gl the host uses (tests inject a fake; WebGL is not available in jsdom). */ export interface DeckModules { MapboxOverlay: new (props: { interleaved: boolean; layers: unknown[]; }) => DeckOverlayLike; ScatterplotLayer: LayerCtor; IconLayer: LayerCtor; PathLayer: LayerCtor; LineLayer: LayerCtor; TextLayer: LayerCtor; ScenegraphLayer: LayerCtor; SimpleMeshLayer: LayerCtor; } export interface DeckOverlayLike { setProps(props: { layers: unknown[]; }): void; pickObject(params: { x: number; y: number; radius?: number; }): { object?: unknown; } | null; finalize(): void; } /** What the host needs from the map it lives in. */ export interface DeckHostEnv { addControl(overlay: DeckOverlayLike): void; removeControl(overlay: DeckOverlayLike): void; theme: RendererTheme; /** The label font's family (labels at height are drawn by deck.gl); none = no labels. */ font(): string | undefined; /** The terrain's exaggeration (1 without terrain). */ terrainExaggeration(): number; /** Ground height (already exaggerated, as the map draws it) under a point; 0 when unknown or flat. */ ground(lng: number, lat: number): number; warn(error: Error): void; } /** Default loader: the real deck.gl, split into its own chunks so 2D maps never download it. */ export declare function loadDeck(): Promise; /** * Version shim (MapLibre v6 × deck.gl 9.4): deck.gl's interleaved mode reads MapLibre's private `map.transform` * (height, elevation, _nearZ, _farZ). MapLibre v6 moved the transform under `map._camera` and renamed the planes * to nearZ/farZ. When `map.transform` is missing, define a read-only view onto the v6 transform. Delete this once * deck.gl supports MapLibre v6 natively. */ export declare function shimTransformForDeck(map: object): void; /** Layers this host draws instead of MapLibre: anything at a height, and models. */ export declare function hostedByDeck(layer: MapLayer): boolean; export declare class DeckHost { private readonly env; private readonly load; private modules; private overlay; private loading; private destroyed; private readonly hosted; private warnedEllipsoid; /** Longest side of each model file, in its own units, once loaded (sizes models in metres and pixels). */ private readonly extents; /** * Placed points per layer, keyed by the scene object: the renderer replaces only objects that changed, so a * frame recomputes heights for those alone. Cleared when the layer definition or the ground changes. */ private placed; /** Ground heights by position (terrain lookups are not free); cleared when terrain tiles arrive. */ private groundCache; constructor(env: DeckHostEnv, load?: () => Promise); /** Sets (or replaces) what one engine layer shows. */ setLayer(layer: MapLayer, objects: SceneObject[]): void; removeLayer(id: string): void; has(id: string): boolean; /** Heights depend on the ground: recompute after terrain loads or changes. */ refresh(): void; /** The top object under a screen point among deck.gl-drawn layers. */ pick(x: number, y: number, radius: number): { objectId: string; layerId: string; } | null; destroy(): void; private render; private readonly meshes; private meshFor; /** Height of an object in the map's metres (ADR-028), and the ground under it. */ private place; private altitudeOf; private points; private paths; private deckLayers; } export {};