Point, Polygon definitions

This commit is contained in:
AdrianFarmadin
2017-05-05 17:30:47 +02:00
parent 0f4e20b7fa
commit 96b6817d5e
+18 -1
View File
@@ -1,7 +1,7 @@
// Type definitions for RethinkDB 2.3
// Project: http://rethinkdb.com/
// Definitions by: Alex Gorbatchev <https://github.com/alexgorbatchev>
// Definitions by: Adrian Farmadin <https://github.com/AdrianFarmadin>
// Definitions by: Adrian Farmadin <https://github.com/AdrianFarmadin>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
//
// Reference: https://rethinkdb.com/api/javascript/
@@ -38,6 +38,9 @@ declare module "rethinkdb" {
export function asc(property: string): Sort;
export function desc(property: string): Sort;
export function point(lng: number, lat: number): Point;
export function polygon(...point: Point[]): Polygon;
export var count: Aggregator;
export function sum(prop: string): Aggregator;
export function avg(prop: string): Aggregator;
@@ -222,6 +225,18 @@ declare module "rethinkdb" {
* See: https://rethinkdb.com/api/javascript/has_fields/
*/
hasFields(...fields: string[]): T;
}
interface Geometry {
}
interface Point {
}
interface Polygon extends Geometry {
}
interface Table extends Sequence, HasFields<Sequence> {
@@ -235,6 +250,8 @@ declare module "rethinkdb" {
get(key: string): Sequence; // primary key
getAll(key: string, index?: Index): Sequence; // without index defaults to primary key
getAll(...keys: string[]): Sequence;
getIntersecting(geometry: Geometry, index: Index): Sequence;
}
interface Sequence extends Operation<Cursor>, Writeable {