Reference · Cube engine and views
MoveListHandletype
A list on the page.
Import it
import type { MoveListHandle } from "@johnmorrisdotca/kyuubu";
Definition
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;
};
Members
| Name | Type | Description |
|---|---|---|
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. |
Examples
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);