import type { CardGameRules } from "../card-games.types.ts"; import type { CrazyEightsGame, CrazyEightsMove } from "./crazy-eights.types.ts"; /** A game of Crazy Eights 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 Crazy Eights as text: its table, its seed and its moves, never a hand. * * @example * ```ts * import { CARD_GAME_TABLES, newGame } from "@johnmorrisdotca/toranpu"; * import { encodeCrazyEights } from "@johnmorrisdotca/toranpu/crazy-eights"; * * const names = Array.from({ length: CARD_GAME_TABLES.crazyEights.defaultPlayers }, (_, seat) => `Seat ${seat + 1}`); * let game = newGame("crazyEights", { players: names, seed: 42 })!; * console.log(encodeCrazyEights(game)); * ``` */ export declare const encodeCrazyEights: (game: CrazyEightsGame) => string; /** Text read back into the game of Crazy Eights 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 Crazy Eights 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 { decodeCrazyEights, encodeCrazyEights } from "@johnmorrisdotca/toranpu/crazy-eights"; * * const names = Array.from({ length: CARD_GAME_TABLES.crazyEights.defaultPlayers }, (_, seat) => `Seat ${seat + 1}`); * let game = newGame("crazyEights", { players: names, seed: 42 })!; * console.log(decodeCrazyEights(encodeCrazyEights(game))?.phase); * ``` */ export declare const decodeCrazyEights: (text: string | null) => CrazyEightsGame | null; /** Crazy Eights as one `CardGameRules`: everything a table asks of the game. * * @example * ```ts * import { CRAZY_EIGHTS_RULES } from "@johnmorrisdotca/toranpu/crazy-eights"; * console.log(Object.keys(CRAZY_EIGHTS_RULES)); * ``` */ export declare const CRAZY_EIGHTS_RULES: CardGameRules;