add point-in-polygon/point-in-polygon.d.ts (#11169)

This commit is contained in:
shinichi.kogai
2016-09-14 20:47:43 +09:00
committed by Masahiro Wakame
parent be0ba281b6
commit 66d2cc80d8
2 changed files with 14 additions and 0 deletions

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

View 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;
}