KumimojiTableOptionstype
Optional initial game, presentation, readiness and callback choices. With nothing, it is a short English game from a hand of seven, with some wild tiles.
Import it
import type { KumimojiTableOptions } from "@johnmorrisdotca/kumimoji/ui";
Definition
type KumimojiTableOptions = {
language?: KumimojiLanguage;
hand?: number;
level?: KumimojiLevel;
gameLength?: KumimojiLength;
diagonals?: boolean;
seed?: number;
onFinish?: (result: {
deal: KumimojiDeal;
play: TilePlay;
elapsedMs: number;
}) => void;
onChange?: (saved: KumimojiSaved) => void;
locale?: KumimojiLocale;
strings?: Partial<KumimojiStrings>;
theme?: Readonly<Record<string, string>>;
cloth?: Cloth;
keep?: boolean;
controls?: boolean;
saved?: KumimojiSaved;
onError?: (error: Error) => void;
};
Members
| Name | Type | Description |
|---|---|---|
language (optional) | KumimojiLanguage | undefined | The language of the tiles: |
hand (optional) | number | undefined | The opening hand: 3, 7 or 11 tiles. |
level (optional) | KumimojiLevel | undefined | How many of the tiles are wild: |
gameLength (optional) | KumimojiLength | undefined | How much of the set the bag holds: |
diagonals (optional) | boolean | undefined | Every diagonal run of three or more must be a word too. |
seed (optional) | number | undefined | The seed the bag is dealt from; a new one each game when absent. |
onFinish (optional) | ((result: { deal: KumimojiDeal; play: TilePlay; elapsedMs: number; }) => void) | undefined | Told when the last tile is laid and every run is a word, with the time it took. |
onChange (optional) | ((saved: KumimojiSaved) => void) | undefined | Told after every change to the game, with the game as it would be saved. |
locale (optional) | KumimojiLocale | undefined | The language of the table's words, which is not the language of the tiles: |
strings (optional) | Partial<KumimojiStrings> | undefined | Words of your own, laid over the locale's: any of |
theme (optional) | Readonly<Record<string, string>> | undefined | CSS variables set on the table itself, which win in light and dark alike: |
cloth (optional) | "green" | "blue" | "red" | "black" | "wood" | undefined | The cloth the table is laid in: "green", "blue", "red", "black" or "wood", the family's five. |
keep (optional) | boolean | undefined | Whether the table offers saving and loading. True by default. |
controls (optional) | boolean | undefined | Show native play-action buttons; a host hiding them supplies its own actions. |
saved (optional) | KumimojiSaved | undefined | A validated saved game to restore initially instead of dealing a new one. |
onError (optional) | ((error: Error) => void) | undefined | Called after a word-list load or initial restoration fails. |
Examples
import type { KumimojiTableOptions } from "@johnmorrisdotca/kumimoji/ui";
const options: KumimojiTableOptions = { hand: 7, keep: false, controls: true };
console.log(options.hand);7What it prints (run when this page was built)