From 0f4e20b7fa690c18ead85bee5280e73c407ecd5b Mon Sep 17 00:00:00 2001 From: AdrianFarmadin Date: Fri, 5 May 2017 17:28:52 +0200 Subject: [PATCH 1/4] Point, Polygon definitions --- types/rethinkdb/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/rethinkdb/index.d.ts b/types/rethinkdb/index.d.ts index f375a50fc7..94130520d1 100644 --- a/types/rethinkdb/index.d.ts +++ b/types/rethinkdb/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for RethinkDB 2.3 // Project: http://rethinkdb.com/ // Definitions by: Alex Gorbatchev +// Definitions by: Adrian Farmadin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // // Reference: https://rethinkdb.com/api/javascript/ From 96b6817d5e442e2c5329af0c5e860d11dc60d6db Mon Sep 17 00:00:00 2001 From: AdrianFarmadin Date: Fri, 5 May 2017 17:30:47 +0200 Subject: [PATCH 2/4] Point, Polygon definitions --- types/rethinkdb/index.d.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/types/rethinkdb/index.d.ts b/types/rethinkdb/index.d.ts index 94130520d1..a4cbd64313 100644 --- a/types/rethinkdb/index.d.ts +++ b/types/rethinkdb/index.d.ts @@ -1,7 +1,7 @@ // Type definitions for RethinkDB 2.3 // Project: http://rethinkdb.com/ // Definitions by: Alex Gorbatchev -// Definitions by: Adrian Farmadin +// Definitions by: Adrian Farmadin // 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 { @@ -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, Writeable { From dc86e5222e397c382a99c36219f8fe5679a9ffa7 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Fri, 5 May 2017 09:56:00 -0700 Subject: [PATCH 3/4] fix header --- types/rethinkdb/index.d.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/types/rethinkdb/index.d.ts b/types/rethinkdb/index.d.ts index a4cbd64313..afe672468e 100644 --- a/types/rethinkdb/index.d.ts +++ b/types/rethinkdb/index.d.ts @@ -1,7 +1,6 @@ // Type definitions for RethinkDB 2.3 // Project: http://rethinkdb.com/ -// Definitions by: Alex Gorbatchev -// Definitions by: Adrian Farmadin +// Definitions by: Alex Gorbatchev , Adrian Farmadin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // // Reference: https://rethinkdb.com/api/javascript/ From c79832e00141c34b9a49c09d6368175b58d0bb78 Mon Sep 17 00:00:00 2001 From: Adrian Farmadin Date: Mon, 26 Feb 2018 21:37:36 +0100 Subject: [PATCH 4/4] Point and Polygon functions for RethinkDb Geometry --- types/rethinkdb/index.d.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/types/rethinkdb/index.d.ts b/types/rethinkdb/index.d.ts index d45f359359..038a9d48e6 100644 --- a/types/rethinkdb/index.d.ts +++ b/types/rethinkdb/index.d.ts @@ -40,6 +40,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; @@ -233,7 +236,13 @@ 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 { indexCreate(name: string, index?: ExpressionFunction): Operation;