Skip to content

TableRuntime

Defined in: core/runtime.ts:345

One running table. The server creates one per table; shoehive/testing drives it directly. All mutating methods are queued and run one at a time.

readonly dev: boolean

Defined in: core/runtime.ts:351


readonly game: AnyGame

Defined in: core/runtime.ts:346

get engine(): Readonly<EngineState>

Defined in: core/runtime.ts:831

The committed engine bookkeeping. Treat as read-only.

Readonly<EngineState>


get faulted(): boolean

Defined in: core/runtime.ts:384

True after a persist failure. The table must be reloaded from its store.

boolean


get id(): string

Defined in: core/runtime.ts:817

string


get log(): readonly LogEntry[]

Defined in: core/runtime.ts:835

The log of committed entries, oldest first.

readonly LogEntry[]


get rev(): number

Defined in: core/runtime.ts:820

number


get state(): unknown

Defined in: core/runtime.ts:827

The committed raw state. Server-side only: never send it to clients.

unknown


get status(): TableStatus

Defined in: core/runtime.ts:823

TableStatus

act(args): Promise<{ result: Json | undefined; rev: number; }>

Defined in: core/runtime.ts:927

Runs a client action. Rejects with a ShoehiveError.

unknown

string

string

number

number

Promise<{ result: Json | undefined; rev: number; }>


diagnostics(): readonly Diagnostic[]

Defined in: core/runtime.ts:839

Recently rejected actions (not part of the log).

readonly Diagnostic[]


disconnect(args): Promise<void>

Defined in: core/runtime.ts:1030

Marks every seat of player as reserved and disconnected.

string

Promise<void>


dispose(): void

Defined in: core/runtime.ts:807

Stops timers and refuses further entries.

void


idle(): Promise<void>

Defined in: core/runtime.ts:918

Resolves once the queue is empty, including follow-up entries such as auto-start.

Promise<void>


meta(): TableMeta

Defined in: core/runtime.ts:847

TableMeta


onCommit(listener): () => void

Defined in: core/runtime.ts:912

Subscribes to commits. Returns an unsubscribe function.

(commit) => void

() => void


reconnect(args): Promise<void>

Defined in: core/runtime.ts:1035

Marks every seat of player as occupied and connected again.

string

Promise<void>


releaseOpenReservations(): void

Defined in: core/runtime.ts:586

Releases every reservation still open (call when a table closes, ADR 0007 rule 4).

void


rename(args): Promise<void>

Defined in: core/runtime.ts:1040

Updates the display name on every seat player holds. No game hook runs.

string

string

Promise<void>


seats(): SeatInfo[]

Defined in: core/runtime.ts:843

SeatInfo[]


seatsHeldBy(playerId): number[]

Defined in: core/runtime.ts:394

The seats playerId holds at this table, ascending.

string

number[]


setPersist(persist): void

Defined in: core/runtime.ts:389

Sets the persistence hook, for example after recovering a table by replay.

((entry) => void | Promise<void>) | undefined

void


sit(args): Promise<{ rev: number; seat: number; }>

Defined in: core/runtime.ts:989

Seats a player. Without seat, takes the lowest free seat.

{ id: string; name: string; }

string

string

number

Promise<{ rev: number; seat: number; }>


snapshot(): Snapshot

Defined in: core/runtime.ts:576

A copy of the table's current state and engine bookkeeping.

Snapshot


stand(args): Promise<{ rev: number; }>

Defined in: core/runtime.ts:1018

Frees a seat (the player stood up, or their reconnect grace expired).

"stand" | "grace-expired"

number

Promise<{ rev: number; }>


start(): Promise<void>

Defined in: core/runtime.ts:1054

Starts a table that is waiting (operator API, or autoStart: false).

Promise<void>


view(viewer): Json

Defined in: core/runtime.ts:882

The game's view() for viewer at the current revision (cached per rev).

Viewer

Json


viewerFor(playerId): Viewer

Defined in: core/runtime.ts:873

The viewer for a player: their seats if they hold any, otherwise a spectator.

string | null

Viewer


static create(game, args?): Promise<TableRuntime>

Defined in: core/runtime.ts:402

Creates a new table: validates options, seeds the RNG and runs setup.

AnyGame

RuntimeOptions & object = {}

Promise<TableRuntime>


static replay(game, log, args?): Promise<TableRuntime>

Defined in: core/runtime.ts:493

Rebuilds a table from its log, optionally starting from a snapshot. With live: true the result arms its timers and accepts new entries (restart recovery); otherwise it is a read-only copy (tests, devtools).

AnyGame

readonly LogEntry[]

RuntimeOptions & object = {}

Promise<TableRuntime>