Interface: SessionEvents
@termwright/driver / SessionEvents
Interface: SessionEvents
Section titled “Interface: SessionEvents”Defined in: driver/src/api.ts:821
@termwright/driver — PTY + VT sessions, locators, actions and waits.
The normative public API lives in api.ts; this module is the only entry
point and re-exports the types from there together with their runtime
implementations.
Example
Section titled “Example”import { launchTerminal } from '@termwright/driver';
const terminal = await launchTerminal({ command: ['node', 'app.js'] });await terminal.waitForText('Ready');await terminal.getByRole('button', { name: 'Approve' }).activate();await terminal.close();Methods
Section titled “Methods”checkpoint()
Section titled “checkpoint()”checkpoint():
number
Defined in: driver/src/api.ts:828
Last sequence assigned by the source journal. Zero means no event yet.
Returns
Section titled “Returns”number
on<
E>(event,cb): () =>void
Defined in: driver/src/api.ts:822
Type Parameters
Section titled “Type Parameters”E extends keyof SessionEventMap
Parameters
Section titled “Parameters”E
(payload) => void
Returns
Section titled “Returns”() => void
subscribe()
Section titled “subscribe()”subscribe(
options,cb): () =>void
Defined in: driver/src/api.ts:836
Subscribes to the single ordered session stream and replays retained
events starting at fromSequence before switching to live delivery.
A requested prefix that exceeded the bounded journal is never hidden:
onGap runs first, or subscription throws when no gap handler is given.
Parameters
Section titled “Parameters”options
Section titled “options”SessionEventSubscriptionOptions
(event) => void
Returns
Section titled “Returns”() => void