Skip to the content

Jirai documentation

Jirai 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/jirai/orthogonal

encodeOrthogonalGamefunction

Encodes an orthogonal game with an explicit variant marker and version 2.

orthogonalHintfunction

Gives a clue-only deduction; flags remain notes and cannot influence the result.

@johnmorrisdotca/jirai/play

JiraiMounttype

Controls for reading and operating a mounted board.

mountJiraifunction

One playable board in any element.

MountOptionstype

Initial game, appearance, control, and lifecycle callbacks for a mounted board.

STRINGSconstant

Built-in English and Japanese strings used by the player and renderer.

@johnmorrisdotca/jirai/draw

boardModelfunction

Where the cells sit, and what may be shown.

BoardModeltype

Layout and cell presentation returned by boardModel.

CellModeltype

Accessible presentation data for one active board cell.

DrawOptionstype

Appearance and optional hint marker used by drawing and play.

@johnmorrisdotca/jirai/element

defineBoardfunction

Registers the default board, or a subclass under a host's custom tag.

defineJiraifunction

Registers the compatible default tag in a registry.

JiraiElementclass

A Minesweeper board with reflected settings, UTC daily play and native events.

JiraiElementOptionstype

Host settings, saved play and callbacks; visual attributes override settings.

@johnmorrisdotca/jirai/element/define

defineBoardfunction

Registers the default board, or a subclass under a host's custom tag.

defineJiraifunction

Registers the compatible default tag in a registry.

JiraiElementclass

A Minesweeper board with reflected settings, UTC daily play and native events.

JiraiElementOptionstype

Host settings, saved play and callbacks; visual attributes override settings.

@johnmorrisdotca/jirai/react

JiraiBoardfunction

Renders the DOM player inside a React-owned host.

@johnmorrisdotca/jirai

activeCellfunction

Row-major addresses stay stable; omitted cells have no clue and no neighbours.

activeCellsfunction

Returns all active cells in stable row-major order.

Boardtype

A dealt board including its answer; keep it off public clients.

Constrainttype

An exact count over unknown cells, with the clues that supplied it.

dailySeedfunction

UTC by definition, so two people sharing a daily seed get the same board.

deducefunction

What the clues prove, without reading the answer or trusting a player's flags.

Deductiontype

Certain safe cells and mines proved from visible clues.

DEFAULT_SETTINGSconstant

Default easy game, with a verified no-guess board and clear opening.

encodeOrthogonalGamefunction

Encodes an orthogonal game with an explicit variant marker and version 2.

ENUMERATION_NODESconstant

Maximum partial assignments checked in one exact deduction search.

Gametype

Rules data includes the answer; never send it to a competitive client.

gameProgressfunction

Keep settings and moves, never an unchecked answer array.

GENERATION_ATTEMPTSconstant

Default number of random layouts tried before a no-guess deal falls back to repairing the closest one.

GenerationErrorclass

A bounded generator must say it failed, never quietly return a guessing board.

GenerationOptionstype

Work limits for seeded board generation and its no-guess check.

Gridtype

Neighbour topology used to count the clues around each cell.

GRID_SPECSconstant

Neighbour offsets and edge behaviour for each topology.

GRIDSconstant

Names for the supported square, four-neighbour, hex, and wrap grids.

hintForfunction

Keep discovering certain mines until there is a safe cell or nothing more is proved.

HUGE_SIZESconstant

The huge fields: four times the area of a 16×16 (the medium level), 1,024 to 1,152 squares, for a long solve.

hugeSettingsfunction

The size and mine count of a level on a huge field: a field of HUGE_SIZES (32 × 32 unless size says another of them), with the level's own share of mines over its squares.

HugeSizetype

The outline of a huge field: one of HUGE_SIZES' width and height.

isSolvablefunction

Verify a board from one opening, using only clues that have been uncovered.

Languagetype

Supported interface copy locales.

Leveltype

A difficulty level: easy, medium, hard or extra-hard.

LEVEL_ALIASESconstant

The 0.1 and 0.2 names for the first three levels.

LEVEL_SIZESconstant

Size and mine count of each level on a rectangular board.

LevelAliastype

The 0.1 and 0.2 names for easy, medium and hard, still accepted wherever a level is.

levelNamedfunction

The level a name means, or null.

LEVELSconstant

The four difficulty levels, easiest first.

LevelSizetype

Board size and mine count a level asks for.

makeBoardfunction

Deal after the first reveal.

Marktype

Player-facing state of one cell; the answer is never a mark.

MARKSconstant

Names for the cell mark cycle.

Materialtype

Board colours for drawing and mounted play.

MAX_CELLSconstant

Largest total cell count accepted by settings validation.

MAX_SIDEconstant

Largest width or height accepted by settings validation.

Measuretype

How demanding a dealt board is to solve by deduction, measured by solving it.

measureBoardfunction

Solve a dealt board from its opening and report what it took.

Movetype

A reveal, mark-cycle, or numbered-cell chord applied to a game.

MOVESconstant

Names for the moves accepted by the engine.

neighboursOffunction

Precomputes the neighbour list for each row-major cell.

newGamefunction

Creates an unstarted game with covered cells and no dealt answer.

orthogonalHintfunction

Gives a clue-only deduction; flags remain notes and cannot influence the result.

Piecestype

Symbols used to mark mines.

playfunction

A legal move returns a new game; an unavailable move returns the same one.

PRESETSconstant

Common minefield dimensions and mine counts.

ProofKindtype

Why a cell was proved: one clue, two overlapping clues, the mine counter, or every arrangement of a small frontier.

ProofTallytype

Cells proved by each kind of reasoning.

seededRandomfunction

Mulberry32, pinned by the replay tests: changing it would change every kept board.

Settingstype

Board dimensions and rules used to deal and validate a game.

SHAPESconstant

Board silhouettes supported by settings.

Statustype

Current game state, including whether a mine has been hit.

STATUSESconstant

Names for the game lifecycle states.

validCellfunction

Reports whether a row-major cell is inside the board's active shape.

validSettingsfunction

Reject a setting before it reaches a board allocation or a shuffle.

VERSIONconstant

Package version, kept in step with the release metadata.

visibleGamefunction

The clue-only view used by the solver.

VisibleGametype

Answer-free state suitable for deductions, hints, and public display.

withBoardfunction

Attaches a worker-dealt board that matches the game's settings, preserving existing moves.