/** * SSR-safe environment guards. The library must be import-safe outside a * browser (Next.js server components, Jest/Vitest in node, agent pipelines * running pre-flight validation server-side) — the research-validated * failure mode is touching browser globals at import time (Mapbox GL's * six-years-open #4593). Two rules keep us clean: * * 1. No module evaluates a browser global at import time. Class * declarations `extends HTMLElementBase` (below) instead of * `extends HTMLElement`, and element registration goes through * `defineElement`, which no-ops outside a browser. * 2. Everything that genuinely needs a DOM (rendering, observers, * sandbox iframes) touches it inside methods/functions only. * * Outside a browser the custom elements are inert-but-importable: the * classes exist (so types, registries, validation, expression compilation, * and IR snapshots all work), they just never register or upgrade. */ export declare const isBrowser: boolean; /** * Base class for the om-* custom elements. In a browser this IS * HTMLElement; in node it's an empty class so the module can evaluate. * Constructing an element outside a browser is not supported (nothing * registers them there), so the stub never needs real behavior. */ export declare const HTMLElementBase: typeof HTMLElement; /** * `customElements.define`, guarded twice: no-op outside a browser, and * idempotent under double-import (a second `define` of the same name * throws — a real hazard when a CDN tag and a bundled import coexist). */ export declare function defineElement(name: string, ctor: CustomElementConstructor): void; /** * Parses a manifest HTML string into a Document — used by the string-input * surfaces (`OmMap.validate(html)`, `snapshotIR(html)`). Neither needs a * *browser* (no rendering, no custom-element upgrade — they read tags and * attributes), but they do need a DOM implementation for DOMParser. In * plain node, that means a test DOM: vitest/jest with the happy-dom or * jsdom environment both provide it. */ export declare function parseHtmlDocument(html: string): Document;