blob: ef482cb5dc3bc504f5d71f310713782cbbf1be1f [file] [log] [blame]
Tim van der Lippe706ec962021-06-04 13:24:42 +01001import type { CompiledQuery, Options, Query, Adapter } from "./types";
2export type { Options };
3/**
4 * Compiles the query, returns a function.
5 */
6export declare const compile: <Node_1, ElementNode extends Node_1>(selector: string, options?: Options<ElementNode, ElementNode> | undefined, context?: ElementNode[] | undefined) => CompiledQuery<ElementNode>;
7export declare const _compileUnsafe: <Node_1, ElementNode extends Node_1>(selector: string, options?: Options<ElementNode, ElementNode> | undefined, context?: ElementNode[] | undefined) => CompiledQuery<ElementNode>;
8export declare const _compileToken: <Node_1, ElementNode extends Node_1>(selector: import("./types").InternalSelector[][], options?: Options<ElementNode, ElementNode> | undefined, context?: ElementNode[] | undefined) => CompiledQuery<ElementNode>;
9export declare function prepareContext<Node, ElementNode extends Node>(elems: ElementNode | ElementNode[], adapter: Adapter<Node, ElementNode>, shouldTestNextSiblings?: boolean): Node[];
10/**
11 * @template Node The generic Node type for the DOM adapter being used.
12 * @template ElementNode The Node type for elements for the DOM adapter being used.
13 * @param elems Elements to query. If it is an element, its children will be queried..
14 * @param query can be either a CSS selector string or a compiled query function.
15 * @param [options] options for querying the document.
16 * @see compile for supported selector queries.
17 * @returns All matching elements.
18 *
19 */
20export declare const selectAll: <Node_1, ElementNode extends Node_1>(query: Query<ElementNode>, elements: ElementNode | ElementNode[], options?: Options<Node_1, ElementNode> | undefined) => ElementNode[];
21/**
22 * @template Node The generic Node type for the DOM adapter being used.
23 * @template ElementNode The Node type for elements for the DOM adapter being used.
24 * @param elems Elements to query. If it is an element, its children will be queried..
25 * @param query can be either a CSS selector string or a compiled query function.
26 * @param [options] options for querying the document.
27 * @see compile for supported selector queries.
28 * @returns the first match, or null if there was no match.
29 */
30export declare const selectOne: <Node_1, ElementNode extends Node_1>(query: Query<ElementNode>, elements: ElementNode | ElementNode[], options?: Options<Node_1, ElementNode> | undefined) => ElementNode | null;
31/**
32 * Tests whether or not an element is matched by query.
33 *
34 * @template Node The generic Node type for the DOM adapter being used.
35 * @template ElementNode The Node type for elements for the DOM adapter being used.
36 * @param elem The element to test if it matches the query.
37 * @param query can be either a CSS selector string or a compiled query function.
38 * @param [options] options for querying the document.
39 * @see compile for supported selector queries.
40 * @returns
41 */
42export declare function is<Node, ElementNode extends Node>(elem: ElementNode, query: Query<ElementNode>, options?: Options<Node, ElementNode>): boolean;
43/**
44 * Alias for selectAll(query, elems, options).
45 * @see [compile] for supported selector queries.
46 */
47export default selectAll;
48export { filters, pseudos } from "./pseudo-selectors";
49//# sourceMappingURL=index.d.ts.map