import type { DOMParserSupportedType } from './dom-types.js'; /** * iterator to collect text nodes from a dom element * */ export declare function collectTextNodes(el: Node, endNode?: Node): Generator; /** * empty a node */ export declare function empty(el: Node): Node; /** * collect text nodes that satisfy a filter function */ export declare function filterTextNodes(el: Node, filterFn: (node: Node) => boolean): Generator; /** * convert a document fragment to html */ export declare function fragmentToHtml(fragment: Document | DocumentFragment | Element): string; /** * convert a document fragment to html * */ export declare function fragmentToText(fragment: Document | DocumentFragment): string; export declare function isFragment(obj: Node): obj is DocumentFragment; export declare function isDocument(obj: Node): obj is Document; /** * create a document fragment from an html string * copied from JSDOM * */ export declare function createFragment(html?: string, document?: Document): DocumentFragment; /** * create one HTML element from an html string * */ export declare function createElement(html?: string, document?: Document): Element | null; /** * return a text node * */ export declare function createTextNode(text: string, document?: Document): Text; /** * iterate over a dom element's parents until a target * element or selector is found * */ type Matchable = Element | Element[] | string | ((node: Element) => boolean); export declare function parentsUntil(childNode: Node, target?: Matchable): Generator; export declare function matches(el: Element, comparator?: Matchable): boolean; /** * get the first element that matches the selector by * testing the element itself and traversing up through its * ancestors in the DOM tree. */ export declare function closest(el: unknown, matcher?: Matchable): Element | null; /** * unwrap the contents of an element * */ export declare function unwrap(el: Node): void; /** * convert element.attributes NamedNodeMap to a POJO * */ export declare function attr(el: Element): Record; /** * seach for text in an element */ export declare function splitSearch(el: Element, pattern: RegExp): Text[][] | Text[]; export declare function splitTextNode(node: Text, offset: number): Text | null; export declare function previousSiblings(el: Node): Generator; export declare function previousElementSiblings(el: Element): Generator; export declare function nextSiblings(el: Node): Generator; export declare function nextElementSiblings(el: Element): Generator; export declare function nodeToSelector(node: Element): string; export declare function hasDescendant(parent: Node, target: Node): boolean; export declare function parse(string: string, contentType: DOMParserSupportedType): Document; export declare function isSelector(thing: unknown): thing is string; export declare function isHtml(thing: unknown): thing is string; export declare function lookupNamespaceURI(prefix: string, document?: Document): string; export {};