Skip to content

Interface: Board ​

Methods ​

configure() ​

ts
configure(changes): Promise<BoardSettings>;

Changes any of the settings in place, keeping the game, hover and focus. Focus in a part that navigation: false hides moves to the board. Resolves to the settings in use: 'realistic' falls back to 'classic' without WebGL2.

Parameters ​

ParameterType
changesPartial<BoardSettings>

Returns ​

Promise<BoardSettings>


destroy() ​

ts
destroy(): void;

Returns ​

void


onChange() ​

ts
onChange(listener): () => void;

Called after every change to the game shown: 'user' for a person's input (applied by an uncontrolled board, or returned by the intent handler), 'api' for show. Returns a function that stops it.

Parameters ​

ParameterType
listener(state, event) => void

Returns ​

() => void


onIntent() ​

ts
onIntent(handler): void;

Makes the board controlled: what a person does on it comes to the handler as an action, and the board changes nothing itself. A returned ok result is shown; a returned refusal's reason shows under the board; nothing returned leaves it to the caller to show. One handler; null makes the board uncontrolled again.

Parameters ​

ParameterType
handler((action) => void | Result) | null

Returns ​

void


show() ​

ts
show(game): void;

Shows another game value. onChange fires once, with source 'api'; showing the game already shown does nothing.

Parameters ​

ParameterType
gameGame

Returns ​

void

Properties ​

PropertyModifierTypeDescription
coordinatesreadonlyboolean-
statereadonlyGameThe game the board shows.
stylereadonlyStyle-
viewreadonlyView-

Released under the MIT License.