KumimojiTableOptions型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
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 type { KumimojiTableOptions } from "@johnmorrisdotca/kumimoji/ui";
定義
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;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
language (省略可) | KumimojiLanguage | undefined | The language of the tiles: |
hand (省略可) | number | undefined | The opening hand: 3, 7 or 11 tiles. |
level (省略可) | KumimojiLevel | undefined | How many of the tiles are wild: |
gameLength (省略可) | KumimojiLength | undefined | How much of the set the bag holds: |
diagonals (省略可) | boolean | undefined | Every diagonal run of three or more must be a word too. |
seed (省略可) | number | undefined | The seed the bag is dealt from; a new one each game when absent. |
onFinish (省略可) | ((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 (省略可) | ((saved: KumimojiSaved) => void) | undefined | Told after every change to the game, with the game as it would be saved. |
locale (省略可) | KumimojiLocale | undefined | The language of the table's words, which is not the language of the tiles: |
strings (省略可) | Partial<KumimojiStrings> | undefined | Words of your own, laid over the locale's: any of |
theme (省略可) | Readonly<Record<string, string>> | undefined | CSS variables set on the table itself, which win in light and dark alike: |
cloth (省略可) | "green" | "blue" | "red" | "black" | "wood" | undefined | The cloth the table is laid in: "green", "blue", "red", "black" or "wood", the family's five. |
keep (省略可) | boolean | undefined | Whether the table offers saving and loading. True by default. |
controls (省略可) | boolean | undefined | Show native play-action buttons; a host hiding them supplies its own actions. |
saved (省略可) | KumimojiSaved | undefined | A validated saved game to restore initially instead of dealing a new one. |
onError (省略可) | ((error: Error) => void) | undefined | Called after a word-list load or initial restoration fails. |
例
import type { KumimojiTableOptions } from "@johnmorrisdotca/kumimoji/ui";
const options: KumimojiTableOptions = { hand: 7, keep: false, controls: true };
console.log(options.hand);7出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。