-
-
Notifications
You must be signed in to change notification settings - Fork 105
Expand file tree
/
Copy pathstatic-interval-tree.d.ts
More file actions
27 lines (22 loc) · 737 Bytes
/
Copy pathstatic-interval-tree.d.ts
File metadata and controls
27 lines (22 loc) · 737 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/**
* Mnemonist StaticIntervalTree Typings
* =====================================
*/
type StaticIntervalTreeGetter<T> = (item: T) => number;
type StaticIntervalTreeGettersTuple<T> = [StaticIntervalTreeGetter<T>, StaticIntervalTreeGetter<T>];
export default class StaticIntervalTree<T> {
// Members
height: number;
size: number;
// Constructor
constructor(intervals: Array<T>, getters?: StaticIntervalTreeGettersTuple<T>);
// Methods
intervalsContainingPoint(point: number): Array<T>;
intervalsOverlappingInterval(interval: T): Array<T>;
inspect(): any;
// Statics
static from<I>(
iterable: Iterable<I> | {[key: string]: I},
getters?: StaticIntervalTreeGettersTuple<I>
): StaticIntervalTree<I>;
}