/** * Adds class `className` to `el` * @param {Element} el * @param {string} className */ export declare function addClass(el: T, className: string): T; /** * Removes class `className` from `el` * @param {Element} el * @param {string} className */ export declare function removeClass(el: T, className: string): T; /** * Helper to recursively find parent with the `className` class * @param base `Element` to start from * @param className class that the parent should have */ export declare function getParentByClassName(base: Element, className: string): Element; /** * Removes all child DOM nodes from `el` * @param {Element} el */ export declare function removeChildren(el: T): T; /** * Get last element of `NodeList` * @param list NodeListOf e.g. return value of `getElementsByClassName` */ export declare function getLastItemOfNodeList(list: NodeListOf | null): T; /** Calls `fn` with each element of `els` */ export declare function forEachNodeList(els: NodeListOf, fn: (el: T, index: number) => any): void; export interface StringOrNumberMap { [key: string]: string | number; } /** Sets a CSS style property, but only if property exists on `el` */ export declare function safeSetStyle(el: HTMLElement | SVGElement, property: string, value: string): void; /** Sets an attribute, but only if `name` exists on `el` */ export declare function safeSetAttribute(el: HTMLElement | SVGElement, name: string, value: string): void; /** Sets multiple CSS style properties, but only if property exists on `el` */ export declare function safeSetStyles(el: HTMLElement | SVGElement, css: StringOrNumberMap): void; /** Sets attributes, but only if they exist on `el` */ export declare function safeSetAttributes(el: HTMLElement | SVGElement, attributes: StringOrNumberMap): void; export declare function makeHtmlEl(): HTMLHtmlElement; export declare function makeBodyEl(css?: StringOrNumberMap, innerHTML?: string): HTMLBodyElement;