Interface: Board
Methods
configure()
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
| Parameter | Type |
|---|---|
changes | Partial<BoardSettings> |
Returns
Promise<BoardSettings>
destroy()
destroy(): void;Returns
void
onChange()
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
| Parameter | Type |
|---|---|
listener | (state, event) => void |
Returns
() => void
onIntent()
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
| Parameter | Type |
|---|---|
handler | ((action) => void | Result) | null |
Returns
void
show()
show(game): void;Shows another game value. onChange fires once, with source 'api'; showing the game already shown does nothing.
Parameters
| Parameter | Type |
|---|---|
game | Game |
Returns
void
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
coordinates | readonly | boolean | - |
state | readonly | Game | The game the board shows. |
style | readonly | Style | - |
view | readonly | View | - |