KumimojiElementOptionstype
Full native host options, including saved state, private words and callbacks.
Import it
import type { KumimojiElementOptions } from "@johnmorrisdotca/kumimoji/element";
Also exported from: @johnmorrisdotca/kumimoji/element/define
Definition
type KumimojiElementOptions = KumimojiTableOptions;
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 { KumimojiElementOptions } from "@johnmorrisdotca/kumimoji/element";
const options: KumimojiElementOptions = { keep: false, locale: "ja" };
console.log(options.locale);jaWhat it prints (run when this page was built)