import { LayerExtension } from "@deck.gl/core"; import type { Layer } from "@deck.gl/core"; import type { LayerIR } from "./ir"; export interface ClipBoxIR { /** [lng, lat, elevationMeters] — one corner. Order vs. `max` doesn't matter; both get componentwise min/max'd after projecting. */ min: [number, number, number]; max: [number, number, number]; /** Show OUTSIDE the box instead of inside. */ invert: boolean; /** Dim clipped-out geometry instead of discarding it — "non-destructive": nothing disappears, it just de-emphasizes. */ highlight: boolean; } /** `` → `ClipBoxIR`, or `null` when min/max aren't both present/valid (no box = no clipping, not a broken one). */ export declare function parseClipBoxAttrs(getAttr: (name: string) => string | null): ClipBoxIR | null; export interface ClipBoxExtensionProps { clipBoxMin?: [number, number, number]; clipBoxMax?: [number, number, number]; clipBoxInvert?: boolean; clipBoxHighlight?: boolean; } /** Fragment-level box clip (targets extruded/mesh geometry — GeoJsonLayer extrusions, Tile3DLayer/BIMLayer triangles — not point/icon anchors, unlike the built-in ClipExtension's dual vertex/fragment modes; this library's clip-box use case is "cut into a 3D scene," not "hide points outside a rect"). */ export declare class ClipBoxExtension extends LayerExtension { static extensionName: string; static defaultProps: { clipBoxMin: number[]; clipBoxMax: number[]; clipBoxInvert: boolean; clipBoxHighlight: boolean; }; getShaders(): { modules: { readonly name: "clipBox"; readonly fs: "\nlayout(std140) uniform clipBoxUniforms {\n vec3 boxMin;\n vec3 boxMax;\n float invert;\n float highlight;\n vec4 highlightTint;\n} clipBox;\n\nbool clipBox_isInside(vec3 commonPos) {\n return commonPos.x >= clipBox.boxMin.x && commonPos.x <= clipBox.boxMax.x\n && commonPos.y >= clipBox.boxMin.y && commonPos.y <= clipBox.boxMax.y\n && commonPos.z >= clipBox.boxMin.z && commonPos.z <= clipBox.boxMax.z;\n}\n"; readonly uniformTypes: { readonly boxMin: "vec3"; readonly boxMax: "vec3"; readonly invert: "f32"; readonly highlight: "f32"; readonly highlightTint: "vec4"; }; }[]; inject: { "vs:#decl": string; "vs:DECKGL_FILTER_GL_POSITION": string; "fs:#decl": string; "fs:DECKGL_FILTER_COLOR": string; }; }; draw(this: Layer>): void; } export interface ClipBoxLayerPatch { /** * The deck-layer id to construct with. Suffixed `#c` while a * box is active and this layer is opted in: adding/removing an extension * on a LIVE (already-mounted) layer corrupts DataFilterExtension's * attribute state for some layer types (ColumnLayer, Tile3DLayer/BIMLayer * sublayers — empirically verified: a box present from the FIRST render * works fine, but toggling one on live on an already-mounted filtered * layer silently blanks it, with no console error) — the exact same * "birth-stable extension set" issue `applyTerrain`'s own `deckId` * suffixing already works around. A fresh id forces clean teardown + * rebuild instead of a live prop update. */ deckId: string; extraProps: Record; } /** * Per-layer clip-box patches, PURE — mirrors `applyTerrain`'s exact shape * (same file this gets merged alongside in runtime-core.ts's `buildLayers`). * Default is APPLIED (every layer gets clipped once a box is configured), * unlike terrain's per-layer OPT-IN default — the clip box's whole point is * cutting into "the scene," and requiring every single layer to opt in * individually would make the common case ("cut through everything, show me * what's inside") the awkward one; `clip="off"` is the escape hatch for the * layers that shouldn't be touched (a basemap, most often). */ export declare function applyClipBox(irs: readonly LayerIR[], clipBox: ClipBoxIR | null, generation: number): Map;