source: trip-planner-front/node_modules/domutils/lib/querying.d.ts@ 76712b2

Last change on this file since 76712b2 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 2.3 KB
Line 
1import { Node, Element } from "domhandler";
2/**
3 * Search a node and its children for nodes passing a test function.
4 *
5 * @param test Function to test nodes on.
6 * @param node Node to search. Will be included in the result set if it matches.
7 * @param recurse Also consider child nodes.
8 * @param limit Maximum number of nodes to return.
9 * @returns All nodes passing `test`.
10 */
11export declare function filter(test: (elem: Node) => boolean, node: Node | Node[], recurse?: boolean, limit?: number): Node[];
12/**
13 * Search an array of node and its children for nodes passing a test function.
14 *
15 * @param test Function to test nodes on.
16 * @param nodes Array of nodes to search.
17 * @param recurse Also consider child nodes.
18 * @param limit Maximum number of nodes to return.
19 * @returns All nodes passing `test`.
20 */
21export declare function find(test: (elem: Node) => boolean, nodes: Node[], recurse: boolean, limit: number): Node[];
22/**
23 * Finds the first element inside of an array that matches a test function.
24 *
25 * @param test Function to test nodes on.
26 * @param nodes Array of nodes to search.
27 * @returns The first node in the array that passes `test`.
28 */
29export declare function findOneChild(test: (elem: Node) => boolean, nodes: Node[]): Node | undefined;
30/**
31 * Finds one element in a tree that passes a test.
32 *
33 * @param test Function to test nodes on.
34 * @param nodes Array of nodes to search.
35 * @param recurse Also consider child nodes.
36 * @returns The first child node that passes `test`.
37 */
38export declare function findOne(test: (elem: Element) => boolean, nodes: Node[], recurse?: boolean): Element | null;
39/**
40 * @param test Function to test nodes on.
41 * @param nodes Array of nodes to search.
42 * @returns Whether a tree of nodes contains at least one node passing a test.
43 */
44export declare function existsOne(test: (elem: Element) => boolean, nodes: Node[]): boolean;
45/**
46 * Search and array of nodes and its children for nodes passing a test function.
47 *
48 * Same as `find`, only with less options, leading to reduced complexity.
49 *
50 * @param test Function to test nodes on.
51 * @param nodes Array of nodes to search.
52 * @returns All nodes passing `test`.
53 */
54export declare function findAll(test: (elem: Element) => boolean, nodes: Node[]): Element[];
55//# sourceMappingURL=querying.d.ts.map
Note: See TracBrowser for help on using the repository browser.