/** * Minimal DOM and SVG helpers. * * Deliberately dependency-free and namespace-correct: `createElement` on an SVG * tag silently produces an unrenderable HTML element, which is a bug class worth * designing out rather than debugging. * * @module utils/dom */ export declare const SVG_NS = "http://www.w3.org/2000/svg"; export declare const XHTML_NS = "http://www.w3.org/1999/xhtml"; /** Attribute values accepted by {@link setAttrs}. */ export type AttrValue = string | number | boolean | null | undefined | Partial | Record | ((event: Event) => void); export type Attrs = Record; /** * Create an SVG element in the correct namespace. */ export declare function svg(tag: K, attrs?: Attrs, children?: (Element | null)[]): SVGElementTagNameMap[K]; export declare function html(tag: K, attrs?: Attrs, children?: (Node | null)[]): HTMLElementTagNameMap[K]; /** * Set attributes, with `class`, `style`, `text`, `dataset` and `on*` handled * specially. `null`, `undefined` and `false` are skipped so callers can pass * conditional values inline. */ export declare function setAttrs(el: Element, attrs: Attrs): void; export declare function remove(el: Element | null | undefined): void; export declare function empty(el: Element): void; /** * Resolve a CSS size (`'100%'`, `400`, `'50vh'`) against a container. */ export declare function resolveSize(value: string | number | undefined, containerSize: number, fallback: number): number; /** * Pointer position relative to an element, correct under CSS transforms and * scrolling, which `offsetX` is not. */ export declare function pointerPosition(el: Element, event: MouseEvent | Touch): [number, number]; export declare function escapeHtml(text: unknown): string; /** * Whether a usable DOM exists. Guards every render path so the bundle stays * importable under SSR. */ export declare function hasDom(): boolean; //# sourceMappingURL=dom.d.ts.map