@jbrowse/core
Version:
JBrowse 2 core libraries used by plugins
43 lines (42 loc) • 1.41 kB
TypeScript
declare const RB_TREE_COLOR_RED = 1;
declare const RB_TREE_COLOR_BLACK = 0;
type NodeColor = typeof RB_TREE_COLOR_RED | typeof RB_TREE_COLOR_BLACK;
declare class Interval {
low: number;
high: number;
constructor(low: number, high: number);
lessThan(other: Interval): boolean;
equalTo(other: Interval): boolean;
intersects(other: Interval): boolean;
merge(other: Interval): Interval;
}
declare class Node<V> {
left: Node<V> | null;
right: Node<V> | null;
parent: Node<V> | null;
color: NodeColor;
key: Interval | undefined;
values: V[];
max: Interval | undefined;
constructor(key?: Interval | [number, number], value?: V, left?: Node<V> | null, right?: Node<V> | null, parent?: Node<V> | null, color?: NodeColor);
lessThan(other: Node<V>): boolean;
equalTo(other: Node<V>): boolean;
intersects(other: Node<V>): boolean;
updateMax(): void;
notIntersectLeftSubtree(searchNode: Node<V>): boolean;
notIntersectRightSubtree(searchNode: Node<V>): boolean;
}
export declare class IntervalTree<V> {
root: Node<V> | null;
private nilNode;
insert(key: [number, number], value: V): Node<V>;
search(interval: [number, number]): V[];
private recalcMax;
private treeInsert;
private insertFixup;
private treeSearch;
private treeSearchInterval;
private rotateLeft;
private rotateRight;
}
export {};