Skip to the content

Tobiishi documentation

Tobiishi API: every export

Every export of every entry point, each with its own page. This page keeps the addresses the old one-page reference had.

@johnmorrisdotca/tobiishi/draw

boundsOffunction

Returns the SVG view box size for the board.

drawfunction

A self-contained board drawing; no browser globals and no random SVG ids.

escapeXmlfunction

Escapes text for safe inclusion in XML attributes and content.

Materialtype

Built-in board and peg palettes.

MATERIALSconstant

Built-in palette names in player-menu order.

pointOffunction

Maps a board cell index to its SVG centre point.

Themetype

SVG color properties that can be partially overridden by a caller.

THEMESconstant

Palette values used by the SVG renderer.

@johnmorrisdotca/tobiishi/play

Languagetype

Supported player interface languages.

mountfunction

Mount one independent player.

MountOptionstype

Initial puzzle, display choices, optional settings host, and persistence callback.

Playertype

Controls for reading, replacing, updating presentation or unmounting one player instance.

STRINGSconstant

Localized English and Japanese labels used by the player.

@johnmorrisdotca/tobiishi/element

defineGamefunction

Registers the default game or a subclass under a host's tag.

defineTobiishifunction

Compatible registration name, with an optional registry.

TobiishiElementOptionstype

Host games, witnesses, palettes, external settings and the original persistence callback.

TobiishiGameclass

A peg-solitaire element with reflected choices and preserved native player state.

@johnmorrisdotca/tobiishi/element/define

defineGamefunction

Registers the default game or a subclass under a host's tag.

defineTobiishifunction

Compatible registration name, with an optional registry.

TobiishiElementOptionstype

Host games, witnesses, palettes, external settings and the original persistence callback.

TobiishiGameclass

A peg-solitaire element with reflected choices and preserved native player state.

@johnmorrisdotca/tobiishi

Boardtype

Immutable hole lattice and all legal jump triples for a board.

boardOffunction

A familiar lattice or a shaped outline.

Celltype

A hole's stable coordinate within a board shape, independent of its drawing.

Challengetype

A starting position paired with its complete legal witness and seed.

ChallengeDifficultytype

Requested witness length category; this is not a measured human rating.

challengeOffunction

Generates a seeded challenge on a built-in shape, optionally fixing its final hole.

ChallengePacktype

Curated goal choices for one supported board shape.

classicEnglishfunction

Returns the classic centre-empty English game with its complete solution.

classicTrianglefunction

Returns the full triangle with the apex empty and any final hole accepted.

Gametype

Immutable peg position, target, move history, and assistance marker.

gameCodefunction

Versioned save: replay, rather than accepting a claimed final position.

gameFromCodefunction

Validates and replays a versioned save string, returning null if invalid.

generatefunction

Grow backward from one peg.

GoalChallengetype

Generated puzzle augmented with its pack, goal, and requested length category.

GoalHoletype

Named goal hole and its localized menu labels.

isGameSolvedfunction

Checks whether one peg remains at the required target, if any.

isGameStuckfunction

Checks whether no legal continuation remains before the goal is reached.

Jumptype

A legal solitaire jump from an occupied hole over a peg to an empty hole.

jumpAtfunction

Invalid jumps leave a game unchanged; a valid jump removes exactly one peg.

legalJumpsfunction

Lists legal jumps from the current position.

makeBoardfunction

Make a board from holes and a lattice; absent holes cannot be crossed.

markHelpedfunction

Mark an assisted run without changing pieces or history.

newGamefunction

Creates a validated immutable position with the given target hole, if any.

pegCountfunction

Counts pegs remaining on the board.

rectangleBoardfunction

Creates a square-lattice rectangle, including supported wide and tall boards.

restartfunction

Restores the original peg arrangement and clears moves and assistance.

seededRandomfunction

Creates a deterministic pseudo-random stream from a text seed.

Shapetype

Built-in board outlines supported by the player and challenge packs.

SHAPESconstant

Built-in shape names in player-menu order.

Solutiontype

Bounded search result; limit distinguishes unfinished search from proof.

solvefunction

A bounded depth-first proof search.

SQUARE_STEPSconstant

Orthogonal direction steps used by square-lattice boards.

TRIANGLE_STEPSconstant

Six jump directions used by the triangular lattice.

undofunction

Returns the previous position, or the same game when history is empty.

VERSIONconstant

Current package API version.