function test_rbush() { var index = rbush<IndexedRect>(); index .clear() .insert({ minX: 0, minY: 0, maxX: 10, maxY: 10, index: 0, }); index.all(); index.fromJSON(index.toJSON()); index.search({ minX: 5, maxX: 15, minY: 5, maxY: 11, }) index.load([ { minX: 0, minY: 0, maxX: 10, maxY: 10, index: 0, } ]) }
constructor(points: IndexedRect[]) { super() this.index = rbush<IndexedRect>() this.index.load(points) }
constructor(points: (Rect & {i: number})[]) { super() this.index = rbush<Rect & {i: number}>() this.index.load(points) }