fix(point-in-polygon): Fixed point-in-polygon type declaration (#18069)

* fix(point-in-polygon): Fixed point-in-polygon type declaration

The export format of point-in-polygon did not match the type declaration format.

* Fixed removed definition author
This commit is contained in:
dyst5422
2017-07-24 08:43:11 -07:00
committed by Andy
parent 765d26a240
commit 64099f0b4c
2 changed files with 5 additions and 3 deletions
+4 -2
View File
@@ -1,8 +1,10 @@
// Type definitions for point-in-polygon
// Project: https://github.com/substack/point-in-polygon
// Definitions by: kogai <https://github.com/kogai>
// Definitions by: dyst5422 <https://github.com/dyst5422>
// kogai <https://github.com/kogai>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module 'point-in-polygon' {
export default function inside(point: number[], polygon: number[][]): boolean;
const inside: (point: number[], polygon: number[][]) => boolean;
export = inside;
}
@@ -1,4 +1,4 @@
import inside from 'point-in-polygon';
import * as inside from 'point-in-polygon';
const polygon = [ [ 1, 1 ], [ 1, 2 ], [ 2, 2 ], [ 2, 1 ] ];
const inPolygon: boolean = inside([ 1.5, 1.5 ], polygon);