mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
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:
parent
bd677abc92
commit
8eaac71fb2
9
types/robust-point-in-polygon/index.d.ts
vendored
Normal file
9
types/robust-point-in-polygon/index.d.ts
vendored
Normal 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;
|
||||
@ -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);
|
||||
23
types/robust-point-in-polygon/tsconfig.json
Normal file
23
types/robust-point-in-polygon/tsconfig.json
Normal 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"
|
||||
]
|
||||
}
|
||||
1
types/robust-point-in-polygon/tslint.json
Normal file
1
types/robust-point-in-polygon/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user