Skip to content

StreamEvent

One event off an exec’s output stream.

One object with a kind discriminant rather than three classes, because JS has no instanceof over a union a caller can switch on cleanly and the TypeScript idiom is a tagged union. kind is "output", "gap", or "exit", and the fields for the other two shapes are null — which keeps [Self::exit_code] distinguishable from an output chunk that happens to be last. The absence of an exit event is what tells a cut connection from a finished command; the byte sequences are otherwise identical.

optional data?: Buffer<ArrayBufferLike>;

The bytes, for an output event.


optional end?: number;

One past an output chunk’s last byte, or a gap’s exclusive end — either way, where a cursor resumes. null on an exit event, whose offset is a total rather than a position, so resuming from it would ask the daemon to replay from the end.


optional exitCode?: number;

kind: string;

"output", "gap", or "exit".


optional offset?: number;

Where an output chunk starts, or where a gap starts.


optional signal?: number;

optional stream?: string;

"stdout" or "stderr", for an output event. Both share one offset space, so a caller holds one cursor rather than two that can disagree about ordering.


optional text?: string;

The bytes as text, replacing anything undecodable. data is the lossless form.


optional timedOut?: boolean;

Present on exit: whether the remote execution deadline expired.


optional totalOffset?: number;

Total bytes published, on an exit event.


optional truncated?: boolean;

optional writersMayBeAlive?: boolean;

This page is generated from bindings/microvms-js/index.d.ts by TypeDoc 0.28.20 and typedoc-plugin-markdown 4.13.1, run from site/scripts/gen-reference.mjs on every pnpm run sync, so an edit made here is overwritten by the next run.

To change the page, change the doc comment in the binding’s Rust source, then regenerate the declarations with mise run dts. mise run dts:check fails when the committed file no longer matches the source.