UNPKG

mvdom

Version:

deprecated - Moved to dom-native package

38 lines (37 loc) 2.96 kB
export declare type AppendPosition = "first" | "last" | "empty" | "before" | "after"; export declare function first(el: Document | HTMLElement | DocumentFragment | null | undefined, selector: string): HTMLElement | null; export declare function first(selector: string): HTMLElement | null; export declare function first(el: Document | HTMLElement | DocumentFragment | null | undefined): HTMLElement | null; export declare function all(el: Document | HTMLElement | DocumentFragment | null | undefined, selector: string): HTMLElement[]; export declare function all(selector: string): HTMLElement[]; export declare function next(el: Node | null | undefined, selector?: string): HTMLElement | null; export declare function prev(el: Node | null | undefined, selector?: string): HTMLElement | null; export declare function closest(el: HTMLElement | null | undefined, selector: string): HTMLElement | null; export declare function append<T extends HTMLElement | HTMLElement[] | DocumentFragment | string>(this: any, refEl: HTMLElement | DocumentFragment, newEl: T, position?: AppendPosition): T extends HTMLElement ? HTMLElement : HTMLElement[]; export declare function frag(html: string | null | undefined): DocumentFragment; export declare function style<T extends HTMLElement | HTMLElement[] | null | undefined>(el: T, style: Partial<CSSStyleDeclaration>): T; export declare function className<E extends HTMLElement | HTMLElement[] | null | undefined>(els: E, keyValues: { [name: string]: boolean | object | null | undefined; }): E; declare type Val = string | null; declare type NameValMap = { [name: string]: string | null | boolean; }; export declare function attr(el: HTMLElement, name: string): string | null; export declare function attr(els: HTMLElement[], name: string): (string | null)[]; export declare function attr(el: HTMLElement, names: string[]): (string | null)[]; export declare function attr(els: HTMLElement[], names: string[]): (string | null)[][]; export declare function attr(el: HTMLElement, nameValues: { [name: string]: string | null | boolean; }): HTMLElement; export declare function attr(els: HTMLElement[], nameValues: { [name: string]: string | null | boolean; }): HTMLElement[]; export declare function attr(el: HTMLElement, name: string, val: string | null | boolean): HTMLElement; export declare function attr(els: HTMLElement[], name: string, val: string | null | boolean): HTMLElement[]; export declare function _attrSet<E extends HTMLElement | HTMLElement[]>(els: E, arg: NameValMap): E; export declare function _attrGet<E extends HTMLElement | HTMLElement[], A extends string | string[]>(els: E, arg: A): Val | Val[] | Val[][] | E; export declare function _getAttrEl<N extends string | string[]>(el: HTMLElement, names: N): N extends string ? string | null : (string | null)[]; export declare function elem(name: string): HTMLElement; export declare function elem(...names: string[]): HTMLElement[]; export {};