Skip to the content

Kumimoji documentation

Kumimoji 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/kumimoji/words

@johnmorrisdotca/kumimoji/ui

BOARD_LEASTconstant

The fewest squares a side, so an empty or small table is still a table.

BOARD_MARGINconstant

How many empty squares are kept round the tiles on every side, so there is always room to build out.

boardModelfunction

THE PART OF THE TABLE TO DRAW, for a grid and its verdict: the tiles and a margin round them, at least BOARD_LEAST a side, each square with its tile, what is printed on it, and how it stands.

BoardModeltype

The part of the table to draw: how many rows and columns, and every square, row by row.

Clothtype

A cloth's name.

clothVarsfunction

A cloth as CSS variables; nothing for a name that is not a cloth, so the defaults stay.

isClothfunction

Whether a text names a cloth.

KUMIMOJI_CLOTHSconstant

THE CLOTHS A TABLE MAY BE LAID IN: the same five the whole family offers, and itsutsu.com's boards: green, blue, red, black and wood.

KUMIMOJI_STRINGSconstant

The table's words in each language it speaks: KUMIMOJI_STRINGS.en, KUMIMOJI_STRINGS.ja.

KUMIMOJI_STYLEconstant

The table's own styles, scoped to .km-root, every colour and size a CSS variable so a page can wear it in its own colours (set them on the element or any ancestor, or pass them as theme).

KumimojiLocaletype

The languages the table speaks: English and Japanese.

kumimojiSayfunction

A line from a table of strings with its braces filled in: kumimojiSay(strings.left, { n: 12, time: "1:05" }).

kumimojiStringsfunction

The table of strings for a locale with a page's own words laid over it.

KumimojiStringstype

Every word the table shows, by name: one table of these for each language.

KumimojiTableHandletype

Readiness, structured play and presentation/game controls for a mounted table.

mountKumimojifunction

A GAME OF KUMIMOJI ALONE, IN PLAIN DOM: the bag dealt from a seed, your hand, and a table to build your crossword on, every run judged as you lay it.

TileMarktype

How a tile on the table stands: part of a sound crossword, in a run that is not a word, or apart from the rest.

@johnmorrisdotca/kumimoji/react

KumimojiBoardfunction

A KUMIMOJI TABLE, AS A REACT COMPONENT: the tiles of a grid with a margin of empty squares round them, a run that is not a word ringed red and a tile apart from the crossword faded, and a press on any square reported by its key (squareAt(row, col)).

KumimojiBoardPropstype

What KumimojiBoard takes: a grid to draw, and any attribute of its <div>.

KumimojiTablefunction

A whole game alone, as a React component: the plain-DOM table (mountKumimoji) mounted into this component's element once the browser has it.

KumimojiTablePropstype

Native table options, readiness/error choices and attributes of the host div.

@johnmorrisdotca/kumimoji/element

defineTablefunction

Defines the table or a subclass under a custom tag.

KumimojiTableclass

A reflected crossword table with the native table handle and saved-state getter.

@johnmorrisdotca/kumimoji/element/define

defineTablefunction

Defines the table or a subclass under a custom tag.

KumimojiTableclass

A reflected crossword table with the native table handle and saved-state getter.

@johnmorrisdotca/kumimoji

afterComputerTurnfunction

The game a computer's turn passes on: its plan's last step, or the game as it was where there is nothing to play.

Areatype

The squares shown: from top/left, rows by cols.

arrowStepfunction

The step in the grid an arrow key means: the square that way on the screen, with the table turned.

assignHandTilefunction

Give a hand tile its chosen reading, without changing which physical tile it is.

assignTableTilefunction

Give a tile on the table its chosen reading, without changing its square.

BASE_KANAconstant

JAPANESE KUMIMOJI'S TILES ARE THE 45 BASE KANA, and every other kana is one of them played another way.

bestLayingfunction

THE COMPUTER'S NEXT WORD: its play after laying the best word its hand can lay on its table, and the word, or null when there is none.

Boundstype

The rows and columns a grid's tiles stand within.

boundsOffunction

The rows and columns the tiles stand within, or null for no tiles.

checkKumimojifunction

WHETHER A GRID FINISHES A KUMIMOJI: the one check the server also runs.

COMPUTER_STEPS_MOSTconstant

The most things a computer does in one turn before pressing Done: at the page's pause, a turn of about three seconds.

computerNamefunction

The name a new computer takes: "Computer" and the lowest number no player at the table already goes by.

ComputerSaidtype

What a computer did in one step of its turn, for the line over its table.

ComputerSteptype

One step of a computer's turn: the game after it, and what it did.

CORNER_FORMSconstant

WHAT A TILE SHOWS SMALL IN ITS CORNER: the other ways it is commonly played (John, 2026-09-28: "the tiles like Yu can show the regular and small version in that tile to show its versatility").

crossingFitfunction

Where word stands with its letter at on the tile at anchor, running across or down, or null where it cannot: a square outside what may be used, a tile at either end, a different letter in its way, a new tile with a neighbour at its side, or no new tile at all — and, given diagonalWord (a game with Diagonals), a new tile standing in a diagonal run of three or more that diagonalWord does not take (diagonalsRead).

CrossingFittype

A word's place: its first square, and the squares it lays a new tile on, in the word's order.

dealfunction

The opening hand: the first handSize tiles of the bag, and an empty table.

decodeGridfunction

A grid read back, its first row at row 0, or null for anything that is not one: a stray character, a capital, a grid wider or taller than any grid of fifty tiles can be.

decodePartyfunction

A kept game read back, or null for anything that is not one.

decodeTileProgressfunction

A kept game opened again on its own bag, or null where it does not belong to it: every tile held — hand and table — must be one taken from the bag and not given back.

diagonalsReadfunction

Whether every diagonal run a laying's new tiles would stand in is taken by isWord: each walked from its top end down, with the word's own letters on its new squares.

doneRefusedfunction

Why Done cannot be pressed now, or null when it can: a hand to trade first, or, for the last one standing, no tile laid on a sound grid yet (a hand already used on a sound grid has nothing left to lay, and wins as it is).

drawfunction

The next tile or tiles out of the bag into the hand.

drawAllfunction

DRAW: every player still in takes one tile, in turn order from the one who pressed it — the race game's rule that when one player uses their hand, everybody draws.

edgePanfunction

Which way, and how far, the table pans this frame for a tile dragged to (px, py): toward the edge it is near.

encodeGridfunction

A grid as a string, drawn from its own top-left tile: cat/2o/2w.

encodePartyfunction

A table of players as text to keep.

encodeTileProgressfunction

A GAME KEPT half way, as one string (PuzzleRun.progress): how many tiles were taken, the tiles traded back, the hand in its order and the grid (encodeGrid), as 12:q:ae:cat/2o/2w.

endTurnfunction

DONE: the end of a turn, and the device passed on.

familyKeyOffunction

WHICH TILE OF THE SET A TILE IS, without the word lists: a letter is itself, and any wild — blank or given a face — is the wild.

fittedMostfunction

The largest a fitted tile is drawn in a table this big.

fitViewfunction

The view that shows the whole area, centred, its tiles as big as fit between the least and the most.

formsOfTilefunction

Every hiragana a tile plays as, itself first: は is は, ば and ぱ.

generateKumimojifunction

MAKING A KUMIMOJI, in the browser, from a seed: the bag the game is played from, in the order its tiles come out.

goesOutfunction

Whether the player whose turn it is would go out with Done: their hand used, their grid sound, and too few tiles in the bag for everybody still in to draw.

GridRulestype

How a grid is read: whether its diagonals are (KumimojiOptions.diagonals).

gridToTextfunction

A grid as lines of text, the way it lies on the table: English letters in capitals with a space between squares and a dot for an empty one, kana side by side with a full-width dot for an empty one, so that either lines up in a fixed-width face, every row as wide as the crossword.

GridVerdicttype

WHAT IS WRONG WITH A GRID, tile by tile, so the table can mark it: the tiles in a run that is not a word, the tiles not joined to the main grid, and whether the whole is sound — two tiles or more, all joined, every run a word.

groupsOffunction

The tiles in groups that touch across or down, largest first.

handCanSpellfunction

Whether a hand can spell a word from the list: any word of two tiles or more, a wild counting as able to be anything.

handSpellingfunction

The hand with word's tiles first, in its order, and the rest after them as they were.

HELP_WORDS_MOSTconstant

How many words one hand offers before the presses go round again: the longest first.

holdsItsBagfunction

Whether what everybody holds is exactly what was taken from the bag, less what was given back.

isComputerfunction

Whether a computer plays this seat.

isFinishedfunction

Whether the game is over: the bag empty, the hand used, and the grid sound.

isLastTurnfunction

Whether the turn now being played is a player's last.

isOverfunction

Whether the game is over.

isPartyForfunction

Whether a kept game is the one an address asks for: the same settings, and dealt to as many players, whoever has joined or left since.

JAPANESE_TILE_MIXconstant

THE JAPANESE SET: 144 hiragana tiles in 45 kinds (kana.ts), as the English set is 144 letters.

joinPartyfunction

