create types for robust-point-in-polygon (#34526)

* create types for robust-point-in-polygon

* fix errors in index and test

* fix travis build issues

* declare point type in test
This commit is contained in:
mb 2019-05-30 15:17:55 -04:00 committed by Sheetal Nandi
parent bd677abc92
commit 8eaac71fb2
4 changed files with 41 additions and 0 deletions

View File

@ -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 <https://github.com/crashspringfield>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
type Point = [number, number];
declare function robustPointInPolygon(vs: Point[], point: Point): number;
export = robustPointInPolygon;

View File

@ -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);

View File

@ -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"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }