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

/**
 * out = min(img1 + img2, 255) per channel; returns the byte sum of the result.
 */
export function blend_scalar(): number;

/**
 * 16 channels per instruction (`u8x16_add_sat`), widening adds for the checksum.
 */
export function blend_simd(): number;

/**
 * Reference value accumulated in f64, to show each version's rounding error.
 */
export function dot_exact(): number;

export function dot_scalar(): number;

/**
 * Four running sums, one per lane, added together at the end.
 */
export function dot_simd(): number;

/**
 * Iteration count per pixel for the view centred at (cx, cy) with `scale` units per pixel.
 */
export function mandel_scalar(w: number, h: number, cx: number, cy: number, scale: number, max_iter: number): Uint16Array;

/**
 * Four horizontally adjacent pixels iterate together; a lane mask stops counting
 * for pixels that escaped, and the loop ends when all four have.
 */
export function mandel_simd(w: number, h: number, cx: number, cy: number, scale: number, max_iter: number): Uint16Array;

/**
 * Fill the input buffers: two f32 vectors of `n` elements, two RGBA images of `pixels` pixels.
 */
export function simd_prepare(n: number, pixels: number): void;

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

export interface InitOutput {
    readonly memory: WebAssembly.Memory;
    readonly blend_scalar: () => number;
    readonly blend_simd: () => number;
    readonly dot_exact: () => number;
    readonly dot_scalar: () => number;
    readonly dot_simd: () => number;
    readonly mandel_scalar: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
    readonly mandel_simd: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
    readonly simd_prepare: (a: number, b: number) => void;
    readonly __wbindgen_externrefs: WebAssembly.Table;
    readonly __wbindgen_free: (a: number, b: number, c: number) => void;
    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>;
