mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
point-in-polygon: Lint (#18349)
This commit is contained in:
parent
97c89cee56
commit
73c39cf916
8
types/point-in-polygon/index.d.ts
vendored
8
types/point-in-polygon/index.d.ts
vendored
@ -1,10 +1,8 @@
|
||||
// Type definitions for point-in-polygon
|
||||
// Type definitions for point-in-polygon 1.0
|
||||
// Project: https://github.com/substack/point-in-polygon
|
||||
// Definitions by: dyst5422 <https://github.com/dyst5422>
|
||||
// kogai <https://github.com/kogai>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module 'point-in-polygon' {
|
||||
const inside: (point: number[], polygon: number[][]) => boolean;
|
||||
export = inside;
|
||||
}
|
||||
declare function inside(point: ReadonlyArray<number>, polygon: ReadonlyArray<ReadonlyArray<number>>): boolean;
|
||||
export = inside;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import * as inside from 'point-in-polygon';
|
||||
import inside = require("point-in-polygon");
|
||||
|
||||
const polygon = [ [ 1, 1 ], [ 1, 2 ], [ 2, 2 ], [ 2, 1 ] ];
|
||||
const inPolygon: boolean = inside([ 1.5, 1.5 ], polygon);
|
||||
|
||||
1
types/point-in-polygon/tslint.json
Normal file
1
types/point-in-polygon/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user