/** * Set attribute `name` to `val`, or get attr `name`. * * @param {Element} el * @param {String} name * @param {String} [val] * @api public */ export function attr(el: T, name: string): string; export function attr(el: T, name: string, val: null): void; export function attr(el: T, name: string, val: string): T; export function attr(el: T, name: string, val?: string | null): void | string | T; /** * Wrap `el` in a `ClassList`. * * @param {Element} el * @return {ClassList} * @api public */ export function classes(el: T): ClassList; export class ClassList { public list: T["classList"]; public el: T; constructor(el: T); add(name: string): this; remove(name: string | RegExp): this; removeMatching(re: RegExp): this; toggle(name: string, force?: boolean): this; array(): string[]; has(name: string): boolean; contains(name: string): boolean; } /** * Remove all children from the given element. */ export function clear(el: T): T; export type CSSSelector = string; export function closest(element: Element, selector: CSSSelector, checkYoSelf?: boolean): Element; export namespace delegate { export function bind(el: T, selector: CSSSelector, type: string, callback: (el: T, e: Event) => void, capture?: boolean): Function; export function unbind(el: T, type: string, callback: (el: T, e: Event) => void, capture?: boolean): void; } export function domify(dom: string, doc?: HTMLDocument): HTMLElement; export namespace event { export function bind(el: EventTarget, type: string, fn: CType, capture?: boolean): CType; export function unbind(el: EventTarget , type: string, fn: CType, capture?: boolean): CType; } export function matches(el: HTMLElementTagNameMap[K], selector: K): el is HTMLElementTagNameMap[K]; export function matches(el: HTMLElement, selector: CSSSelector): boolean; export function query(selectors: K, el?: HTMLElement): HTMLElementTagNameMap[K] | null; export function query(selectors: K, el?: HTMLElement): SVGElementTagNameMap[K] | null; export function query(selectors: string, el?: HTMLElement): E | null; export function queryAll(selectors: K, el?: HTMLElement): NodeListOf; export function queryAll(selectors: K, el?: HTMLElement): NodeListOf; export function queryAll(selectors: string, el?: HTMLElement): NodeListOf; export function remove(el: Element): void;