/* tslint:disable */
/* eslint-disable */

/**
 * Add a point (ignored if it duplicates an existing one). Returns the point count.
 */
export function dl_add(x: number, y: number): number;

/**
 * Circumcircle [cx, cy, r] of a triangle from `dl_triangles`.
 */
export function dl_circumcircle(t: number): Float32Array;

/**
 * Start an empty triangulation of a `w`×`h` area.
 */
export function dl_clear(w: number, h: number): void;

/**
 * Index (into `dl_triangles`) of the triangle containing (x, y), or -1.
 */
export function dl_find(x: number, y: number): number;

/**
 * Low-poly version of an image: `n` points sampled more densely along edges (`edge_bias`
 * 0 = uniform, 1 = strongly edge-weighted) plus the border, triangulated, each triangle
 * filled with the average colour under it. The points replace the current ones.
 */
export function dl_lowpoly(rgba: Uint8Array, w: number, h: number, n: number, seed: number, edge_bias: number): Uint8Array;

/**
 * x0, y0, x1, y1 …
 */
export function dl_points(): Float32Array;

/**
 * Add `n` uniformly random points.
 */
export function dl_random(n: number, seed: number): number;

/**
 * Triangles as point index triples (counter-clockwise).
 */
export function dl_triangles(): Uint32Array;

/**
 * Voronoi edges as segments x1, y1, x2, y2 …
 */
export function dl_voronoi(): Float32Array;

export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;

export interface InitOutput {
    readonly memory: WebAssembly.Memory;
    readonly dl_add: (a: number, b: number) => number;
    readonly dl_circumcircle: (a: number) => [number, number];
    readonly dl_clear: (a: number, b: number) => void;
    readonly dl_find: (a: number, b: number) => number;
    readonly dl_lowpoly: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number];
    readonly dl_points: () => [number, number];
    readonly dl_random: (a: number, b: number) => number;
    readonly dl_triangles: () => [number, number];
    readonly dl_voronoi: () => [number, number];
    readonly __wbindgen_externrefs: WebAssembly.Table;
    readonly __wbindgen_free: (a: number, b: number, c: number) => void;
    readonly __wbindgen_malloc: (a: number, b: number) => number;
    readonly __wbindgen_start: () => void;
}

export type SyncInitInput = BufferSource | WebAssembly.Module;

/**
 * Instantiates the given `module`, which can either be bytes or
 * a precompiled `WebAssembly.Module`.
 *
 * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
 *
 * @returns {InitOutput}
 */
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;

/**
 * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
 * for everything else, calls `WebAssembly.instantiate` directly.
 *
 * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
 *
 * @returns {Promise<InitOutput>}
 */
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
