declare function addEventListener(target: Window, type: K, listener: (this: Window, ev: WindowEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): () => void; declare function addEventListener(target: Document, type: K, listener: (this: Document, ev: DocumentEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): () => void; declare function addEventListener(target: HTMLElement, type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): () => void; declare function addEventListener(target: MediaQueryList, type: K, listener: (this: HTMLElement, ev: MediaQueryListEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): () => void; declare const listen: typeof addEventListener; declare function isHTMLElement(node?: Node | null): node is HTMLElement; declare function isTextNode(node?: Node | null): node is Text; /** * Creates a text string from the specified value. * @param data String that specifies the nodeValue property of the text node. */ declare const createTextNode: (data: string) => Text; declare function insertBefore(target: Node, node: T, anchor?: Node): T; declare const insert: typeof insertBefore; declare function appendChild(target: Node, child: T): T; declare function removeChild(target: Node, child: T): T; declare function replaceChild(target: Node, node: Node, child: T): T; /** * Returns a copy of node. If deep is true, the copy also includes the node's descendants. */ declare function cloneNode(node: T, deep?: boolean): T; /** * Returns true if other is an inclusive descendant of node, and false otherwise. */ declare function contains(node: Node, other: Node | null): boolean; declare function detach(node: T): T; /** * Creates an instance of the element for the specified tag. */ declare const createElement: { (tagName: K, options?: ElementCreationOptions | undefined): HTMLElementTagNameMap[K]; (tagName: K_1, options?: ElementCreationOptions | undefined): HTMLElementDeprecatedTagNameMap[K_1]; (tagName: string, options?: ElementCreationOptions | undefined): HTMLElement; }; /** * Creates an instance of the element for the specified tag. */ declare const element: { (tagName: K, options?: ElementCreationOptions | undefined): HTMLElementTagNameMap[K]; (tagName: K_1, options?: ElementCreationOptions | undefined): HTMLElementDeprecatedTagNameMap[K_1]; (tagName: string, options?: ElementCreationOptions | undefined): HTMLElement; }; /** * Creates an instance of a svg element. */ declare const createSvgElement: (qualifiedName: string, options?: string | ElementCreationOptions | undefined) => Element; /** * Creates an instance of a svg element. */ declare const svgElement: (qualifiedName: string, options?: string | ElementCreationOptions | undefined) => Element; /** * Sets or removes element's attribute */ declare function attr(el: Element, name: string, value?: string | null | undefined): void; /** * Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. * * Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. */ declare function append(el: Element, ...nodes: (Node | string)[]): void; /** * Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. * * Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. */ declare function prepend(el: Element, ...nodes: (Node | string)[]): void; /** * Returns the first element that is a descendant of node that matches selectors. */ declare function querySelector(selectors: K, parentNode?: ParentNode): HTMLElementTagNameMap[K] | null; declare function querySelector(selectors: K, parentNode?: ParentNode): SVGElementTagNameMap[K] | null; declare function querySelector(selectors: string, parentNode?: ParentNode): E | null; /** * Returns all element descendants of node that match selectors. */ declare function querySelectorAll(selectors: K, parentNode?: ParentNode): NodeListOf; declare function querySelectorAll(selectors: K, parentNode?: ParentNode): NodeListOf; declare function querySelectorAll(selectors: string, parentNode?: ParentNode): NodeListOf; /** * If force is not given, "toggles" token, removing it if it's present and adding it if it's not present. If force is true, adds token (same as add()). If force is false, removes token (same as remove()). * * Returns true if token is now present, and false otherwise. * * Throws a "SyntaxError" DOMException if token is empty. * * Throws an "InvalidCharacterError" DOMException if token contains any spaces. */ declare function toggleClassName(el: Element, token: string, force?: boolean): boolean; declare function h(tag: K, attributes?: Record, ...children: Array): HTMLElementTagNameMap[K]; export { addEventListener, append, appendChild, attr, cloneNode, contains, createElement, createSvgElement, createTextNode, detach, element, h, insert, insertBefore, isHTMLElement, isTextNode, listen, prepend, querySelector, querySelectorAll, removeChild, replaceChild, svgElement, toggleClassName };