Reference · Board and position elements
SugorokuPositionOptionstype
Host data and all native SVG drawing choices for a position.
Import it
import type { SugorokuPositionOptions } from "@johnmorrisdotca/sugoroku/element";
Also exported from: @johnmorrisdotca/sugoroku/element/define
Definition
type SugorokuPositionOptions = SugorokuDrawOptions & {
position?: Position;
onChange?: (position: Position) => void;
};
Members
| Name | Type | Description |
|---|---|---|
variant (optional) | VariantKey | VariantSpec | undefined | The variant, for how its sides' points line up. Default |
view (optional) | Side | undefined | Whose home board is at the bottom of the drawing. Default white. |
home (optional) | "left" | "right" | undefined | Which end of the board the trays are at. Default right. |
orientation (optional) | Orientation | undefined | Lying across the page (default) or standing up, a better shape for a phone. |
numbers (optional) | boolean | undefined | Put the numbers of the points beside them, counted for the side |
board (optional) | SugorokuBoardName | undefined | A named board, whose surfaces are used; |
checkers (optional) | SugorokuCheckerSetName | undefined | A named pair of checkers. Left out, the theme's own. |
colours (optional) | Partial<SugorokuColours> | undefined | Any colours to use instead, each a CSS colour. |
theme (optional) | "auto" | "light" | "dark" | undefined |
|
dice (optional) | { side: Side; values: readonly number[]; spent?: readonly boolean[]; } | null | undefined | The dice rolled: white's are shown on its half of the board, black's on the other. |
cube (optional) | { value: number; owner: Side | null; } | null | undefined | The doubling cube, or null (the default) for a game without one, which then has no rail for it. |
highlight (optional) | { side: Side; from?: number | null; targets?: readonly number[]; movable?: readonly number[]; } | null | undefined | The checker picked up and where it may go, in |
label (optional) | string | undefined | A description for screen readers. |
style (optional) | boolean | undefined | Put |
position (optional) | Position | undefined | |
onChange (optional) | ((position: Position) => void) | undefined |
Examples
import type { SugorokuPositionOptions } from "@johnmorrisdotca/sugoroku/element";
const options: SugorokuPositionOptions = {};
console.log(Object.keys(options).length); // 00What it prints (run when this page was built)