use external module style in voronoi-diagram

This commit is contained in:
michaelneu
2016-11-16 00:09:42 +01:00
parent 33338d5b11
commit 0fbab808e0
3 changed files with 27 additions and 24 deletions
+6 -6
View File
@@ -3,16 +3,16 @@
// Definitions by: Michael Neu <https://github.com/michaelneu>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module "voronoi-diagram" {
declare namespace voronoi {
type Point = number[];
type Cell = number[];
type Position = number[];
interface VoronoiDiagram {
cells: Cell[];
positions: Position[];
positions: Point[];
}
}
function voronoi(points: Point[]) : VoronoiDiagram;
export = voronoi;
}
declare function voronoi(points: voronoi.Point[]) : voronoi.VoronoiDiagram;
export = voronoi;
+17 -17
View File
@@ -1,19 +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"
]
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"voronoi-diagram-tests.ts"
]
}
+4 -1
View File
@@ -2,7 +2,10 @@
import voronoi = require("voronoi-diagram");
let points = [
const x: voronoi.Point = [1, 2];
let points: voronoi.Point[] = [
x,
[1, 1],
[2, 2],
[3, 3]