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

/**
 * Best move for the side to move: `[x, y, nodes searched, score]` (x = -1 if the game is over).
 */
export function gomoku_ai_move(depth: number): Int32Array;

/**
 * 225 cells, row-major: 0 empty, 1 black, 2 white.
 */
export function gomoku_board(): Uint8Array;

/**
 * Start a new game (black moves first).
 */
export function gomoku_new(): void;

/**
 * Place a stone for the side to move. Returns INVALID, ONGOING, 1 / 2 (winner) or DRAW.
 */
export function gomoku_play(x: number, y: number): number;

/**
 * `[side to move, result, move count, last move index or -1]`.
 */
export function gomoku_state(): Int32Array;

/**
 * Take back the last move. Returns false if there is nothing to undo.
 */
export function gomoku_undo(): boolean;

/**
 * Cell indices of the winning line (empty if nobody has won).
 */
export function gomoku_winning_line(): Uint32Array;

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

export interface InitOutput {
    readonly memory: WebAssembly.Memory;
    readonly gomoku_ai_move: (a: number) => [number, number];
    readonly gomoku_board: () => [number, number];
    readonly gomoku_new: () => void;
    readonly gomoku_play: (a: number, b: number) => number;
    readonly gomoku_state: () => [number, number];
    readonly gomoku_undo: () => number;
    readonly gomoku_winning_line: () => [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>;
