type ExcludeGettersSetters = { [K in keyof T]: T[K] extends (...args: any[]) => any ? K extends `get ${string}` | `set ${string}` | 'webkitMatchesSelector' ? never : K : never; }[keyof T]; interface CustomEventInit extends EventInit { detail?: T; } type NativeElementMethods = Pick>; /** * A QeKit instance, which extends QeKit with native Element methods and * array methods. */ export interface QeKitInstance extends QeKit, NativeElementMethods, ArrayMethods { } /** * A utility class for manipulating DOM elements. * * Provides a chainable API for common DOM operations. */ declare class QeKit { #private; /** * Creates a new QeKit instance. * * @param selectors - The CSS selector string, Element(s), NodeList, HTMLCollection or * EventTarget to select elements. * @param parent - The parent element or CSS selector string within which to search for the * elements. If not provided, the selector will be applied to the entire * document. */ constructor(selectors: string | Element | Element[] | NodeList | HTMLCollection | EventTarget | null, parent?: Element | Document | string | QeKitInstance | null); /** * Gets the number of selected elements. */ get length(): number; /** * Gets the element at the specified index. * * @param index The index of the element to get. */ get(): T[]; get(index: number): T | null; /** * Gets the first element in the selected elements. */ first(): QeKitInstance; /** * Gets the last element in the selected elements. */ last(): QeKitInstance; /** * Gets an element at a specific index from the selected elements. * * @param index - The index of the element to get. */ eq(index: number): QeKitInstance; /** * Adds one or more classes to the selected elements. * * @param classname - The class name(s) to add, separated by spaces. */ addClass(classname: string): this; /** * Removes one or more classes from the selected elements. * * @param classname - The class name(s) to remove, separated by spaces. */ removeClass(classname: string): this; /** * Toggles one or more classes on the selected elements. * * @param classname - The class name(s) to toggle, separated by spaces. * @param force - If provided, forces the class to be added or removed based on the boolean value. */ toggleClass(classname: string, force?: boolean): this; /** * Checks if all selected elements have the specified class. * * @param classname - The class name to check. */ hasClass(classname: string): boolean; /** * Gets all sibling elements of the selected elements. * * @param selector - Optional selector string to filter siblings. */ siblings(selector?: string): QeKitInstance; /** * Adds an event listener to the selected elements. * * @param type - The event type to listen for. * @param listener - The event listener function. * @param options - Optional event listener options. */ on(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): this; on(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): this; /** * Removes an event listener from the selected elements. * * @param type - The event type to remove the listener for. * @param listener - The event listener function to remove. * @param options - Optional event listener options. */ off(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): this; off(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): this; /** * Triggers a custom event on the selected elements. * * @param type - The event type to trigger. * @param init - Optional event initialization options. */ trigger(type: string | CustomEvent, init?: CustomEventInit): this; } /** * A list of supported Array method names. */ declare const arrayMethods: readonly ["map", "filter", "forEach", "reduce", "some", "every", "find", "findIndex"]; type ArrayMethodNames = (typeof arrayMethods)[number]; type ArrayMethods = { [K in ArrayMethodNames]: Array[K]; }; /** * Selects DOM elements using a CSS selector and returns a QeKit instance. * * @param selectors - The CSS selector string, Element(s), NodeList, HTMLCollection or * EventTarget to select elements. * @param parent - The parent element or CSS selector string within which to search for the * elements. If not provided, the selector will be applied to the entire * document. */ export default function qe(selectors: string | Element | Element[] | NodeList | HTMLCollection | EventTarget | null, parent?: Element | Document | string | QeKitInstance | null): QeKitInstance; export {};