DrawBoardOptionstype
What to draw besides the board and the stones. Every field is optional.
Import it
import type { DrawBoardOptions } from "@johnmorrisdotca/narabe/draw";
Definition
type DrawBoardOptions = {
width?: number;
title?: string;
lastMove?: boolean;
winningLine?: boolean;
forbidden?: boolean;
legal?: boolean;
selected?: Point;
};
Members
| Name | Type | Description |
|---|---|---|
width (optional) | number | undefined | The width in pixels. Unless said, the SVG has a |
title (optional) | string | undefined | What a screen reader says for the picture. Unless said, "Board". An empty string makes it decoration. |
lastMove (optional) | boolean | undefined | Mark the last move with a dot. Unless said, on. |
winningLine (optional) | boolean | undefined | Ring the stones of a winning line. Unless said, on. |
forbidden (optional) | boolean | undefined | Cross the points a forbidden-move rule (renju, omok) refuses. Unless said, off. |
legal (optional) | boolean | undefined | Dot every point the player to move may play, or the squares the piece on |
selected (optional) | Point | undefined | A piece picked up: its moves are dotted when |
Examples
import type { DrawBoardOptions } from "@johnmorrisdotca/narabe/draw";
const value: DrawBoardOptions = {width:480,title:"Opening position",legal:true};
console.log(value);{ width: 480, title: 'Opening position', legal: true }What it prints (run when this page was built)