aboutsummaryrefslogtreecommitdiff
path: root/web/pw-visualizer/src/voronoi/voronoi-core.d.ts
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2021-12-29 21:24:57 +0100
committerIlion Beyst <ilion.beyst@gmail.com>2021-12-29 21:25:29 +0100
commit0c6d978442b244ca3f29c1ffdd44b5007ae7ad93 (patch)
treebaae5fa459a49ecd362e548e0649e2f58c669a70 /web/pw-visualizer/src/voronoi/voronoi-core.d.ts
parent3eeaab6cec70e7a06a99a1ac2662974f71064bee (diff)
downloadplanetwars.dev-0c6d978442b244ca3f29c1ffdd44b5007ae7ad93.tar.xz
planetwars.dev-0c6d978442b244ca3f29c1ffdd44b5007ae7ad93.zip
separate out visualizer library
Diffstat (limited to 'web/pw-visualizer/src/voronoi/voronoi-core.d.ts')
-rw-r--r--web/pw-visualizer/src/voronoi/voronoi-core.d.ts56
1 files changed, 56 insertions, 0 deletions
diff --git a/web/pw-visualizer/src/voronoi/voronoi-core.d.ts b/web/pw-visualizer/src/voronoi/voronoi-core.d.ts
new file mode 100644
index 0000000..e908fbb
--- /dev/null
+++ b/web/pw-visualizer/src/voronoi/voronoi-core.d.ts
@@ -0,0 +1,56 @@
+
+declare namespace Voronoi {
+ class Point {
+ x: number;
+ y: number;
+ }
+
+ class Site {
+ x: number;
+ y: number;
+ voronoiId: number;
+ }
+
+ class Cell {
+ site: Site;
+ halfedges: HalfEdge[];
+ closeMe: boolean;
+ }
+
+ class Edge {
+ lSite: Site;
+ rSite: Site;
+ vb: Point;
+ va: Point;
+ }
+
+ class HalfEdge {
+ site: Site;
+ edge: Edge;
+ angle: number;
+ getStartpoint(): Point;
+ getEndpoint(): Point;
+ }
+
+ class BBox {
+ xl: number;
+ xr: number;
+ yt: number;
+ yb: number;
+ }
+
+ class VoronoiDiagram {
+ site: any;
+ cells: Cell[];
+ edges: Edge[];
+ vertices: Point[];
+ execTime: number;
+ }
+}
+
+declare class Voronoi {
+ constructor();
+ compute(sites: Voronoi.Point[], bbox: Voronoi.BBox): Voronoi.VoronoiDiagram;
+}
+
+export = Voronoi;