diff options
author | Minteck <contact@minteck.org> | 2022-02-09 17:58:07 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2022-02-09 17:58:07 +0100 |
commit | 22a25ded9f7d9c9a96cce8d1bc12475ca0434201 (patch) | |
tree | 0e33d0650fe58f41c00bbc4b8047956905766823 /node_modules/domutils/lib/querying.d.ts | |
parent | 8f54d903fb3470823a5e4d6ff4655de009836245 (diff) | |
download | youtoo-22a25ded9f7d9c9a96cce8d1bc12475ca0434201.tar.gz youtoo-22a25ded9f7d9c9a96cce8d1bc12475ca0434201.tar.bz2 youtoo-22a25ded9f7d9c9a96cce8d1bc12475ca0434201.zip |
Major update
Diffstat (limited to 'node_modules/domutils/lib/querying.d.ts')
-rw-r--r-- | node_modules/domutils/lib/querying.d.ts | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/node_modules/domutils/lib/querying.d.ts b/node_modules/domutils/lib/querying.d.ts new file mode 100644 index 0000000..e3dc7aa --- /dev/null +++ b/node_modules/domutils/lib/querying.d.ts @@ -0,0 +1,55 @@ +import { Node, Element } from "domhandler"; +/** + * Search a node and its children for nodes passing a test function. + * + * @param test Function to test nodes on. + * @param node Node to search. Will be included in the result set if it matches. + * @param recurse Also consider child nodes. + * @param limit Maximum number of nodes to return. + * @returns All nodes passing `test`. + */ +export declare function filter(test: (elem: Node) => boolean, node: Node | Node[], recurse?: boolean, limit?: number): Node[]; +/** + * Search an array of node and its children for nodes passing a test function. + * + * @param test Function to test nodes on. + * @param nodes Array of nodes to search. + * @param recurse Also consider child nodes. + * @param limit Maximum number of nodes to return. + * @returns All nodes passing `test`. + */ +export declare function find(test: (elem: Node) => boolean, nodes: Node[], recurse: boolean, limit: number): Node[]; +/** + * Finds the first element inside of an array that matches a test function. + * + * @param test Function to test nodes on. + * @param nodes Array of nodes to search. + * @returns The first node in the array that passes `test`. + */ +export declare function findOneChild(test: (elem: Node) => boolean, nodes: Node[]): Node | undefined; +/** + * Finds one element in a tree that passes a test. + * + * @param test Function to test nodes on. + * @param nodes Array of nodes to search. + * @param recurse Also consider child nodes. + * @returns The first child node that passes `test`. + */ +export declare function findOne(test: (elem: Element) => boolean, nodes: Node[], recurse?: boolean): Element | null; +/** + * @param test Function to test nodes on. + * @param nodes Array of nodes to search. + * @returns Whether a tree of nodes contains at least one node passing a test. + */ +export declare function existsOne(test: (elem: Element) => boolean, nodes: Node[]): boolean; +/** + * Search and array of nodes and its children for nodes passing a test function. + * + * Same as `find`, only with less options, leading to reduced complexity. + * + * @param test Function to test nodes on. + * @param nodes Array of nodes to search. + * @returns All nodes passing `test`. + */ +export declare function findAll(test: (elem: Element) => boolean, nodes: Node[]): Element[]; +//# sourceMappingURL=querying.d.ts.map
\ No newline at end of file |