diff --git a/types/robust-point-in-polygon/index.d.ts b/types/robust-point-in-polygon/index.d.ts new file mode 100644 index 0000000000..07b4953dc1 --- /dev/null +++ b/types/robust-point-in-polygon/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for robust-point-in-polygon 1.0 +// Project: https://github.com/mikolalysenko/robust-point-in-polygon +// Definitions by: Crash Springfield +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +type Point = [number, number]; + +declare function robustPointInPolygon(vs: Point[], point: Point): number; +export = robustPointInPolygon; diff --git a/types/robust-point-in-polygon/robust-point-in-polygon-tests.ts b/types/robust-point-in-polygon/robust-point-in-polygon-tests.ts new file mode 100644 index 0000000000..cd6b026339 --- /dev/null +++ b/types/robust-point-in-polygon/robust-point-in-polygon-tests.ts @@ -0,0 +1,8 @@ +import robustPointInPolygon = require('robust-point-in-polygon'); + +type Point = [number, number]; + +const polygon: Point[] = [ [ 1, 1 ], [ 1, 2 ], [ 2, 2 ], [ 2, 1 ] ]; +const point: Point = [ 1.5, 1.5 ]; + +robustPointInPolygon(polygon, point); diff --git a/types/robust-point-in-polygon/tsconfig.json b/types/robust-point-in-polygon/tsconfig.json new file mode 100644 index 0000000000..e38f6c17fd --- /dev/null +++ b/types/robust-point-in-polygon/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "robust-point-in-polygon-tests.ts" + ] +} diff --git a/types/robust-point-in-polygon/tslint.json b/types/robust-point-in-polygon/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/robust-point-in-polygon/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }