Skip to the content

Kumimoji組み文字

Build crosswords from seeded English or Japanese tile bags, alone or at a shared table.

Kumimoji means assembled characters in Japanese. About the name

Contents

Reference · Browser table

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

NameTypeDescription
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.

Examples

import type { KumimojiTableHandle } from "@johnmorrisdotca/kumimoji/ui";
const setJapanese = (table: KumimojiTableHandle): void => table.set({ locale: "ja" });
console.log(typeof setJapanese);
function

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/kumimoji 1.6.0.