/** * Walks a DOM tree up to the provided `stopElement`, or if falsy before. * @param element * @param stopElement */ export declare function walkUpTreeUntil(element: HTMLElement, shouldStop: (element: HTMLElement) => boolean): HTMLElement; /** * Takes all children out from wrapped el and puts them directly inside * the parent el, at the wrapped el's position */ export declare function unwrap(parent: HTMLElement, wrapped: HTMLElement): void; /** * Walks up DOM removing elements if they are empty until it finds * one that is not */ export declare function removeNestedEmptyEls(el: HTMLElement): void; /** * IE11 doesn't support classList to SVGElements **/ export declare const containsClassName: (node: HTMLElement | SVGElement | null, className: string) => boolean; export declare function closest(node: HTMLElement | null | undefined, s: string): HTMLElement | null; export declare function closestElement(node: HTMLElement | null | undefined, s: string): HTMLElement | null; /** * Util for converting a css pixel size value to a number (of pixels). * * ie. * ```ts * const pixels = parsePx('10px') * // ^$ const pixels: number * ``` * * ```ts * const pixels = parsePx('10') * // ^$ const pixels: number | undefined * ``` */ export declare function parsePx(pxStr: PXString): number; export declare function parsePx(pxStr: PXString): number | undefined; export type MapCallback = (elem: S, idx: number, parent: Element) => T; export declare function mapElem(elem: Element, callback: MapCallback): Array; export declare function maphElem(elem: U, callback: MapCallback): Array;