mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-03-29 17:08:21 +08:00
add point-in-polygon/point-in-polygon.d.ts (#11169)
This commit is contained in:
committed by
Masahiro Wakame
parent
be0ba281b6
commit
66d2cc80d8
6
point-in-polygon/point-in-polygon-tests.ts
Normal file
6
point-in-polygon/point-in-polygon-tests.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
/// <reference path="point-in-polygon.d.ts" />
|
||||
|
||||
import inside from 'point-in-polygon';
|
||||
|
||||
const polygon = [ [ 1, 1 ], [ 1, 2 ], [ 2, 2 ], [ 2, 1 ] ];
|
||||
const inPolygon: boolean = inside([ 1.5, 1.5 ], polygon);
|
||||
8
point-in-polygon/point-in-polygon.d.ts
vendored
Normal file
8
point-in-polygon/point-in-polygon.d.ts
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
// Type definitions for point-in-polygon
|
||||
// Project: https://github.com/substack/point-in-polygon
|
||||
// Definitions by: 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;
|
||||
}
|
||||
Reference in New Issue
Block a user