NarabeElementOptions型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Host state, rules, replay choices, drawing options and callbacks.
インポート
import type { NarabeElementOptions } from "@johnmorrisdotca/narabe/element";
ほかのエクスポート元: @johnmorrisdotca/narabe/element/define
定義
type NarabeElementOptions = {
state?: GameState;
settings?: Partial<GameSettings>;
moves?: readonly MoveInput[];
choices?: readonly OpeningChoice[];
clocked?: boolean;
draw?: DrawBoardOptions;
onChange?: (state: GameState) => void;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
state (省略可) | GameState | undefined | Complete host position, taking precedence over replay input. |
settings (省略可) | Partial<GameSettings> | undefined | Advanced native engine settings; attributes override these. |
moves (省略可) | readonly MoveInput[] | undefined | Trusted host moves, used when the moves attribute is absent. |
choices (省略可) | readonly OpeningChoice[] | undefined | Native colour-opening decisions. |
clocked (省略可) | boolean | undefined | Whether recorded clock forfeits may replay. |
draw (省略可) | DrawBoardOptions | undefined | Native SVG drawing options. |
onChange (省略可) | ((state: GameState) => void) | undefined | Called after a position changes, with the structured state. |
例
import type { NarabeElementOptions } from "@johnmorrisdotca/narabe/element";
const options: NarabeElementOptions = { settings: { variant: "freestyle" }, draw: { legal: true } };
console.log(options.settings?.variant);freestyle出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。