import type { Cell, GameSettings, GameState, Move, Piece, PieceCell, Point, Stone } from "../types.ts"; /** The whole queue for these settings, the same every time for the same seed. */ export declare function pieceQueue(settings: GameSettings): Piece[]; /** How many pieces `stone` has laid so far: its index into the queue. */ export declare function piecesLaidBy(moves: readonly Move[], stone: Stone): number; /** How many single stones `stone` has spent. */ export declare function singlesUsedBy(moves: readonly Move[], stone: Stone): number; /** The piece the colour to move must lay next, or null outside the piece games. * * @param state - The current immutable game position. * @returns The piece in hand, or null when this variant has no piece queue. * @example * ```ts * import { createGame, queuedPiece } from "@johnmorrisdotca/narabe"; * * const queued = createGame({variant:"dominoFive",seed:42}); * console.log(queuedPiece(queued)); * ``` */ export declare function queuedPiece(state: GameState): Piece | null; /** The pieces after the one in hand, for the preview. * * @param state - The current immutable game position. * @param count - The number of upcoming queue pieces to read. * @returns The pieces after the one in hand, for the preview. * @example * ```ts * import { createGame, upcomingPieces } from "@johnmorrisdotca/narabe"; * * const queued = createGame({variant:"dominoFive",seed:42}); * console.log(upcomingPieces(queued,2)); * ``` */ export declare function upcomingPieces(state: GameState, count: number): Piece[]; /** Shifts a set of cells so its top-left bounding corner is the origin, in a fixed order. */ export declare function normalise(cells: readonly PieceCell[]): PieceCell[]; /** * Every distinct way the piece can lie: four rotations, each also mirrored. * Colours travel with their cells, so a black-white domino turned round is a * different orientation from the one it started as. * * @param piece - The queued piece with relative coloured cells. * @returns Every distinct way the piece can lie: four rotations, each also mirrored. Colours travel with their cells, so a black-white domino turned round is a different orientation from the one it started as. * @example * ```ts * import { orientations } from "@johnmorrisdotca/narabe"; * * console.log(orientations({cells:[{row:0,col:0,stone:"black"},{row:0,col:1,stone:"white"}]}).length); * ``` */ export declare function orientations(piece: Piece): PieceCell[][]; /** The piece turned `turns` quarter turns and, if asked, mirrored — the shape a player has in hand. * * @param piece - The queued piece with relative coloured cells. * @param turns - The number of clockwise quarter turns. * @param flipped - Whether to reflect the piece before rotating it. * @returns The piece turned `turns` quarter turns and, if asked, mirrored — the shape a player has in hand. * @example * ```ts * import { orientCells } from "@johnmorrisdotca/narabe"; * * console.log(orientCells({cells:[{row:0,col:0,stone:"black"},{row:0,col:1,stone:"white"}]},1,false)); * ``` */ export declare function orientCells(piece: Piece, turns: number, flipped: boolean): PieceCell[]; /** The absolute cells of an orientation anchored with its origin at `anchor`. * * @param orientation - Relative coloured cells after rotation or reflection. * @param anchor - The absolute point where the relative footprint is placed. * @returns The absolute cells of an orientation anchored with its origin at `anchor`. * @example * ```ts * import { footprintAt } from "@johnmorrisdotca/narabe"; * * const point = {row:7,col:7}; * console.log(footprintAt([{row:0,col:0,stone:"black"}],point)); * ``` */ export declare function footprintAt(orientation: readonly PieceCell[], anchor: Point): PieceCell[]; /** Whether every cell of a footprint is on the board and empty. * * @param board - The row-major board cells; null marks an empty point. * @param size - The number of cells on each side of the board. * @param cells - The absolute coloured cells of the piece placement. * @returns Whether every cell of a footprint is on the board and empty. * @example * ```ts * import { createGame, footprintFits } from "@johnmorrisdotca/narabe"; * * const state = createGame({variant:"freestyle",size:15}); * const point = {row:7,col:7}; * console.log(footprintFits(state.board,15,[{...point,stone:"black"}])); * ``` */ export declare function footprintFits(board: Cell[], size: number, cells: readonly PieceCell[]): boolean; /** Every legal footprint of the piece in hand. Empty when nothing fits. * * @param state - The current immutable game position. * @returns Every legal footprint of the piece in hand. Empty when nothing fits. * @example * ```ts * import { createGame, piecePlacements } from "@johnmorrisdotca/narabe"; * * const queued = createGame({variant:"dominoFive",seed:42}); * console.log(piecePlacements(queued).length); * ``` */ export declare function piecePlacements(state: GameState): PieceCell[][]; /** * Whether `cells` is the piece in hand, in some orientation, laid somewhere * it fits. Colours must match cell for cell. */ export declare function isPieceInHand(state: GameState, cells: readonly PieceCell[]): boolean;