Merge pull request #34060 from 28Apps-Software-GmbH/master

[polygons-intersect] created types
This commit is contained in:
Sheetal Nandi
2019-03-21 10:22:27 -07:00
committed by GitHub
4 changed files with 43 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
// Type definitions for polygons-intersect 1.0
// Project: https://github.com/DudaGod/polygons-intersect#readme
// Definitions by: Konrad Klockgether <https://github.com/Nielio>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/**
* Finds all points where the polygons intersect each other.
*/
declare function intersection(
poly1: Array<{ x: number, y: number }>,
poly2: Array<{ x: number, y: number }>
): Array<{ x: number, y: number }>;
export = intersection;
@@ -0,0 +1,5 @@
import polygonsIntersect = require('polygons-intersect');
const poly1 = [{x: 10, y: 10}, {x: 10, y: 30}, {x: 30, y: 30}, {x: 30, y: 10}];
const poly2 = [{x: 20, y: 20}, {x: 20, y: 40}, {x: 40, y: 40}, {x: 40, y: 20}];
polygonsIntersect(poly1, poly2);
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"strictFunctionTypes": true
},
"files": [
"index.d.ts",
"polygons-intersect-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }