delaunator
delaunator copied to clipboard
Type definition for Typescript
Would it be possible to add type definitions to this project so it is easier to import it as a module?
Below is an example that works for me which lets me import Delaunator as a module (import Delaunator from 'delaunator') in a Typescript project. I am not entirely sure if the type definition is 100% accurate though.
File: delaunator.d.ts
declare module 'delaunator' {
export default class Delaunator<T extends Record<number, number>> {
triangles: Uint32Array
halfedges: Int32Array
hull: Uint32Array
coords: Float64Array
constructor(coords: Float64Array);
static from(points: T[], getX?: (p: T) => number, getY?: (p: T) => number): Delaunator<T>;
}
}