Reference · Board and position elements
SugorokuElementOptionstype
Host mount options, including custom colours, names, a match and callbacks.
Import it
import type { SugorokuElementOptions } from "@johnmorrisdotca/sugoroku/element";
Also exported from: @johnmorrisdotca/sugoroku/element/define
Definition
type SugorokuElementOptions = SugorokuMountOptions;
Members
| Name | Type | Description |
|---|---|---|
board (optional) | SugorokuBoardName | undefined | |
checkers (optional) | SugorokuCheckerSetName | undefined | |
colours (optional) | Partial<SugorokuColours> | undefined | |
theme (optional) | "auto" | "light" | "dark" | undefined | |
home (optional) | "left" | "right" | undefined | Which end of the board the trays are at. |
view (optional) | Side | "auto" | undefined | Whose home board is at the bottom: |
numbers (optional) | boolean | undefined | Numbers on the points. |
orientation (optional) | Orientation | "auto" | undefined |
|
variant (optional) | VariantKey | undefined | The variant. Default |
rules (optional) | Partial<Rules> | undefined | The rules left out are a single game with no cube. |
preset (optional) | string | undefined | A named way of playing (a |
seed (optional) | RecordSeed | undefined | Dice from a seed, so the game can be played again; left out they are random. |
dice (optional) | "button" | "host" | undefined |
|
computer (optional) | { white?: Strength | null; black?: Strength | null; } | undefined | The strength of the computer for each side it plays. A side left out, or null, is played by a person. |
computerDelay (optional) | number | undefined | How long the computer pauses between what it does, in milliseconds. Default 450, and none for a reader who has asked for less motion. |
controls (optional) | boolean | undefined | The buttons and the lines of words. Default true. |
drag (optional) | boolean | undefined | Whether a checker may be dragged as well as tapped. Default true. |
autoEnd (optional) | boolean | undefined | End a turn at once when it is played out, without waiting for Done. Default false. |
language (optional) | SugorokuLanguage | undefined | The language the words are in. Left out, the host's own |
names (optional) | Partial<Record<Side, string>> | undefined | What each side is called, instead of its colour or |
sound (optional) | boolean | Partial<Record<SoundName, string>> | undefined | Sounds: |
match (optional) | Match | undefined | Carry on a match already begun. |
onRoll (optional) | ((detail: SugorokuEventDetail) => void) | undefined | |
onMove (optional) | ((detail: SugorokuEventDetail) => void) | undefined | |
onTurn (optional) | ((detail: SugorokuEventDetail) => void) | undefined | |
onCube (optional) | ((detail: SugorokuEventDetail) => void) | undefined | |
onEnd (optional) | ((detail: SugorokuEventDetail) => void) | undefined |
Examples
import type { SugorokuElementOptions } from "@johnmorrisdotca/sugoroku/element";
const options: SugorokuElementOptions = {};
console.log(Object.keys(options).length); // 00What it prints (run when this page was built)