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