import { c as TreeNode, i as ElementNode, o as ParentNode, r as DocumentNode } from "./tree-builder-fO9Gka1f.mjs"; //#region src/main/whatwg-parser/index.d.ts /** Parse HTML into the full WHATWG document tree a browser would build. */ declare function parse(html: string): DocumentNode; /** * The bundled WHATWG parser as a parse adapter. Import it from here (not from * `neosanitize`) when you need it in a browser bundle: the `.` browser export * resolves to the DOMParser build, which does not carry this adapter. * * import { whatwgAdapter } from 'neosanitize/whatwg-parser'; * Sanitizer.builder(ugc).parser(whatwgAdapter).build(); */ declare const whatwgAdapter: typeof parse; /** Serialize a node (or a whole document) back to HTML, faithfully — no filtering. */ declare function serialize(node: DocumentNode | TreeNode): string; /** * Depth-first (pre-order) walk over every descendant of `root`. Return `false` * from the visitor to skip that node's subtree. */ declare function walk(root: ParentNode, visit: (node: TreeNode, parent: ParentNode) => void | boolean): void; /** All descendant text concatenated — DOM `textContent` semantics. */ declare function textContent(node: DocumentNode | TreeNode): string; /** A tag name (e.g. `'a'`) or a predicate over elements. */ type ElementMatch = string | ((el: ElementNode) => boolean); /** First descendant element matching a tag name or predicate, or `null`. */ declare function find(root: ParentNode, match: ElementMatch): ElementNode | null; /** Every descendant element matching a tag name or predicate (document order). */ declare function findAll(root: ParentNode, match: ElementMatch): ElementNode[]; //#endregion export { serialize as a, whatwgAdapter as c, parse as i, find as n, textContent as o, findAll as r, walk as s, ElementMatch as t }; //# sourceMappingURL=index-CwZwsTZV.d.mts.map