MoveListHandle型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A list on the page.
インポート
import type { MoveListHandle } from "@johnmorrisdotca/kyuubu";
定義
type MoveListHandle = {
readonly element: HTMLElement;
setCurrent(index: number | null): void;
setGroups(groups: readonly MoveListGroup[], current?: number | null): void;
setLocale(locale: KyuubuLanguage): void;
focus(): void;
destroy(): void;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
element | HTMLElement | The element the list is drawn in. |
setCurrent | (index: number | null): void | Mark the move just made, counted across every run from 0, or none with null; it is scrolled into view. |
setGroups | (groups: readonly MoveListGroup[], current?: number | null): void | Other runs of moves in place of those showing. |
setLocale | (locale: KyuubuLanguage): void | |
focus | (): void | Put the keyboard's focus on the move just made. |
destroy | (): void | Take it off the page, with every listener. |
例
import type { MoveListHandle } from "@johnmorrisdotca/kyuubu";
import { mountMoveList } from "@johnmorrisdotca/kyuubu";
const value: MoveListHandle = mountMoveList(document.createElement("div"), { groups: [{ label: "Solve", items: ["R"] }] });
console.log(value.element.tagName);この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。