SugorokuDrawOptions型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
What to draw with.
インポート
import type { SugorokuDrawOptions } from "@johnmorrisdotca/sugoroku/draw";
定義
type SugorokuDrawOptions = {
variant?: VariantKey | VariantSpec;
view?: Side;
home?: "left" | "right";
orientation?: Orientation;
numbers?: boolean;
board?: SugorokuBoardName;
checkers?: SugorokuCheckerSetName;
colours?: Partial<SugorokuColours>;
theme?: "auto" | "light" | "dark";
dice?: {
side: Side;
values: readonly number[];
spent?: readonly boolean[];
} | null;
cube?: {
value: number;
owner: Side | null;
} | null;
highlight?: {
side: Side;
from?: number | null;
targets?: readonly number[];
movable?: readonly number[];
} | null;
label?: string;
style?: boolean;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
variant (省略可) | VariantKey | VariantSpec | undefined | The variant, for how its sides' points line up. Default |
view (省略可) | Side | undefined | Whose home board is at the bottom of the drawing. Default white. |
home (省略可) | "left" | "right" | undefined | Which end of the board the trays are at. Default right. |
orientation (省略可) | Orientation | undefined | Lying across the page (default) or standing up, a better shape for a phone. |
numbers (省略可) | boolean | undefined | Put the numbers of the points beside them, counted for the side |
board (省略可) | SugorokuBoardName | undefined | A named board, whose surfaces are used; |
checkers (省略可) | SugorokuCheckerSetName | undefined | A named pair of checkers. Left out, the theme's own. |
colours (省略可) | Partial<SugorokuColours> | undefined | Any colours to use instead, each a CSS colour. |
theme (省略可) | "auto" | "light" | "dark" | undefined |
|
dice (省略可) | { 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 (省略可) | { 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 (省略可) | { side: Side; from?: number | null; targets?: readonly number[]; movable?: readonly number[]; } | null | undefined | The checker picked up and where it may go, in |
label (省略可) | string | undefined | A description for screen readers. |
style (省略可) | boolean | undefined | Put |
例
import type { SugorokuDrawOptions } from "@johnmorrisdotca/sugoroku/draw";
const value: SugorokuDrawOptions = {variant:"backgammon",view:"white",numbers:true};
console.log(value);{ variant: 'backgammon', view: 'white', numbers: true }出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。