mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-13 05:20:25 +00:00
Merge pull request #34060 from 28Apps-Software-GmbH/master
[polygons-intersect] created types
This commit is contained in:
Vendored
+14
@@ -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);
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user