TenkaTableHandle型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Native game access, restoration, redealing and presentation updates.
インポート
import type { TenkaTableHandle } from "@johnmorrisdotca/tenka/ui";
定義
type TenkaTableHandle = {
game: () => TenkaGame;
newGame: (options?: Pick<TenkaTableOptions, "players" | "computers" | "rounds" | "seed" | "map">) => void;
setGame: (game: TenkaGame, computers?: readonly boolean[]) => void;
setLocale: (locale: TenkaLocale, strings?: Partial<TenkaStrings>) => void;
set: (options: Pick<TenkaTableOptions, "locale" | "strings" | "theme" | "record" | "dressing" | "colours" | "computerDelayMs" | "onChange">) => void;
destroy: () => void;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
game | () => TenkaGame | The game as it stands. |
newGame | (options?: Pick<TenkaTableOptions, "players" | "computers" | "rounds" | "seed" | "map">) => void | A new game at the same table, with any options changed. |
setGame | (game: TenkaGame, computers?: readonly boolean[]) => void | Put a game on the table: one read back by |
setLocale | (locale: TenkaLocale, strings?: Partial<TenkaStrings>) => void | Change the table's language, and with it any words of your own. |
set | (options: Pick<TenkaTableOptions, "locale" | "strings" | "theme" | "record" | "dressing" | "colours" | "computerDelayMs" | "onChange">) => void | Update presentation and callbacks without redealing or replacing the current game. |
destroy | () => void | Take the table off the page and stop its timers. |
例
import type { TenkaTableHandle } from "@johnmorrisdotca/tenka/ui";
const update = (table: TenkaTableHandle) => table.set({ locale: "ja" });
console.log(typeof update);function出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。