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.
- package/LICENSE-APACHE +201 -0
- package/README.md +68 -2
- package/THIRD_PARTY_NOTICES.md +264 -0
- package/dist/index.d.ts +326 -0
- package/dist/index.js +866 -0
- package/dist/wongtty.wasm +0 -0
- package/dist/xterm.d.ts +6 -0
- package/dist/xterm.js +32 -0
- package/dist/xterm_web.d.ts +943 -0
- package/dist/xterm_web.js +4063 -0
- package/dist/xterm_web_bg.wasm +0 -0
- package/dist/xterm_web_bg.wasm.d.ts +179 -0
- package/package.json +67 -4
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
/** Loads the WebAssembly module once. Defaults to the bundled `wongtty.wasm`. */
|
|
2
|
+
export function init(
|
|
3
|
+
source?: URL | string | ArrayBuffer | ArrayBufferView | WebAssembly.Module | Response,
|
|
4
|
+
): Promise<void>;
|
|
5
|
+
|
|
6
|
+
export interface TerminalOptions {
|
|
7
|
+
cols?: number;
|
|
8
|
+
rows?: number;
|
|
9
|
+
/** Lines of history to keep (default 1000, max 100000). */
|
|
10
|
+
scrollback?: number;
|
|
11
|
+
/** End a synchronized update the program never ended after this many ms (default 1000, as xterm.js). */
|
|
12
|
+
syncTimeoutMs?: number;
|
|
13
|
+
/** Called after such a timed end, so the renderer can redraw. */
|
|
14
|
+
onSyncFlush?: () => void;
|
|
15
|
+
/**
|
|
16
|
+
* Called when the engine crashed (a trap in the shared WebAssembly
|
|
17
|
+
* instance) and this terminal started over empty at the same size. The
|
|
18
|
+
* call that hit the crash throws; the terminal works again afterwards.
|
|
19
|
+
*/
|
|
20
|
+
onCrash?: (error: Error) => void;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface Cursor {
|
|
24
|
+
/** Screen line; while scrolled back it is drawn on viewport row `line + displayOffset`. */
|
|
25
|
+
line: number;
|
|
26
|
+
col: number;
|
|
27
|
+
visible: boolean;
|
|
28
|
+
/** Set by the program with DECSCUSR (`CSI Ps SP q`). */
|
|
29
|
+
shape: 'block' | 'underline' | 'bar';
|
|
30
|
+
blink: boolean;
|
|
31
|
+
/** The program chose `shape` and `blink`; when false they are the host's (`setCursorDefault`, block and steady by default). */
|
|
32
|
+
styled: boolean;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface Damage {
|
|
36
|
+
/** Redraw everything; `scroll` is 0 and `lines` is empty. */
|
|
37
|
+
full: boolean;
|
|
38
|
+
/** Move drawn rows up by this many first (the top ones fall off). */
|
|
39
|
+
scroll: number;
|
|
40
|
+
/** Viewport rows to redraw after scrolling, top to bottom. */
|
|
41
|
+
lines: number[];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface Hyperlink {
|
|
45
|
+
/** Shared by every cell of one link (generated when the program gave none). */
|
|
46
|
+
id: string;
|
|
47
|
+
uri: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** What a cell carries beyond `rowCells`. */
|
|
51
|
+
export interface CellExtra {
|
|
52
|
+
col: number;
|
|
53
|
+
/** Full cell text when it has combining marks. */
|
|
54
|
+
text?: string;
|
|
55
|
+
/** Underline colour (SGR 58), packed like `rowCells` colours. */
|
|
56
|
+
underlineColor?: number;
|
|
57
|
+
/** OSC 8 hyperlink; cells of one link share the same object. */
|
|
58
|
+
hyperlink?: Hyperlink;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* `payload` written to a fresh xterm.js of the same size and scrollback
|
|
63
|
+
* rebuilds this screen; it ends with the unfinished escape sequence or UTF-8
|
|
64
|
+
* character the output stopped in. During a synchronized update `CSI ? 2026 h`
|
|
65
|
+
* comes before that unfinished end, so the receiver is inside the same update.
|
|
66
|
+
* On refusal replay the raw output instead.
|
|
67
|
+
*/
|
|
68
|
+
export type AnsiSnapshot =
|
|
69
|
+
| { ok: true; payload: Uint8Array }
|
|
70
|
+
/** `"unsupported-wide-edge"`, `"margins"` or `"partial-tail-overflow"`. */
|
|
71
|
+
| { ok: false; reason: string };
|
|
72
|
+
|
|
73
|
+
/** A hooked sequence parsing stopped at, before its default action (`Terminal.writeUntilHook`). */
|
|
74
|
+
export interface Hook {
|
|
75
|
+
kind: 'csi' | 'osc' | 'dcs';
|
|
76
|
+
/** As given to `setHook`. */
|
|
77
|
+
id: number;
|
|
78
|
+
/**
|
|
79
|
+
* CSI and DCS parameters, each followed by its sub-parameters (an empty parameter is 0 and an empty sub-parameter
|
|
80
|
+
* -1, as in xterm.js; values stop at 65535).
|
|
81
|
+
*/
|
|
82
|
+
params: number[][];
|
|
83
|
+
/** OSC: everything after the first `;`. DCS: the payload. */
|
|
84
|
+
data: Uint8Array;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** How `searchNext` and friends compare text. */
|
|
88
|
+
export interface SearchOptions {
|
|
89
|
+
/**
|
|
90
|
+
* Off: matched with the RegExp `i` flag, but by `searchRows` of a plain ASCII query, which the engine matches
|
|
91
|
+
* with each line lowercased as the N-API binding does (U+212A KELVIN SIGN reads as `k`, U+0130 as `i` + U+0307).
|
|
92
|
+
*/
|
|
93
|
+
caseSensitive?: boolean;
|
|
94
|
+
/** A match needs a non-word character (`@xterm/addon-search`'s set, so not `_`) or a line end on both sides. */
|
|
95
|
+
wholeWord?: boolean;
|
|
96
|
+
/** `query` is a JavaScript regular expression (flag `g`); otherwise it is matched as plain text. Regular
|
|
97
|
+
* expressions, and plain queries but for `searchRows` of an ASCII one, are matched in JS over each logical line's
|
|
98
|
+
* text (`searchLine`). */
|
|
99
|
+
regex?: boolean;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** A match in cells: lines as in `rowText`, end exclusive and on `endLine` (`endCol` is 1…cols). */
|
|
103
|
+
export interface SearchMatch {
|
|
104
|
+
startLine: number;
|
|
105
|
+
startCol: number;
|
|
106
|
+
endLine: number;
|
|
107
|
+
endCol: number;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/** A logical line as search reads it: rows joined across soft wraps, blanks as spaces, empty cells at the end dropped. */
|
|
111
|
+
export interface SearchLine {
|
|
112
|
+
/** Its first row. */
|
|
113
|
+
first: number;
|
|
114
|
+
rows: number;
|
|
115
|
+
text: string;
|
|
116
|
+
/** The cell of each UTF-16 unit of `text`: `row * cols + col` from `first`, bit 31 set for a wide character. */
|
|
117
|
+
cells: Uint32Array;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/** What `ansiSnapshot` leaves out, like `@xterm/addon-serialize`'s `serialize` options. */
|
|
121
|
+
export interface AnsiSnapshotOptions {
|
|
122
|
+
/** Keep only the newest this many history lines (0: the screen alone). All of them by default. */
|
|
123
|
+
scrollback?: number;
|
|
124
|
+
/**
|
|
125
|
+
* Leave out the modes (cursor keys, keypad, mouse, focus reports, bracketed paste, insert, origin, autowrap off,
|
|
126
|
+
* cursor visibility) and what continues the output (the unfinished sequence at the end, a synchronized update in
|
|
127
|
+
* progress), so the bytes only paint the screen. Scroll margins are then not refused.
|
|
128
|
+
*/
|
|
129
|
+
excludeModes?: boolean;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export class Terminal {
|
|
133
|
+
constructor(options?: TerminalOptions);
|
|
134
|
+
/** Feeds program output. Strings are encoded as UTF-8. */
|
|
135
|
+
write(data: string | Uint8Array): void;
|
|
136
|
+
resize(cols: number, rows: number): void;
|
|
137
|
+
readonly cols: number;
|
|
138
|
+
readonly rows: number;
|
|
139
|
+
/** Scrollback lines; address them as rows -1 (newest) … -historyLength (oldest). */
|
|
140
|
+
readonly historyLength: number;
|
|
141
|
+
/**
|
|
142
|
+
* Lines that have left the top of the scrollback so far (a full history dropping its oldest, ED3, RIS), like
|
|
143
|
+
* xterm.js `onTrim` summed up. History row `-k` is line `trimmedLines + historyLength - k` counted from the first
|
|
144
|
+
* line ever kept, until a resize reflows the history.
|
|
145
|
+
*/
|
|
146
|
+
readonly trimmedLines: number;
|
|
147
|
+
rowText(line: number): string | null;
|
|
148
|
+
/**
|
|
149
|
+
* `translateToString(trimRight)` of lines `first`…`last` (clamped to the buffer; by default all of it), each
|
|
150
|
+
* followed by `\n`, in one call. `trimRight` defaults to true.
|
|
151
|
+
*/
|
|
152
|
+
textRows(first?: number, last?: number, trimRight?: boolean): string;
|
|
153
|
+
/** `[codepoint, fg, bg, attrs]` per cell. */
|
|
154
|
+
rowCells(line: number): Uint32Array | null;
|
|
155
|
+
/**
|
|
156
|
+
* Like `rowCells`, but a view into WebAssembly memory instead of a copy:
|
|
157
|
+
* valid only until the next call into any terminal. For renderers that read
|
|
158
|
+
* every visible row each frame.
|
|
159
|
+
*/
|
|
160
|
+
rowCellsView(line: number): Uint32Array | null;
|
|
161
|
+
rowWrapped(line: number): boolean;
|
|
162
|
+
/** Cell text including combining marks. */
|
|
163
|
+
cellText(line: number, col: number): string | null;
|
|
164
|
+
/** Cells with combining marks, an underline colour or a hyperlink (see `Attr`). */
|
|
165
|
+
rowExtras(line: number): CellExtra[] | null;
|
|
166
|
+
cursor(): Cursor;
|
|
167
|
+
/** Rows the view is scrolled back into history (0 = following output). Viewport row `y` is line `y - displayOffset`. */
|
|
168
|
+
readonly displayOffset: number;
|
|
169
|
+
/** Positive `delta` scrolls back into history; clamped. Damage becomes full when the view moves. */
|
|
170
|
+
scrollDisplay(delta: number): void;
|
|
171
|
+
scrollToBottom(): void;
|
|
172
|
+
/** Bitwise OR of {@link Mode} values. */
|
|
173
|
+
modes(): number;
|
|
174
|
+
/** Lets the program use the kitty keyboard protocol (off by default, its sequences ignored); switching drops the flags it pushed. */
|
|
175
|
+
setKittyKeyboard(enabled: boolean): void;
|
|
176
|
+
/** Drops the kitty keyboard flags the program pushed on both screens, keeping the protocol on or off. */
|
|
177
|
+
resetKittyKeyboard(): void;
|
|
178
|
+
/** Active kitty keyboard flags: 1 disambiguate, 2 event types, 4 alternate keys, 8 all keys as escapes, 16 associated text. */
|
|
179
|
+
kittyFlags(): number;
|
|
180
|
+
/**
|
|
181
|
+
* The host's focus, for the report (`CSI I` or `CSI O`) that joins the replies, in order, each time the program turns
|
|
182
|
+
* on focus events (`CSI ? 1004 h`); `null`, the default, sends none. Kept across a crash.
|
|
183
|
+
*/
|
|
184
|
+
setFocus(focused: boolean | null): void;
|
|
185
|
+
/**
|
|
186
|
+
* The host's cursor style (xterm.js `cursorStyle` and `cursorBlink`; block, steady by default): `cursor()` reports it
|
|
187
|
+
* until the program sets one, and DECRQSS (`DCS $ q SP q ST`) reports it, as xterm.js does. Kept across a crash.
|
|
188
|
+
*/
|
|
189
|
+
setCursorDefault(shape: 'block' | 'underline' | 'bar', blink: boolean): void;
|
|
190
|
+
takeDamage(): Damage;
|
|
191
|
+
/** Bytes to write back to the PTY (status reports, …). */
|
|
192
|
+
takeReplies(): Uint8Array;
|
|
193
|
+
/** The same replies one by one, in order: xterm.js fires one `onData` per reply. */
|
|
194
|
+
takeReplyList(): Uint8Array[];
|
|
195
|
+
/** New window title, or null if unchanged ("" = reset). */
|
|
196
|
+
takeTitle(): string | null;
|
|
197
|
+
takeBells(): number;
|
|
198
|
+
/** Full resets (RIS, `ESC c`) the program sent since the last call, so the host can drop its own screen state (selection). */
|
|
199
|
+
takeResets(): number;
|
|
200
|
+
/** Lets the program read and/or write the host clipboards with OSC 52 (both off by default). */
|
|
201
|
+
setClipboardAccess(access?: { read?: boolean; write?: boolean }): void;
|
|
202
|
+
/** Oldest text the program asked to copy, or null. */
|
|
203
|
+
takeClipboardWrite(): { selection: 'c' | 'p'; text: string } | null;
|
|
204
|
+
/** Oldest clipboard the program asked to read, or null. Answer it with replyClipboard. */
|
|
205
|
+
takeClipboardRead(): 'c' | 'p' | null;
|
|
206
|
+
/** Answers the oldest read of `selection`; the reply joins takeReplies(). False if none is waiting. */
|
|
207
|
+
replyClipboard(selection: 'c' | 'p', text: string): boolean;
|
|
208
|
+
/** Colours (0xRRGGBB, COLOR_SLOTS of them: palette 0–255, foreground, background, cursor) that answer OSC 4/10/11/12 queries; null stops answering. */
|
|
209
|
+
setColors(colors: ArrayLike<number> | null): void;
|
|
210
|
+
/**
|
|
211
|
+
* A synchronized update (`CSI ? 2026 h`) is open. Its output is applied at once, as in xterm.js; a renderer
|
|
212
|
+
* holds its frames (does not take damage) until it ends.
|
|
213
|
+
*/
|
|
214
|
+
syncPending(): boolean;
|
|
215
|
+
/** Ends a synchronized update, as its timeout does. False while a hook is pending (see `writeUntilHook`). */
|
|
216
|
+
flushSync(): boolean;
|
|
217
|
+
/**
|
|
218
|
+
* Stops parsing at sequences of `kind` with `id`, or no longer does (`on` false). For CSI and DCS the id is the
|
|
219
|
+
* intermediates (a private marker such as `?` first) and final byte, one byte each from the most significant;
|
|
220
|
+
* for OSC the number before the first `;`. `write` runs their default action as usual.
|
|
221
|
+
*/
|
|
222
|
+
setHook(kind: 'csi' | 'osc' | 'dcs', id: number, on: boolean): void;
|
|
223
|
+
/**
|
|
224
|
+
* Like `write`, but stops right after a hooked sequence, before its default action. True when all of `data` was
|
|
225
|
+
* parsed; false when stopped: read `pendingHook()`, run or skip the default with `finishHook()`, then `resume()`.
|
|
226
|
+
* Throws until then.
|
|
227
|
+
*/
|
|
228
|
+
writeUntilHook(data: string | Uint8Array): boolean;
|
|
229
|
+
pendingHook(): Hook | null;
|
|
230
|
+
/** Runs the pending hook's default action (`runDefault`) or skips it; `resume()` parses on. */
|
|
231
|
+
finishHook(runDefault: boolean): void;
|
|
232
|
+
/** Parses the rest of the stopped write (or flush) after `finishHook`; false when it stopped at the next hook. */
|
|
233
|
+
resume(): boolean;
|
|
234
|
+
/**
|
|
235
|
+
* Behaves as xterm.js 6.1 does with `windowsPty` (none by default): with a backend or build, more rows are added
|
|
236
|
+
* blank at the bottom instead of bringing scrollback back; with a build that is not conpty 21376 or later,
|
|
237
|
+
* resizing does not reflow; with conpty before 21376, a line feed or `CSI H` marks the cursor row as continuing
|
|
238
|
+
* the row above when that row ends in a non-blank cell.
|
|
239
|
+
*/
|
|
240
|
+
setWindowsPty(pty: { backend?: 'conpty' | 'winpty'; buildNumber?: number } | null | undefined): void;
|
|
241
|
+
/**
|
|
242
|
+
* The first match of `query` starting at or after cell (`line`, `col`), down to the bottom of the screen (no
|
|
243
|
+
* wrap-around). Defaults to the top of the history. Matches never span logical lines (rows joined by soft wraps).
|
|
244
|
+
* Ignoring case, it folds as the RegExp `i` flag does, not as `searchRows` of a plain ASCII query: a match on
|
|
245
|
+
* U+212A or U+0130 that `searchRows` finds is skipped here (`SearchOptions.caseSensitive`).
|
|
246
|
+
*/
|
|
247
|
+
searchNext(query: string, options?: SearchOptions, line?: number, col?: number): SearchMatch | null;
|
|
248
|
+
/** The last match ending at or before cell (`line`, `col`), up to the top of the history. Defaults to the end of the screen. */
|
|
249
|
+
searchPrevious(query: string, options?: SearchOptions, line?: number, col?: number): SearchMatch | null;
|
|
250
|
+
/** Every match in the logical lines rows `first`…`last` belong to (each search goes on from the end of the previous match), keeping those that touch the rows. */
|
|
251
|
+
searchRows(query: string, options: SearchOptions | undefined, first: number, last: number): SearchMatch[];
|
|
252
|
+
/**
|
|
253
|
+
* The engine's matching of a plain `query` over rows `first`…`last` (`searchRows` without `regex`): at most
|
|
254
|
+
* `limit` matches as `[startLine, startCol, endLine, endCol]` each, a view into WebAssembly memory valid only until
|
|
255
|
+
* the next call into any terminal. Null for a query that is not ASCII and, with `keepLength`, when a line with a
|
|
256
|
+
* match holds U+0130 (İ), which lowercases to two characters (for hosts that lowercase whole lines themselves).
|
|
257
|
+
*/
|
|
258
|
+
searchRowsView(
|
|
259
|
+
query: string,
|
|
260
|
+
options: { caseSensitive?: boolean; wholeWord?: boolean; keepLength?: boolean } | undefined,
|
|
261
|
+
first: number,
|
|
262
|
+
last: number,
|
|
263
|
+
limit?: number,
|
|
264
|
+
): Int32Array | null;
|
|
265
|
+
/** The logical line row `line` belongs to, as search reads it, for matching the text yourself; null outside the buffer. */
|
|
266
|
+
searchLine(line: number): SearchLine | null;
|
|
267
|
+
/**
|
|
268
|
+
* Puts a marker on buffer line `line` of the screen that is up (0 is the oldest history line, `historyLength` the
|
|
269
|
+
* top screen row) and returns its id; 0 outside the buffer. The marker follows its line as output scrolls it into
|
|
270
|
+
* the history and as scroll regions, IL and DL move it; it is dropped when its line leaves the scrollback or is
|
|
271
|
+
* cleared whole (ED, a line IL or DL pushed out, RIS), and with the alternate screen when that is left. A resize
|
|
272
|
+
* keeps it on its logical line.
|
|
273
|
+
*/
|
|
274
|
+
addMarker(line: number): number;
|
|
275
|
+
/** The marker's buffer line on its screen, -1 once it is gone. */
|
|
276
|
+
markerLine(id: number): number;
|
|
277
|
+
/** Drops a marker; it is not reported by `takeDisposedMarkers`. */
|
|
278
|
+
removeMarker(id: number): void;
|
|
279
|
+
/** Markers the engine dropped since the last call. */
|
|
280
|
+
takeDisposedMarkers(): number[];
|
|
281
|
+
/**
|
|
282
|
+
* Covers `cols` × `rows` cells with the tiles of image `id` (a host that keeps the pixels, as @xterm/addon-image):
|
|
283
|
+
* from the cursor, feeding lines as needed, or with `scrolling: false` from the top left of the screen with the
|
|
284
|
+
* cursor staying. The cursor ends on the last row, at the image's left column (`'vt340'`) or right of it
|
|
285
|
+
* (`'iip'`). Columns past the right edge are cut off. Returns the tiles written and the image id of each tile it
|
|
286
|
+
* covered. Text or an erase over a cell removes its tile; tiles scroll and leave with their lines.
|
|
287
|
+
*/
|
|
288
|
+
placeImage(id: number, cols: number, rows: number, options?: { scrolling?: boolean; cursor?: 'vt340' | 'iip' }): { tiles: number; covered: number[] };
|
|
289
|
+
/** `[col, id, tile]` per cell of the row an image tile covers (`tile` is `row * cols + col` in the image), or null if out of range. */
|
|
290
|
+
rowImages(line: number): Uint32Array | null;
|
|
291
|
+
/** `[fg, bg, attrs]` that text written now gets, packed like `rowCells`. */
|
|
292
|
+
pen(): Uint32Array;
|
|
293
|
+
/**
|
|
294
|
+
* Does not change the terminal, so it is safe while a renderer draws it; two calls give the same bytes.
|
|
295
|
+
* `{ scrollback: 0, excludeModes: true }` paints just the screen it shows (a cold frame).
|
|
296
|
+
*/
|
|
297
|
+
ansiSnapshot(options?: AnsiSnapshotOptions): AnsiSnapshot;
|
|
298
|
+
dispose(): void;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/** Entries `setColors` takes: palette 0–255, then foreground, background, cursor. */
|
|
302
|
+
export declare const COLOR_SLOTS: 259;
|
|
303
|
+
export declare const Attr: Readonly<{
|
|
304
|
+
BOLD: number; DIM: number; ITALIC: number; UNDERLINE: number;
|
|
305
|
+
DOUBLE_UNDERLINE: number; CURLY_UNDERLINE: number; DOTTED_UNDERLINE: number; DASHED_UNDERLINE: number;
|
|
306
|
+
INVERSE: number; HIDDEN: number; STRIKEOUT: number; BLINK: number;
|
|
307
|
+
WIDE: number; WIDE_SPACER: number; COMBINING: number; UNDERLINE_COLOR: number; HYPERLINK: number;
|
|
308
|
+
/** Blank end of a wrapped row whose wide character moved to the next row; not text. */
|
|
309
|
+
LEADING_WIDE_SPACER: number;
|
|
310
|
+
/** A space the program printed. Other blanks were erased or never written (xterm.js empty cells). */
|
|
311
|
+
TYPED_SPACE: number;
|
|
312
|
+
/** An image tile covers the cell; see `rowImages`. */
|
|
313
|
+
IMAGE: number;
|
|
314
|
+
}>;
|
|
315
|
+
|
|
316
|
+
export declare const Mode: Readonly<{
|
|
317
|
+
SHOW_CURSOR: number; APP_CURSOR: number; APP_KEYPAD: number; BRACKETED_PASTE: number;
|
|
318
|
+
MOUSE_CLICK: number; MOUSE_DRAG: number; MOUSE_MOTION: number; SGR_MOUSE: number;
|
|
319
|
+
FOCUS_EVENTS: number; ALT_SCREEN: number; ALTERNATE_SCROLL: number; LINE_WRAP: number;
|
|
320
|
+
INSERT: number; ORIGIN: number; KITTY_KEYBOARD: number; MOUSE_X10: number; SGR_PIXELS_MOUSE: number;
|
|
321
|
+
}>;
|
|
322
|
+
|
|
323
|
+
export declare const ColorKind: Readonly<{ NAMED: 1; INDEXED: 2; RGB: 3 }>;
|
|
324
|
+
|
|
325
|
+
/** Named: 0–15 ANSI, 256 default fg, 257 default bg. Indexed: 0–255. RGB: 0xRRGGBB. */
|
|
326
|
+
export function decodeColor(packed: number): { kind: 'named' | 'indexed' | 'rgb'; value: number };
|