diff --git a/polyline/polyline-tests.ts b/polyline/polyline-tests.ts
new file mode 100644
index 0000000000..888d15f91a
--- /dev/null
+++ b/polyline/polyline-tests.ts
@@ -0,0 +1,16 @@
+///
+
+// returns an array of lat, lon pairs
+polyline.decode('_p~iF~ps|U_ulLnnqC_mqNvxq`@');
+
+// returns a string-encoded polyline
+polyline.encode([[38.5, -120.2], [40.7, -120.95], [43.252, -126.453]]);
+
+// returns a string-encoded polyline from a GeoJSON LineString
+polyline.fromGeoJSON({ "type": "Feature",
+ "geometry": {
+ "type": "LineString",
+ "coordinates": [[-120.2, 38.5], [-120.95, 40.7], [-126.453, 43.252]]
+ },
+ "properties": {}
+});
\ No newline at end of file
diff --git a/polyline/polyline.d.ts b/polyline/polyline.d.ts
new file mode 100644
index 0000000000..5663fac491
--- /dev/null
+++ b/polyline/polyline.d.ts
@@ -0,0 +1,22 @@
+// Type definitions for Polyline 0.1.0
+// Project: https://github.com/mapbox/polyline
+// Definitions by: Arseniy Maximov
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+///
+
+interface NumberArray {
+ [index: number]: number;
+}
+
+interface Polyline {
+ decode(string: string, precision?: number): NumberArray[];
+ encode(coordinate: NumberArray[], precision?: number): string;
+ fromGeoJSON(geojson: GeoJSON.GeoJsonObject, precision?: number): string;
+}
+
+declare var polyline: Polyline;
+
+declare module "polyline" {
+ export = polyline;
+}
\ No newline at end of file