import type { CardGameRules } from "../card-games.types.ts"; import type { CribbageGame, CribbageMove } from "./cribbage.types.ts"; /** A game of Cribbage as text: its table, its seed and its moves, never a hand. * * @param game - The current native game; applying a move returns a new state. * @returns A game of Cribbage as text: its table, its seed and its moves, never a hand. * * @example * ```ts * import { CARD_GAME_TABLES, newGame } from "@johnmorrisdotca/toranpu"; * import { encodeCribbage } from "@johnmorrisdotca/toranpu/cribbage"; * * const names = Array.from({ length: CARD_GAME_TABLES.cribbage.defaultPlayers }, (_, seat) => `Seat ${seat + 1}`); * let game = newGame("cribbage", { players: names, seed: 42 })!; * console.log(encodeCribbage(game)); * ``` */ export declare const encodeCribbage: (game: CribbageGame) => string; /** Text read back into the game of Cribbage it records, by playing every move again through the rules; null for anything they cannot play out. * * @param text - The notation, encoded state or saved text to read. * @returns Text read back into the game of Cribbage it records, by playing every move again through the rules; null for anything they cannot play out. * * @example * ```ts * import { CARD_GAME_TABLES, newGame } from "@johnmorrisdotca/toranpu"; * import { decodeCribbage, encodeCribbage } from "@johnmorrisdotca/toranpu/cribbage"; * * const names = Array.from({ length: CARD_GAME_TABLES.cribbage.defaultPlayers }, (_, seat) => `Seat ${seat + 1}`); * let game = newGame("cribbage", { players: names, seed: 42 })!; * console.log(decodeCribbage(encodeCribbage(game))?.phase); * ``` */ export declare const decodeCribbage: (text: string | null) => CribbageGame | null; /** Cribbage as one `CardGameRules`: everything a table asks of the game. * * @example * ```ts * import { CRIBBAGE_RULES } from "@johnmorrisdotca/toranpu/cribbage"; * console.log(Object.keys(CRIBBAGE_RULES)); * ``` */ export declare const CRIBBAGE_RULES: CardGameRules;