mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
@@ -270,6 +270,7 @@ All definitions files include a header with the author and editors, so at some p
|
||||
* [Raphael](http://raphaeljs.com/) (by [CheCoxshall](https://github.com/CheCoxshall))
|
||||
* [Restangular](https://github.com/mgonto/restangular/) (by [Boris Yankov](https://github.com/borisyankov))
|
||||
* [require.js](http://requirejs.org/) (by [Josh Baldwin](https://github.com/jbaldwin/))
|
||||
* [rtree.js] (https://github.com/leaflet-extras/RTree) (by [Omede Firouz](https://github.com/oefirouz))
|
||||
* [Sammy.js](http://sammyjs.org/) (by [Boris Yankov](https://github.com/borisyankov))
|
||||
* [Select2](http://ivaynberg.github.com/select2/) (by [Boris Yankov](https://github.com/borisyankov))
|
||||
* [Selenium WebDriverJS](https://code.google.com/p/selenium/) (by [Bill Armstrong](https://github.com/BillArmstrong))
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
/// <reference path="rtree.d.ts"/>
|
||||
|
||||
var myRTree = RTree(5);
|
||||
var el = "test";
|
||||
|
||||
myRTree.insert({x: 0, y: 0, w: 1, h: 1}, el);
|
||||
|
||||
var intersections = myRTree.search({x: 0.5, y: 0.5, w: 1, h: 1});
|
||||
|
||||
intersections = myRTree.remove({x: 0.5, y: 0.5, w: 1, h: 1}, "notTest!");
|
||||
|
||||
intersections = myRTree.remove({x: 0.5, y: 0.5, w: 1, h: 1});
|
||||
|
||||
Vendored
+25
@@ -0,0 +1,25 @@
|
||||
// Type definitions for rtree 1.4.0
|
||||
// Project: https://github.com/leaflet-extras/RTree
|
||||
// Definitions by: Omede Firouz <https://github.com/oefirouz>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
interface Rectangle {
|
||||
x: number;
|
||||
y: number;
|
||||
w: number;
|
||||
h: number;
|
||||
}
|
||||
|
||||
interface RTreeStatic {
|
||||
insert(bounds: Rectangle, element: Object): boolean;
|
||||
remove(area: Rectangle, element?: Object): any[];
|
||||
geoJSON(geoJSON: any): void;
|
||||
bbox(arg1: any, arg2?: any, arg3?: number, arg4?: number): any[];
|
||||
search(area: Rectangle, return_node?: boolean, return_array?: any[]): any[];
|
||||
}
|
||||
|
||||
interface RTreeFactory {
|
||||
(max_node_width?: number): RTreeStatic;
|
||||
}
|
||||
|
||||
declare var RTree: RTreeFactory;
|
||||
Reference in New Issue
Block a user