import { type Selector } from "css-what"; import type { Adapter, CompiledQuery, Options, Query } from "./types.js"; export type { Options }; /** * Compiles a selector to an executable function. * * The returned function checks if each passed node is an element. Use * `_compileUnsafe` to skip this check. * * @param selector Selector to compile. * @param options Compilation options. * @param context Optional context for the selector. */ export declare function compile(selector: string | Selector[][], options?: Options, context?: Node[] | Node): CompiledQuery; /** * Like `compile`, but does not add a check if elements are tags. */ export declare function _compileUnsafe(selector: string | Selector[][], options?: Options, context?: Node[] | Node): CompiledQuery; /** * @deprecated Use `_compileUnsafe` instead. */ export declare function _compileToken(selector: Selector[][], options?: Options, context?: Node[] | Node): CompiledQuery; export declare function prepareContext(elems: Node | Node[], adapter: Adapter, shouldTestNextSiblings?: boolean): Node[]; /** * @template Node The generic Node type for the DOM adapter being used. * @template ElementNode The Node type for elements for the DOM adapter being used. * @param elems Elements to query. If it is an element, its children will be queried. * @param query can be either a CSS selector string or a compiled query function. * @param [options] options for querying the document. * @see compile for supported selector queries. * @returns All matching elements. * */ export declare const selectAll: (query: Query, elements: Node | Node[], options?: Options | undefined) => ElementNode[]; /** * @template Node The generic Node type for the DOM adapter being used. * @template ElementNode The Node type for elements for the DOM adapter being used. * @param elems Elements to query. If it is an element, its children will be queried. * @param query can be either a CSS selector string or a compiled query function. * @param [options] options for querying the document. * @see compile for supported selector queries. * @returns the first match, or null if there was no match. */ export declare const selectOne: (query: Query, elements: Node | Node[], options?: Options | undefined) => ElementNode | null; /** * Tests whether or not an element is matched by query. * * @template Node The generic Node type for the DOM adapter being used. * @template ElementNode The Node type for elements for the DOM adapter being used. * @param elem The element to test if it matches the query. * @param query can be either a CSS selector string or a compiled query function. * @param [options] options for querying the document. * @see compile for supported selector queries. * @returns */ export declare function is(elem: ElementNode, query: Query, options?: Options): boolean; /** * Alias for selectAll(query, elems, options). * @see [compile] for supported selector queries. */ export default selectAll; /** @deprecated Use the `pseudos` option instead. */ export { aliases, filters, pseudos } from "./pseudo-selectors/index.js"; //# sourceMappingURL=index.d.ts.map