import type { CardGameRules } from "../card-games.types.ts"; import type { WarGame, WarMove } from "./war.types.ts"; /** A game of War as text: its table, its seed and its moves, never a pile. * * @param game - The current native game; applying a move returns a new state. * @returns A game of War as text: its table, its seed and its moves, never a pile. * * @example * ```ts * import { CARD_GAME_TABLES, newGame } from "@johnmorrisdotca/toranpu"; * import { encodeWar } from "@johnmorrisdotca/toranpu/war"; * * const names = Array.from({ length: CARD_GAME_TABLES.war.defaultPlayers }, (_, seat) => `Seat ${seat + 1}`); * let game = newGame("war", { players: names, seed: 42 })!; * console.log(encodeWar(game)); * ``` */ export declare const encodeWar: (game: WarGame) => string; /** Text read back into the game of War 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 War 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 { decodeWar, encodeWar } from "@johnmorrisdotca/toranpu/war"; * * const names = Array.from({ length: CARD_GAME_TABLES.war.defaultPlayers }, (_, seat) => `Seat ${seat + 1}`); * let game = newGame("war", { players: names, seed: 42 })!; * console.log(decodeWar(encodeWar(game))?.phase); * ``` */ export declare const decodeWar: (text: string | null) => WarGame | null; /** War as one `CardGameRules`: everything a table asks of the game. * * @example * ```ts * import { WAR_RULES } from "@johnmorrisdotca/toranpu/war"; * console.log(Object.keys(WAR_RULES)); * ``` */ export declare const WAR_RULES: CardGameRules;