import type { CardId, CardRank } from "../card-games.types.ts"; import type { GoFishGame, GoFishMove } from "./go-fish.types.ts"; /** Seven cards each for two or three players, five for more. * * @param seats - The seat count or seat state supplied by this API. * @returns Seven cards each for two or three players, five for more. * * @example * ```ts * import { goFishHandSize } from "@johnmorrisdotca/toranpu/go-fish"; * * console.log(goFishHandSize(3)); * ``` */ export declare function goFishHandSize(seats: number): number; /** A hand as a player holds it: grouped by rank, ace to king. * * @param hand - The player’s held cards, or the hand number for a deal. * @returns A hand as a player holds it: grouped by rank, ace to king. * * @example * ```ts * import { sortGoFish } from "@johnmorrisdotca/toranpu/go-fish"; * * console.log(sortGoFish(["AS", "AH", "2C"])); * ``` */ export declare function sortGoFish(hand: readonly CardId[]): CardId[]; /** A new game of Go Fish for these players (one name a seat) at this size, dealt from the seed `dealt`, or null for a table Go Fish is not offered for. `computers` says, one a seat, which seats a computer plays; the third argument is unused. * * @param size - The game’s length or size, as defined by its table specification. * @param players - The player names in seat order. * @param _language - An unused legacy language argument retained for compatibility. * @param dealt - The numeric seed used to deal the game. * @param computers - Flags by seat: true where a computer controls that seat. * @returns A new game of Go Fish for these players (one name a seat) at this size, dealt from the seed `dealt`, or null for a table Go Fish is not offered for. `computers` says, one a seat, which seats a computer plays; the third argument is unused. * * @example * ```ts * import { CARD_GAME_TABLES } from "@johnmorrisdotca/toranpu"; * import { startGoFish } from "@johnmorrisdotca/toranpu/go-fish"; * * const names = Array.from({ length: CARD_GAME_TABLES.goFish.defaultPlayers }, (_, seat) => `Seat ${seat + 1}`); * console.log(startGoFish(CARD_GAME_TABLES.goFish.defaultSize, names, undefined, 42)?.phase); * ``` */ export declare function startGoFish(size: number, players: readonly string[], _language?: unknown, dealt?: number, computers?: readonly boolean[]): GoFishGame | null; /** The players the seat to move may ask: everybody else holding cards, or, when nobody else does, anybody else. * * @param game - The current native game; applying a move returns a new state. * @returns The players the seat to move may ask: everybody else holding cards, or, when nobody else does, anybody else. * * @example * ```ts * import { CARD_GAME_TABLES, newGame } from "@johnmorrisdotca/toranpu"; * import { goFishTargets } from "@johnmorrisdotca/toranpu/go-fish"; * * const names = Array.from({ length: CARD_GAME_TABLES.goFish.defaultPlayers }, (_, seat) => `Seat ${seat + 1}`); * let game = newGame("goFish", { players: names, seed: 42 })!; * console.log(goFishTargets(game)); * ``` */ export declare function goFishTargets(game: GoFishGame): number[]; /** The ranks the seat to move may ask for: those it holds. * * @param game - The current native game; applying a move returns a new state. * @returns The ranks the seat to move may ask for: those it holds. * * @example * ```ts * import { CARD_GAME_TABLES, newGame } from "@johnmorrisdotca/toranpu"; * import { goFishRanks } from "@johnmorrisdotca/toranpu/go-fish"; * * const names = Array.from({ length: CARD_GAME_TABLES.goFish.defaultPlayers }, (_, seat) => `Seat ${seat + 1}`); * let game = newGame("goFish", { players: names, seed: 42 })!; * console.log(goFishRanks(game)); * ``` */ export declare function goFishRanks(game: GoFishGame): CardRank[]; /** Every move the seat to play may make now; none once the game is over. * * @param game - The current native game; applying a move returns a new state. * @returns Every move the seat to play may make now; none once the game is over. * * @example * ```ts * import { CARD_GAME_TABLES, newGame } from "@johnmorrisdotca/toranpu"; * import { goFishMoves } from "@johnmorrisdotca/toranpu/go-fish"; * * const names = Array.from({ length: CARD_GAME_TABLES.goFish.defaultPlayers }, (_, seat) => `Seat ${seat + 1}`); * let game = newGame("goFish", { players: names, seed: 42 })!; * console.log(goFishMoves(game)); * ``` */ export declare function goFishMoves(game: GoFishGame): GoFishMove[]; /** The game after that move, with the move added to its record, or null for a move the rules refuse. * * @param game - The current native game; applying a move returns a new state. * @param move - The native move to validate or apply. * @returns The game after that move, with the move added to its record, or null for a move the rules refuse. * * @example * ```ts * import { CARD_GAME_TABLES, newGame, rulesFor } from "@johnmorrisdotca/toranpu"; * import { playGoFish } from "@johnmorrisdotca/toranpu/go-fish"; * * const names = Array.from({ length: CARD_GAME_TABLES.goFish.defaultPlayers }, (_, seat) => `Seat ${seat + 1}`); * let game = newGame("goFish", { players: names, seed: 42 })!; * console.log(playGoFish(game, rulesFor("goFish").moves(game)[0]!)?.moves.length); * ``` */ export declare function playGoFish(game: GoFishGame, move: GoFishMove): GoFishGame | null; /** The most books wins; level on the most shares it. * * @param game - The current native game; applying a move returns a new state. * @returns The most books wins; level on the most shares it. * * @example * ```ts * import { CARD_GAME_TABLES, newGame } from "@johnmorrisdotca/toranpu"; * import { goFishWinners } from "@johnmorrisdotca/toranpu/go-fish"; * * const names = Array.from({ length: CARD_GAME_TABLES.goFish.defaultPlayers }, (_, seat) => `Seat ${seat + 1}`); * let game = newGame("goFish", { players: names, seed: 42 })!; * console.log(goFishWinners(game)); * ``` */ export declare function goFishWinners(game: GoFishGame): number[];