import type { CardGameKind } from "./games/card-games.constants.ts"; import type { CardId, CardRank, CardSuit } from "./games/card-games.types.ts"; import type { MoveOf } from "./play.ts"; import { type Language } from "./strings.ts"; /** A game's name: "Hearts", or "ハーツ" in Japanese. * * @param kind - The named card game or sound kind. * @param language - English or Japanese for the displayed words. * @returns A game's name: "Hearts", or "ハーツ" in Japanese. * * @example * ```ts * import { gameName } from "@johnmorrisdotca/toranpu"; * * console.log(gameName("hearts", "ja")); * ``` */ export declare function gameName(kind: CardGameKind, language?: Language): string; /** A game in a line: what it is about, for a list of games. * * @param kind - The named card game or sound kind. * @param language - English or Japanese for the displayed words. * @returns A game in a line: what it is about, for a list of games. * * @example * ```ts * import { gameSays } from "@johnmorrisdotca/toranpu"; * * console.log(gameSays("hearts", "en")); * ``` */ export declare function gameSays(kind: CardGameKind, language?: Language): string; /** A suit's name: "spades", or "スペード" in Japanese. * * @param suit - The card suit to compare or name. * @param language - English or Japanese for the displayed words. * @returns A suit's name: "spades", or "スペード" in Japanese. * * @example * ```ts * import { suitName } from "@johnmorrisdotca/toranpu"; * * console.log(suitName("S", "en")); * ``` */ export declare function suitName(suit: CardSuit, language?: Language): string; /** A suit's symbol: ♠ ♥ ♦ ♣. * * @param suit - The card suit to compare or name. * @returns A suit's symbol: ♠ ♥ ♦ ♣. * * @example * ```ts * import { suitSymbol } from "@johnmorrisdotca/toranpu"; * * console.log(suitSymbol("S")); * ``` */ export declare function suitSymbol(suit: CardSuit): string; /** A rank as a sentence names one card of it: "queen", "seven"; in Japanese "クイーン", "7". * * @param rank - The card rank to inspect or name. * @param language - English or Japanese for the displayed words. * @returns A rank as a sentence names one card of it: "queen", "seven"; in Japanese "クイーン", "7". * * @example * ```ts * import { rankName } from "@johnmorrisdotca/toranpu"; * * console.log(rankName(1, "en")); * ``` */ export declare function rankName(rank: CardRank, language?: Language): string; /** A card's name in full: "queen of spades", or "スペードのクイーン" in Japanese. What a screen reader should say. * * @param card - The physical card or card id to read, draw or play. * @param language - English or Japanese for the displayed words. * @returns A card's name in full: "queen of spades", or "スペードのクイーン" in Japanese. What a screen reader should say. * * @example * ```ts * import { cardText } from "@johnmorrisdotca/toranpu"; * * console.log(cardText("AS", "ja")); * ``` */ export declare function cardText(card: CardId, language?: Language): string; /** A card as a corner shows it: "Q♠", "10♦". The same in every language. * * @param card - The physical card or card id to read, draw or play. * @returns A card as a corner shows it: "Q♠", "10♦". The same in every language. * * @example * ```ts * import { cardShort } from "@johnmorrisdotca/toranpu"; * * console.log(cardShort("AS")); * ``` */ export declare function cardShort(card: CardId): string; /** Cards as corners show them, with a space between: "Q♠ 10♦ A♥". * * @param cards - The cards in their current order. * @returns Cards as corners show them, with a space between: "Q♠ 10♦ A♥". * * @example * ```ts * import { cardsShort } from "@johnmorrisdotca/toranpu"; * * console.log(cardsShort(["AS", "KH", "TD"])); * ``` */ export declare function cardsShort(cards: readonly CardId[]): string; /** Names in a list: "Ann, Ben", or "Ann、Ben" in Japanese. * * @param names - The player names in seat order. * @param language - English or Japanese for the displayed words. * @returns Names in a list: "Ann, Ben", or "Ann、Ben" in Japanese. * * @example * ```ts * import { namesList } from "@johnmorrisdotca/toranpu"; * * console.log(namesList(["Aki", "Ben", "Cy"], "en")); * ``` */ export declare function namesList(names: readonly string[], language?: Language): string; /** How a move is put into words. * * @example * ```ts * import type { MoveTextOptions } from "@johnmorrisdotca/toranpu"; * * const value: MoveTextOptions = { language: "ja", form: "offer" }; * console.log(value.language); * ``` */ export type MoveTextOptions = { /** English unless said. */ language?: Language; /** * `"offer"` is a button's words for the player to move ("Play Q♠"), which is * what is given unless said. `"did"` is what a record says after a name * ("plays Q♠"). `"hidden"` is `"did"` as another player at the table saw * it: cards passed, given or laid away face down are counted, not named. */ form?: "offer" | "did" | "hidden"; /** The players' names by seat, for a move that names one (Go Fish's ask). A seat without a name is "Seat 2". */ players?: readonly string[]; }; /** * A move in words, for any of the twelve games: `moveText("hearts", { play: "QS" })` * is "Play Q♠", and with `{ form: "did" }` it is "plays Q♠". `kind` is needed * because a bid of nought is "nil" in Spades and "0" in Oh Hell. * * @param kind - The named card game or sound kind. * @param move - The native move to validate or apply. * @param options - Options for this call; omitted fields retain their documented defaults. * @returns A move in words, for any of the twelve games: `moveText("hearts", { play: "QS" })` is "Play Q♠", and with `{ form: "did" }` it is "plays Q♠". `kind` is needed because a bid of nought is "nil" in Spades and "0" in Oh Hell. * * @example * ```ts * import { moveText, newGame, rulesFor } from "@johnmorrisdotca/toranpu"; * * const game = newGame("hearts", { players: ["Aki", "Ben", "Cy", "Dev"], seed: 42 })!; * console.log(moveText("hearts", rulesFor("hearts").moves(game)[0]!, { language: "en" })); * ``` */ export declare function moveText(kind: K, move: MoveOf, options?: MoveTextOptions): string;