Reference · Cube engine and views
GuideHandletype
A guide beside a cube, on the page.
Import it
import type { GuideHandle } from "@johnmorrisdotca/kyuubu";
Definition
type GuideHandle = {
readonly guide: Guide;
takeBack(): void;
makeNext(): void;
load(source: GuideSource): void;
setLocale(locale: KyuubuLanguage): void;
destroy(): void;
};
Members
| Name | Type | Description |
|---|---|---|
guide | Guide | The guide it shows: what is next, what has been done, any detour. |
takeBack | (): void | Every detour taken back, on the cube. |
makeNext | (): void | The next movement made for the person, on the cube, after taking back any detour. |
load | (source: GuideSource): void | Another list or the method, from the cube as it is now. |
setLocale | (locale: KyuubuLanguage): void | |
destroy | (): void | Take it off the page, and the hint off the cube. The cube stays as it is. |
Examples
import type { GuideHandle } from "@johnmorrisdotca/kyuubu";
import { CubeView, mountGuide } from "@johnmorrisdotca/kyuubu";
const value: GuideHandle = mountGuide(document.createElement("div"), new CubeView(document.createElement("div"), { size: 3, interactive: true }), { moves: "R U" });
console.log(value.guide.next?.text);