Reference · Game engine and table
mountHitotsufunction
Put a table of Hitotsu into an element: the person at this screen in seat 0, computers in the rest. Tap a card that glows to play it (a wild asks for a colour, a seven under sevens-and-zeros for a hand to swap with), tap the stock to draw, and call Hitotsu! before the second-last card goes down.
Import it
import { mountHitotsu } from "@johnmorrisdotca/hitotsu";
Definition
function mountHitotsu(target: HTMLElement, options?: HitotsuTableOptions): HitotsuHandle
Parameters
| Name | Type | Description |
|---|---|---|
target | HTMLElement | The host element, including a host in a shadow root. |
options (optional) | HitotsuTableOptions | Game settings, private names and presentation choices. |
Returns
HitotsuHandle
The live table; destroy it when the host is removed.
Examples
import { mountHitotsu } from "@johnmorrisdotca/hitotsu";
const show = (host: HTMLElement) => mountHitotsu(host, { seed: 42 });
console.log(typeof show);functionWhat it prints (run when this page was built)