Reference · Cube engine and views
MoveListOptionstype
How a list is set up.
Import it
import type { MoveListOptions } from "@johnmorrisdotca/kyuubu";
Definition
type MoveListOptions = {
groups: readonly MoveListGroup[];
current?: number | null;
locale?: KyuubuLanguage;
onPick?: (index: number, group: number, at: number) => void;
label?: string;
};
Members
| Name | Type | Description |
|---|---|---|
groups | readonly MoveListGroup[] | The runs of moves, in order. |
current (optional) | number | null | undefined | The move just made, counted across every run from 0, or null for none. |
locale (optional) | KyuubuLanguage | undefined | English or Japanese: for the words of each move when none is given, and for the list's own name. The page's |
onPick (optional) | ((index: number, group: number, at: number) => void) | undefined | Called when a move is chosen, by a press or a key: its place counted across every run from 0, its run and its place in the run. |
label (optional) | string | undefined | What a screen reader calls the whole list. "The moves" in the list's language when left out. |
Examples
import type { MoveListOptions } from "@johnmorrisdotca/kyuubu";
const value: MoveListOptions = { groups: [{ label: "Solve", items: ["R", "R'"] }], current: 0 };
console.log(value.current);0What it prints (run when this page was built)