export declare type Comparator = (key1: K, key2: K) => number; export interface Entry { key: K; value: V; } export declare class SortedMap { comparator: Comparator; root: LLRBNode | LLRBEmptyNode; constructor(comparator: Comparator, root?: LLRBNode | LLRBEmptyNode); insert(key: K, value: V): SortedMap; remove(key: K): SortedMap; get(key: K): V | null; indexOf(key: K): number; isEmpty(): boolean; readonly size: number; minKey(): K | null; maxKey(): K | null; inorderTraversal(action: (k: K, v: V) => T): T; forEach(fn: (k: K, v: V) => void): void; reverseTraversal(action: (k: K, v: V) => T): T; getIterator(): SortedMapIterator; getIteratorFrom(key: K): SortedMapIterator; getReverseIterator(): SortedMapIterator; getReverseIteratorFrom(key: K): SortedMapIterator; } export declare class SortedMapIterator { private isReverse; private nodeStack; constructor(node: LLRBNode | LLRBEmptyNode, startKey: K | null, comparator: Comparator, isReverse: boolean); getNext(): Entry; hasNext(): boolean; peek(): Entry | null; } export declare class LLRBNode { key: K; value: V; readonly color: boolean; readonly left: LLRBNode | LLRBEmptyNode; readonly right: LLRBNode | LLRBEmptyNode; readonly size: number; static EMPTY: LLRBEmptyNode; static RED: boolean; static BLACK: boolean; constructor(key: K, value: V, color?: boolean, left?: LLRBNode | LLRBEmptyNode, right?: LLRBNode | LLRBEmptyNode); copy(key: K | null, value: V | null, color: boolean | null, left: LLRBNode | LLRBEmptyNode | null, right: LLRBNode | LLRBEmptyNode | null): LLRBNode; isEmpty(): boolean; inorderTraversal(action: (k: K, v: V) => T): T; reverseTraversal(action: (k: K, v: V) => T): T; private min(); minKey(): K | null; maxKey(): K | null; insert(key: K, value: V, comparator: Comparator): LLRBNode; private removeMin(); remove(key: K, comparator: Comparator): LLRBNode | LLRBEmptyNode; isRed(): boolean; private fixUp(); private moveRedLeft(); private moveRedRight(); private rotateLeft(); private rotateRight(); private colorFlip(); checkMaxDepth(): boolean; protected check(): number; } export declare class LLRBEmptyNode { key: K; value: V; color: boolean; left: LLRBNode; right: LLRBNode; size: number; constructor(); copy(key: K | null, value: V | null, color: boolean | null, left: LLRBNode | LLRBEmptyNode | null, right: LLRBNode | LLRBEmptyNode | null): LLRBEmptyNode; insert(key: K, value: V, comparator: Comparator): LLRBNode; remove(key: K, comparator: Comparator): LLRBEmptyNode; isEmpty(): boolean; inorderTraversal(action: (k: K, v: V) => boolean): boolean; reverseTraversal(action: (k: K, v: V) => boolean): boolean; minKey(): K | null; maxKey(): K | null; isRed(): boolean; checkMaxDepth(): boolean; protected check(): 0; }