package.structs.RBush.d.ts Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ol Show documentation
Show all versions of ol Show documentation
OpenLayers mapping library
The newest version!
export default RBush;
export type Entry = import("rbush").BBox & {
value: T;
};
/**
* @typedef {import("rbush").BBox & {value: T}} Entry
* @template T
*/
/**
* @classdesc
* Wrapper around the RBush by Vladimir Agafonkin.
* See https://github.com/mourner/rbush.
*
* @template {Object} T
*/
declare class RBush {
/**
* @param {number} [maxEntries] Max entries.
*/
constructor(maxEntries?: number | undefined);
/**
* @private
* @type {RBush_>}
*/
private rbush_;
/**
* A mapping between the objects added to this rbush wrapper
* and the objects that are actually added to the internal rbush.
* @private
* @type {Object>}
*/
private items_;
/**
* Insert a value into the RBush.
* @param {import("../extent.js").Extent} extent Extent.
* @param {T} value Value.
*/
insert(extent: import("../extent.js").Extent, value: T): void;
/**
* Bulk-insert values into the RBush.
* @param {Array} extents Extents.
* @param {Array} values Values.
*/
load(extents: Array, values: Array): void;
/**
* Remove a value from the RBush.
* @param {T} value Value.
* @return {boolean} Removed.
*/
remove(value: T): boolean;
/**
* Update the extent of a value in the RBush.
* @param {import("../extent.js").Extent} extent Extent.
* @param {T} value Value.
*/
update(extent: import("../extent.js").Extent, value: T): void;
/**
* Return all values in the RBush.
* @return {Array} All.
*/
getAll(): Array;
/**
* Return all values in the given extent.
* @param {import("../extent.js").Extent} extent Extent.
* @return {Array} All in extent.
*/
getInExtent(extent: import("../extent.js").Extent): Array;
/**
* Calls a callback function with each value in the tree.
* If the callback returns a truthy value, this value is returned without
* checking the rest of the tree.
* @param {function(T): *} callback Callback.
* @return {*} Callback return value.
*/
forEach(callback: (arg0: T) => any): any;
/**
* Calls a callback function with each value in the provided extent.
* @param {import("../extent.js").Extent} extent Extent.
* @param {function(T): *} callback Callback.
* @return {*} Callback return value.
*/
forEachInExtent(extent: import("../extent.js").Extent, callback: (arg0: T) => any): any;
/**
* @param {Array} values Values.
* @param {function(T): *} callback Callback.
* @private
* @return {*} Callback return value.
*/
private forEach_;
/**
* @return {boolean} Is empty.
*/
isEmpty(): boolean;
/**
* Remove all values from the RBush.
*/
clear(): void;
/**
* @param {import("../extent.js").Extent} [extent] Extent.
* @return {import("../extent.js").Extent} Extent.
*/
getExtent(extent?: import("../extent.js").Extent | undefined): import("../extent.js").Extent;
/**
* @param {RBush} rbush R-Tree.
*/
concat(rbush: RBush): void;
}
//# sourceMappingURL=RBush.d.ts.map