import { Handler, Any, Filter } from './types'; export type Context = Element | Document | null; export type Target = string | Element | null; /** * Finds the first element matching the given selector. * * @param selector - The selector to match elements against. * @param context - The context to search in (default: document). * @returns - The first element matching the selector, or null if none found. */ export declare function find(selector: string, context?: Context): T | null; /** * Finds all elements matching the given selector. * * @param selector - The selector to match elements against. * @param context - The context to search in (default: document). * @returns - All elements matching the selector. */ export declare function findAll(selector: string, context?: Context): T[]; /** * Finds the last element matching the given selector. * * @param selector - The selector to match elements against. * @param context - The context to search in (default: document). * @returns - The last element matching the selector, or null if none found. */ export declare function findLast(selector: string, context?: Context): T | null; /** * Finds all elements matching the given selector and applies the given function to each element. * * @param selector - The selector to match elements against. * @param fn - The function to apply to each element. * @param context - The context to search in (default: document). * @returns - The results of the function calls. */ export declare function forEach(selector: string, fn: Handler, context?: Context): Any[]; /** * Converts the given target to an Element type or finds it in the given context, if a string. * * @param target - The target to convert. * @param context - The context to search in (default: document). * @returns - The converted target. */ export declare function to(target: string | Element | null, context?: Context): T | null; /** * Focuses the given target. * * @param target - The target to focus. * @param context - The context to search in (default: document). */ export declare function focus(target: Target, context?: Context): void; /** * Focuses the given target, but waits until the next tick to do so. * * @param target - The target to focus. * @param context - The context to search in (default: document). */ export declare function focusNext(target: Target, context?: Context): void; /** * Checks if the given event's target is the given target. * * @param target - The target to check. * @param event - The event to check. * @param context - The context to check in (default: document). * @return - True if the event's target is the given target. */ export declare function isTargetOf(target: Target, event: Event, context?: Context): boolean; /** * Finds the last element (as defined by last opening tag, not last closing tag). * recursively. * * @param skip specify a filter function identifying element's to be wholly ignored * @param stop specify a test function to identify a satisfactory element *prior* to the last */ export declare function getDescendant(el: Element, skip?: Filter, stop?: Filter): Element; export declare const DISABLED = "disabled"; export declare const NEVER_DISABLE = "never-disable"; export declare const CLASS_NEVER_DISABLE = ".never-disable"; export declare const HAD_DISABLED = "had-disabled"; /** * Disables all forms in the given target, unless they have the class "never-disable". * * @param target - the target to disable forms in * @param readonly - whether to disable the forms or just make them readonly * @param disableLinks - whether to disable links as well */ export declare function disableForms(target?: Target, readonly?: boolean, disableLinks?: boolean): void; /** * Sets an attribute on all elements matching the given selector. * * @param selector - The selector to match elements against. * @param attr - The attribute to set. * @param value - The value to set the attribute to. * @param context - The context to search in (default: document). */ export declare function setAttribute(selector: string, attr: string, value: string | number | boolean, context?: Context): void; /** * Adds a CSS rule to the document. * * @param selector - The selector to match elements against. * @param props - The properties to set. */ export declare function addCss(selector: string, props: Record): void;