KumimojiTableHandle型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Readiness, structured play and presentation/game controls for a mounted table.
インポート
import type { KumimojiTableHandle } from "@johnmorrisdotca/kumimoji/ui";
定義
type KumimojiTableHandle = {
readonly ready: Promise<void>;
set: (options: Pick<KumimojiTableOptions, "locale" | "strings" | "cloth" | "theme" | "keep" | "controls">) => void;
play: () => TilePlay | null;
saved: () => KumimojiSaved | null;
newGame: (options?: GameOptions) => Promise<void>;
setGame: (saved: KumimojiSaved) => Promise<void>;
setLocale: (locale: KumimojiLocale, strings?: Partial<KumimojiStrings>) => void;
destroy: () => void;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
ready | Promise<void> | Settles once the initial deal or restored game is ready. |
set | (options: Pick<KumimojiTableOptions, "locale" | "strings" | "cloth" | "theme" | "keep" | "controls">) => void | Change presentation and controls without redealing. |
play | () => TilePlay | null | The game as it stands, or null while it is being dealt. |
saved | () => KumimojiSaved | null | The game as it would be saved ( |
newGame | (options?: GameOptions) => Promise<void> | A new game at the same table, with any options changed. Resolves when it is dealt. |
setGame | (saved: KumimojiSaved) => Promise<void> | Put a game on the table: one read back by |
setLocale | (locale: KumimojiLocale, strings?: Partial<KumimojiStrings>) => void | Change the language of the table's words, and with it any words of your own. |
destroy | () => void | Take the table off the page and stop its clock. |
例
import type { KumimojiTableHandle } from "@johnmorrisdotca/kumimoji/ui";
const setJapanese = (table: KumimojiTableHandle): void => table.set({ locale: "ja" });
console.log(typeof setJapanese);function出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。