From 0c6d978442b244ca3f29c1ffdd44b5007ae7ad93 Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Wed, 29 Dec 2021 21:24:57 +0100 Subject: separate out visualizer library --- web/pw-visualizer/src/voronoi/voronoi-core.d.ts | 56 +++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 web/pw-visualizer/src/voronoi/voronoi-core.d.ts (limited to 'web/pw-visualizer/src/voronoi/voronoi-core.d.ts') 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; -- cgit v1.2.3