KumimojiTableHandletype
Readiness, structured play and presentation/game controls for a mounted table.
Import it
import type { KumimojiTableHandle } from "@johnmorrisdotca/kumimoji/ui";
Definition
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;
};
Members
| Name | Type | Description |
|---|---|---|
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. |
Examples
import type { KumimojiTableHandle } from "@johnmorrisdotca/kumimoji/ui";
const setJapanese = (table: KumimojiTableHandle): void => table.set({ locale: "ja" });
console.log(typeof setJapanese);functionWhat it prints (run when this page was built)