@jay-js/system
Version:
A powerful and flexible TypeScript library for UI, state management, lazy loading, routing and managing draggable elements in modern web applications.
17 lines (16 loc) • 1.13 kB
TypeScript
/**
* Selects all elements matching the specified CSS selector within the target element (or the entire document if no target is provided).
*
* @param selector - A string containing one or more comma-separated CSS selectors.
* @param target - The HTML element or Document within which to search. If not provided, defaults to the entire document.
* @returns A NodeList of found elements. Returns an empty NodeList if no elements match the selector.
*/
export declare function selectors<T extends NodeListOf<Element>>(selector: string, target?: HTMLElement | Document): T;
/**
* Selects the first element matching the specified CSS selector within the target element (or the entire document if no target is provided).
*
* @param selector - A string containing a valid CSS selector.
* @param target - The HTML element or Document within which to search. If not provided, defaults to the entire document.
* @returns The first element found that matches the selector, or null if no elements match.
*/
export declare function selector<T extends HTMLElement>(selector: string, target?: HTMLElement | Document): T | null;