本文へ移動

Kumimoji組み文字

シードから配った英字やかなのタイルで、ひとりでも複数人の卓でも、単語を組み合わせて遊べます。

「組み文字」は文字を組み合わせることを表す言葉です。 名前について(英語)

目次

リファレンス · ブラウザーの卓

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;
};

メンバー

名前型説明
readyPromise<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 (kumimojiToJSON), or null while it is being dealt.

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 kumimojiFromJSON. Its clock goes on from the time already spent.

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

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/kumimoji 1.6.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。