UNPKG

629 BTypeScriptView Raw
1declare const _exports: <V extends import("unist").Node<import("unist").Data>>(tree: Node, condition: TestStr | TestObj | TestFn) => V | undefined;
2export = _exports;
3export type Node = import('unist').Node;
4/**
5 * Finds first node with a truthy property matching string.
6 */
7export type TestStr = string;
8/**
9 * Finds first node that has matching values for all properties of object.
10 */
11export type TestObj = {
12 [x: string]: unknown;
13};
14/**
15 * Finds first node for which function returns true when passed node as argument.
16 */
17export type TestFn = <V extends import("unist").Node<import("unist").Data>>(node: V) => boolean;