Reference · Game engine and table
HitotsuHandletype
Native game access, redealing and presentation updates.
Import it
import type { HitotsuHandle } from "@johnmorrisdotca/hitotsu";
Definition
type HitotsuHandle = {
game(): HitotsuGame;
restart(options?: Omit<HitotsuTableOptions, "language" | "strings" | "theme" | "sound" | "onMove">): void;
set(options: Pick<HitotsuTableOptions, "language" | "strings" | "theme" | "sound" | "onMove">): void;
destroy(): void;
};
Members
| Name | Type | Description |
|---|---|---|
game | (): HitotsuGame | The game as it stands. |
restart | (options?: Omit<HitotsuTableOptions, "language" | "strings" | "theme" | "sound" | "onMove">): void | Deal again, with any options changed. |
set | (options: Pick<HitotsuTableOptions, "language" | "strings" | "theme" | "sound" | "onMove">): void | Update words, palette, sound and callback while preserving the current game. |
destroy | (): void |
Examples
import type { HitotsuHandle } from "@johnmorrisdotca/hitotsu";
const update = (table: HitotsuHandle) => table.set({ language: "ja" });
console.log(typeof update);functionWhat it prints (run when this page was built)