import { ReactNode } from 'react'; import { StyleSpecification, Map as MapLibreMap } from 'maplibre-gl'; /** * MapShell — data-agnostic MapLibre GL mount container (GAP-04). * * Owns ONLY the shared chrome that every MapLibre surface reproduces: WebGL * feature-gate, the sized container element, map construction boilerplate, the * RAF 0×0-container guard, ResizeObserver re-fit, and teardown. It deliberately * does NOT own style/paint/data/interactions — the app wires those against the * live map via the `onMapReady(map)` seam. This lets a glance map (interactive * false) and a drill-down map (interactive true) share one component with zero * fork. * * The root carries a `.map-shell` scope class so the shipped popup re-skin * (`MapShell.css`) never collides across two mounted maps. Base MapLibre control * styles are NOT bundled — a consumer whose map shows controls imports * `maplibre-gl/dist/maplibre-gl.css` itself (it holds the maplibre-gl peer dep). * * maplibre-gl is an OPTIONAL peer dependency; code-split your map surface * (`React.lazy`) so non-map routes never load it. */ export interface MapShellProps { /** MapLibre style document (sources + layers) built by the consumer. */ style: StyleSpecification; /** `[west, south, east, north]` to fit on load + resize. Omit for style-driven framing. */ bounds?: [number, number, number, number]; /** Padding (px) for `fitBounds`. Default `24`. */ fitBoundsPadding?: number; /** Enable pan/zoom. Default `false` (a static glance map). */ interactive?: boolean; /** Keep the WebGL drawing buffer across composites. Default `true` (required for non-interactive maps to paint). */ preserveDrawingBuffer?: boolean; /** Optional glyphs endpoint merged into the style. */ glyphs?: string; /** * Called once the map's `load` fires (after the 0×0 guard). Wire paint, * layer visibility, interactions, and data here against the live `map`. * Return a cleanup that runs on unmount. */ onMapReady?: (map: MapLibreMap) => void | (() => void); /** * Called with the loaded `maplibre-gl` module IMMEDIATELY before the map is * constructed — the seam for global setup that must precede style load, e.g. * `maplibre.addProtocol(...)` for a custom glyph/tile protocol (`onMapReady` * fires post-`load`, too late for protocol registration). */ preMapInit?: (maplibre: typeof import("maplibre-gl")) => void; /** Rendered instead of the map when WebGL is unavailable. Defaults to a built-in panel. */ webglFallback?: ReactNode; /** Overlay shown centered over the map until it is ready (or while `isLoading`). */ loadingOverlay?: ReactNode; /** Forces the loading overlay even after the map is ready. */ isLoading?: boolean; /** Applied to the root — the consumer supplies its own glass frame token here. */ className?: string; /** Overlay content positioned over the map (e.g. a floating control). */ children?: ReactNode; "data-testid"?: string; } export declare function MapShell({ style, bounds, fitBoundsPadding, interactive, preserveDrawingBuffer, glyphs, onMapReady, preMapInit, webglFallback, loadingOverlay, isLoading, className, children, "data-testid": dataTestId, }: MapShellProps): import("react").JSX.Element; export declare namespace MapShell { var displayName: string; } //# sourceMappingURL=MapShell.d.ts.map