diff --git a/types/wellknown/index.d.ts b/types/wellknown/index.d.ts new file mode 100644 index 0000000000..0b100e5c33 --- /dev/null +++ b/types/wellknown/index.d.ts @@ -0,0 +1,7 @@ +// Type definitions for wellknown 0.5 +// Project: https://github.com/mapbox/wellknown#readme +// Definitions by: Yair Tawil +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export function parse(input: string): {}; +export function stringify(gj: {}): string; diff --git a/types/wellknown/tsconfig.json b/types/wellknown/tsconfig.json new file mode 100644 index 0000000000..66be74a40f --- /dev/null +++ b/types/wellknown/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "wellknown-tests.ts" + ] +} diff --git a/types/wellknown/tslint.json b/types/wellknown/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/wellknown/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/wellknown/wellknown-tests.ts b/types/wellknown/wellknown-tests.ts new file mode 100644 index 0000000000..0f1bcd656e --- /dev/null +++ b/types/wellknown/wellknown-tests.ts @@ -0,0 +1,7 @@ +import * as wellknown from 'wellknown'; +wellknown.parse("POINT(1 2)"); +const geoJson: {} = { + coordinates: [1, 2], + type: "Point" +}; +wellknown.stringify(geoJson);