Skip to content

Interface: SessionEvents

@termwright/driver


@termwright/driver / 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.

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();

checkpoint(): number

Defined in: driver/src/api.ts:828

Last sequence assigned by the source journal. Zero means no event yet.

number


on<E>(event, cb): () => void

Defined in: driver/src/api.ts:822

E extends keyof SessionEventMap

E

(payload) => void

() => void


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.

SessionEventSubscriptionOptions

(event) => void

() => void