2016-06-21 12:17:30 -07:00

17 lines
424 B
TypeScript

export declare class Tree<T> {
_root: TreeNode<T>;
constructor(root: TreeNode<T>);
readonly root: T;
parent(t: T): T | null;
children(t: T): T[];
firstChild(t: T): T | null;
siblings(t: T): T[];
pathFromRoot(t: T): T[];
contains(tree: Tree<T>): boolean;
}
export declare class TreeNode<T> {
value: T;
children: TreeNode<T>[];
constructor(value: T, children: TreeNode<T>[]);
}