Reference · Cube engine and views
CubeViewEventstype
What a cube tells the listeners on adds: a turn a person made, with the stickers after it; and the view turned, in degrees.
Import it
import type { CubeViewEvents } from "@johnmorrisdotca/kyuubu";
Definition
type CubeViewEvents = {
turn: (move: CubeMove, state: string) => void;
look: (yaw: number, pitch: number) => void;
};
Members
| Name | Type | Description |
|---|---|---|
turn | (move: CubeMove, state: string) => void | |
look | (yaw: number, pitch: number) => void |
Examples
import type { CubeViewEvents } from "@johnmorrisdotca/kyuubu";
const value: CubeViewEvents = { turn: (move, state) => console.log(move, state), look: (yaw, pitch) => console.log(yaw, pitch) };
console.log(Object.keys(value));[ 'turn', 'look' ]What it prints (run when this page was built)