@types/trianglify
TypeScript icon, indicating that this package has built-in type declarations

1.2.3 • Public • Published

Installation

npm install --save @types/trianglify

Summary

This package contains type definitions for trianglify (https://github.com/qrohlf/trianglify).

Details

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

index.d.ts

declare namespace trianglify {
    interface Options {
        /** Width of pattern */
        width?: number | undefined;
        /** Height of pattern */
        height?: number | undefined;
        /** Size of the cells used to generate a randomized grid */
        cell_size?: number | undefined;
        /** how much to randomize the grid */
        variance?: number | undefined;
        /** Seed for the RNG */
        seed?: number | string | null | undefined;
        /** X color stops */
        x_colors?: false | string | string[] | undefined;
        /** Y color stops */
        y_colors?: false | string | string[] | undefined;
        /** Color space used for gradient construction & interpolation */
        color_space?: string | undefined;
        /** Color function f(x, y) that returns a color specification that is consumable by chroma-js */
        color_function?: ((x: number, y: number) => string) | null | undefined;
        /** Width of stroke. Defaults to 1.51 to fix an issue with canvas antialiasing. */
        stroke_width?: number | undefined;
        /** An array of [x,y] coordinates to trianglulate. Defaults to undefined, and points are generated. */
        points?: number[] | undefined;
    }

    interface SVGOptions {
        includeNamespace: boolean;
    }

    interface Pattern {
        opts: Options;
        polys: any;
        svg(opts?: SVGOptions): SVGElement;
        canvas(canvas?: HTMLCanvasElement): HTMLCanvasElement;
        png(): string;
    }
}

declare function Trianglify(opts?: trianglify.Options): trianglify.Pattern;

export = Trianglify;

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: none

Credits

These definitions were written by Daniel Perez Alvarez.

Dependents (1)

Package Sidebar

Install

npm i @types/trianglify

Weekly Downloads

147

Version

1.2.3

License

MIT

Unpacked Size

5.78 kB

Total Files

5

Last publish

Collaborators

  • types