@joist/element
Version:
Intelligently apply styles to WebComponents
11 lines (10 loc) • 826 B
TypeScript
type Tags = keyof HTMLElementTagNameMap;
type SVGTags = keyof SVGElementTagNameMap;
type MathTags = keyof MathMLElementTagNameMap;
type NodeUpdate<T extends Node> = Partial<T> | ((node: T) => Partial<T>);
type QueryResult<T extends Node> = (updates?: NodeUpdate<T>) => T;
export declare function query<K extends Tags>(selectors: K, root?: HTMLElement | ShadowRoot): QueryResult<HTMLElementTagNameMap[K]>;
export declare function query<K extends SVGTags>(selectors: K, root?: HTMLElement | ShadowRoot): QueryResult<SVGElementTagNameMap[K]>;
export declare function query<K extends MathTags>(selectors: K, root?: HTMLElement | ShadowRoot): QueryResult<MathMLElementTagNameMap[K]>;
export declare function query<E extends HTMLElement = HTMLElement>(selectors: string, root?: HTMLElement | ShadowRoot): QueryResult<E>;
export {};