A player, or a computer, sat down after the last seat with the next hand out of the bag.

JoinRefusaltype

Why nobody can join now, or null when a hand can be dealt.

joinRefusedfunction

Why nobody can join the table now, or null when a hand can be dealt.

judgeGridfunction

A grid judged against any test of a word: isWord answers for a run as spelt, and readable says how to name one that is not.

judgeTilesfunction

Whether a grid is sound, read against the loaded word list by the game's rules: the same judgement the desk shows.

judgeWithWordsfunction

A GRID JUDGED AGAINST ITS LANGUAGE'S LIST, the one way the solo game, each seat of a pass-and-play game and the server's check all ask it: a run is a word when its tiles spell one the list holds (wordOf, so a wild reads as the letter or kana it was given), and a run that is not is named as it reads.

KANA_WILD_STARTconstant

Where the codes of wild tiles given a kana begin: the kana's place in BASE_KANA above this.

kanaTileCodefunction

The code of a base kana's tile, or of a wild given that kana.

keepInReachfunction

Kept within reach: some of the area always on the screen, so a pan can never lose the crossword.

KUMIMOJI_CHECK_REASONSconstant

Why checkKumimoji will not take a grid, as a stable code and the English clause it says: {name} is a gap the check's values fill.

KUMIMOJI_DRAWconstant

How many tiles one Draw takes from the bag, once the hand is used and the grid is sound.

KUMIMOJI_HANDSconstant

THE HANDS, which are the puzzle's sizes: the tiles a game opens with.

KUMIMOJI_PARTYconstant

doubleFrom: from this many players the set-up screen recommends the Double set, and chooses it when the count reaches it (John, 2026-09-28: "when having 6 or more players, we should recommend the double size 288 version"); in Japanese, which has no Double, the Full game instead.

KUMIMOJI_SCOREconstant

WHAT A FINISHED GAME SCORES on its leaderboard, as the other puzzles score theirs (puzzlePoints.ts): ten for every tile laid, and as much again for speed, which falls away evenly until a game that took half a minute a tile earns no speed at all.

KUMIMOJI_STRINGSconstant

The table's words in each language it speaks: KUMIMOJI_STRINGS.en, KUMIMOJI_STRINGS.ja.

KUMIMOJI_TRADEconstant

THE TRADE: one awkward tile back into the bag for three new ones — the classic way out of a hand of Q, X and J.

KUMIMOJI_WILDSconstant

Wild tiles per original 40/50-tile game, included within the bag total.

KumimojiChecktype

The answer to "does this grid finish the game?": yes, or no and why, in English (reason) and as a stable code with values a site can say in its own language (KUMIMOJI_CHECK_REASONS).

KumimojiCheckValuestype

