Skip to content

Commit

Permalink
Added Typescript definitions A to D #515
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisCarriere committed Nov 24, 2016
1 parent 1ec968d commit 5360d47
Show file tree
Hide file tree
Showing 17 changed files with 143 additions and 2 deletions.
8 changes: 8 additions & 0 deletions packages/turf-area/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/// <reference types="geojson" />

/***
* http://turfjs.org/docs/#area
*/
declare function area(features: GeoJSON.Feature<any> | GeoJSON.FeatureCollection<any>): number;
declare namespace area { }
export = area;
8 changes: 8 additions & 0 deletions packages/turf-bbox-polygon/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/// <reference types="geojson" />

/***
* http://turfjs.org/docs/#bboxpolygon
*/
declare function bboxPolygon(bbox: Array<number>): GeoJSON.Feature<GeoJSON.Polygon>;
declare namespace bboxPolygon { }
export = bboxPolygon;
2 changes: 1 addition & 1 deletion packages/turf-bbox/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
/***
* http://turfjs.org/docs/#bbox
*/
declare function bbox(geojson: GeoJSON.Feature<any> | GeoJSON.FeatureCollection<any>): Array<number>;
declare function bbox(features: GeoJSON.Feature<any> | GeoJSON.FeatureCollection<any>): Array<number>;
declare namespace bbox { }
export = bbox;
10 changes: 10 additions & 0 deletions packages/turf-bearing/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/// <reference types="geojson" />

/***
* http://turfjs.org/docs/#bearing
*/
declare function bearing(
start: GeoJSON.Feature<GeoJSON.Point>,
end: GeoJSON.Feature<GeoJSON.Point>): number;
declare namespace bearing { }
export = bearing;
11 changes: 11 additions & 0 deletions packages/turf-bezier/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/// <reference types="geojson" />

/***
* http://turfjs.org/docs/#bezier
*/
declare function bezier(
line: GeoJSON.Feature<GeoJSON.LineString>,
resolution?: number,
sharpness?: number): GeoJSON.Feature<GeoJSON.LineString>;
declare namespace bezier { }
export = bezier;
11 changes: 11 additions & 0 deletions packages/turf-buffer/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/// <reference types="geojson" />

/***
* http://turfjs.org/docs/#buffer
*/
declare function buffer(
features: GeoJSON.Feature<any> | GeoJSON.FeatureCollection<any>,
radius?: number,
unit?: string): GeoJSON.Feature<GeoJSON.LineString>;
declare namespace buffer { }
export = buffer;
8 changes: 8 additions & 0 deletions packages/turf-center-of-mass/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/// <reference types="geojson" />

/***
* http://turfjs.org/docs/#center
*/
declare function centerOfMass(features: GeoJSON.Feature<any> | GeoJSON.FeatureCollection<any>): GeoJSON.Feature<GeoJSON.Point>;
declare namespace centerOfMass { }
export = centerOfMass;
8 changes: 8 additions & 0 deletions packages/turf-center/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/// <reference types="geojson" />

/***
* http://turfjs.org/docs/#center
*/
declare function center(features: GeoJSON.Feature<any> | GeoJSON.FeatureCollection<any>): GeoJSON.Feature<GeoJSON.Point>;
declare namespace center { }
export = center;
8 changes: 8 additions & 0 deletions packages/turf-centroid/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/// <reference types="geojson" />

/***
* http://turfjs.org/docs/#centroid
*/
declare function centroid(features: GeoJSON.Feature<any> | GeoJSON.FeatureCollection<any>): GeoJSON.Feature<GeoJSON.Point>;
declare namespace centroid { }
export = centroid;
1 change: 0 additions & 1 deletion packages/turf-circle/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ declare function circle(
radius: number,
steps?: number,
units?: string): GeoJSON.Feature<GeoJSON.Polygon>;

declare namespace circle { }
export = circle;
12 changes: 12 additions & 0 deletions packages/turf-collect/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/// <reference types="geojson" />

/***
* http://turfjs.org/docs/#collect
*/
declare function collect(
polygons: GeoJSON.FeatureCollection<GeoJSON.Polygon>,
points: GeoJSON.FeatureCollection<GeoJSON.Point>,
inProperty: string,
outProperty: string): GeoJSON.FeatureCollection<GeoJSON.Polygon>;
declare namespace collect { }
export = collect;
8 changes: 8 additions & 0 deletions packages/turf-combine/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/// <reference types="geojson" />

/***
* http://turfjs.org/docs/#combine
*/
declare function combine(features: GeoJSON.FeatureCollection<GeoJSON.Point | GeoJSON.LineString | GeoJSON.Polygon>): GeoJSON.FeatureCollection<GeoJSON.MultiPoint | GeoJSON.MultiLineString | GeoJSON.MultiPolygon>;
declare namespace combine { }
export = combine;
11 changes: 11 additions & 0 deletions packages/turf-concave/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/// <reference types="geojson" />

/***
* http://turfjs.org/docs/#concave
*/
declare function concave(
points: GeoJSON.FeatureCollection<GeoJSON.Point>,
maxEdge: number,
units: string): GeoJSON.Feature<GeoJSON.Polygon>;
declare namespace concave { }
export = concave;
8 changes: 8 additions & 0 deletions packages/turf-convex/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/// <reference types="geojson" />

/***
* http://turfjs.org/docs/#convex
*/
declare function convex(features: GeoJSON.Feature<any> | GeoJSON.FeatureCollection<any>): GeoJSON.Feature<GeoJSON.Polygon>;
declare namespace convex { }
export = convex;
12 changes: 12 additions & 0 deletions packages/turf-destination/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/// <reference types="geojson" />

/***
* http://turfjs.org/docs/#destination
*/
declare function destination(
from: GeoJSON.Feature<GeoJSON.Point>,
distance: number,
bearing: number,
units?: string): GeoJSON.Feature<GeoJSON.Point>;
declare namespace destination { }
export = destination;
8 changes: 8 additions & 0 deletions packages/turf-difference/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/// <reference types="geojson" />

/***
* http://turfjs.org/docs/#difference
*/
declare function difference(poly1: GeoJSON.Feature<GeoJSON.Polygon>, poly2: GeoJSON.Feature<GeoJSON.Polygon>): GeoJSON.Feature<GeoJSON.Polygon>;
declare namespace difference { }
export = difference;
11 changes: 11 additions & 0 deletions packages/turf-distance/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/// <reference types="geojson" />

/***
* http://turfjs.org/docs/#distance
*/
declare function distance(
from: GeoJSON.Feature<GeoJSON.Point>,
to: GeoJSON.Feature<GeoJSON.Point>,
units?: string): number;
declare namespace distance { }
export = distance;

0 comments on commit 5360d47

Please sign in to comment.