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

/**
 * Number of cells of each material, indexed by material id.
 */
export function sand_counts(): Uint32Array;

/**
 * Material at (x, y), or EMPTY outside the world.
 */
export function sand_get(x: number, y: number): number;

/**
 * Create an empty world of w×h cells.
 */
export function sand_init(w: number, h: number): void;

/**
 * Paint `material` in a disc of `radius` cells around (x, y).
 * Particles (sand, water, fire, smoke) are sprinkled at ~50% density, solids fill completely.
 */
export function sand_paint(x: number, y: number, radius: number, material: number): void;

/**
 * w×h RGBA image of the world.
 */
export function sand_render(): Uint8Array;

/**
 * Set a single cell (no randomness).
 */
export function sand_set(x: number, y: number, material: number): void;

/**
 * Advance one frame.
 */
export function sand_step(): void;

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

export interface InitOutput {
    readonly memory: WebAssembly.Memory;
    readonly sand_counts: () => [number, number];
    readonly sand_get: (a: number, b: number) => number;
    readonly sand_init: (a: number, b: number) => void;
    readonly sand_paint: (a: number, b: number, c: number, d: number) => void;
    readonly sand_render: () => [number, number];
    readonly sand_set: (a: number, b: number, c: number) => void;
    readonly sand_step: () => 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>;
