Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/delaunator

Package Overview
Dependencies
Maintainers
0
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/delaunator

TypeScript definitions for delaunator

  • 5.0.3
  • ts4.8
  • ts4.9
  • ts5.0
  • ts5.1
  • ts5.2
  • ts5.3
  • ts5.4
  • ts5.5
  • ts5.6
  • ts5.7
  • ts5.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

Installation

npm install --save @types/delaunator

Summary

This package contains type definitions for delaunator (https://github.com/mapbox/delaunator#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/delaunator.

index.d.ts

declare class Delaunator<A extends ArrayLike<number>> {
    /**
     * A Uint32Array array of triangle vertex indices (each group of three numbers forms a triangle).
     * All triangles are directed counterclockwise.
     */
    triangles: Uint32Array;

    /**
     * A Int32Array array of triangle half-edge indices that allows you to traverse the triangulation.
     * i-th half-edge in the array corresponds to vertex triangles[i] the half-edge is coming from.
     * halfedges[i] is the index of a twin half-edge in an adjacent triangle (or -1 for outer half-edges on the convex hull).
     *
     * The flat array-based data structures might be counterintuitive, but they're one of the key reasons this library is fast.
     */
    halfedges: Int32Array;

    /**
     * A Uint32Array array of indices that reference points on the convex hull of the input data, counter-clockwise.
     */
    hull: Uint32Array;

    /**
     * An array of input coordinates in the form [x0, y0, x1, y1, ....], of the type provided in the constructor (or Float64Array if you used Delaunator.from).
     */
    coords: A;

    /**
     * Constructs a delaunay triangulation object given a typed array of point coordinates of the form: [x0, y0, x1, y1, ...].
     * (use a typed array for best performance).
     */
    constructor(points: A);

    /**
     * Constructs a delaunay triangulation object given an array of points ([x, y] by default).
     */
    static from(points: ArrayLike<ArrayLike<number>>): Delaunator<Float64Array>;

    /**
     * Constructs a delaunay triangulation object given an array of custom points. Duplicate points are skipped.
     * getX and getY are optional functions for custom point formats. Duplicate points are skipped.
     */
    static from<P>(
        points: ArrayLike<P>,
        getX: (point: P) => number,
        getY: (point: P) => number,
    ): Delaunator<Float64Array>;

    /**
     * Updates the triangulation if you modified delaunay.coords values in place, avoiding expensive memory
     * allocations. Useful for iterative relaxation algorithms such as Lloyd's.
     */
    update(): void;
}

export = Delaunator;

Additional Details

  • Last updated: Fri, 12 Jul 2024 23:07:20 GMT
  • Dependencies: none

Credits

These definitions were written by Denis Carriere, Bradley Odell, and Tobias Kraus.

FAQs

Package last updated on 12 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc