vterm.js 0.4.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -33,11 +33,36 @@
33
33
  * @see https://terminfo.dev for the feature matrix
34
34
  * @see https://github.com/beorn/vterm for the monorepo
35
35
  */
36
- interface CellColor {
36
+ /**
37
+ * An RGB color, identity-preserving. `r`/`g`/`b` are always present (painters read
38
+ * them unconditionally); `index` is optional palette provenance. Named `Color` per the
39
+ * §9 naming ruling (rule 5: flat progressive shape over a discriminated union — a type
40
+ * named `RGB` that carries `.index` would lie). {@link CellColor} is the deprecated alias.
41
+ */
42
+ interface Color {
37
43
  r: number;
38
44
  g: number;
39
45
  b: number;
46
+ /**
47
+ * The palette index (0-255) this RGB was resolved from, when the color came
48
+ * from an INDEXED SGR (`31`, `91`, `38;5;N`, `48;5;N`, `58;5;N`, …). Absent
49
+ * for true 24-bit RGB (`38;2;R;G;B`) and for OSC-sourced colors (OSC 4/10/11),
50
+ * which are genuine RGB with no themeable index.
51
+ *
52
+ * Why it exists: vterm resolves every indexed SGR to `palette256[idx]` at parse
53
+ * time. Without keeping the origin index, {@link serializeSnapshot} can only
54
+ * re-emit `38;2;R;G;B`, which bakes vterm's built-in ANSI values and defeats the
55
+ * outer terminal's theme on reattach. Preserving `index` lets the serializer
56
+ * re-emit the faithful indexed form so a themeable receiver themes it again.
57
+ *
58
+ * It rides {@link Snapshot} as plain optional data (like
59
+ * `scrollbackSoftWrapped`) and is stripped at the {@link VtermScreen.getCell} /
60
+ * {@link VtermScreen.getRow} read boundary, whose contract is the resolved RGB.
61
+ */
62
+ index?: number;
40
63
  }
64
+ /** @deprecated Renamed to {@link Color} (§9 naming ruling). This alias rides the migration window. */
65
+ type CellColor = Color;
41
66
  type UnderlineStyle = "none" | "single" | "double" | "curly" | "dotted" | "dashed";
42
67
  interface ScreenCell {
43
68
  char: string;
@@ -73,16 +98,397 @@ interface SixelImage {
73
98
  row: number;
74
99
  col: number;
75
100
  }
101
+ interface ScreenAttrsSnapshot {
102
+ fg: CellColor | null;
103
+ bg: CellColor | null;
104
+ bold: boolean;
105
+ faint: boolean;
106
+ italic: boolean;
107
+ underline: UnderlineStyle;
108
+ underlineColor: CellColor | null;
109
+ overline: boolean;
110
+ strikethrough: boolean;
111
+ inverse: boolean;
112
+ hidden: boolean;
113
+ blink: boolean;
114
+ url: string | null;
115
+ }
116
+ interface ScreenColorStateSnapshot {
117
+ palette256: CellColor[];
118
+ defaultFgColor: CellColor | null;
119
+ defaultBgColor: CellColor | null;
120
+ cursorColor: CellColor | null;
121
+ specialColors: [number, CellColor][];
122
+ pointerFgColor: CellColor | null;
123
+ pointerBgColor: CellColor | null;
124
+ highlightBgColor: CellColor | null;
125
+ highlightFgColor: CellColor | null;
126
+ }
127
+ type ScreenParserState = "ground" | "escape" | "escape_charset" | "escape_hash" | "csi" | "osc" | "dcs" | "dcs_passthrough" | "osc_st" | "dcs_st" | "apc" | "apc_st";
128
+ interface ScreenBufferSnapshot {
129
+ grid: ScreenCell[][];
130
+ softWrapped: boolean[];
131
+ }
132
+ /**
133
+ * The whole-world persist/restore value — grids, ranges, modes, cursor, colors,
134
+ * parser transients, wrap bits. JSON-safe plain data; the persist boundary, not the
135
+ * incremental read path. Named `Snapshot` per §9 (the namespace supplies the context);
136
+ * {@link ScreenSnapshot} is the deprecated alias.
137
+ *
138
+ * Note: `cursor`/`savedState` still carry `x`/`y` (not `col`/`row`) — the §9
139
+ * `Cursor{col,row}` field rename is DEFERRED here because these fields are the wire
140
+ * shape read by the binary codec (`encodeScreenSnapshotBinary`); renaming them silently
141
+ * changes the persisted format. The {@link Cursor} read type + `getCursor()` accessor
142
+ * carry the col/row vocabulary at the read boundary instead.
143
+ */
144
+ interface Snapshot {
145
+ version: 1;
146
+ cols: number;
147
+ rows: number;
148
+ scrollbackLimit: number;
149
+ activeBuffer: "main" | "alt";
150
+ main: ScreenBufferSnapshot;
151
+ alt: ScreenBufferSnapshot;
152
+ scrollback: ScreenCell[][];
153
+ /**
154
+ * Per-scrollback-row soft-wrap bit: true when the row soft-wraps INTO the
155
+ * following row (autowrap continued the same logical line below it) — the
156
+ * same semantics as `ScreenBufferSnapshot.softWrapped`. Parallel to
157
+ * `scrollback`. Absent in snapshots taken before this field existed —
158
+ * `restore()` treats missing as all-false (hard-wrapped).
159
+ */
160
+ scrollbackSoftWrapped: boolean[];
161
+ cursor: {
162
+ x: number;
163
+ y: number;
164
+ visible: boolean;
165
+ shape: "block" | "underline" | "bar";
166
+ blinking: boolean;
167
+ savedX: number;
168
+ savedY: number;
169
+ };
170
+ savedState: {
171
+ x: number;
172
+ y: number;
173
+ attrs: ScreenAttrsSnapshot;
174
+ originMode: boolean;
175
+ autoWrap: boolean;
176
+ charsetG0: boolean;
177
+ };
178
+ attrs: ScreenAttrsSnapshot;
179
+ modes: {
180
+ bracketedPaste: boolean;
181
+ applicationCursor: boolean;
182
+ applicationKeypad: boolean;
183
+ autoWrap: boolean;
184
+ mouseTracking: boolean;
185
+ mouseTrackingMode: number;
186
+ sgrMouse: boolean;
187
+ focusTracking: boolean;
188
+ origin: boolean;
189
+ insert: boolean;
190
+ reverseVideo: boolean;
191
+ syncOutput: boolean;
192
+ kittyKeyboardFlags: number;
193
+ kittyKeyboardStack: number[];
194
+ kittyGraphics: boolean;
195
+ colorSchemeReporting: boolean;
196
+ decColumn: boolean;
197
+ altScroll: boolean;
198
+ utf8Mouse: boolean;
199
+ };
200
+ margins: {
201
+ scrollTop: number;
202
+ scrollBottom: number;
203
+ leftRight: boolean;
204
+ left: number;
205
+ right: number;
206
+ };
207
+ colors: {
208
+ current: ScreenColorStateSnapshot;
209
+ stack: ScreenColorStateSnapshot[];
210
+ };
211
+ tabStops: number[];
212
+ title: string;
213
+ clipboard: string;
214
+ cwd: string;
215
+ notifications: string[];
216
+ viewportOffset: number;
217
+ parser: {
218
+ state: ScreenParserState;
219
+ esc: string;
220
+ osc: string;
221
+ dcs: string;
222
+ dcsStart: {
223
+ row: number;
224
+ col: number;
225
+ };
226
+ apc: string;
227
+ utf8PendingBytes: number[];
228
+ };
229
+ unicode: {
230
+ charsetG0: boolean;
231
+ lastChar: string;
232
+ pendingRegionalIndicator: string | null;
233
+ afterZWJ: boolean;
234
+ };
235
+ }
236
+ /** @deprecated Renamed to {@link Snapshot} (§9 naming ruling). This alias rides the migration window. */
237
+ type ScreenSnapshot = Snapshot;
238
+ /**
239
+ * The cursor position at the read boundary, in the grid's own `col`/`row` vocabulary
240
+ * (§9 naming ruling: `x`/`y` contradicted the row/col naming used everywhere else, and
241
+ * the `State` suffix was redundant). Returned by {@link VtermScreen.getCursor}; the legacy
242
+ * {@link VtermScreen.getCursorPosition} still returns the `{ x, y }` shape (deprecated).
243
+ */
244
+ interface Cursor {
245
+ col: number;
246
+ row: number;
247
+ }
248
+ /**
249
+ * A terminal write as serializable data — the coarse WRITE vocabulary, symmetric with the
250
+ * Hab session journal and termless `Recording`. Bytes remain the CANONICAL encoding of an
251
+ * `output` op (they are what the journal persists and what {@link Screen.tapOps} delivers);
252
+ * a `string` is a convenience input to {@link Screen.apply} that is UTF-8-encoded before it
253
+ * is applied. This is deliberately NOT a per-VT-action reification — fine-grained parsed
254
+ * actions are surfaced by {@link ParserEvent} through {@link Screen.tapParser}.
255
+ */
256
+ type TerminalOp = {
257
+ type: "output";
258
+ data: Uint8Array | string;
259
+ } | {
260
+ type: "resize";
261
+ cols: number;
262
+ rows: number;
263
+ };
264
+ /**
265
+ * A single parsed VT action, emitted by {@link Screen.tapParser} AFTER the engine applies it,
266
+ * in stream order. A minimal, stable union over what the parser dispatches:
267
+ *
268
+ * - `print` — a run of consecutive printable graphemes, coalesced within one {@link
269
+ * Screen.process}/{@link Screen.apply} flood and flushed before the next control
270
+ * event (and at end-of-flood).
271
+ * - `execute` — a recognized C0 control byte (BEL, BS, HT, LF, VT, FF, CR); `code` is the byte.
272
+ * - `csi` — a complete CSI sequence; `final` is the dispatching byte, `params` are the
273
+ * `;`-separated numeric parameters (empty → `0`, matching the engine's own parse),
274
+ * `prefix` is the private marker (`?`/`>`/`<`/`=`) when present, `intermediates`
275
+ * are the `0x20`–`0x2f` bytes when present. (Colon sub-parameters collapse to
276
+ * their leading integer — the top-level view the non-SGR dispatchers also use.)
277
+ * - `osc` — a complete OSC with a numeric `code`; `data` is everything after the first `;`.
278
+ * - `esc` — a complete non-CSI/OSC escape (`ESC c`/`D`/`M`/`7`/`8`/`E`/`H`/`=`/`>` and the
279
+ * charset/`#` designators); `final` is the dispatching byte, `intermediates`
280
+ * carries the `(`/`)`/`#` designator byte when present.
281
+ *
282
+ * DCS and APC string sequences are not (yet) surfaced. A listener MUST NOT throw — taps are
283
+ * fail-loud: an exception propagates out of the write call (the engine state stays consistent).
284
+ */
285
+ type ParserEvent = {
286
+ kind: "print";
287
+ text: string;
288
+ } | {
289
+ kind: "execute";
290
+ code: number;
291
+ } | {
292
+ kind: "csi";
293
+ final: string;
294
+ params: number[];
295
+ prefix?: string;
296
+ intermediates?: string;
297
+ } | {
298
+ kind: "osc";
299
+ code: number;
300
+ data: string;
301
+ } | {
302
+ kind: "esc";
303
+ final: string;
304
+ intermediates?: string;
305
+ };
306
+ /**
307
+ * Accumulated per-row damage since the previous {@link Screen.takeDirty} call — the PULL-plane
308
+ * observation surface for renderers that read on their own schedule (distinct from the push-plane
309
+ * {@link Screen.tapOps}/{@link Screen.tapParser}). Absolute-row indexed, consistent with
310
+ * {@link Screen.getRowAbsolute}.
311
+ *
312
+ * - `rows` — the changed rows as retained-relative ABSOLUTE indices (row 0 = oldest retained
313
+ * scrollback line), OR the literal `"all"` when the whole visible buffer changed structurally
314
+ * (resize, full clear, alt-screen switch, reset, restore). The `Set` is freshly OWNED by the
315
+ * caller — the engine keeps a separate empty accumulator after the take.
316
+ * - `cursor` — `true` when the cursor position/visibility/shape/blink changed since the last take.
317
+ * - `scrolled` — number of lines that entered scrollback since the last take (a renderer shifts
318
+ * its viewport by this and repaints only the rows in `rows`).
319
+ *
320
+ * Contract note on trimming: a retention trim shifts every absolute index down by the trimmed
321
+ * count; `rows` are valid against the buffer AT take time. Pair with {@link Screen.firstRetainedRow}
322
+ * (which bumps by the trimmed count) to rebase indices cached across a take that spanned a trim.
323
+ */
324
+ interface DirtyRegion {
325
+ rows: Set<number> | "all";
326
+ cursor: boolean;
327
+ scrolled: number;
328
+ }
329
+ /**
330
+ * A minimal read-signal — the atom of the REACTIVE read plane (§4). Defined IN vterm.js, which
331
+ * stays dependency-free (§9 rule 7: compatible SHAPES over shared imports). A consumer wraps it in
332
+ * `alien-signals`, a zustand store, or React's `useSyncExternalStore` trivially, because the shape
333
+ * is exactly `{ get, subscribe }` — nothing here imports a reactive library.
334
+ *
335
+ * - `get()` returns the CURRENT value, computed live from engine state. It is pull-safe and
336
+ * independent of subscription: calling it never schedules, consumes, or resets a delivery.
337
+ * - `subscribe(listener)` registers for change delivery and returns an unsubscribe function. The
338
+ * listener fires at most once per flush boundary (see {@link ScreenSignals}), and only when the
339
+ * value actually changed since the last delivery (equality-gated). Subscribing does NOT fire
340
+ * immediately — the baseline is the value at subscribe time, so only later changes deliver.
341
+ * Fail-loud: a throwing listener propagates out of the write call.
342
+ */
343
+ interface ReadSignal<T> {
344
+ get(): T;
345
+ subscribe(listener: (value: T) => void): () => void;
346
+ }
347
+ /** The terminal's screen size (its column/row dimensions). Emitted by {@link ScreenSignals.size$}. */
348
+ interface Size {
349
+ cols: number;
350
+ rows: number;
351
+ }
352
+ /**
353
+ * The closed DEC/xterm private-mode set at the OBSERVATION boundary — everything a guest previously
354
+ * discovered by regex-scanning the DECSET byte stream. Emitted by {@link ScreenSignals.modes$}
355
+ * (equality-gated: one emission per flush that actually flips a mode). Mirrors the string keys of
356
+ * {@link Screen.getMode}, plus the numeric mouse-tracking protocol level.
357
+ */
358
+ interface TerminalModes {
359
+ altScreen: boolean;
360
+ cursorVisible: boolean;
361
+ bracketedPaste: boolean;
362
+ applicationCursor: boolean;
363
+ applicationKeypad: boolean;
364
+ autoWrap: boolean;
365
+ mouseTracking: boolean;
366
+ /** The active mouse-tracking protocol: `0` = off; `1000`/`1002`/`1003` = X10/button/any-event. */
367
+ mouseTrackingMode: number;
368
+ sgrMouse: boolean;
369
+ utf8Mouse: boolean;
370
+ focusTracking: boolean;
371
+ originMode: boolean;
372
+ insertMode: boolean;
373
+ reverseVideo: boolean;
374
+ syncOutput: boolean;
375
+ leftRightMargin: boolean;
376
+ colorSchemeReporting: boolean;
377
+ kittyKeyboard: boolean;
378
+ kittyGraphics: boolean;
379
+ sixel: boolean;
380
+ }
381
+ /**
382
+ * The REACTIVE read plane (§4): five equality-gated signals over the SAME state the pull plane
383
+ * ({@link Screen.getRowAbsolute}/{@link Screen.takeDirty}) and the push plane ({@link Screen.tapOps})
384
+ * expose. It replaces consumers' title-polling and DECSET regex scanning.
385
+ *
386
+ * Zero overhead when unused: `.signals` is lazily created (the getter allocates nothing until first
387
+ * read), and each signal is lazily created on first access (per-signal laziness). The write core does
388
+ * NO signal bookkeeping until `.signals` is read, and NO per-write damage accumulation until
389
+ * `damage$` actually has a subscriber.
390
+ *
391
+ * Flush boundary: every signal coalesces to AT MOST ONE emission per public state-mutating call
392
+ * (`process`/`apply`/`resize`/`reset`/`restore`; `apply` inherits it via `process`/`resize`) — the
393
+ * natural batch. `title$`/`modes$`/`cursor$`/`size$` fire only when their value actually changed
394
+ * across the call; `damage$` publishes the BATCHED dirty-set accumulated during the call.
395
+ *
396
+ * Two-plane coexistence: `damage$` runs on an accumulator INDEPENDENT of {@link Screen.takeDirty}.
397
+ * Subscribing never steals or resets the pull-plane epoch, so a `damage$` renderer and a
398
+ * `takeDirty()` differ observe the same damage without draining each other.
399
+ */
400
+ interface ScreenSignals {
401
+ /** The window title (OSC 0/2). Replaces title-diff polling. */
402
+ title$: ReadSignal<string>;
403
+ /** The closed DEC/xterm mode set. Replaces the guest's DECSET regex scanner. */
404
+ modes$: ReadSignal<TerminalModes>;
405
+ /** The cursor position in grid `col`/`row` (§9). Visibility rides {@link modes$}`.cursorVisible`. */
406
+ cursor$: ReadSignal<Cursor>;
407
+ /** The screen size. */
408
+ size$: ReadSignal<Size>;
409
+ /**
410
+ * The per-flush BATCHED dirty region — the union of rows changed during the call (or `"all"` on a
411
+ * structural change), with the cursor/scroll deltas. Same shape as {@link Screen.takeDirty}, but
412
+ * drained on its OWN epoch (see the interface note); this is precisely what a future canvas/DOM
413
+ * renderer subscribes to. The emitted region (including its `rows` `Set`) is SHARED across all
414
+ * `damage$` subscribers for that flush — treat it as read-only.
415
+ */
416
+ damage$: ReadSignal<DirtyRegion>;
417
+ }
76
418
  interface Screen {
77
419
  readonly cols: number;
78
420
  readonly rows: number;
421
+ /** The reactive read plane (§4). Lazily created; zero write-path overhead until used. */
422
+ readonly signals: ScreenSignals;
79
423
  process(data: Uint8Array): void;
80
424
  resize(cols: number, rows: number): void;
425
+ /**
426
+ * Apply one {@link TerminalOp} — the single public write entry, symmetric with the journal.
427
+ * `output` routes to {@link process} (a `string` payload is UTF-8-encoded first); `resize`
428
+ * routes to {@link resize}. Additive over `process`/`resize`, which remain public.
429
+ */
430
+ apply(op: TerminalOp): void;
431
+ /**
432
+ * Observe applied ops (opt-in). The listener fires exactly once per applied op — one per
433
+ * `process`/`apply`/`resize` call — with the CANONICAL payload (an `output` op always carries
434
+ * a `Uint8Array`). Returns an unsubscribe function. Zero overhead when no listener is
435
+ * registered. Enables symmetric journaling of the write stream.
436
+ */
437
+ tapOps(listener: (op: TerminalOp) => void): () => void;
438
+ /**
439
+ * Observe parsed VT actions (opt-in), delivered AFTER each is applied, in stream order.
440
+ * Returns an unsubscribe function. Zero overhead when no listener is registered — no {@link
441
+ * ParserEvent} is allocated on the byte-flood path unless a listener exists.
442
+ */
443
+ tapParser(listener: (event: ParserEvent) => void): () => void;
81
444
  reset(): void;
445
+ snapshot(): Snapshot;
446
+ restore(snapshot: Snapshot): void;
447
+ /** Serialize the current state to minimal ANSI — `serializeSnapshot(this.snapshot(), options)`. */
448
+ serialize(options?: SerializeOptions): string;
82
449
  getCell(row: number, col: number): ScreenCell;
450
+ /**
451
+ * The cells of a screen-relative row (§9: **row = cells, line = text**). Colors are
452
+ * stripped of palette-origin index at the read boundary.
453
+ */
454
+ getRow(row: number): ScreenCell[];
455
+ /** @deprecated Renamed to {@link getRow} (§9: row = cells, line = text). */
83
456
  getLine(row: number): ScreenCell[];
84
457
  getText(): string;
458
+ /** Scrollback rows above the visible grid, oldest first, rendered like getText(). */
459
+ getScrollbackText(): string;
85
460
  getTextRange(startRow: number, startCol: number, endRow: number, endCol: number): string;
461
+ /** Total rows in the buffer: retained scrollback + screen. */
462
+ totalRows(): number;
463
+ /** Number of visible screen rows (the terminal's row dimension). */
464
+ screenRows(): number;
465
+ /**
466
+ * Absolute row where the viewport's top line sits. At the bottom (no scroll):
467
+ * `totalRows() - screenRows()`. Scrolled fully up: `0`.
468
+ */
469
+ viewportTop(): number;
470
+ /**
471
+ * The row at ABSOLUTE index `row` (row 0 = oldest retained scrollback line; the screen occupies
472
+ * the last `screenRows()` rows). Colors are stripped of palette-origin index like {@link getLine}.
473
+ * Out-of-range indices return a blank row (matching the {@link getLine} read-boundary contract).
474
+ */
475
+ getRowAbsolute(row: number): ScreenCell[];
476
+ /**
477
+ * The GLOBAL index of retained absolute row 0 — i.e. the number of scrollback lines permanently
478
+ * evicted by retention trimming since creation (0 initially). Increases only when trimming drops
479
+ * lines; resets on {@link reset}/{@link restore}. A stable global row id is
480
+ * `firstRetainedRow() + <absolute row>`; an increase since a prior read signals a trim.
481
+ */
482
+ firstRetainedRow(): number;
483
+ /**
484
+ * Take and reset the accumulated per-row damage since the previous call — the pull-plane damage
485
+ * surface for renderers. See {@link DirtyRegion}. Always-on (independent of {@link tapOps}); the
486
+ * write path costs at most one Set membership update per row-run.
487
+ */
488
+ takeDirty(): DirtyRegion;
489
+ /** Cursor position in the grid's `col`/`row` vocabulary (§9). See {@link Cursor}. */
490
+ getCursor(): Cursor;
491
+ /** @deprecated Use {@link getCursor} — returns `{ col, row }` per the §9 naming ruling. */
86
492
  getCursorPosition(): {
87
493
  x: number;
88
494
  y: number;
@@ -102,5 +508,45 @@ interface Screen {
102
508
  getSixelImages(): SixelImage[];
103
509
  }
104
510
  declare function createScreen(options?: ScreenOptions): Screen;
511
+ interface SerializeOptions {
512
+ /** Emit scrollback history rows before the screen paint. Default: true. */
513
+ includeScrollback?: boolean;
514
+ /** Emit the window title (OSC 0) when non-empty. Default: false. */
515
+ includeTitle?: boolean;
516
+ /** Emit OSC 8 hyperlinks for cell and pending-pen urls. Default: true. */
517
+ hyperlinks?: boolean;
518
+ /**
519
+ * Snapshot mode keys to skip during emission (e.g. `"bracketedPaste"`,
520
+ * `"mouseTracking"`, `"kittyKeyboardFlags"`, `"origin"`, `"insert"`).
521
+ * The receiver keeps its fresh default for excluded keys — an explicit,
522
+ * caller-requested divergence from the snapshot. DECAWM paint discipline
523
+ * is correctness, not configuration, and cannot be excluded.
524
+ */
525
+ excludeModes?: readonly string[];
526
+ }
527
+ /**
528
+ * Serialize a snapshot to minimal ANSI a FRESH same-size terminal can replay.
529
+ * Phase order + the hard exclusion set are documented on the section header
530
+ * above; every ordering constraint is pinned by the mode round-trip matrix.
531
+ *
532
+ * Intended divergences (documented, not silent): syncOutput/decColumn are
533
+ * never emitted; the inactive buffer, SCP saved cursor, DECSC saved state,
534
+ * color stack, and parser/pending-wrap/mid-parse state are unserializable to
535
+ * a VT byte stream by design — the binary snapshot carries them.
536
+ */
537
+ declare function serializeSnapshot(snapshot: ScreenSnapshot, options?: SerializeOptions): string;
538
+ //#endregion
539
+ //#region src/snapshot-codec.d.ts
540
+ /**
541
+ * Encode a {@link ScreenSnapshot} to a compact binary buffer. Output is
542
+ * deterministic for identical input and decodes back to a deep-equal snapshot.
543
+ */
544
+ declare function encodeScreenSnapshotBinary(snapshot: ScreenSnapshot): Uint8Array;
545
+ /**
546
+ * Decode a buffer produced by {@link encodeScreenSnapshotBinary} back into a
547
+ * {@link ScreenSnapshot}. Throws loudly on an unknown version byte, truncated
548
+ * input, or any internal inconsistency — never returns a partial/normalized result.
549
+ */
550
+ declare function decodeScreenSnapshotBinary(bytes: Uint8Array): ScreenSnapshot;
105
551
  //#endregion
106
- export { type CellColor, type ScreenCell, type SemanticZone, type SixelImage, type UnderlineStyle, type Screen as VtermScreen, type ScreenOptions as VtermScreenOptions, createScreen as createVtermScreen };
552
+ export { type CellColor, type Color, type Cursor, type DirtyRegion, type ParserEvent, type ReadSignal, type ScreenCell, type ScreenSignals, type ScreenSnapshot, type ScreenSnapshot as VtermScreenSnapshot, type SemanticZone, type SerializeOptions, type SixelImage, type Size, type Snapshot, type TerminalModes, type TerminalOp, type UnderlineStyle, type Screen as VtermScreen, type ScreenAttrsSnapshot as VtermScreenAttrsSnapshot, type ScreenBufferSnapshot as VtermScreenBufferSnapshot, type ScreenColorStateSnapshot as VtermScreenColorStateSnapshot, type ScreenOptions as VtermScreenOptions, type ScreenParserState as VtermScreenParserState, createScreen as createVtermScreen, decodeScreenSnapshotBinary, encodeScreenSnapshotBinary, serializeSnapshot };