wongtty 0.0.0-stage → 0.0.2

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.
@@ -0,0 +1,943 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ /** One host history row: packed cells as the engine's `rowCells` gives them, or ANSI text for the row. */
5
+ export interface IHistoryRow {
6
+ cells?: Uint32Array;
7
+ ansi?: string;
8
+ /** The row wraps into the next one (the engine's `rowWrapped`). */
9
+ wrapped?: boolean;
10
+ /** The engine's `rowExtras` for `cells`: combining marks, underline colours, OSC 8 links. */
11
+ extras?: unknown[];
12
+ }
13
+ /** The host's history for viewport-only mode (`setHistoryProvider`). */
14
+ export interface IHistoryProvider {
15
+ /** History lines the host holds now, this terminal's own included (the host engine's `historyLength`). */
16
+ readonly length: number;
17
+ /** Most history lines the host keeps; past it, its oldest lines drop off. No limit by default. */
18
+ readonly limit?: number;
19
+ /** Host rows kept for the view (256 by default). */
20
+ readonly cacheLines?: number;
21
+ /** Host history lines `start .. start + count`, 0 its oldest line; `null` for a line it no longer has. */
22
+ fetch(start: number, count: number): Promise<ReadonlyArray<IHistoryRow | Uint32Array | string | null | undefined>>;
23
+ }
24
+
25
+
26
+
27
+ /** `@xterm/addon-image` options; `kittySupport` and `kittySizeLimit` are read but kitty graphics are not supported. */
28
+ export interface IImageAddonOptions {
29
+ enableSizeReports?: boolean;
30
+ pixelLimit?: number;
31
+ storageLimit?: number;
32
+ showPlaceholder?: boolean;
33
+ sixelSupport?: boolean;
34
+ sixelScrolling?: boolean;
35
+ sixelPaletteLimit?: number;
36
+ sixelSizeLimit?: number;
37
+ iipSupport?: boolean;
38
+ iipSizeLimit?: number;
39
+ kittySupport?: boolean;
40
+ kittySizeLimit?: number;
41
+ }
42
+
43
+
44
+
45
+ /** xterm.js `CustomKeyEventHandler`: return false to stop the terminal from handling the key. */
46
+ export type CustomKeyEventHandler = (event: KeyboardEvent) => boolean;
47
+ /** xterm.js `CustomWheelEventHandler`: return false to stop the terminal from handling the wheel. */
48
+ export type CustomWheelEventHandler = (event: WheelEvent) => boolean;
49
+
50
+
51
+
52
+ /** xterm.js `IBufferCellPosition`: a buffer cell, `x` the column and `y` the buffer line. */
53
+ export interface IBufferCellPosition {
54
+ x: number;
55
+ y: number;
56
+ }
57
+ /** xterm.js `IBufferRange`. */
58
+ export interface IBufferRange {
59
+ start: IBufferCellPosition;
60
+ end: IBufferCellPosition;
61
+ }
62
+
63
+
64
+
65
+ /** xterm.js `IEvent`: call it with a listener to subscribe; `dispose()` the result to unsubscribe. */
66
+ export interface IEvent<T, U = void> {
67
+ (listener: (arg1: T, arg2: U) => any): Disposable;
68
+ }
69
+
70
+
71
+
72
+ /** xterm.js `IModes`. */
73
+ export interface IModes {
74
+ readonly applicationCursorKeysMode: boolean;
75
+ readonly applicationKeypadMode: boolean;
76
+ readonly bracketedPasteMode: boolean;
77
+ readonly insertMode: boolean;
78
+ readonly mouseTrackingMode: 'none' | 'x10' | 'vt200' | 'drag' | 'any';
79
+ readonly originMode: boolean;
80
+ readonly reverseWraparoundMode: boolean;
81
+ readonly sendFocusMode: boolean;
82
+ readonly showCursor: boolean;
83
+ readonly synchronizedOutputMode: boolean;
84
+ readonly win32InputMode: boolean;
85
+ readonly wraparoundMode: boolean;
86
+ }
87
+
88
+ /** What `ansiSnapshot` leaves out, like `@xterm/addon-serialize`'s `serialize` options. */
89
+ export interface AnsiSnapshotOptions {
90
+ /** Keep only the newest this many history lines (0: the screen alone). All of them by default. */
91
+ scrollback?: number;
92
+ /** Leave out the modes and what continues the output, so the bytes only paint the screen. */
93
+ excludeModes?: boolean;
94
+ }
95
+
96
+ /** Bytes that rebuild the screen, scrollback included, in a fresh terminal of the same size, or why they cannot. */
97
+ export type AnsiSnapshot =
98
+ | { ok: true; payload: Uint8Array }
99
+ /** `"unsupported-wide-edge"`, `"margins"` or `"partial-tail-overflow"`. */
100
+ | { ok: false; reason: string };
101
+
102
+
103
+
104
+ /** xterm.js `IViewportRange`: 1-based cells, end inclusive. */
105
+ export interface IViewportRange {
106
+ start: IViewportRangePosition;
107
+ end: IViewportRangePosition;
108
+ }
109
+ export interface IViewportRangePosition {
110
+ x: number;
111
+ y: number;
112
+ }
113
+ /** xterm.js `ILinkDecorations`. */
114
+ export interface ILinkDecorations {
115
+ pointerCursor: boolean;
116
+ underline: boolean;
117
+ }
118
+ /** xterm.js `ILink`: `range` in 1-based buffer cells, end inclusive. */
119
+ export interface ILink {
120
+ range: IBufferRange;
121
+ text: string;
122
+ decorations?: ILinkDecorations;
123
+ activate(event: MouseEvent, text: string): void;
124
+ hover?(event: MouseEvent, text: string): void;
125
+ leave?(event: MouseEvent, text: string): void;
126
+ dispose?(): void;
127
+ }
128
+ /** xterm.js `ILinkProvider`: `bufferLineNumber` is 1-based. */
129
+ export interface ILinkProvider {
130
+ provideLinks(bufferLineNumber: number, callback: (links: ILink[] | undefined) => void): void;
131
+ }
132
+ /** xterm.js `ILinkHandler`, the `linkHandler` option for OSC 8 links. */
133
+ export interface ILinkHandler {
134
+ activate(event: MouseEvent, text: string, range: IBufferRange): void;
135
+ hover?(event: MouseEvent, text: string, range: IBufferRange): void;
136
+ leave?(event: MouseEvent, text: string, range: IBufferRange): void;
137
+ allowNonHttpProtocols?: boolean;
138
+ }
139
+ /** `@xterm/addon-web-links` `ILinkProviderOptions`. */
140
+ export interface ILinkProviderOptions {
141
+ hover?(event: MouseEvent, text: string, location: IViewportRange): void;
142
+ leave?(event: MouseEvent, text: string): void;
143
+ urlRegex?: RegExp;
144
+ }
145
+
146
+
147
+
148
+ export interface IRenderDimensions {
149
+ css: { canvas: { width: number; height: number }; cell: { width: number; height: number } };
150
+ device: {
151
+ canvas: { width: number; height: number };
152
+ cell: { width: number; height: number };
153
+ char: { width: number; height: number; left: number; top: number };
154
+ };
155
+ }
156
+
157
+
158
+
159
+ export interface ISearchOptions {
160
+ regex?: boolean;
161
+ wholeWord?: boolean;
162
+ caseSensitive?: boolean;
163
+ incremental?: boolean;
164
+ decorations?: ISearchDecorationOptions;
165
+ }
166
+ export interface ISearchDecorationOptions {
167
+ matchBackground?: string;
168
+ matchBorder?: string;
169
+ matchOverviewRuler: string;
170
+ activeMatchBackground?: string;
171
+ activeMatchBorder?: string;
172
+ activeMatchColorOverviewRuler: string;
173
+ }
174
+ export interface ISearchResultChangeEvent {
175
+ resultIndex: number;
176
+ resultCount: number;
177
+ }
178
+ export interface ISearchAddonOptions {
179
+ highlightLimit: number;
180
+ }
181
+
182
+
183
+
184
+ export interface ITerminalAddon {
185
+ activate(terminal: Terminal): void;
186
+ dispose(): void;
187
+ }
188
+
189
+
190
+
191
+ export type IBufferNamespace = BufferNamespace;
192
+ export type IBuffer = BufferView;
193
+ export type IBufferLine = BufferLine;
194
+ export type IBufferCell = BufferCell;
195
+
196
+
197
+
198
+ export type IMarker = Marker;
199
+
200
+
201
+
202
+ export type IParser = Parser;
203
+
204
+ /** xterm.js `IFunctionIdentifier`: a CSI or DCS sequence by its private marker, intermediates and final byte. */
205
+ export interface IFunctionIdentifier {
206
+ /** One byte of `<`…`?`. */
207
+ prefix?: string;
208
+ /** Up to two bytes of ` `…`/`. */
209
+ intermediates?: string;
210
+ /** One byte of `@`…`~`. */
211
+ final: string;
212
+ }
213
+
214
+ /** Each parameter, followed by an array of its sub-parameters if it has any (an empty one is -1). */
215
+ export type IParams = (number | number[])[];
216
+
217
+
218
+
219
+ /**
220
+ * xterm.js `IBufferCell`.
221
+ */
222
+ export class BufferCell {
223
+ private constructor();
224
+ free(): void;
225
+ [Symbol.dispose](): void;
226
+ /**
227
+ * The cell text; `''` for an erased cell and the right half of a wide character, like xterm.js.
228
+ */
229
+ getChars(): string;
230
+ /**
231
+ * The code point (0 for an erased cell), or the last UTF-16 unit of a cell with combining marks, like xterm.js.
232
+ */
233
+ getCode(): number;
234
+ /**
235
+ * 2 for a wide character, 0 for its right half, else 1.
236
+ */
237
+ getWidth(): number;
238
+ isBlink(): number;
239
+ isBold(): number;
240
+ isDim(): number;
241
+ isInverse(): number;
242
+ isInvisible(): number;
243
+ isItalic(): number;
244
+ isStrikethrough(): number;
245
+ /**
246
+ * Any underline style.
247
+ */
248
+ isUnderline(): number;
249
+ }
250
+
251
+ /**
252
+ * xterm.js `IBufferLine`: a copy of one row.
253
+ */
254
+ export class BufferLine {
255
+ private constructor();
256
+ free(): void;
257
+ [Symbol.dispose](): void;
258
+ /**
259
+ * Cell `x`, or `undefined` outside the line. `cell` is accepted for xterm.js compatibility and not reused:
260
+ * use the returned cell.
261
+ */
262
+ getCell(x: number, cell?: IBufferCell): BufferCell | undefined;
263
+ /**
264
+ * Like xterm.js: erased cells are spaces, `trimRight` drops trailing erased cells (not typed spaces), a wide
265
+ * character covers two columns, and a range that starts on its right half gets a space there. Unlike
266
+ * xterm.js, columns outside the line are clamped (xterm.js pads them).
267
+ */
268
+ translateToString(trimRight?: boolean | null, startColumn?: number | null, endColumn?: number | null): string;
269
+ /**
270
+ * Whether this line continues the previous one (soft wrap).
271
+ */
272
+ readonly isWrapped: boolean;
273
+ readonly length: number;
274
+ }
275
+
276
+ /**
277
+ * xterm.js `IBufferNamespace`.
278
+ */
279
+ export class BufferNamespace {
280
+ private constructor();
281
+ free(): void;
282
+ [Symbol.dispose](): void;
283
+ /**
284
+ * The buffer on screen now; it keeps its type when the program switches screens.
285
+ */
286
+ readonly active: BufferView;
287
+ readonly alternate: BufferView;
288
+ readonly normal: BufferView;
289
+ /**
290
+ * Fires with the new active buffer when the program enters or leaves the alternate screen.
291
+ */
292
+ readonly onBufferChange: IEvent<IBuffer>;
293
+ }
294
+
295
+ /**
296
+ * xterm.js `IBuffer`, one of the two screens.
297
+ */
298
+ export class BufferView {
299
+ private constructor();
300
+ free(): void;
301
+ [Symbol.dispose](): void;
302
+ /**
303
+ * A copy of line `y` taken now (xterm.js hands out a live view), or `undefined` outside `0..length`.
304
+ */
305
+ getLine(y: number): BufferLine | undefined;
306
+ /**
307
+ * An empty cell: no text, width 1.
308
+ */
309
+ getNullCell(): BufferCell;
310
+ /**
311
+ * Line at the top of the screen: the scrollback length (the host's lines included in viewport-only mode).
312
+ */
313
+ readonly baseY: number;
314
+ /**
315
+ * Cursor column. At the right edge it stays on the last column where xterm.js reports `cols` (the engine
316
+ * keeps the pending wrap to itself).
317
+ */
318
+ readonly cursorX: number;
319
+ /**
320
+ * Cursor row on the screen (0 is the top screen row, whatever the scroll position).
321
+ */
322
+ readonly cursorY: number;
323
+ readonly type: 'normal' | 'alternate';
324
+ /**
325
+ * Scrollback plus screen lines.
326
+ */
327
+ readonly length: number;
328
+ /**
329
+ * Line shown at the top of the viewport.
330
+ */
331
+ readonly viewportY: number;
332
+ }
333
+
334
+ /**
335
+ * xterm.js `IDisposable`. Dropping it on the Rust side does nothing; `dispose()` runs the teardown once.
336
+ */
337
+ export class Disposable {
338
+ private constructor();
339
+ free(): void;
340
+ [Symbol.dispose](): void;
341
+ dispose(): void;
342
+ }
343
+
344
+ /**
345
+ * Sizes the terminal to its element's parent, like `@xterm/addon-fit`.
346
+ */
347
+ export class FitAddon {
348
+ free(): void;
349
+ [Symbol.dispose](): void;
350
+ /**
351
+ * `terminal.loadAddon(fitAddon)` calls this.
352
+ */
353
+ activate(terminal: Terminal): void;
354
+ dispose(): void;
355
+ /**
356
+ * Resizes the terminal to `proposeDimensions()`.
357
+ */
358
+ fit(): void;
359
+ constructor();
360
+ /**
361
+ * The size that fills the parent, `undefined` before `open` or while the cell size is unknown.
362
+ */
363
+ proposeDimensions(): { cols: number; rows: number } | undefined;
364
+ }
365
+
366
+ /**
367
+ * Built-in image addon: `new ImageAddon(options)` takes `@xterm/addon-image`'s options.
368
+ */
369
+ export class ImageAddon {
370
+ free(): void;
371
+ [Symbol.dispose](): void;
372
+ /**
373
+ * `terminal.loadAddon(addon)` calls this.
374
+ */
375
+ activate(terminal: Terminal): void;
376
+ /**
377
+ * Removes the handlers and every image.
378
+ */
379
+ dispose(): void;
380
+ constructor(options: IImageAddonOptions);
381
+ /**
382
+ * Resets the options sequences change and drops every image (RIS, DECSTR).
383
+ */
384
+ reset(): boolean;
385
+ /**
386
+ * The protocol handlers by name (`'sixel'`, `'iip'`), as `@xterm/addon-image` keeps them.
387
+ */
388
+ readonly _handlers: Map<string, unknown>;
389
+ /**
390
+ * Fires after an image is placed.
391
+ */
392
+ readonly onImageAdded: IEvent<void>;
393
+ showPlaceholder: boolean;
394
+ /**
395
+ * Storage limit in MB; -1 before `loadAddon`.
396
+ */
397
+ storageLimit: number;
398
+ /**
399
+ * MB the images hold; -1 before `loadAddon`.
400
+ */
401
+ readonly storageUsage: number;
402
+ }
403
+
404
+ /**
405
+ * xterm.js `IMarker`.
406
+ */
407
+ export class Marker {
408
+ private constructor();
409
+ free(): void;
410
+ [Symbol.dispose](): void;
411
+ /**
412
+ * Removes the marker and fires `onDispose`, like xterm.js; again does nothing.
413
+ */
414
+ dispose(): void;
415
+ /**
416
+ * Unique among the terminal's markers (xterm.js numbers markers across all terminals).
417
+ */
418
+ readonly id: number;
419
+ readonly isDisposed: boolean;
420
+ /**
421
+ * The buffer line (0 is the oldest scrollback line), -1 once disposed.
422
+ */
423
+ readonly line: number;
424
+ /**
425
+ * Fires once when the marker is disposed; a listener added after that is never called.
426
+ */
427
+ readonly onDispose: IEvent<void>;
428
+ }
429
+
430
+ /**
431
+ * xterm.js `IParser`: CSI, DCS and OSC handlers. `true` from a handler skips the older handlers and the default
432
+ * action; `false` falls through to them; a `Promise<boolean>` holds the write queue until it settles. `write()`
433
+ * from inside a handler is parsed after the data being parsed. A throwing or rejecting handler counts as false
434
+ * and its error is thrown again on a later task.
435
+ */
436
+ export class Parser {
437
+ private constructor();
438
+ free(): void;
439
+ [Symbol.dispose](): void;
440
+ registerCsiHandler(id: IFunctionIdentifier, callback: (params: IParams) => boolean | Promise<boolean>): Disposable;
441
+ registerDcsHandler(id: IFunctionIdentifier, callback: (data: string, param: IParams) => boolean | Promise<boolean>): Disposable;
442
+ /**
443
+ * `ident` is the number before the first `;`; the handler gets the rest.
444
+ */
445
+ registerOscHandler(ident: number, callback: (data: string) => boolean | Promise<boolean>): Disposable;
446
+ }
447
+
448
+ /**
449
+ * xterm.js `@xterm/addon-search`, built in: load it with `terminal.loadAddon(new SearchAddon())`.
450
+ */
451
+ export class SearchAddon {
452
+ free(): void;
453
+ [Symbol.dispose](): void;
454
+ /**
455
+ * `terminal.loadAddon(searchAddon)` calls this.
456
+ */
457
+ activate(terminal: Terminal): void;
458
+ /**
459
+ * Clears the active match's decoration (meant for the search box's `blur`).
460
+ */
461
+ clearActiveDecoration(): void;
462
+ /**
463
+ * Clears the decorations and forgets the term, so the next search starts over from the selection start.
464
+ */
465
+ clearDecorations(): void;
466
+ /**
467
+ * Stops following the terminal and clears the decorations; searching still works, like the addon.
468
+ */
469
+ dispose(): void;
470
+ /**
471
+ * Selects the next match after the selection (from the top without one), wrapping around, and scrolls it into
472
+ * view. False when there is none; a bad regular expression throws.
473
+ */
474
+ findNext(term: string, searchOptions?: ISearchOptions): boolean;
475
+ /**
476
+ * Like `findNext`, backwards from the selection (from the bottom without one).
477
+ */
478
+ findPrevious(term: string, searchOptions?: ISearchOptions): boolean;
479
+ constructor(options?: Partial<ISearchAddonOptions>);
480
+ readonly onAfterSearch: IEvent<void>;
481
+ readonly onBeforeSearch: IEvent<void>;
482
+ /**
483
+ * With decorations: the active match's index among all matches (-1 if none or past `highlightLimit`) and their
484
+ * count, after each search.
485
+ */
486
+ readonly onDidChangeResults: IEvent<ISearchResultChangeEvent>;
487
+ }
488
+
489
+ export class Terminal {
490
+ free(): void;
491
+ [Symbol.dispose](): void;
492
+ /**
493
+ * Bytes that rebuild this screen, scrollback included, in a fresh terminal of the same size (the engine's
494
+ * `ansiSnapshot`; replaces `@xterm/addon-serialize`). `{ scrollback: 0, excludeModes: true }` paints just the
495
+ * screen it shows (a cold frame), as `serialize` with the same options does.
496
+ */
497
+ ansiSnapshot(options?: AnsiSnapshotOptions): AnsiSnapshot;
498
+ /**
499
+ * `handler` sees every keydown, keypress and keyup first; returning false stops the terminal from handling it.
500
+ */
501
+ attachCustomKeyEventHandler(handler: CustomKeyEventHandler): void;
502
+ /**
503
+ * `handler` sees every wheel event the mouse handles first; returning false keeps it from being reported or
504
+ * sent as arrow keys.
505
+ */
506
+ attachCustomWheelEventHandler(handler: CustomWheelEventHandler): void;
507
+ blur(): void;
508
+ clearSelection(): void;
509
+ /**
510
+ * Drops pending writes without running their callbacks, like xterm.js. Safe to call from any listener.
511
+ */
512
+ dispose(): void;
513
+ focus(): void;
514
+ /**
515
+ * The selection in buffer cells, end exclusive, or `undefined` without one.
516
+ */
517
+ getSelectionPosition(): IBufferRange | undefined;
518
+ /**
519
+ * The selected text: wrapped rows joined, wide characters once, lines joined with `\n` (`\r\n` on Windows).
520
+ */
521
+ getSelection(): string;
522
+ /**
523
+ * Whether some text is selected.
524
+ */
525
+ hasSelection(): boolean;
526
+ /**
527
+ * xterm.js `input` (`CoreTerminal.input`): `data` goes to `onData` as is. With `wasUserInput` (the default) it
528
+ * counts as typed: it scrolls to the bottom (`scrollOnUserInput`), fires `onUserInput` and clears the selection.
529
+ * `disableStdin` drops it either way.
530
+ */
531
+ input(data: string, wasUserInput?: boolean): void;
532
+ /**
533
+ * Accepts the built-in `FitAddon` (refitted by itself when the cell size changes) and `SearchAddon`, and
534
+ * absorbs `@xterm/addon-webgl` (and the built-in `WebglAddon`) and `@xterm/addon-unicode11`, whose work is
535
+ * built in. Any other addon throws.
536
+ */
537
+ loadAddon(addon: ITerminalAddon): void;
538
+ /**
539
+ * Throws unless `await init()` has finished.
540
+ */
541
+ constructor(options?: object | null);
542
+ open(parent: HTMLElement): void;
543
+ /**
544
+ * Sends `data` as if pasted: newlines become CR, bracketed when the program asked for it.
545
+ */
546
+ paste(data: string): void;
547
+ /**
548
+ * Redraws viewport rows `start`…`end` on the next frame.
549
+ */
550
+ refresh(start: number, end: number): void;
551
+ /**
552
+ * Adds a link provider, asked after the OSC 8 links and the providers registered before it; the earliest
553
+ * provider with a link under the mouse wins and later links that overlap its links are dropped.
554
+ */
555
+ registerLinkProvider(linkProvider: ILinkProvider): Disposable;
556
+ /**
557
+ * A marker on the cursor line plus `cursorYOffset` of the active buffer. `undefined` for a line outside the
558
+ * buffer (xterm.js marks those too); non-integers throw like xterm.js.
559
+ */
560
+ registerMarker(cursorYOffset?: number | null): IMarker;
561
+ /**
562
+ * wongtty API: drops the kitty keyboard flags the program pushed, on both screens; keys are encoded the legacy
563
+ * way at once.
564
+ */
565
+ resetKittyKeyboard(): void;
566
+ /**
567
+ * Full reset (RIS), applied at once: a synchronized update ends, writes still queued are parsed afterwards (as
568
+ * in xterm.js, whose write buffer `reset` leaves alone).
569
+ */
570
+ reset(): void;
571
+ /**
572
+ * A second resize before the next frame only records the size (`cols`/`rows` report it at once); the frame,
573
+ * or a write before it, reflows once and fires `onResize` then.
574
+ */
575
+ resize(cols: number, rows: number): void;
576
+ /**
577
+ * Positive `amount` scrolls down towards the newest output.
578
+ */
579
+ scrollLines(amount: number): void;
580
+ /**
581
+ * Scrolls by `pageCount` screens less one row, like xterm.js.
582
+ */
583
+ scrollPages(pageCount: number): void;
584
+ scrollToBottom(): void;
585
+ /**
586
+ * Scrolls so that buffer line `line` is the top viewport row.
587
+ */
588
+ scrollToLine(line: number): void;
589
+ scrollToTop(): void;
590
+ /**
591
+ * Selects the whole buffer.
592
+ */
593
+ selectAll(): void;
594
+ /**
595
+ * Selects buffer lines `start` to `end`, both included.
596
+ */
597
+ selectLines(start: number, end: number): void;
598
+ /**
599
+ * Selects `length` cells from `column` of buffer line `row`, running on into the next rows. Does nothing
600
+ * before `open()` (xterm.js throws).
601
+ */
602
+ select(column: number, row: number, length: number): void;
603
+ /**
604
+ * Viewport-only mode (PRD M4): history older than this terminal's own `scrollback` is read from `provider` as
605
+ * the view scrolls to it. `null` turns it off. Set it again after a resize, with the host's new `length`.
606
+ */
607
+ setHistoryProvider(provider: IHistoryProvider | null): void;
608
+ /**
609
+ * `callback` runs once the engine has parsed `data`; `write('', callback)` waits for earlier writes.
610
+ */
611
+ write(data: any, callback?: Function | null): void;
612
+ writeln(data: any, callback?: Function | null): void;
613
+ /**
614
+ * xterm.js `term.buffer`; a new namespace object per read.
615
+ */
616
+ readonly buffer: BufferNamespace;
617
+ readonly cols: number;
618
+ /**
619
+ * Cell and canvas size, `undefined` before `open`.
620
+ */
621
+ readonly dimensions: IRenderDimensions | undefined;
622
+ readonly element: HTMLElement | undefined;
623
+ /**
624
+ * wongtty API: the kitty keyboard flags the program pushed, read from the engine like `modes` so they are current
625
+ * right after a write (0 while it pushed none or `vtExtensions.kittyKeyboard` is off).
626
+ */
627
+ readonly kittyKeyboardFlags: number;
628
+ /**
629
+ * The live markers of the active buffer, oldest first, like xterm.js.
630
+ */
631
+ readonly markers: ReadonlyArray<IMarker>;
632
+ /**
633
+ * A new object per read, like xterm.js. `reverseWraparoundMode` and `win32InputMode` are always false (the
634
+ * engine has neither).
635
+ */
636
+ readonly modes: IModes;
637
+ readonly onBell: IEvent<void>;
638
+ readonly onBinary: IEvent<string>;
639
+ readonly onCursorMove: IEvent<void>;
640
+ /**
641
+ * Input for the program (keys, paste) and replies to it (status reports).
642
+ */
643
+ readonly onData: IEvent<string>;
644
+ /**
645
+ * The cell size changed: after a font option, or when fonts finish loading (a loaded fit addon refits then).
646
+ */
647
+ readonly onDimensionsChange: IEvent<IRenderDimensions>;
648
+ readonly onRender: IEvent<{ start: number, end: number }>;
649
+ readonly onResize: IEvent<{ cols: number, rows: number }>;
650
+ /**
651
+ * The new viewport top line (`buffer.active.viewportY`).
652
+ */
653
+ readonly onScroll: IEvent<number>;
654
+ /**
655
+ * Fires when the selection changes: mouse selections when the button is released, the API, and clears by
656
+ * user input, a resize, a screen switch or a reset (not when trimming moves or drops it, like xterm.js).
657
+ */
658
+ readonly onSelectionChange: IEvent<void>;
659
+ readonly onTitleChange: IEvent<string>;
660
+ /**
661
+ * wongtty API: fires just before `onData` for keys, IME, paste and mouse reports, never for replies to the
662
+ * program.
663
+ */
664
+ readonly onUserInput: IEvent<void>;
665
+ readonly onWriteParsed: IEvent<void>;
666
+ /**
667
+ * `term.options.x = y` and `term.options = { … }` both go through `setOption`.
668
+ */
669
+ get options(): ProxyConstructor;
670
+ set options(value: object);
671
+ readonly parser: IParser;
672
+ readonly rows: number;
673
+ /**
674
+ * The hidden textarea that takes keyboard and IME input, set by `open`.
675
+ */
676
+ readonly textarea: HTMLTextAreaElement | undefined;
677
+ /**
678
+ * The engine measures widths with the Unicode 11 tables only.
679
+ */
680
+ readonly unicode: UnicodeHandling;
681
+ }
682
+
683
+ /**
684
+ * `terminal.unicode`: the engine measures widths with the Unicode 11 tables only.
685
+ */
686
+ export class UnicodeHandling {
687
+ private constructor();
688
+ free(): void;
689
+ [Symbol.dispose](): void;
690
+ /**
691
+ * Always `"11"`; setting another version throws.
692
+ */
693
+ activeVersion: string;
694
+ readonly versions: ReadonlyArray<string>;
695
+ }
696
+
697
+ /**
698
+ * `@xterm/addon-web-links`, built in: load it with `terminal.loadAddon(new WebLinksAddon(handler?, options?))`.
699
+ */
700
+ export class WebLinksAddon {
701
+ free(): void;
702
+ [Symbol.dispose](): void;
703
+ /**
704
+ * `terminal.loadAddon(webLinksAddon)` calls this: registers the URL provider.
705
+ */
706
+ activate(terminal: Terminal): void;
707
+ /**
708
+ * Removes the URL provider.
709
+ */
710
+ dispose(): void;
711
+ /**
712
+ * `handler` opens a link (a new window without an opener by default); `options.hover`/`leave` follow the mouse
713
+ * and `options.urlRegex` replaces the URL pattern.
714
+ */
715
+ constructor(handler?: (event: MouseEvent, uri: string) => void, options?: ILinkProviderOptions);
716
+ }
717
+
718
+ /**
719
+ * `@xterm/addon-webgl`, built in: the terminal already draws with WebGL2 (one context per page) and restores a lost
720
+ * context by itself. Loading this addon, or `@xterm/addon-webgl` itself, only keeps code written for xterm.js working.
721
+ */
722
+ export class WebglAddon {
723
+ free(): void;
724
+ [Symbol.dispose](): void;
725
+ activate(_terminal: Terminal): void;
726
+ /**
727
+ * Redraws the terminal the addon was loaded into in full (`loadAddon` binds it).
728
+ */
729
+ clearTextureAtlas(): void;
730
+ dispose(): void;
731
+ /**
732
+ * `preserveDrawingBuffer` is ignored: the renderer owns its context.
733
+ */
734
+ constructor(_preserve_drawing_buffer?: boolean | null);
735
+ /**
736
+ * Never fires: the renderer restores or replaces a lost context by itself.
737
+ */
738
+ onContextLoss(_listener: () => void): Disposable;
739
+ }
740
+
741
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
742
+
743
+ export interface InitOutput {
744
+ readonly memory: WebAssembly.Memory;
745
+ readonly __wbg_buffercell_free: (a: number, b: number) => void;
746
+ readonly __wbg_bufferline_free: (a: number, b: number) => void;
747
+ readonly __wbg_buffernamespace_free: (a: number, b: number) => void;
748
+ readonly __wbg_bufferview_free: (a: number, b: number) => void;
749
+ readonly __wbg_disposable_free: (a: number, b: number) => void;
750
+ readonly __wbg_fitaddon_free: (a: number, b: number) => void;
751
+ readonly __wbg_imageaddon_free: (a: number, b: number) => void;
752
+ readonly __wbg_marker_free: (a: number, b: number) => void;
753
+ readonly __wbg_parser_free: (a: number, b: number) => void;
754
+ readonly __wbg_searchaddon_free: (a: number, b: number) => void;
755
+ readonly __wbg_terminal_free: (a: number, b: number) => void;
756
+ readonly __wbg_unicodehandling_free: (a: number, b: number) => void;
757
+ readonly __wbg_webgladdon_free: (a: number, b: number) => void;
758
+ readonly __wbg_weblinksaddon_free: (a: number, b: number) => void;
759
+ readonly buffercell_getChars: (a: number, b: number) => void;
760
+ readonly buffercell_getCode: (a: number) => number;
761
+ readonly buffercell_getWidth: (a: number) => number;
762
+ readonly buffercell_isBlink: (a: number) => number;
763
+ readonly buffercell_isBold: (a: number) => number;
764
+ readonly buffercell_isDim: (a: number) => number;
765
+ readonly buffercell_isInverse: (a: number) => number;
766
+ readonly buffercell_isInvisible: (a: number) => number;
767
+ readonly buffercell_isItalic: (a: number) => number;
768
+ readonly buffercell_isStrikethrough: (a: number) => number;
769
+ readonly buffercell_isUnderline: (a: number) => number;
770
+ readonly bufferline_getCell: (a: number, b: number, c: number) => number;
771
+ readonly bufferline_is_wrapped: (a: number) => number;
772
+ readonly bufferline_length: (a: number) => number;
773
+ readonly bufferline_translateToString: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
774
+ readonly buffernamespace_active: (a: number) => number;
775
+ readonly buffernamespace_alternate: (a: number) => number;
776
+ readonly buffernamespace_normal: (a: number) => number;
777
+ readonly buffernamespace_on_buffer_change: (a: number) => number;
778
+ readonly bufferview_base_y: (a: number) => number;
779
+ readonly bufferview_cursor_x: (a: number) => number;
780
+ readonly bufferview_cursor_y: (a: number) => number;
781
+ readonly bufferview_getLine: (a: number, b: number) => number;
782
+ readonly bufferview_getNullCell: (a: number) => number;
783
+ readonly bufferview_kind: (a: number, b: number) => void;
784
+ readonly bufferview_length: (a: number) => number;
785
+ readonly bufferview_viewport_y: (a: number) => number;
786
+ readonly disposable_dispose: (a: number) => void;
787
+ readonly fitaddon___wongttyFitAddon: (a: number) => number;
788
+ readonly fitaddon_activate: (a: number, b: number) => void;
789
+ readonly fitaddon_dispose: (a: number) => void;
790
+ readonly fitaddon_fit: (a: number, b: number) => void;
791
+ readonly fitaddon_new: () => number;
792
+ readonly fitaddon_proposeDimensions: (a: number) => number;
793
+ readonly imageaddon___wongttyImageAddon: (a: number) => number;
794
+ readonly imageaddon_activate: (a: number, b: number) => void;
795
+ readonly imageaddon_dispose: (a: number) => void;
796
+ readonly imageaddon_handlers: (a: number) => number;
797
+ readonly imageaddon_new: (a: number) => number;
798
+ readonly imageaddon_on_image_added: (a: number) => number;
799
+ readonly imageaddon_reset: (a: number) => number;
800
+ readonly imageaddon_set_show_placeholder: (a: number, b: number) => void;
801
+ readonly imageaddon_set_storage_limit: (a: number, b: number, c: number) => void;
802
+ readonly imageaddon_show_placeholder: (a: number) => number;
803
+ readonly imageaddon_storage_limit: (a: number) => number;
804
+ readonly imageaddon_storage_usage: (a: number) => number;
805
+ readonly marker_dispose: (a: number) => void;
806
+ readonly marker_id: (a: number) => number;
807
+ readonly marker_is_disposed: (a: number) => number;
808
+ readonly marker_line: (a: number) => number;
809
+ readonly marker_on_dispose: (a: number) => number;
810
+ readonly parser_registerCsiHandler: (a: number, b: number, c: number, d: number) => void;
811
+ readonly parser_registerDcsHandler: (a: number, b: number, c: number, d: number) => void;
812
+ readonly parser_registerOscHandler: (a: number, b: number, c: number, d: number) => void;
813
+ readonly searchaddon___wongttySearchAddon: (a: number) => number;
814
+ readonly searchaddon_activate: (a: number, b: number) => void;
815
+ readonly searchaddon_clearActiveDecoration: (a: number) => void;
816
+ readonly searchaddon_clearDecorations: (a: number) => void;
817
+ readonly searchaddon_dispose: (a: number) => void;
818
+ readonly searchaddon_findNext: (a: number, b: number, c: number, d: number) => void;
819
+ readonly searchaddon_findPrevious: (a: number, b: number, c: number, d: number) => void;
820
+ readonly searchaddon_new: (a: number) => number;
821
+ readonly searchaddon_on_after_search: (a: number) => number;
822
+ readonly searchaddon_on_before_search: (a: number) => number;
823
+ readonly searchaddon_on_did_change_results: (a: number) => number;
824
+ readonly terminal__historyCacheSize: (a: number) => number;
825
+ readonly terminal__imageDebug: (a: number) => number;
826
+ readonly terminal__rendererDebug: (a: number) => number;
827
+ readonly terminal__setHighlights: (a: number, b: number, c: number, d: number) => void;
828
+ readonly terminal__setRendererSelection: (a: number, b: number) => void;
829
+ readonly terminal_ansiSnapshot: (a: number, b: number, c: number) => void;
830
+ readonly terminal_attachCustomKeyEventHandler: (a: number, b: number) => void;
831
+ readonly terminal_attachCustomWheelEventHandler: (a: number, b: number) => void;
832
+ readonly terminal_blur: (a: number) => void;
833
+ readonly terminal_buffer: (a: number) => number;
834
+ readonly terminal_clearSelection: (a: number) => void;
835
+ readonly terminal_cols: (a: number) => number;
836
+ readonly terminal_dimensions: (a: number) => number;
837
+ readonly terminal_dispose: (a: number) => void;
838
+ readonly terminal_element: (a: number) => number;
839
+ readonly terminal_focus: (a: number) => void;
840
+ readonly terminal_getSelection: (a: number, b: number) => void;
841
+ readonly terminal_getSelectionPosition: (a: number) => number;
842
+ readonly terminal_hasSelection: (a: number) => number;
843
+ readonly terminal_input: (a: number, b: number, c: number) => void;
844
+ readonly terminal_kitty_keyboard_flags: (a: number) => number;
845
+ readonly terminal_loadAddon: (a: number, b: number, c: number) => void;
846
+ readonly terminal_markers: (a: number) => number;
847
+ readonly terminal_modes: (a: number) => number;
848
+ readonly terminal_new: (a: number, b: number) => void;
849
+ readonly terminal_on_bell: (a: number) => number;
850
+ readonly terminal_on_binary: (a: number) => number;
851
+ readonly terminal_on_cursor_move: (a: number) => number;
852
+ readonly terminal_on_data: (a: number) => number;
853
+ readonly terminal_on_dimensions_change: (a: number) => number;
854
+ readonly terminal_on_render: (a: number) => number;
855
+ readonly terminal_on_resize: (a: number) => number;
856
+ readonly terminal_on_scroll: (a: number) => number;
857
+ readonly terminal_on_selection_change: (a: number) => number;
858
+ readonly terminal_on_title_change: (a: number) => number;
859
+ readonly terminal_on_user_input: (a: number) => number;
860
+ readonly terminal_on_write_parsed: (a: number) => number;
861
+ readonly terminal_open: (a: number, b: number, c: number) => void;
862
+ readonly terminal_options: (a: number, b: number) => void;
863
+ readonly terminal_parser: (a: number) => number;
864
+ readonly terminal_paste: (a: number, b: number, c: number) => void;
865
+ readonly terminal_refresh: (a: number, b: number, c: number) => void;
866
+ readonly terminal_registerLinkProvider: (a: number, b: number) => number;
867
+ readonly terminal_registerMarker: (a: number, b: number, c: number, d: number) => void;
868
+ readonly terminal_reset: (a: number) => void;
869
+ readonly terminal_resetKittyKeyboard: (a: number) => void;
870
+ readonly terminal_resize: (a: number, b: number, c: number, d: number) => void;
871
+ readonly terminal_rows: (a: number) => number;
872
+ readonly terminal_scrollLines: (a: number, b: number, c: number) => void;
873
+ readonly terminal_scrollPages: (a: number, b: number, c: number) => void;
874
+ readonly terminal_scrollToBottom: (a: number, b: number) => void;
875
+ readonly terminal_scrollToLine: (a: number, b: number, c: number) => void;
876
+ readonly terminal_scrollToTop: (a: number, b: number) => void;
877
+ readonly terminal_select: (a: number, b: number, c: number, d: number) => void;
878
+ readonly terminal_selectAll: (a: number) => void;
879
+ readonly terminal_selectLines: (a: number, b: number, c: number) => void;
880
+ readonly terminal_setHistoryProvider: (a: number, b: number, c: number) => void;
881
+ readonly terminal_set_options: (a: number, b: number, c: number) => void;
882
+ readonly terminal_textarea: (a: number) => number;
883
+ readonly terminal_unicode: (a: number) => number;
884
+ readonly terminal_write: (a: number, b: number, c: number) => void;
885
+ readonly terminal_writeln: (a: number, b: number, c: number) => void;
886
+ readonly unicodehandling_activeVersion: (a: number, b: number) => void;
887
+ readonly unicodehandling_set_activeVersion: (a: number, b: number, c: number) => void;
888
+ readonly unicodehandling_versions: (a: number) => number;
889
+ readonly webgladdon_activate: (a: number, b: number) => void;
890
+ readonly webgladdon_clearTextureAtlas: (a: number) => void;
891
+ readonly webgladdon_dispose: (a: number) => void;
892
+ readonly webgladdon_new: (a: number) => number;
893
+ readonly webgladdon_onContextLoss: (a: number, b: number) => number;
894
+ readonly weblinksaddon___wongttyWebLinksAddon: (a: number) => number;
895
+ readonly weblinksaddon_activate: (a: number, b: number) => void;
896
+ readonly weblinksaddon_dispose: (a: number) => void;
897
+ readonly weblinksaddon_new: (a: number, b: number) => number;
898
+ readonly __wasm_bindgen_func_elem_648: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
899
+ readonly __wasm_bindgen_func_elem_647: (a: number, b: number, c: number, d: number, e: number) => number;
900
+ readonly __wasm_bindgen_func_elem_651: (a: number, b: number, c: number, d: number, e: number) => number;
901
+ readonly __wasm_bindgen_func_elem_644: (a: number, b: number, c: number, d: number) => number;
902
+ readonly __wasm_bindgen_func_elem_644_151: (a: number, b: number, c: number, d: number) => number;
903
+ readonly __wasm_bindgen_func_elem_653: (a: number, b: number, c: number, d: number) => number;
904
+ readonly __wasm_bindgen_func_elem_2801: (a: number, b: number, c: number, d: number) => void;
905
+ readonly __wasm_bindgen_func_elem_2817: (a: number, b: number, c: number, d: number) => void;
906
+ readonly __wasm_bindgen_func_elem_645: (a: number, b: number, c: number) => number;
907
+ readonly __wasm_bindgen_func_elem_655: (a: number, b: number, c: number) => number;
908
+ readonly __wasm_bindgen_func_elem_646: (a: number, b: number, c: number) => void;
909
+ readonly __wasm_bindgen_func_elem_646_149: (a: number, b: number, c: number) => void;
910
+ readonly __wasm_bindgen_func_elem_657: (a: number, b: number, c: number) => void;
911
+ readonly __wasm_bindgen_func_elem_657_148: (a: number, b: number, c: number) => void;
912
+ readonly __wasm_bindgen_func_elem_657_150: (a: number, b: number, c: number) => void;
913
+ readonly __wasm_bindgen_func_elem_649: (a: number, b: number) => void;
914
+ readonly __wasm_bindgen_func_elem_659: (a: number, b: number) => void;
915
+ readonly __wbindgen_export: (a: number) => void;
916
+ readonly __wbindgen_export2: (a: number, b: number) => number;
917
+ readonly __wbindgen_export3: (a: number, b: number, c: number, d: number) => number;
918
+ readonly __wbindgen_export4: (a: number, b: number) => void;
919
+ readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
920
+ readonly __wbindgen_export5: (a: number, b: number, c: number) => void;
921
+ }
922
+
923
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
924
+
925
+ /**
926
+ * Instantiates the given `module`, which can either be bytes or
927
+ * a precompiled `WebAssembly.Module`.
928
+ *
929
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
930
+ *
931
+ * @returns {InitOutput}
932
+ */
933
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
934
+
935
+ /**
936
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
937
+ * for everything else, calls `WebAssembly.instantiate` directly.
938
+ *
939
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
940
+ *
941
+ * @returns {Promise<InitOutput>}
942
+ */
943
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;