The numbers and words that fill a reason's gaps, by the gap's name (see KUMIMOJI_CHECK_REASONS for each code's).

kumimojiDailySeedfunction

Today's seed, the date as a number: 2026-10-01 is 20261001.

kumimojiDayfunction

The day a moment falls on, in UTC, written YYYY-MM-DD.

KumimojiDealtype

A GAME DEALT (generateKumimoji): the bag, in the order its tiles come out, as one string of tile codes (* a wild), and one finished grid of those tiles that proves the bag can be finished, never shown to the player.

KumimojiExportedtype

A whole JSON export of one game: what kumimojiToJSON writes and kumimojiFromJSON reads.

KumimojiLanguagetype

The language of the tiles and of the word list they are judged by.

KumimojiLengthtype

How much of the set a game's bag holds: a short game, half the set, or all of it.

KumimojiLeveltype

How many of the bag's tiles are wild: easy the most, hard none (KUMIMOJI_WILDS).

KumimojiLocaletype

The languages the table speaks: English and Japanese.

KumimojiOptionstype

WHAT A KUMIMOJI WAS SET UP AS, beyond its hand and level: the choices that make one game a different game from another at the same seed, carried together wherever a game is made, checked, kept or raced.

kumimojiPointsfunction

A finished game's leaderboard points (KUMIMOJI_SCORE): ten a tile, and up to as much again for speed.

kumimojiRefusalfunction

A refusal: { ok: false }, the English reason (the clause of the code with the values in its gaps), the code and the values.

KumimojiSavedtype

A game alone as it is kept: the deal, where the player has got to, and the time spent so far.

kumimojiSayfunction

A line from a table of strings with its braces filled in: kumimojiSay(strings.left, { n: 12, time: "1:05" }).

kumimojiStringsfunction

The table of strings for a locale with a page's own words laid over it.

KumimojiStringstype

Every word the table shows, by name: one table of these for each language.

kumimojiToJSONfunction

A game as JSON, two spaces deep, with the format's number first.

kumimojiToTextfunction

A game as plain text, for a chat or a note: how it was set up, the crossword as it lies, the hand, how many tiles are left, and the time.

kumimojiWildCountfunction

Wilds scale with the bag; doubling the tile set doubles the wild count too.

laidThisTurnfunction

Whether the player whose turn it is has laid a tile on their table this turn: more tiles there than when it began.

lastStandingfunction

Whether the player whose turn it is is the only one still in: everybody else has resigned.

LeaveRefusaltype

Why this player cannot leave now, or null when they can.

leaveRefusedfunction

Why the player at seat at cannot leave now, or null when they can.

LengthRowtype

One length of game at one opening hand: how many tiles it deals from one set and from two, and how many of them are wild at each level.

lengthRowsfunction

For one opening hand, each length of game: how many tiles it deals, from one set and from two, and how many are wild at each level.

LENGTHSconstant

The lengths of game, shortest first.

liftAllfunction

Every tile on the table back to the hand.

liftToHandfunction

A tile on the table back to the end of the hand.

mayDrawfunction

Whether Draw may be pressed: the hand used, the grid sound, and a tile left to draw.

mayDrawAllfunction

Whether Draw may be pressed: the hand of the player whose turn it is used, their grid sound, and a tile in the bag for every player still in.

mayResignfunction

Whether the player whose turn it is may resign: only once the bag cannot give a trade, so nothing more can be got from it.

mayTradefunction

Whether a trade may be made: the bag holds as many as a trade takes.

mixShownfunction

A language's set as a page shows it: every tile with its count, the total, and which are the rarest and the commonest.

MixShowntype

A whole set, in its own order (a to z, あ to ん), with what a reader needs to see how uneven it is.

MixTiletype

One kind of tile in a set: the code the game deals, what is printed on it, what shows in its corner, and how many the set holds.

moveOnTablefunction

A tile on the table to another square: to an empty one it moves, onto a tile the two change places.

nameOffunction

What a player is called: their name, or "Player 2".

nextInfunction

The next player still in after from, round the table; from itself when nobody else is.

nextTurnfunction

The next turn a press gives: a quarter clockwise, and four presses back to the start.

overflowsfunction

Whether the area, at this view's size, is bigger than the screen: then the table pans.

panViewfunction

The view moved by dx and dy screen pixels.

partyFitsfunction

Whether a bag of this many tiles can be played by this many: one player can play any bag.

PartyGametype

A PASS-AND-PLAY KUMIMOJI: one bag, read as a line the way the solo game reads it (TilePlay), and a hand and a table for each player.

partyLengthfunction

The game length a set-up plays at: the one chosen where the bag holds this many players, else the shortest that does, so a choice made for fewer players comes back when there are fewer again.

PartyPlayertype

One player: their name as typed (empty for "Player N"), their hand and their own table, and whether the seat is a computer's (computerTurn.ts), whose turns play themselves in the browser.

partyPlayersAskedfunction

A players count from the address, or 1 (the solo game) for anything that is not two to eight.

PartySeattype

A seat asked for before the deal or at a join: a name (empty for its number) and whether a computer plays it.

PartySettingstype

What a pass-and-play game was set up as: the address's own choices, which a kept game is matched to.

partyTilesNeededfunction

The tiles a bag must hold for this many players: a hand each and one round of draws.

placeOffunction

A square's row and column, from its name.

planComputerTurnfunction

A computer seat's whole turn as its steps, in order, for a page to show one at a time.

Randomtype

A number in [0, 1), like Math.random, from a stream a seed fixes.

readSettingsfunction

A game's settings as something outside this browser sent them — a table on several devices, a kept game — checked, or null.

readTileProgressfunction

The parts of a kept game, or null for a string that is not one: its shape only, with no bag to check it against.

readTileWordsWithfunction

Used by tileWordsModule.ts only: how to read a list where there is no browser.

readWildsfunction

The grid with every blank wild read as a letter that makes all its runs words, or null for none; the grid itself when it holds no blank.

resignfunction

RESIGN: the player whose turn it is is out of the game, their table kept for the finish, and their turn passed over from then on.

Runtype

A run of tiles along one line: the word it spells and the squares it stands on, in reading order.

RunLinetype

THE LINES A RUN MAY LIE ALONG, each read top to bottom (and across, left to right): across and down always, and the two diagonals when the game was set up with Diagonals — down to the right, and down to the left.

runsOffunction

Every run the grid is read by: two or more tiles across, then down, and with Diagonals three or more down to the right, then down to the left.

sameLettersfunction

Whether two tallies hold the same letters, as many of each.

seatPlayfunction

The player whose turn it is, as the solo game's moves take a game: the shared bag, and their own hand and table.

seededRandomfunction

A stream of numbers in [0, 1) that the seed fixes: mulberry32.

shuffledfunction

A copy of the list in a random order (Fisher–Yates).

sortHandfunction

The hand in order (John, 2026-09-28: "it gets sorted for letters alphabetically"): English A to Z, Japanese あいうえお, which is the order of the kana's tile codes, and the wilds last as they came.

Squaretype

A square by its row and column.

squareAtfunction

A square's name, "row,col".

squareUnderfunction

The square under a point on the screen.

startPartyfunction

The deal: each player the next hand from the bag in turn, player one first, and every table empty.

stepViewfunction

The player a swipe or an arrow shows next: by seats on, round the table.

stillInfunction

The players still in — not resigned — by place, in turn order.

swapWithHandfunction

A tile from the hand onto a square that holds one: they change places, the table's tile going to the hand where the other was.

TABLEconstant

HOW THE TABLE IS LOOKED AT: which squares are shown, how big a tile is drawn and where.

tableAreafunction

The squares to show: the tiles' extent and the margin, or the margin round square (0, 0) on an empty table.

tableTallyfunction

A table's tiles as one string in order, wherever they stand: what a turn compares to see whether anything was laid or lifted.

tidyNamefunction

A name as kept: trimmed, one line, and no longer than a line holds.

TILE_MIXconstant

THE MIX: how many of each letter a full set holds, 144 tiles in all.

tileDescriptionfunction

What a screen reader says for a tile: its letter, or that it is a wild and what it stands for.

tileFacefunction

What a tile code shows, read without the word list: its letter or kana, its corner forms, and whether it is a wild.

TileFaceOftype

What a tile shows: what tileFace answers.

tileKanafunction

The tile a kana is played with, or null for anything that is not hiragana (ー, katakana, a letter).

TilePlaytype

A KUMIMOJI BEING PLAYED: the bag, the tiles traded back into it, how many have been taken out, the tiles on the table and the hand.

Tilestype

A KUMIMOJI GRID: letter tiles on a table with no edges.

tilesHeldByfunction

How many tiles a player would put back in the bag by leaving: their hand and their table.

tilesLeftfunction

How many tiles are still in the bag.

tileWordsfunction

The list already loaded, for judging and dealing.

TileWordstype

KUMIMOJI'S WORD LIST, loaded once, when a game opens.

tileWordsFromfunction

A list read from its module, for tileWordsModule.ts.

tileWordsReadyfunction

Whether the list has been fetched yet, for a page to say "loading" rather than throw.

tradefunction

One tile from the hand to the bottom of the bag, and the next three out of it.

tradeChoicefunction

The tile a computer trades: its rarest letter in the set, the first of those in its hand; never a wild.

TRY_ITconstant

THE TRY-IT ON THE FRONT DOOR: a Kumimoji of ten tiles, played in the reader's browser with the game's own moves and the game's own word check.

Turntype

How far the player has turned the table to look at it: quarter turns clockwise, 0 to 3.

turnAreafunction

The squares a turned table shows: the grid's area, turned.

turnPlacefunction

Where square (row, col) of the grid is drawn with the table turned: a quarter clockwise sends a word running right to one running down, and one running down to one running left.

turnViewfunction

A view the player zoomed or panned, turned a quarter clockwise with the table about the middle of its box: the same zoom, and the spot of the table that was in the middle stays there.

typingWayfunction

Which way typed letters run ON THE SCREEN.

unpackLengthfunction

Front-coded words of one length read back (see scripts/tile-words.mjs): a shared-prefix character, then the rest.

unpackTileWordsfunction

The English list read from its packed data: every word, the words by length, the set's mix, and the functions that turn tiles into words.

unturnPlacefunction

The grid's square drawn at (row, col) of the turned table: turnPlace undone.

Viewtype

A view: a tile's side in pixels, and where the corner of square (0, 0) is drawn.

WILD_SEARCH_MOSTconstant

A WILD LAID WITHOUT A LETTER READS AS WHATEVER MAKES THE GRID WORDS.

winnersOffunction

The winners of a finished game, by place: everybody who went out; the last one standing; or, tied, the final run of resignations.

withSeatPlayfunction

A move made on seatPlay put back: the bag as it left it, and the hand and table to the player whose turn it is.

wordsInHandfunction

The words the hand's own tiles spell, longest first and then in the list's order; wilds are not used.

zoomViewfunction

Zoomed by factor about the point (px, py) on the screen, which stays over the same spot of the table.