compound-binary-file-js
Version:
This is an implementation of [Compound Binary File v.3](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-cfb/53989ce4-7b05-4f8d-829b-d08d6148375b) \ Allows reading existing files, creation of the/write operation
33 lines (32 loc) • 1 kB
TypeScript
export declare enum Color {
RED = 0,
BLACK = 1
}
export declare class TreeNode<T> {
private readonly value;
private leftChild;
private rightChild;
private parent;
private color;
constructor(value: T, color: Color);
getLeftChild(): TreeNode<T>;
setLeftChild(value: TreeNode<T>): void;
getValue(): T;
setRightChild(value: TreeNode<T>): void;
getRightChild(): TreeNode<T>;
getParent(): TreeNode<T>;
setParent(parent: TreeNode<T>): void;
hasChildren(): boolean;
hasTwoChildren(): boolean;
isLeftChild(node: TreeNode<T>): boolean;
isRightChild(node: TreeNode<T>): boolean;
deleteChild(node: TreeNode<T>): void;
substituteNode(node: TreeNode<T>, substitute: TreeNode<T>): void;
getChildrenRecursive(): TreeNode<T>[];
getColor(): Color;
setColor(color: Color): void;
invertColor(): void;
uncle(): TreeNode<T>;
grandParent(): TreeNode<T>;
sibling(): TreeNode<T>;
}