mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-02-27 19:22:47 +00:00
Add definitions for voronoi-diagram
This commit is contained in:
parent
48c95a4bb4
commit
33338d5b11
18
voronoi-diagram/index.d.ts
vendored
Normal file
18
voronoi-diagram/index.d.ts
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
// Type definitions for voronoi-diagram 1.0.1
|
||||
// Project: https://github.com/mikolalysenko/voronoi-diagram
|
||||
// Definitions by: Michael Neu <https://github.com/michaelneu>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module "voronoi-diagram" {
|
||||
type Point = number[];
|
||||
type Cell = number[];
|
||||
type Position = number[];
|
||||
|
||||
interface VoronoiDiagram {
|
||||
cells: Cell[];
|
||||
positions: Position[];
|
||||
}
|
||||
|
||||
function voronoi(points: Point[]) : VoronoiDiagram;
|
||||
export = voronoi;
|
||||
}
|
||||
19
voronoi-diagram/tsconfig.json
Normal file
19
voronoi-diagram/tsconfig.json
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"voronoi-diagram-tests.ts"
|
||||
]
|
||||
}
|
||||
14
voronoi-diagram/voronoi-diagram-tests.ts
Normal file
14
voronoi-diagram/voronoi-diagram-tests.ts
Normal file
@ -0,0 +1,14 @@
|
||||
/// <reference path="index.d.ts" />
|
||||
|
||||
import voronoi = require("voronoi-diagram");
|
||||
|
||||
let points = [
|
||||
[1, 1],
|
||||
[2, 2],
|
||||
[3, 3]
|
||||
];
|
||||
|
||||
let diagram = voronoi(points);
|
||||
|
||||
let firstCell = diagram.cells[0],
|
||||
firstPosition = diagram.positions[0];
|
||||
Loading…
Reference in New Issue
Block a user