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