mountShikaku関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A rectangle player in any element; mount once, update appearance with set, destroy on unmount.
インポート
import { mountShikaku } from "@johnmorrisdotca/kazu/play";
ほかのエクスポート元: @johnmorrisdotca/kazu/shikaku/play
定義
function mountShikaku(host: HTMLElement, initial: ShikakuMountOptions): ShikakuMount
引数
| 名前 | 型 | 説明 |
|---|---|---|
host | HTMLElement | The DOM host receiving the native player. |
initial | ShikakuMountOptions | The valid board, optional native progress, appearance and callbacks. |
戻り値
ShikakuMount
A rectangle player in any element; mount once, update appearance with set, destroy on unmount.
例
import type { ShikakuBoard } from "@johnmorrisdotca/kazu/shikaku";
import { mountShikaku } from "@johnmorrisdotca/kazu/play";
const shikakuBoard: ShikakuBoard = {"width":5,"height":5,"clues":[3,0,0,0,2,0,0,0,0,4,0,0,0,0,0,0,0,0,0,3,4,3,6,0,0]};
const host = document.createElement("div");
document.body.append(host);
const player = mountShikaku(host,{board:shikakuBoard});
console.log(player.progress());
player.destroy();この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。