UNPKG

855 BTypeScriptView Raw
1import { t } from '../common';
2declare type Node = t.ITreeNode;
3export declare class TreeQuery<T extends Node = Node> implements t.ITreeQuery<T> {
4 static create<T extends Node = Node>(args: T | t.ITreeQueryArgs<T>): t.ITreeQuery<T>;
5 static children<T extends Node = Node>(of?: T, fn?: t.TreeChildrenVisitor<T> | t.TreeChildrenOptions, options?: t.TreeChildrenOptions): T[];
6 static hasChild(parent?: Node, child?: t.NodeIdentifier): boolean;
7 static childAt<T extends Node>(index: number, parent?: T): T;
8 private constructor();
9 readonly root: T;
10 readonly namespace: string;
11 walkDown: t.TreeWalkDown<T>;
12 walkUp: t.TreeWalkUp<T>;
13 find: t.TreeFind<T>;
14 findById: t.TreeFindById<T>;
15 parent: t.TreeParent<T>;
16 ancestor: t.TreeAncestor<T>;
17 depth: t.TreeDepth<T>;
18 exists: t.TreeNodeExists<T>;
19}
20export {};