mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 13:00:19 +00:00
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:
Vendored
+4
-2
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user