/** * Cleans a text value using the same whitespace rules JSX applies to * `JSXText` children: strip leading/trailing whitespace adjacent to * tags, drop blank lines, and add a single trailing space to non-last * lines that survived. Returns `''` when the input was pure * whitespace. Mirrors `cleanJSXElementLiteralChild` in * `babel-preset/transform/children.js` so xml↔jsx round-trips don't * have to fix up whitespace. * * @param {string} value * @returns {string} * @url https://pota.quack.uy/use/dom/cleanJSXText */ export function cleanJSXText(value: string): string; /** * Unwraps `value` and returns `element` if result is a `Node`, else * `undefined` in the case isn't a `Node` * * @template T * @param {T} value - Maybe function * @param {...unknown} args? - Arguments * @returns {DOMElement | T | undefined} * @url https://pota.quack.uy/use/dom/getValueElement */ export function getValueElement(value: T, ...args: unknown[]): DOMElement | T | undefined; /** * Removes from the DOM `prev` elements not found in `next` * * @param {DOMElement[]} [prev=[]] - Array with previous elements. * Default is `[]` * @param {DOMElement[]} [next=[]] - Array with next elements. Default * is `[]` * @param {boolean} [short=false] - Whether to use fast clear. Default * is `false` * @returns {DOMElement[]} The next array of elements * @url https://pota.quack.uy/use/dom/toDiff */ export function toDiff(prev?: DOMElement[], next?: DOMElement[], short?: boolean): DOMElement[]; export const document: Document; export const head: HTMLHeadElement; export function isConnected(node: Node): boolean; export function activeElement(): Element | null; export function isPlaying(el: HTMLMediaElement): boolean; /** @returns {Element | undefined} The root `` element if available. */ export const documentElement: HTMLElement; /** DocumentFragment constructor exposed for convenience. */ export const DocumentFragment: { new (): DocumentFragment; prototype: DocumentFragment; }; export const createElement: Function; export const createElementNS: Function; export const createTextNode: Function; export const createComment: Function; export const importNode: Function; export const createTreeWalker: Function; export function addPart(node: Element & { part: DOMTokenList; }, partName: string): void; export function removePart(node: Element & { part: DOMTokenList; }, partName: string): void; export function tokenList(s: string | undefined | null): string[]; export function addClass(node: Element, className: string | string[]): void; export function removeClass(node: Element, className: string | string[]): void; export function setAttribute(node: Element, name: string, value: string): void; export function hasAttribute(node: Element, name: string): boolean; export function removeAttribute(node: Element, name: string): void; export function querySelector(node: ParentNode, query: string): Element | null; export function querySelectorAll(node: ParentNode, query: string): NodeListOf; export function getDocumentForElement(node: T): Document | ShadowRoot; /** * Traverses element nodes depth-first collecting up to `max` results. * * @param {TreeWalker} walk * @param {Node} node * @param {number} [max=Infinity] Default is `Infinity` * @param {Node[]} [nodes=[]] Default is `[]` * @returns {Node[]} * @url https://pota.quack.uy/use/dom/walkElements */ export const walkElements: (node?: any, max?: number, nodes?: any[]) => any[]; //# sourceMappingURL=dom.d.ts.map