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

/**
 * One byte per cell (row-major): OPEN, WALL, FRONTIER, VISITED, PATH, START, TARGET.
 */
export function maze_cells(): Uint8Array;

/**
 * Generate a perfect maze (every open cell reachable, no loops) with the
 * iterative recursive-backtracker. Width and height are rounded up to odd.
 */
export function maze_generate(width: number, height: number, seed: number): void;

export function maze_height(): number;

/**
 * Flip a cell between wall and open (border cells stay walls). Clears the search.
 */
export function maze_toggle_wall(x: number, y: number): void;

export function maze_width(): number;

/**
 * Discard the current search (e.g. after moving the start or target).
 */
export function search_clear(): void;

/**
 * Begin a search. `use_heuristic`: true = A* (Manhattan), false = Dijkstra.
 */
export function search_start(sx: number, sy: number, tx: number, ty: number, use_heuristic: boolean): void;

/**
 * `[status, expanded nodes, path length in steps]`.
 */
export function search_stats(): Uint32Array;

/**
 * Expand up to `max_nodes` nodes. Returns RUNNING, FOUND or NO_PATH.
 */
export function search_step(max_nodes: number): number;

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

export interface InitOutput {
    readonly memory: WebAssembly.Memory;
    readonly maze_cells: () => [number, number];
    readonly maze_generate: (a: number, b: number, c: number) => void;
    readonly maze_height: () => number;
    readonly maze_toggle_wall: (a: number, b: number) => void;
    readonly maze_width: () => number;
    readonly search_clear: () => void;
    readonly search_start: (a: number, b: number, c: number, d: number, e: number) => void;
    readonly search_stats: () => [number, number];
    readonly search_step: (a: number) => number;
    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>;
