import type { Cell, Point, Stone } from "../types.ts"; /** * Board geometry shared by the engine and the rule modules. It lives apart * from `engine.ts` so a rule can use it without importing the engine that * calls the rule. */ /** Narrows a cell to a played stone, excluding empties and obstacles. * * @param cell - The board cell to check. * @returns Narrows a cell to a played stone, excluding empties and obstacles. * @example * ```ts * import { isStone } from "@johnmorrisdotca/narabe"; * * console.log(isStone("black")); * ``` */ export declare function isStone(cell: Cell): cell is Stone; /** The other stone colour. * * @param stone - The black or white colour being examined. * @returns The other stone colour. * @example * ```ts * import { otherStone } from "@johnmorrisdotca/narabe"; * * console.log(otherStone("black")); * ``` */ export declare function otherStone(stone: Stone): Stone; /** Convert a board point into its row-major array index. * * @param size - The number of cells on each side of the board. * @param point - A zero-based row and column on the board. * @returns Convert a board point into its row-major array index. * @example * ```ts * import { indexOf } from "@johnmorrisdotca/narabe"; * * const point = {row:7,col:7}; * console.log(indexOf(15, point)); * ``` */ export declare function indexOf(size: number, point: Point): number; /** Convert a row-major array index into board coordinates. * * @param size - The number of cells on each side of the board. * @param index - The row-major board array index. * @returns Convert a row-major array index into board coordinates. * @example * ```ts * import { pointOf } from "@johnmorrisdotca/narabe"; * * console.log(pointOf(15, 112)); * ``` */ export declare function pointOf(size: number, index: number): Point; /** Whether both coordinates are within the square board. * * @param size - The number of cells on each side of the board. * @param point - A zero-based row and column on the board. * @returns Whether both coordinates are within the square board. * @example * ```ts * import { isOnBoard } from "@johnmorrisdotca/narabe"; * * const point = {row:7,col:7}; * console.log(isOnBoard(15, point)); * ``` */ export declare function isOnBoard(size: number, point: Point): boolean; export declare function samePoint(a: Point, b: Point): boolean; /** `origin` moved `k` steps along `step`. */ export declare function stepFrom(origin: Point, step: Point, k: number): Point; export declare function negate(step: Point): Point; /** The cell at `point`, or undefined off the board. */ export declare function cellAtPoint(board: Cell[], size: number, point: Point): Cell | undefined; /** Chebyshev distance: how many king moves apart two points are. */ export declare function chebyshev(a: Point, b: Point): number; /** A copy of the board with `stone` placed at `point`. */ export declare function withStone(board: Cell[], size: number, point: Point, stone: Stone): Cell[];