Skip to content

@ue-too/being-devtools / MachineDebugger

Class: MachineDebugger ​

Defined in: debugger.ts:89

A debugger panel: a pannable state chart plus a sidebar with one tab per attached machine, the current state, a context inspector, fire buttons, reset, and a coalescing event log.

Remarks ​

Every attached machine is borrowed. The panel never calls wrapup() — that parks a live machine in TERMINAL and, for a board machine, stops the real board responding to input. reset() is offered because it round-trips through TERMINAL and restarts; it is the recovery for a machine stranded by a hand-fired half-gesture.

Example ​

ts
const panel = new MachineDebugger();
const handle = panel.attach(machine, { name: 'pan-control' });
// later
handle.dispose();
panel.dispose();

Constructors ​

Constructor ​

new MachineDebugger(options): MachineDebugger

Defined in: debugger.ts:102

Parameters ​

options ​

MachineDebuggerOptions = {}

Returns ​

MachineDebugger

Accessors ​

board ​

Get Signature ​

get board(): Board

Defined in: debugger.ts:144

The panel's own graph viewport, so a page can diagram the board it pans.

Returns ​

Board


isOpen ​

Get Signature ​

get isOpen(): boolean

Defined in: debugger.ts:148

Returns ​

boolean


machines ​

Get Signature ​

get machines(): ReadonlyMap<string, MachineLike>

Defined in: debugger.ts:158

Name → machine for every attached machine.

Returns ​

ReadonlyMap<string, MachineLike>


size ​

Get Signature ​

get size(): number

Defined in: debugger.ts:153

Number of attached machines.

Returns ​

number

Methods ​

attach() ​

attach(machine, options): AttachHandle

Defined in: debugger.ts:171

Attaches a machine as a new tab.

Parameters ​

machine ​

MachineLike

options ​

AttachOptions = {}

Returns ​

AttachHandle

Throws ​

Error when options.name is already attached to this panel.


attachBoard() ​

attachBoard(board, options): AttachHandle

Defined in: debugger.ts:194

Attaches every being machine the board exposes (see resolveBoardMachines). Attaches what it finds; throws only when it finds nothing.

Parameters ​

board ​

BoardLike

options ​
namePrefix? ​

string

Returns ​

AttachHandle


close() ​

close(): void

Defined in: debugger.ts:241

Returns ​

void


dispose() ​

dispose(): void

Defined in: debugger.ts:262

Detaches every machine, stops the render loop, and removes the panel.

Returns ​

void


open() ​

open(): void

Defined in: debugger.ts:230

Returns ​

void


toggle() ​

toggle(): void

Defined in: debugger.ts:253

Returns ​

void