@trismegisto/terminal 3.3.13 → 3.4.0
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/README.md +12 -0
- package/dist/addons/attach.d.ts +16 -0
- package/dist/addons/attach.js +58 -0
- package/dist/addons/attach.js.map +1 -0
- package/dist/addons/clipboard.d.ts +31 -0
- package/dist/addons/clipboard.js +77 -0
- package/dist/addons/clipboard.js.map +1 -0
- package/dist/addons/fit.d.ts +19 -0
- package/dist/addons/fit.js +69 -0
- package/dist/addons/fit.js.map +1 -0
- package/dist/addons/image/iip.d.ts +38 -0
- package/dist/addons/image/iip.js +158 -0
- package/dist/addons/image/iip.js.map +1 -0
- package/dist/addons/image/index.d.ts +91 -0
- package/dist/addons/image/index.js +783 -0
- package/dist/addons/image/index.js.map +1 -0
- package/dist/addons/image/kitty.d.ts +57 -0
- package/dist/addons/image/kitty.js +92 -0
- package/dist/addons/image/kitty.js.map +1 -0
- package/dist/addons/image/qoi.d.ts +5 -0
- package/dist/addons/image/qoi.js +70 -0
- package/dist/addons/image/qoi.js.map +1 -0
- package/dist/addons/image/sixel.d.ts +30 -0
- package/dist/addons/image/sixel.js +251 -0
- package/dist/addons/image/sixel.js.map +1 -0
- package/dist/addons/image/storage.d.ts +68 -0
- package/dist/addons/image/storage.js +87 -0
- package/dist/addons/image/storage.js.map +1 -0
- package/dist/addons/ligatures.d.ts +17 -0
- package/dist/addons/ligatures.js +66 -0
- package/dist/addons/ligatures.js.map +1 -0
- package/dist/addons/program-status.d.ts +32 -0
- package/dist/addons/program-status.js +196 -0
- package/dist/addons/program-status.js.map +1 -0
- package/dist/addons/progress.d.ts +21 -0
- package/dist/addons/progress.js +56 -0
- package/dist/addons/progress.js.map +1 -0
- package/dist/addons/search.d.ts +46 -0
- package/dist/addons/search.js +188 -0
- package/dist/addons/search.js.map +1 -0
- package/dist/addons/serialize.d.ts +35 -0
- package/dist/addons/serialize.js +313 -0
- package/dist/addons/serialize.js.map +1 -0
- package/dist/addons/unicode.d.ts +19 -0
- package/dist/addons/unicode.js +44 -0
- package/dist/addons/unicode.js.map +1 -0
- package/dist/addons/web-fonts.d.ts +22 -0
- package/dist/addons/web-fonts.js +88 -0
- package/dist/addons/web-fonts.js.map +1 -0
- package/dist/addons/web-links.d.ts +22 -0
- package/dist/addons/web-links.js +89 -0
- package/dist/addons/web-links.js.map +1 -0
- package/dist/addons/webgl/atlas.d.ts +57 -0
- package/dist/addons/webgl/atlas.js +90 -0
- package/dist/addons/webgl/atlas.js.map +1 -0
- package/dist/addons/webgl/box.d.ts +12 -0
- package/dist/addons/webgl/box.js +105 -0
- package/dist/addons/webgl/box.js.map +1 -0
- package/dist/addons/webgl/frame-model.d.ts +28 -0
- package/dist/addons/webgl/frame-model.js +105 -0
- package/dist/addons/webgl/frame-model.js.map +1 -0
- package/dist/addons/webgl/gl-renderer.d.ts +24 -0
- package/dist/addons/webgl/gl-renderer.js +211 -0
- package/dist/addons/webgl/gl-renderer.js.map +1 -0
- package/dist/addons/webgl/webgl-addon.d.ts +42 -0
- package/dist/addons/webgl/webgl-addon.js +185 -0
- package/dist/addons/webgl/webgl-addon.js.map +1 -0
- package/dist/core/attributes.d.ts +53 -0
- package/dist/core/attributes.js +75 -0
- package/dist/core/attributes.js.map +1 -0
- package/dist/core/buffer-line.d.ts +55 -0
- package/dist/core/buffer-line.js +242 -0
- package/dist/core/buffer-line.js.map +1 -0
- package/dist/core/buffer.d.ts +74 -0
- package/dist/core/buffer.js +277 -0
- package/dist/core/buffer.js.map +1 -0
- package/dist/core/charsets.d.ts +8 -0
- package/dist/core/charsets.js +79 -0
- package/dist/core/charsets.js.map +1 -0
- package/dist/core/circular-list.d.ts +22 -0
- package/dist/core/circular-list.js +84 -0
- package/dist/core/circular-list.js.map +1 -0
- package/dist/core/colors.d.ts +25 -0
- package/dist/core/colors.js +111 -0
- package/dist/core/colors.js.map +1 -0
- package/dist/core/event.d.ts +19 -0
- package/dist/core/event.js +39 -0
- package/dist/core/event.js.map +1 -0
- package/dist/core/index.d.ts +11 -0
- package/dist/core/index.js +13 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/keyboard.d.ts +76 -0
- package/dist/core/keyboard.js +249 -0
- package/dist/core/keyboard.js.map +1 -0
- package/dist/core/parser.d.ts +73 -0
- package/dist/core/parser.js +483 -0
- package/dist/core/parser.js.map +1 -0
- package/dist/core/terminal-core.d.ts +314 -0
- package/dist/core/terminal-core.js +1514 -0
- package/dist/core/terminal-core.js.map +1 -0
- package/dist/core/unicode.d.ts +36 -0
- package/dist/core/unicode.js +185 -0
- package/dist/core/unicode.js.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.js +30 -0
- package/dist/index.js.map +1 -0
- package/dist/terminal/buffer-api.d.ts +59 -0
- package/dist/terminal/buffer-api.js +174 -0
- package/dist/terminal/buffer-api.js.map +1 -0
- package/dist/terminal/glyphs.d.ts +7 -0
- package/dist/terminal/glyphs.js +135 -0
- package/dist/terminal/glyphs.js.map +1 -0
- package/dist/terminal/i18n/terminal-catalogs.d.ts +15 -0
- package/dist/terminal/i18n/terminal-catalogs.js +22 -0
- package/dist/terminal/i18n/terminal-catalogs.js.map +1 -0
- package/dist/terminal/i18n/terminal-messages.d.ts +32 -0
- package/dist/terminal/i18n/terminal-messages.en.d.ts +2 -0
- package/dist/terminal/i18n/terminal-messages.en.js +23 -0
- package/dist/terminal/i18n/terminal-messages.en.js.map +1 -0
- package/dist/terminal/i18n/terminal-messages.es.d.ts +2 -0
- package/dist/terminal/i18n/terminal-messages.es.js +23 -0
- package/dist/terminal/i18n/terminal-messages.es.js.map +1 -0
- package/dist/terminal/i18n/terminal-messages.js +23 -0
- package/dist/terminal/i18n/terminal-messages.js.map +1 -0
- package/dist/terminal/renderer.d.ts +120 -0
- package/dist/terminal/renderer.js +585 -0
- package/dist/terminal/renderer.js.map +1 -0
- package/dist/terminal/styles.d.ts +2 -0
- package/dist/terminal/styles.js +117 -0
- package/dist/terminal/styles.js.map +1 -0
- package/dist/terminal/terminal-messages.d.ts +2 -0
- package/dist/terminal/terminal-messages.js +5 -0
- package/dist/terminal/terminal-messages.js.map +1 -0
- package/dist/terminal/terminal-view.d.ts +118 -0
- package/dist/terminal/terminal-view.js +388 -0
- package/dist/terminal/terminal-view.js.map +1 -0
- package/dist/terminal/terminal.d.ts +198 -0
- package/dist/terminal/terminal.js +1468 -0
- package/dist/terminal/terminal.js.map +1 -0
- package/dist/terminal/token-theme.d.ts +12 -0
- package/dist/terminal/token-theme.js +66 -0
- package/dist/terminal/token-theme.js.map +1 -0
- package/dist/terminal/types.d.ts +364 -0
- package/dist/terminal/types.js +2 -0
- package/dist/terminal/types.js.map +1 -0
- package/package.json +31 -23
- package/fesm2022/trismegisto-terminal.mjs +0 -9717
- package/fesm2022/trismegisto-terminal.mjs.map +0 -1
- package/types/trismegisto-terminal.d.ts +0 -1952
- package/types/trismegisto-terminal.d.ts.map +0 -1
|
@@ -1,1952 +0,0 @@
|
|
|
1
|
-
import * as _trismegisto_terminal from '@trismegisto/terminal';
|
|
2
|
-
import * as _angular_core from '@angular/core';
|
|
3
|
-
import { InjectionToken, Provider } from '@angular/core';
|
|
4
|
-
import { CatalogOverride } from '@trismegisto/primitives/messages';
|
|
5
|
-
|
|
6
|
-
declare const ColorMode: {
|
|
7
|
-
readonly DEFAULT: 0;
|
|
8
|
-
readonly P16: 1;
|
|
9
|
-
readonly P256: 2;
|
|
10
|
-
readonly RGB: 3;
|
|
11
|
-
};
|
|
12
|
-
type ColorMode = (typeof ColorMode)[keyof typeof ColorMode];
|
|
13
|
-
declare const Flags: {
|
|
14
|
-
readonly BOLD: number;
|
|
15
|
-
readonly DIM: number;
|
|
16
|
-
readonly ITALIC: number;
|
|
17
|
-
readonly UNDERLINE: number;
|
|
18
|
-
readonly BLINK: number;
|
|
19
|
-
readonly INVERSE: number;
|
|
20
|
-
readonly INVISIBLE: number;
|
|
21
|
-
readonly STRIKETHROUGH: number;
|
|
22
|
-
readonly OVERLINE: number;
|
|
23
|
-
};
|
|
24
|
-
/** Estilos de sublinhado de SGR 4:n (n = 0 desliga). */
|
|
25
|
-
declare const UnderlineStyle: {
|
|
26
|
-
readonly NONE: 0;
|
|
27
|
-
readonly SINGLE: 1;
|
|
28
|
-
readonly DOUBLE: 2;
|
|
29
|
-
readonly CURLY: 3;
|
|
30
|
-
readonly DOTTED: 4;
|
|
31
|
-
readonly DASHED: 5;
|
|
32
|
-
};
|
|
33
|
-
type UnderlineStyle = (typeof UnderlineStyle)[keyof typeof UnderlineStyle];
|
|
34
|
-
declare function color(mode: ColorMode, value?: number): number;
|
|
35
|
-
declare function colorMode(packed: number): ColorMode;
|
|
36
|
-
declare function colorValue(packed: number): number;
|
|
37
|
-
declare const DEFAULT_COLOR: number;
|
|
38
|
-
/** O que não cabe nos bits: raro, por isso num objeto à parte (compartilhado enquanto não muda). */
|
|
39
|
-
interface ExtendedAttributes {
|
|
40
|
-
readonly underlineStyle: UnderlineStyle;
|
|
41
|
-
/** Cor do sublinhado (SGR 58), no mesmo formato das outras; `DEFAULT_COLOR` segue a cor do texto. */
|
|
42
|
-
readonly underlineColor: number;
|
|
43
|
-
/** Id do hiperlink (OSC 8); 0 = sem link. */
|
|
44
|
-
readonly linkId: number;
|
|
45
|
-
}
|
|
46
|
-
declare const NO_EXTENDED: ExtendedAttributes;
|
|
47
|
-
/** O "pincel" atual: o que a próxima célula escrita recebe. */
|
|
48
|
-
declare class AttributeData {
|
|
49
|
-
fg: number;
|
|
50
|
-
bg: number;
|
|
51
|
-
flags: number;
|
|
52
|
-
extended: ExtendedAttributes;
|
|
53
|
-
clone(): AttributeData;
|
|
54
|
-
reset(): void;
|
|
55
|
-
setExtended(change: Partial<ExtendedAttributes>): void;
|
|
56
|
-
/** Atributos que importam para limpar uma célula (apagar usa a cor de fundo atual, ECMA-48 "erase"). */
|
|
57
|
-
eraseAttributes(): AttributeData;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
interface CellData {
|
|
61
|
-
chars: string;
|
|
62
|
-
code: number;
|
|
63
|
-
width: number;
|
|
64
|
-
fg: number;
|
|
65
|
-
bg: number;
|
|
66
|
-
flags: number;
|
|
67
|
-
extended: ExtendedAttributes;
|
|
68
|
-
}
|
|
69
|
-
declare function emptyCell(): CellData;
|
|
70
|
-
declare class BufferLine {
|
|
71
|
-
private cols;
|
|
72
|
-
private data;
|
|
73
|
-
private combined;
|
|
74
|
-
private extended;
|
|
75
|
-
/** Continuação da linha de cima (quebra automática), não uma linha nova. */
|
|
76
|
-
isWrapped: boolean;
|
|
77
|
-
constructor(cols: number, fill?: AttributeData, isWrapped?: boolean);
|
|
78
|
-
get length(): number;
|
|
79
|
-
getWidth(x: number): number;
|
|
80
|
-
getCode(x: number): number;
|
|
81
|
-
getChars(x: number): string;
|
|
82
|
-
getFg(x: number): number;
|
|
83
|
-
getBg(x: number): number;
|
|
84
|
-
getFlags(x: number): number;
|
|
85
|
-
getExtended(x: number): ExtendedAttributes;
|
|
86
|
-
/** A célula inteira (cópia), para leitura pela API pública. */
|
|
87
|
-
loadCell(x: number, into?: CellData): CellData;
|
|
88
|
-
setCell(x: number, chars: string, width: number, attr: AttributeData): void;
|
|
89
|
-
/** Junta um combinante (largura 0) à célula `x`. */
|
|
90
|
-
addCombining(x: number, chars: string): void;
|
|
91
|
-
/** Apaga a célula com os atributos de apagar (ECMA-48: fica a cor de fundo atual). */
|
|
92
|
-
eraseCell(x: number, attr?: AttributeData): void;
|
|
93
|
-
fill(attr?: AttributeData, start?: number, end?: number): void;
|
|
94
|
-
private copyCell;
|
|
95
|
-
/** ICH: abre `count` células em `x`, empurrando o resto para a direita (o que passa da margem some). */
|
|
96
|
-
insertCells(x: number, count: number, attr?: AttributeData): void;
|
|
97
|
-
/** DCH: tira `count` células em `x`, puxando o resto; a direita fica em branco. */
|
|
98
|
-
deleteCells(x: number, count: number, attr?: AttributeData): void;
|
|
99
|
-
/** Um caractere largo cortado pela borda vira espaço (não sobra meia letra). */
|
|
100
|
-
private fixWideAt;
|
|
101
|
-
private fixWideStart;
|
|
102
|
-
/** Muda a largura: corta ou completa com brancos. */
|
|
103
|
-
resize(cols: number, attr?: AttributeData): void;
|
|
104
|
-
clone(): BufferLine;
|
|
105
|
-
/** Copia células de outra linha (re-quebra, rolagem horizontal). */
|
|
106
|
-
copyCellsFrom(source: BufferLine, srcStart: number, destStart: number, count: number): void;
|
|
107
|
-
/** Quantas células no início guardam algo (o resto é branco sem atributo de fundo). */
|
|
108
|
-
getTrimmedLength(): number;
|
|
109
|
-
/** O texto das colunas `[start, end)`; com `trimRight`, sem os brancos do fim. */
|
|
110
|
-
translateToString(trimRight?: boolean, start?: number, end?: number): string;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
type Charset = Readonly<Record<string, string>> | null;
|
|
114
|
-
/** `null` = ASCII, sem troca. */
|
|
115
|
-
declare const CHARSETS: Readonly<Record<string, Charset>>;
|
|
116
|
-
declare function translate(char: string, charset: Charset): string;
|
|
117
|
-
|
|
118
|
-
declare class CircularList<T> {
|
|
119
|
-
private max;
|
|
120
|
-
private items;
|
|
121
|
-
private start;
|
|
122
|
-
private count;
|
|
123
|
-
constructor(max: number);
|
|
124
|
-
get length(): number;
|
|
125
|
-
get maxLength(): number;
|
|
126
|
-
/** Muda o máximo; se encolher, descarta do início. */
|
|
127
|
-
set maxLength(max: number);
|
|
128
|
-
private index;
|
|
129
|
-
get(i: number): T | undefined;
|
|
130
|
-
set(i: number, value: T): void;
|
|
131
|
-
/** Acrescenta no fim; devolve o item descartado do início, se a lista estava cheia. */
|
|
132
|
-
push(value: T): T | undefined;
|
|
133
|
-
pop(): T | undefined;
|
|
134
|
-
/** Tira `deleteCount` itens em `i` e põe os novos no lugar (o que passa do máximo sai do início). */
|
|
135
|
-
splice(i: number, deleteCount: number, ...insert: T[]): void;
|
|
136
|
-
/** Descarta `count` itens do início. */
|
|
137
|
-
trimStart(count: number): void;
|
|
138
|
-
toArray(): T[];
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
interface SavedCursor {
|
|
142
|
-
x: number;
|
|
143
|
-
y: number;
|
|
144
|
-
attr: AttributeData;
|
|
145
|
-
charsets: Charset[];
|
|
146
|
-
glevel: number;
|
|
147
|
-
originMode: boolean;
|
|
148
|
-
wrapPending: boolean;
|
|
149
|
-
}
|
|
150
|
-
declare class Buffer {
|
|
151
|
-
readonly type: 'normal' | 'alternate';
|
|
152
|
-
cols: number;
|
|
153
|
-
rows: number;
|
|
154
|
-
private scrollback;
|
|
155
|
-
/** Todas as linhas: as `ybase` primeiras são histórico; da `ybase` em diante, a tela. */
|
|
156
|
-
lines: CircularList<BufferLine>;
|
|
157
|
-
/** Primeira linha da tela dentro de `lines`. */
|
|
158
|
-
ybase: number;
|
|
159
|
-
/** Primeira linha à vista (rola para trás no histórico sem mexer no cursor). */
|
|
160
|
-
ydisp: number;
|
|
161
|
-
x: number;
|
|
162
|
-
y: number;
|
|
163
|
-
/** O último caractere foi escrito na última coluna: o próximo quebra antes (DECAWM). */
|
|
164
|
-
wrapPending: boolean;
|
|
165
|
-
scrollTop: number;
|
|
166
|
-
scrollBottom: number;
|
|
167
|
-
tabs: Set<number>;
|
|
168
|
-
saved: SavedCursor | null;
|
|
169
|
-
constructor(type: 'normal' | 'alternate', cols: number, rows: number, scrollback: number);
|
|
170
|
-
private capacity;
|
|
171
|
-
get hasScrollback(): boolean;
|
|
172
|
-
blankLine(attr?: AttributeData, isWrapped?: boolean): BufferLine;
|
|
173
|
-
fillViewport(attr?: AttributeData): void;
|
|
174
|
-
/** Linha `y` da tela (0 = topo da tela atual). */
|
|
175
|
-
line(y: number): BufferLine;
|
|
176
|
-
resetTabs(): void;
|
|
177
|
-
nextTab(x: number): number;
|
|
178
|
-
prevTab(x: number): number;
|
|
179
|
-
/** Devolve quantas linhas saíram do início (para os marcadores). */
|
|
180
|
-
setScrollback(scrollback: number): number;
|
|
181
|
-
/**
|
|
182
|
-
* Rola a região um passo para cima (o texto sobe). Com a região na tela inteira e histórico, a linha de cima vai
|
|
183
|
-
* para o histórico; senão, ela some. Devolve quantas linhas o histórico perdeu pelo início (para os marcadores).
|
|
184
|
-
*/
|
|
185
|
-
scrollUp(attr: AttributeData, isWrapped?: boolean): number;
|
|
186
|
-
/** Rola a região um passo para baixo (o texto desce; a linha de baixo da região some). */
|
|
187
|
-
scrollDown(attr: AttributeData): void;
|
|
188
|
-
clampCursor(): void;
|
|
189
|
-
/**
|
|
190
|
-
* Muda o tamanho. No normal, re-quebra as linhas lógicas na nova largura e mantém o cursor no mesmo texto; no
|
|
191
|
-
* alternativo (aplicações de tela cheia redesenham sozinhas), só corta ou completa. Devolve o mapa "linha antiga →
|
|
192
|
-
* linha nova" (-1 se a linha saiu do histórico), para quem guarda posições absolutas (marcadores).
|
|
193
|
-
*/
|
|
194
|
-
resize(cols: number, rows: number, attr: AttributeData, options?: ResizeOptions): (line: number) => number;
|
|
195
|
-
/** Devolve quantas linhas saíram do início do histórico. */
|
|
196
|
-
private resizeRows;
|
|
197
|
-
/**
|
|
198
|
-
* Re-quebra as linhas lógicas (as unidas por `isWrapped`) na largura `cols`. A linha lógica do cursor só re-quebra
|
|
199
|
-
* com `reflowCursorLine` (o shell costuma redesenhar o prompt sozinho); sem isso, cada linha dela é cortada ou
|
|
200
|
-
* completada no lugar. Devolve o mapa de linhas.
|
|
201
|
-
*/
|
|
202
|
-
private reflow;
|
|
203
|
-
}
|
|
204
|
-
interface ResizeOptions {
|
|
205
|
-
/** Re-quebrar as linhas ao mudar a largura (o pty antigo do Windows não combina com re-quebra). */
|
|
206
|
-
reflow?: boolean;
|
|
207
|
-
reflowCursorLine?: boolean;
|
|
208
|
-
/** Ao ganhar linhas, pôr brancos embaixo em vez de trazer o histórico de volta (ConPTY). */
|
|
209
|
-
growIntoScrollback?: boolean;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
/** As 16 cores ANSI padrão (as do xterm em modo padrão), em 0xRRGGBB. O tema do app troca. */
|
|
213
|
-
declare const ANSI_DEFAULTS: readonly number[];
|
|
214
|
-
/** 16–231: cubo 6×6×6; 232–255: tons de cinza (definição do modo de 256 cores do xterm). */
|
|
215
|
-
declare function defaultPalette(ansi?: readonly number[]): number[];
|
|
216
|
-
/** Lê `#rgb`, `#rrggbb`, `#rrrgggbbb`, `#rrrrggggbbbb` ou `rgb:r/g/b` (1–4 dígitos por canal). `null` se inválido. */
|
|
217
|
-
declare function parseColorSpec(spec: string): number | null;
|
|
218
|
-
/** Resposta de consulta no formato `rgb:rrrr/gggg/bbbb`. */
|
|
219
|
-
declare function formatColorSpec(rgb: number): string;
|
|
220
|
-
/** Converte CSS (`#rgb`, `#rrggbb`, `#rrggbbaa`, `rgb()`) para 0xRRGGBB; `null` se não reconhecer. */
|
|
221
|
-
declare function parseCssColor(css: string): number | null;
|
|
222
|
-
declare function toCss(rgb: number): string;
|
|
223
|
-
/** Cores em uso pelo terminal: tema do app + mudanças feitas pelas sequências OSC. */
|
|
224
|
-
declare class ColorState {
|
|
225
|
-
palette: number[];
|
|
226
|
-
foreground: number;
|
|
227
|
-
background: number;
|
|
228
|
-
cursor: number;
|
|
229
|
-
private base;
|
|
230
|
-
constructor(palette?: number[], foreground?: number, background?: number, cursor?: number);
|
|
231
|
-
/** O tema mudou: vira a nova base, e o que o OSC tinha trocado volta ao tema. */
|
|
232
|
-
setBase(palette: number[], foreground: number, background: number, cursor: number): void;
|
|
233
|
-
reset(): void;
|
|
234
|
-
resetPalette(index?: number): void;
|
|
235
|
-
resetSpecial(which: 'foreground' | 'background' | 'cursor'): void;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
interface IDisposable {
|
|
239
|
-
dispose(): void;
|
|
240
|
-
}
|
|
241
|
-
type IEvent<T> = (listener: (value: T) => void) => IDisposable;
|
|
242
|
-
/** Emissor simples: `event` é o que se expõe; `fire` só quem é dono chama. */
|
|
243
|
-
declare class Emitter<T> {
|
|
244
|
-
private listeners;
|
|
245
|
-
readonly event: IEvent<T>;
|
|
246
|
-
fire(value: T): void;
|
|
247
|
-
get hasListeners(): boolean;
|
|
248
|
-
dispose(): void;
|
|
249
|
-
}
|
|
250
|
-
/** Junta vários descartes num só. */
|
|
251
|
-
declare class DisposableStore implements IDisposable {
|
|
252
|
-
private items;
|
|
253
|
-
add<T extends IDisposable>(item: T): T;
|
|
254
|
-
dispose(): void;
|
|
255
|
-
}
|
|
256
|
-
declare function toDisposable(fn: () => void): IDisposable;
|
|
257
|
-
|
|
258
|
-
interface KeyInput {
|
|
259
|
-
readonly key: string;
|
|
260
|
-
readonly ctrlKey: boolean;
|
|
261
|
-
readonly altKey: boolean;
|
|
262
|
-
readonly shiftKey: boolean;
|
|
263
|
-
readonly metaKey: boolean;
|
|
264
|
-
}
|
|
265
|
-
interface KeyOptions {
|
|
266
|
-
readonly applicationCursorKeys: boolean;
|
|
267
|
-
readonly applicationKeypad?: boolean;
|
|
268
|
-
/** No macOS, Option age como Meta (manda ESC antes) em vez de compor caracteres. */
|
|
269
|
-
readonly macOptionIsMeta?: boolean;
|
|
270
|
-
readonly isMac?: boolean;
|
|
271
|
-
}
|
|
272
|
-
interface KeyResult {
|
|
273
|
-
/** O que mandar; vazio = nada (a tecla não gera texto, ou o navegador compõe). */
|
|
274
|
-
readonly data: string;
|
|
275
|
-
/** Impedir o padrão do navegador (o terminal tratou a tecla). */
|
|
276
|
-
readonly cancel: boolean;
|
|
277
|
-
}
|
|
278
|
-
declare function encodeKey(e: KeyInput, options: KeyOptions): KeyResult;
|
|
279
|
-
/** Ctrl + caractere → controle C0 (Ctrl+A = 0x01 … Ctrl+Z = 0x1a; Ctrl+@/Espaço = NUL; Ctrl+[ \ ] ^ _ e Ctrl+?). */
|
|
280
|
-
declare function controlCharacter(char: string): string | null;
|
|
281
|
-
/** Colagem: com o modo de colagem entre colchetes (2004), o texto vai entre `CSI 200~` e `CSI 201~`. */
|
|
282
|
-
declare function encodePaste(text: string, bracketed: boolean): string;
|
|
283
|
-
interface MouseReport {
|
|
284
|
-
/** 0 esquerdo, 1 meio, 2 direito, 3 soltar (sem SGR), 64/65 roda para cima/baixo. */
|
|
285
|
-
readonly button: number;
|
|
286
|
-
readonly action: 'press' | 'release' | 'move';
|
|
287
|
-
readonly col: number;
|
|
288
|
-
readonly row: number;
|
|
289
|
-
readonly shift: boolean;
|
|
290
|
-
readonly alt: boolean;
|
|
291
|
-
readonly ctrl: boolean;
|
|
292
|
-
/** Posição em pixels dentro da área de texto, a partir de 1 (só o formato 1016 usa). */
|
|
293
|
-
readonly px?: number;
|
|
294
|
-
readonly py?: number;
|
|
295
|
-
}
|
|
296
|
-
type MouseEncodingName = 'default' | 'utf8' | 'sgr' | 'urxvt' | 'sgr-pixels';
|
|
297
|
-
/**
|
|
298
|
-
* Relatório de mouse, coordenadas a partir de 1, nos formatos do xterm: clássico (X10/normal, `CSI M` + 3 bytes),
|
|
299
|
-
* UTF-8 (1005, coordenadas grandes em UTF-8), SGR (1006, `CSI < b ; x ; y M/m`), urxvt (1015, `CSI b ; x ; y M`) e
|
|
300
|
-
* SGR em pixels (1016). `true`/`false` valem como SGR/clássico (forma antiga desta função).
|
|
301
|
-
*/
|
|
302
|
-
declare function encodeMouse(report: MouseReport, encoding: MouseEncodingName | boolean): string;
|
|
303
|
-
|
|
304
|
-
interface FunctionIdentifier {
|
|
305
|
-
/** `<`, `=`, `>` ou `?` (só CSI e DCS). */
|
|
306
|
-
readonly prefix?: string;
|
|
307
|
-
/** Bytes 0x20–0x2f. */
|
|
308
|
-
readonly intermediates?: string;
|
|
309
|
-
readonly final: string;
|
|
310
|
-
}
|
|
311
|
-
/** Parâmetros: número, ou lista quando há subparâmetros (`38:2::255:0:0` vira `[38, 2, -1, 255, 0, 0]`). */
|
|
312
|
-
type Params = (number | number[])[];
|
|
313
|
-
type Result = boolean | Promise<boolean>;
|
|
314
|
-
type CsiHandler = (params: Params) => Result;
|
|
315
|
-
type EscHandler = () => Result;
|
|
316
|
-
type OscHandler = (data: string) => Result;
|
|
317
|
-
type DcsHandler = (data: string, params: Params) => Result;
|
|
318
|
-
type ApcHandler = (data: string) => Result;
|
|
319
|
-
declare function identifierKey(id: FunctionIdentifier): string;
|
|
320
|
-
declare class Parser {
|
|
321
|
-
private state;
|
|
322
|
-
private prefix;
|
|
323
|
-
private intermediates;
|
|
324
|
-
private params;
|
|
325
|
-
/** Valores do parâmetro em curso (o primeiro e os subparâmetros). */
|
|
326
|
-
private current;
|
|
327
|
-
private currentHasDigits;
|
|
328
|
-
private stringData;
|
|
329
|
-
private dcsParams;
|
|
330
|
-
private dcsKey;
|
|
331
|
-
private readonly csi;
|
|
332
|
-
private readonly esc;
|
|
333
|
-
private readonly osc;
|
|
334
|
-
private readonly dcs;
|
|
335
|
-
private readonly apc;
|
|
336
|
-
private readonly executeHandlers;
|
|
337
|
-
/** Texto imprimível, em blocos `[start, end)` de `data`. */
|
|
338
|
-
printHandler: (data: string, start: number, end: number) => void;
|
|
339
|
-
/** Sequência sem manipulador (registro em modo de depuração). */
|
|
340
|
-
fallback: (kind: string, key: string) => void;
|
|
341
|
-
registerCsiHandler(id: FunctionIdentifier, handler: CsiHandler): IDisposable;
|
|
342
|
-
registerEscHandler(id: FunctionIdentifier, handler: EscHandler): IDisposable;
|
|
343
|
-
registerOscHandler(ident: number, handler: OscHandler): IDisposable;
|
|
344
|
-
registerDcsHandler(id: FunctionIdentifier, handler: DcsHandler): IDisposable;
|
|
345
|
-
registerApcHandler(id: FunctionIdentifier, handler: ApcHandler): IDisposable;
|
|
346
|
-
setExecuteHandler(code: number, handler: () => void): void;
|
|
347
|
-
/** Volta ao estado inicial (RIS, ou descarte de uma sequência pela metade). */
|
|
348
|
-
reset(): void;
|
|
349
|
-
private clearSequence;
|
|
350
|
-
private execute;
|
|
351
|
-
private paramDigit;
|
|
352
|
-
private paramSeparator;
|
|
353
|
-
private subparamSeparator;
|
|
354
|
-
private pushParam;
|
|
355
|
-
private finishParams;
|
|
356
|
-
private dispatchCsi;
|
|
357
|
-
private dispatchEsc;
|
|
358
|
-
private dispatchOsc;
|
|
359
|
-
private dispatchDcs;
|
|
360
|
-
private dispatchApc;
|
|
361
|
-
/** Fecha a cadeia em curso (OSC/DCS/APC) quando chega o terminador. */
|
|
362
|
-
private endString;
|
|
363
|
-
private appendString;
|
|
364
|
-
/**
|
|
365
|
-
* Analisa `data`. Devolve uma `Promise` se algum manipulador pediu para esperar; quem chama aguarda antes de mandar
|
|
366
|
-
* mais texto (o resto deste já continua sozinho depois da espera).
|
|
367
|
-
*/
|
|
368
|
-
parse(data: string, start?: number): void | Promise<void>;
|
|
369
|
-
/** Um caractere fora do texto imprimível e das cadeias. */
|
|
370
|
-
private step;
|
|
371
|
-
private c1;
|
|
372
|
-
private csiStep;
|
|
373
|
-
private dcsStep;
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
interface IUnicodeVersionProvider {
|
|
377
|
-
readonly version: string;
|
|
378
|
-
wcwidth(codepoint: number): 0 | 1 | 2;
|
|
379
|
-
/**
|
|
380
|
-
* Propriedades do caractere no contexto do anterior. O formato é deste pacote (a definição de tipos do xterm.js não o
|
|
381
|
-
* documenta): bit 0 = junta ao grafema anterior; bits 1–2 = largura do grafema depois dele; bits 3+ = estado que
|
|
382
|
-
* volta como `preceding` no caractere seguinte. Monte e leia com `charProps`, `propsJoins`, `propsWidth`, `propsState`.
|
|
383
|
-
*/
|
|
384
|
-
charProperties(codepoint: number, preceding: number): number;
|
|
385
|
-
}
|
|
386
|
-
declare function wcwidth(codepoint: number): 0 | 1 | 2;
|
|
387
|
-
declare const DEFAULT_UNICODE_PROVIDER: IUnicodeVersionProvider;
|
|
388
|
-
/** Versões registradas e a ativa (API `IUnicodeHandling`). */
|
|
389
|
-
declare class UnicodeService {
|
|
390
|
-
private readonly providers;
|
|
391
|
-
private active;
|
|
392
|
-
register(provider: IUnicodeVersionProvider): void;
|
|
393
|
-
get versions(): readonly string[];
|
|
394
|
-
get activeVersion(): string;
|
|
395
|
-
set activeVersion(version: string);
|
|
396
|
-
wcwidth(codepoint: number): 0 | 1 | 2;
|
|
397
|
-
/** Propriedades no contexto do caractere anterior (ver `IUnicodeVersionProvider.charProperties`). */
|
|
398
|
-
charProperties(codepoint: number, preceding: number): number;
|
|
399
|
-
/** Largura de um texto inteiro (soma por ponto de código). */
|
|
400
|
-
stringWidth(text: string): number;
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
type MouseTrackingMode = 'none' | 'x10' | 'vt200' | 'drag' | 'any';
|
|
404
|
-
type CursorStyle = 'block' | 'underline' | 'bar';
|
|
405
|
-
interface CoreOptions {
|
|
406
|
-
cols: number;
|
|
407
|
-
rows: number;
|
|
408
|
-
scrollback: number;
|
|
409
|
-
tabStopWidth: number;
|
|
410
|
-
convertEol: boolean;
|
|
411
|
-
scrollOnEraseInDisplay: boolean;
|
|
412
|
-
cursorStyle: CursorStyle;
|
|
413
|
-
cursorBlink: boolean;
|
|
414
|
-
/** Terminal que não aceita entrada (as respostas a consultas também não saem). */
|
|
415
|
-
disableStdin: boolean;
|
|
416
|
-
/** DECSET/DECRST 12 mudam o piscar do cursor (programas costumam esquecer de desfazer; por isso, desligado). */
|
|
417
|
-
allowSetCursorBlink: boolean;
|
|
418
|
-
/** Re-quebrar também a linha lógica do cursor ao mudar a largura. */
|
|
419
|
-
reflowCursorLine: boolean;
|
|
420
|
-
/** Pty hospedado no Windows: liga as heurísticas do ConPTY/winpty. */
|
|
421
|
-
windowsPty: {
|
|
422
|
-
backend?: 'conpty' | 'winpty';
|
|
423
|
-
buildNumber?: number;
|
|
424
|
-
};
|
|
425
|
-
vtExtensions: VtExtensions;
|
|
426
|
-
/** Operações e relatórios de janela (`CSI … t`, DECCOLM); todos desligados por padrão, por segurança. */
|
|
427
|
-
windowOptions: WindowOptions;
|
|
428
|
-
logLevel: LogLevel$1;
|
|
429
|
-
logger: Logger | null;
|
|
430
|
-
}
|
|
431
|
-
interface VtExtensions {
|
|
432
|
-
kittyKeyboard?: boolean;
|
|
433
|
-
kittySgrBoldFaintControl?: boolean;
|
|
434
|
-
win32InputMode?: boolean;
|
|
435
|
-
colorSchemeQuery?: boolean;
|
|
436
|
-
}
|
|
437
|
-
type WindowOptions = Partial<Record<'restoreWin' | 'minimizeWin' | 'setWinPosition' | 'setWinSizePixels' | 'raiseWin' | 'lowerWin' | 'refreshWin' | 'setWinSizeChars' | 'maximizeWin' | 'fullscreenWin' | 'getWinState' | 'getWinPosition' | 'getWinSizePixels' | 'getScreenSizePixels' | 'getCellSizePixels' | 'getWinSizeChars' | 'getScreenSizeChars' | 'getIconTitle' | 'getWinTitle' | 'pushTitle' | 'popTitle' | 'setWinLines', boolean>>;
|
|
438
|
-
type LogLevel$1 = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'off';
|
|
439
|
-
interface Logger {
|
|
440
|
-
trace(message: string, ...args: unknown[]): void;
|
|
441
|
-
debug(message: string, ...args: unknown[]): void;
|
|
442
|
-
info(message: string, ...args: unknown[]): void;
|
|
443
|
-
warn(message: string, ...args: unknown[]): void;
|
|
444
|
-
error(message: string | Error, ...args: unknown[]): void;
|
|
445
|
-
}
|
|
446
|
-
declare const DEFAULT_CORE_OPTIONS: CoreOptions;
|
|
447
|
-
/** Medidas que só a renderização sabe (relatórios de janela em pixels). */
|
|
448
|
-
interface PixelMetrics {
|
|
449
|
-
cellWidth: number;
|
|
450
|
-
cellHeight: number;
|
|
451
|
-
}
|
|
452
|
-
/** Formato das coordenadas nos relatórios de mouse. */
|
|
453
|
-
type MouseEncoding = 'default' | 'utf8' | 'sgr' | 'urxvt' | 'sgr-pixels';
|
|
454
|
-
/** Os modos que a API pública expõe (`IModes`), mais os internos. */
|
|
455
|
-
declare class Modes {
|
|
456
|
-
applicationCursorKeysMode: boolean;
|
|
457
|
-
applicationKeypadMode: boolean;
|
|
458
|
-
bracketedPasteMode: boolean;
|
|
459
|
-
insertMode: boolean;
|
|
460
|
-
mouseTrackingMode: MouseTrackingMode;
|
|
461
|
-
/** Formato das coordenadas do mouse: 1005 (UTF-8), 1006 (SGR), 1015 (urxvt), 1016 (SGR em pixels). */
|
|
462
|
-
mouseEncoding: MouseEncoding;
|
|
463
|
-
/** Codificação SGR (1006 ou 1016) das coordenadas do mouse. */
|
|
464
|
-
get mouseSgrEncoding(): boolean;
|
|
465
|
-
/** win32-input-mode (DECSET 9001): teclas como registros INPUT_RECORD. */
|
|
466
|
-
win32InputMode: boolean;
|
|
467
|
-
/** DECSET 2031: avisar quando o esquema de cores (claro/escuro) muda. */
|
|
468
|
-
colorSchemeUpdates: boolean;
|
|
469
|
-
/** Protocolo de teclado do kitty: pilha de flags por tela (a de cima vale). */
|
|
470
|
-
kittyKeyboardNormal: number[];
|
|
471
|
-
kittyKeyboardAlt: number[];
|
|
472
|
-
originMode: boolean;
|
|
473
|
-
reverseWraparoundMode: boolean;
|
|
474
|
-
sendFocusMode: boolean;
|
|
475
|
-
showCursor: boolean;
|
|
476
|
-
synchronizedOutputMode: boolean;
|
|
477
|
-
wraparoundMode: boolean;
|
|
478
|
-
/** LNM: LF também volta ao início da linha. */
|
|
479
|
-
newlineMode: boolean;
|
|
480
|
-
cursorBlinkOverride: boolean | null;
|
|
481
|
-
}
|
|
482
|
-
interface Hyperlink {
|
|
483
|
-
readonly id: number;
|
|
484
|
-
readonly uri: string;
|
|
485
|
-
/** O `id=` dos parâmetros do OSC 8, quando há (liga trechos separados do mesmo link). */
|
|
486
|
-
readonly linkId?: string;
|
|
487
|
-
}
|
|
488
|
-
/** Marcador de uma linha do buffer normal, que acompanha a linha enquanto o texto rola (API `IMarker`). */
|
|
489
|
-
declare class Marker implements IDisposable {
|
|
490
|
-
line: number;
|
|
491
|
-
private static nextId;
|
|
492
|
-
readonly id: number;
|
|
493
|
-
isDisposed: boolean;
|
|
494
|
-
private readonly disposeEmitter;
|
|
495
|
-
readonly onDispose: IEvent<void>;
|
|
496
|
-
constructor(line: number);
|
|
497
|
-
dispose(): void;
|
|
498
|
-
}
|
|
499
|
-
/** Uma posição no buffer: coluna e linha absoluta (contando o histórico). */
|
|
500
|
-
interface BufferPoint {
|
|
501
|
-
x: number;
|
|
502
|
-
y: number;
|
|
503
|
-
}
|
|
504
|
-
declare class TerminalCore implements IDisposable {
|
|
505
|
-
readonly options: CoreOptions;
|
|
506
|
-
readonly parser: Parser;
|
|
507
|
-
readonly unicode: UnicodeService;
|
|
508
|
-
readonly modes: Modes;
|
|
509
|
-
readonly colors: ColorState;
|
|
510
|
-
normal: Buffer;
|
|
511
|
-
alt: Buffer;
|
|
512
|
-
buffer: Buffer;
|
|
513
|
-
curAttr: AttributeData;
|
|
514
|
-
charsets: Charset[];
|
|
515
|
-
glevel: number;
|
|
516
|
-
title: string;
|
|
517
|
-
readonly links: Map<number, Hyperlink>;
|
|
518
|
-
private nextLinkId;
|
|
519
|
-
readonly markers: Marker[];
|
|
520
|
-
/** Último caractere impresso (para REP). */
|
|
521
|
-
private lastPrinted;
|
|
522
|
-
/** Seleção: âncora e ponta em coordenadas absolutas; `null` sem seleção. */
|
|
523
|
-
selection: {
|
|
524
|
-
start: BufferPoint;
|
|
525
|
-
end: BufferPoint;
|
|
526
|
-
} | null;
|
|
527
|
-
/** Medidas em pixels, dadas pela renderização (sem tela, zero). */
|
|
528
|
-
pixelMetrics: PixelMetrics;
|
|
529
|
-
/** Pilha de títulos (XTWINOPS 22/23). */
|
|
530
|
-
private readonly titleStack;
|
|
531
|
-
/** Pedidos de janela que o terminal não faz sozinho (mover, iconizar…), para quem hospeda decidir. */
|
|
532
|
-
private readonly windowRequestEmitter;
|
|
533
|
-
readonly onWindowRequest: IEvent<{
|
|
534
|
-
op: number;
|
|
535
|
-
params: number[];
|
|
536
|
-
}>;
|
|
537
|
-
/** Flags ativas do protocolo de teclado do kitty (0 sem a extensão). */
|
|
538
|
-
get kittyKeyboardFlags(): number;
|
|
539
|
-
/** Registra no `logger` (ou no console), respeitando `logLevel`. */
|
|
540
|
-
log(level: Exclude<LogLevel$1, 'off'>, message: string, ...args: unknown[]): void;
|
|
541
|
-
/** Sem as heurísticas do pty do Windows, ou ConPTY novo o bastante para re-quebrar (build 21376+). */
|
|
542
|
-
private get windowsReflowOk();
|
|
543
|
-
private readonly writeQueue;
|
|
544
|
-
private writing;
|
|
545
|
-
private readonly decoder;
|
|
546
|
-
/** Linhas tocadas desde o último aviso (para a renderização redesenhar só o necessário). */
|
|
547
|
-
private dirtyStart;
|
|
548
|
-
private dirtyEnd;
|
|
549
|
-
private readonly dataEmitter;
|
|
550
|
-
private readonly binaryEmitter;
|
|
551
|
-
private readonly bellEmitter;
|
|
552
|
-
private readonly titleEmitter;
|
|
553
|
-
private readonly lineFeedEmitter;
|
|
554
|
-
private readonly cursorMoveEmitter;
|
|
555
|
-
private readonly scrollEmitter;
|
|
556
|
-
private readonly resizeEmitter;
|
|
557
|
-
private readonly writeParsedEmitter;
|
|
558
|
-
private readonly bufferChangeEmitter;
|
|
559
|
-
private readonly dirtyEmitter;
|
|
560
|
-
private readonly selectionEmitter;
|
|
561
|
-
private readonly cursorStyleEmitter;
|
|
562
|
-
private readonly colorsEmitter;
|
|
563
|
-
/** Dados para o processo do outro lado: o que a pessoa digita e as respostas às consultas. */
|
|
564
|
-
readonly onData: IEvent<string>;
|
|
565
|
-
/** Dados binários (relatório de mouse X10 com coordenadas acima de 95). */
|
|
566
|
-
readonly onBinary: IEvent<string>;
|
|
567
|
-
readonly onBell: IEvent<void>;
|
|
568
|
-
readonly onTitleChange: IEvent<string>;
|
|
569
|
-
readonly onLineFeed: IEvent<void>;
|
|
570
|
-
readonly onCursorMove: IEvent<void>;
|
|
571
|
-
readonly onScroll: IEvent<number>;
|
|
572
|
-
readonly onResize: IEvent<{
|
|
573
|
-
cols: number;
|
|
574
|
-
rows: number;
|
|
575
|
-
}>;
|
|
576
|
-
readonly onWriteParsed: IEvent<void>;
|
|
577
|
-
readonly onBufferChange: IEvent<Buffer>;
|
|
578
|
-
/** Linhas da tela (`start`–`end`, relativas ao topo da tela) que mudaram. */
|
|
579
|
-
readonly onDirty: IEvent<{
|
|
580
|
-
start: number;
|
|
581
|
-
end: number;
|
|
582
|
-
}>;
|
|
583
|
-
readonly onSelectionChange: IEvent<void>;
|
|
584
|
-
readonly onCursorStyleChange: IEvent<void>;
|
|
585
|
-
readonly onColorsChange: IEvent<void>;
|
|
586
|
-
constructor(options?: Partial<CoreOptions>);
|
|
587
|
-
get cols(): number;
|
|
588
|
-
get rows(): number;
|
|
589
|
-
dispose(): void;
|
|
590
|
-
/** Põe na fila; o texto é analisado em seguida (fora da pilha de quem chamou), na ordem, e `callback` avisa. */
|
|
591
|
-
write(data: string | Uint8Array, callback?: () => void): void;
|
|
592
|
-
/** Analisa já (testes e quem precisa do estado na hora). Manipuladores assíncronos ainda atrasam o resto. */
|
|
593
|
-
writeSync(data: string | Uint8Array): void | Promise<void>;
|
|
594
|
-
private drain;
|
|
595
|
-
/** Manda para o processo do outro lado (respostas e entrada). */
|
|
596
|
-
triggerData(data: string, wasUserInput?: boolean): void;
|
|
597
|
-
triggerBinary(data: string): void;
|
|
598
|
-
private reply;
|
|
599
|
-
private markDirty;
|
|
600
|
-
markAllDirty(): void;
|
|
601
|
-
private flushDirty;
|
|
602
|
-
private print;
|
|
603
|
-
/** Estado do último grafema escrito e onde o cursor ficou (para juntar o próximo caractere a ele). */
|
|
604
|
-
private graphemeProps;
|
|
605
|
-
private graphemeAt;
|
|
606
|
-
private graphemeBuffer;
|
|
607
|
-
/** Escrever por cima de metade de um caractere largo apaga a outra metade. */
|
|
608
|
-
private breakWideAt;
|
|
609
|
-
/**
|
|
610
|
-
* Junta o caractere à célula escrita por último (combinante, ZWJ, tom de pele…). Se o grafema passa a ter largura
|
|
611
|
-
* 2 (VS16, bandeira), a célula alarga e o cursor anda uma coluna, quando cabe.
|
|
612
|
-
*/
|
|
613
|
-
private combine;
|
|
614
|
-
/** A quebra pendente: vai para a próxima linha (marcada como continuação) ou, sem DECAWM, fica na última coluna. */
|
|
615
|
-
private wrapOrOverwrite;
|
|
616
|
-
private scrollUp;
|
|
617
|
-
private trimMarkers;
|
|
618
|
-
private removeMarker;
|
|
619
|
-
/** IND/LF: desce uma linha; no fim da região, rola. */
|
|
620
|
-
index(): void;
|
|
621
|
-
lineFeed(): void;
|
|
622
|
-
/** RI: sobe uma linha; no topo da região, rola para baixo. */
|
|
623
|
-
reverseIndex(): void;
|
|
624
|
-
carriageReturn(): void;
|
|
625
|
-
backspace(): void;
|
|
626
|
-
tab(): void;
|
|
627
|
-
/** Limites verticais do cursor: a região de rolagem com DECOM, a tela inteira sem. */
|
|
628
|
-
private cursorBounds;
|
|
629
|
-
/** CUP: linha e coluna a partir de 1 (relativas à região com DECOM). */
|
|
630
|
-
cursorTo(row: number, col: number): void;
|
|
631
|
-
/** Movimento relativo que para nas margens da região de rolagem (CUU/CUD dentro dela). */
|
|
632
|
-
private moveVertical;
|
|
633
|
-
private moveHorizontal;
|
|
634
|
-
private eraseInLine;
|
|
635
|
-
/** ED/DECSED. */
|
|
636
|
-
private eraseInDisplay;
|
|
637
|
-
/** ED 3 e `clear()`: some o histórico; a tela fica. */
|
|
638
|
-
clearScrollback(): void;
|
|
639
|
-
private insertLines;
|
|
640
|
-
private deleteLines;
|
|
641
|
-
saveCursor(): void;
|
|
642
|
-
restoreCursor(): void;
|
|
643
|
-
private useAltBuffer;
|
|
644
|
-
private useNormalBuffer;
|
|
645
|
-
resize(cols: number, rows: number): void;
|
|
646
|
-
private applyTabStops;
|
|
647
|
-
setScrollback(scrollback: number): void;
|
|
648
|
-
/** RIS: volta tudo ao estado inicial (o tamanho fica). */
|
|
649
|
-
reset(): void;
|
|
650
|
-
/** DECSTR: a redefinição suave (modos, região, atributos e cursor salvo; o texto fica). */
|
|
651
|
-
private softReset;
|
|
652
|
-
registerMarker(cursorYOffset?: number): Marker | undefined;
|
|
653
|
-
/** Seleciona `length` células a partir de `(column, row)` (linha absoluta), em ordem de leitura. */
|
|
654
|
-
select(column: number, row: number, length: number): void;
|
|
655
|
-
selectLines(start: number, end: number): void;
|
|
656
|
-
selectAll(): void;
|
|
657
|
-
setSelection(start: BufferPoint, end: BufferPoint): void;
|
|
658
|
-
clearSelection(): void;
|
|
659
|
-
hasSelection(): boolean;
|
|
660
|
-
/** O texto selecionado; linhas unidas por quebra automática viram uma linha só. */
|
|
661
|
-
getSelection(): string;
|
|
662
|
-
getCell(x: number, y: number): CellData | undefined;
|
|
663
|
-
private registerHandlers;
|
|
664
|
-
private scrollRegionUp;
|
|
665
|
-
private eraseLineMode;
|
|
666
|
-
private alignmentTest;
|
|
667
|
-
private setScrollRegion;
|
|
668
|
-
private setAnsiModes;
|
|
669
|
-
private setDecModes;
|
|
670
|
-
/** DECRQM: 1 ligado, 2 desligado, 0 desconhecido. */
|
|
671
|
-
private reportAnsiMode;
|
|
672
|
-
private reportDecMode;
|
|
673
|
-
private deviceStatus;
|
|
674
|
-
private setCursorStyle;
|
|
675
|
-
private sgr;
|
|
676
|
-
private sgrSimple;
|
|
677
|
-
/** 38/48/58 com `5;n` (paleta) ou `2;r;g;b` (RGB); na forma com `:`, `2` pode trazer o espaço de cor antes. */
|
|
678
|
-
private extendedColor;
|
|
679
|
-
private setTitle;
|
|
680
|
-
private colorsChanged;
|
|
681
|
-
private lastScheme;
|
|
682
|
-
/** DECSET 2031: avisa o processo quando o esquema (claro/escuro) muda — pelo OSC ou pelo tema do app. */
|
|
683
|
-
notifyColorScheme(): void;
|
|
684
|
-
private oscPalette;
|
|
685
|
-
private oscSpecial;
|
|
686
|
-
private resetSpecialColor;
|
|
687
|
-
/** OSC 8 ; parâmetros ; URI — URI vazia fecha o link. */
|
|
688
|
-
private oscHyperlink;
|
|
689
|
-
/** Fundo mais escuro que o texto = esquema escuro (luminância relativa, WCAG). */
|
|
690
|
-
isDarkScheme(): boolean;
|
|
691
|
-
/** XTWINOPS (`CSI Ps ; … t`): só o que `windowOptions` liga. O resto vira pedido para quem hospeda. */
|
|
692
|
-
private windowOp;
|
|
693
|
-
private kittyStack;
|
|
694
|
-
/** `CSI ? u`: responde as flags ativas. */
|
|
695
|
-
private kittyQuery;
|
|
696
|
-
/** `CSI > flags u`: empilha (a pilha tem limite; o mais antigo sai). */
|
|
697
|
-
private kittyPush;
|
|
698
|
-
/** `CSI < n u`: desempilha n (esvaziar volta ao teclado legado). */
|
|
699
|
-
private kittyPop;
|
|
700
|
-
/** `CSI = flags ; modo u`: 1 troca, 2 liga os bits, 3 desliga os bits (no topo da pilha). */
|
|
701
|
-
private kittySet;
|
|
702
|
-
/** DECRQSS (`DCS $ q Pt ST`): responde o estado pedido (`DCS 1 $ r … ST`) ou `DCS 0 $ r ST` se não souber. */
|
|
703
|
-
private requestStatusString;
|
|
704
|
-
/** Os atributos atuais como parâmetros SGR (para o DECRQSS e a serialização). */
|
|
705
|
-
sgrString(attr?: AttributeData): string;
|
|
706
|
-
/** Para a API (`IBufferCell`): os atributos estendidos por id de link. */
|
|
707
|
-
linkFor(extended: ExtendedAttributes): Hyperlink | undefined;
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
interface RenderOptions {
|
|
711
|
-
fontFamily: string;
|
|
712
|
-
fontSize: number;
|
|
713
|
-
fontWeight: string | number;
|
|
714
|
-
fontWeightBold: string | number;
|
|
715
|
-
lineHeight: number;
|
|
716
|
-
letterSpacing: number;
|
|
717
|
-
cursorStyle: 'block' | 'underline' | 'bar';
|
|
718
|
-
cursorInactiveStyle: 'outline' | 'block' | 'bar' | 'underline' | 'none';
|
|
719
|
-
cursorWidth: number;
|
|
720
|
-
cursorBlink: boolean;
|
|
721
|
-
drawBoldTextInBrightColors: boolean;
|
|
722
|
-
/** Caixa (U+2500–U+257F) e blocos (U+2580–U+259F) desenhados pela célula, não pela fonte. */
|
|
723
|
-
customGlyphs: boolean;
|
|
724
|
-
/** Meio período do piscar do SGR 5, em ms (0 = não pisca). */
|
|
725
|
-
blinkIntervalDuration: number;
|
|
726
|
-
/** Contraste mínimo do texto contra o fundo (1 = sem ajuste; 4,5 = WCAG AA). */
|
|
727
|
-
minimumContrastRatio: number;
|
|
728
|
-
/** Encolhe na horizontal os glifos que passam da largura da célula. */
|
|
729
|
-
rescaleOverlappingGlyphs: boolean;
|
|
730
|
-
selectionBackground: string;
|
|
731
|
-
selectionForeground: string | undefined;
|
|
732
|
-
selectionInactiveBackground: string;
|
|
733
|
-
cursorAccent: string | undefined;
|
|
734
|
-
}
|
|
735
|
-
interface CellRange {
|
|
736
|
-
/** Linha absoluta do buffer. */
|
|
737
|
-
y: number;
|
|
738
|
-
start: number;
|
|
739
|
-
/** Exclusivo. */
|
|
740
|
-
end: number;
|
|
741
|
-
}
|
|
742
|
-
declare class DomRenderer {
|
|
743
|
-
private readonly core;
|
|
744
|
-
private readonly host;
|
|
745
|
-
private options;
|
|
746
|
-
readonly screen: HTMLElement;
|
|
747
|
-
private readonly rowsLayer;
|
|
748
|
-
private readonly selectionLayer;
|
|
749
|
-
private readonly linkLayer;
|
|
750
|
-
private readonly cursor;
|
|
751
|
-
readonly decorationsBottom: HTMLElement;
|
|
752
|
-
readonly decorationsTop: HTMLElement;
|
|
753
|
-
private readonly measure;
|
|
754
|
-
private rowElements;
|
|
755
|
-
private dirtyStart;
|
|
756
|
-
private dirtyEnd;
|
|
757
|
-
private frame;
|
|
758
|
-
private readonly cell;
|
|
759
|
-
private readonly glyphCache;
|
|
760
|
-
private readonly contrastCache;
|
|
761
|
-
private readonly glyphWidthCache;
|
|
762
|
-
private measureContext;
|
|
763
|
-
/** Juntores de caracteres (`registerCharacterJoiner`): texto da linha → faixas desenhadas como uma unidade. */
|
|
764
|
-
readonly joiners: Map<number, (text: string) => [number, number][]>;
|
|
765
|
-
/** Depois de medir a célula (para `dimensions` e os relatórios em pixels). */
|
|
766
|
-
onMeasured: () => void;
|
|
767
|
-
/** O cursor parou de piscar por inatividade. */
|
|
768
|
-
blinkIdle: boolean;
|
|
769
|
-
cellWidth: number;
|
|
770
|
-
cellHeight: number;
|
|
771
|
-
focused: boolean;
|
|
772
|
-
/** Faixas sublinhadas (link sob o mouse). */
|
|
773
|
-
linkRanges: CellRange[];
|
|
774
|
-
/** Chamado depois de cada quadro, com as linhas redesenhadas (relativas à tela). */
|
|
775
|
-
onRendered: (start: number, end: number) => void;
|
|
776
|
-
constructor(core: TerminalCore, host: HTMLElement, options: RenderOptions);
|
|
777
|
-
private layer;
|
|
778
|
-
setOptions(options: RenderOptions): void;
|
|
779
|
-
private applyFont;
|
|
780
|
-
/** Mede a célula com uma amostra de 32 caracteres (fonte monoespaçada). Sem layout (jsdom), estima pela fonte. */
|
|
781
|
-
measureCell(): void;
|
|
782
|
-
/** Tamanho da tela e número de linhas desenhadas seguem `cols`×`rows`. */
|
|
783
|
-
layout(): void;
|
|
784
|
-
refreshAll(): void;
|
|
785
|
-
/** Marca linhas da tela (relativas ao topo à vista) e agenda o quadro. */
|
|
786
|
-
refreshRows(start: number, end: number): void;
|
|
787
|
-
/** Desenha já o que está pendente (testes e `refresh` síncrono). */
|
|
788
|
-
renderNow(): void;
|
|
789
|
-
private renderOverlays;
|
|
790
|
-
/** Chamado a cada quadro, depois das camadas (decorações acompanham). */
|
|
791
|
-
onOverlays: () => void;
|
|
792
|
-
/** Ouvintes de quadro dos complementos (imagens, renderizador WebGL…): recebem as linhas redesenhadas ou -1/-1. */
|
|
793
|
-
readonly frameListeners: Set<(start: number, end: number) => void>;
|
|
794
|
-
/**
|
|
795
|
-
* Camada extra na tela, para complementos: abaixo das linhas (fundo), acima das linhas (imagens) ou no topo
|
|
796
|
-
* (acima de tudo, inclusive do cursor).
|
|
797
|
-
*/
|
|
798
|
-
addLayer(className: string, position: 'below-rows' | 'above-rows' | 'top'): HTMLElement;
|
|
799
|
-
/** Esconde as linhas DOM (quando outro renderizador desenha o texto) sem tirar a seleção, o cursor e as decorações. */
|
|
800
|
-
set rowsHidden(hidden: boolean);
|
|
801
|
-
get rowsHidden(): boolean;
|
|
802
|
-
dispose(): void;
|
|
803
|
-
private renderRow;
|
|
804
|
-
/** Faixas dos juntores para esta linha: célula inicial → célula final (exclusiva). */
|
|
805
|
-
private joinedRanges;
|
|
806
|
-
/** Quanto encolher um glifo para caber na célula (1 = cabe). Emoji, Powerline e ícones (área privada) não encolhem. */
|
|
807
|
-
private glyphScale;
|
|
808
|
-
/** Clareia ou escurece a cor do texto até o contraste mínimo contra o fundo (WCAG, luminância relativa). */
|
|
809
|
-
private ensureContrast;
|
|
810
|
-
/** CSS do caractere desenhado pela célula, guardado por código (refeito quando a célula muda de tamanho). */
|
|
811
|
-
private glyphCss;
|
|
812
|
-
private rgb;
|
|
813
|
-
private color;
|
|
814
|
-
private cellStyle;
|
|
815
|
-
private renderCursor;
|
|
816
|
-
private renderSelection;
|
|
817
|
-
private renderLinks;
|
|
818
|
-
/** Célula (coluna e linha da tela, a partir de 0) sob um ponto do mouse. */
|
|
819
|
-
cellAt(clientX: number, clientY: number): {
|
|
820
|
-
col: number;
|
|
821
|
-
row: number;
|
|
822
|
-
};
|
|
823
|
-
/** O mesmo, mas a coluna arredonda para a borda mais próxima (seleção começa/termina entre células). */
|
|
824
|
-
edgeAt(clientX: number, clientY: number): {
|
|
825
|
-
col: number;
|
|
826
|
-
row: number;
|
|
827
|
-
};
|
|
828
|
-
}
|
|
829
|
-
|
|
830
|
-
type IFunctionIdentifier = FunctionIdentifier;
|
|
831
|
-
type FontWeight = 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900' | number;
|
|
832
|
-
type LogLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'off';
|
|
833
|
-
interface ITheme {
|
|
834
|
-
foreground?: string;
|
|
835
|
-
background?: string;
|
|
836
|
-
cursor?: string;
|
|
837
|
-
cursorAccent?: string;
|
|
838
|
-
selectionBackground?: string;
|
|
839
|
-
selectionForeground?: string;
|
|
840
|
-
selectionInactiveBackground?: string;
|
|
841
|
-
scrollbarSliderBackground?: string;
|
|
842
|
-
scrollbarSliderHoverBackground?: string;
|
|
843
|
-
scrollbarSliderActiveBackground?: string;
|
|
844
|
-
overviewRulerBorder?: string;
|
|
845
|
-
black?: string;
|
|
846
|
-
red?: string;
|
|
847
|
-
green?: string;
|
|
848
|
-
yellow?: string;
|
|
849
|
-
blue?: string;
|
|
850
|
-
magenta?: string;
|
|
851
|
-
cyan?: string;
|
|
852
|
-
white?: string;
|
|
853
|
-
brightBlack?: string;
|
|
854
|
-
brightRed?: string;
|
|
855
|
-
brightGreen?: string;
|
|
856
|
-
brightYellow?: string;
|
|
857
|
-
brightBlue?: string;
|
|
858
|
-
brightMagenta?: string;
|
|
859
|
-
brightCyan?: string;
|
|
860
|
-
brightWhite?: string;
|
|
861
|
-
/** Cores 16–255 da paleta, na ordem. */
|
|
862
|
-
extendedAnsi?: string[];
|
|
863
|
-
}
|
|
864
|
-
interface ILinkHandler {
|
|
865
|
-
activate(event: MouseEvent, text: string, range: IBufferRange): void;
|
|
866
|
-
hover?(event: MouseEvent, text: string, range: IBufferRange): void;
|
|
867
|
-
leave?(event: MouseEvent, text: string, range: IBufferRange): void;
|
|
868
|
-
allowNonHttpProtocols?: boolean;
|
|
869
|
-
}
|
|
870
|
-
interface IWindowsPty {
|
|
871
|
-
backend?: 'conpty' | 'winpty';
|
|
872
|
-
buildNumber?: number;
|
|
873
|
-
}
|
|
874
|
-
interface ITerminalQuirks {
|
|
875
|
-
/** DECSET/DECRST 12 mudam o piscar do cursor (o DECRQM responde de qualquer jeito). */
|
|
876
|
-
allowSetCursorBlink?: boolean;
|
|
877
|
-
}
|
|
878
|
-
interface IOverviewRulerOptions {
|
|
879
|
-
showTopBorder?: boolean;
|
|
880
|
-
showBottomBorder?: boolean;
|
|
881
|
-
}
|
|
882
|
-
interface IScrollbarOptions {
|
|
883
|
-
/** Mostrar a barra de rolagem (padrão true; false vale mais que `width`). */
|
|
884
|
-
showScrollbar?: boolean;
|
|
885
|
-
/** Setas nas pontas da barra (padrão false). */
|
|
886
|
-
showArrows?: boolean;
|
|
887
|
-
/** Largura da barra e da régua de visão geral em px; definida, liga a régua. */
|
|
888
|
-
width?: number;
|
|
889
|
-
overviewRuler?: IOverviewRulerOptions;
|
|
890
|
-
}
|
|
891
|
-
interface IVtExtensions {
|
|
892
|
-
/** Protocolo de teclado do kitty (`CSI =|?|>|< u`). Padrão false. */
|
|
893
|
-
kittyKeyboard?: boolean;
|
|
894
|
-
/** SGR 221 (tira o negrito) e 222 (tira o esmaecido). Padrão true. */
|
|
895
|
-
kittySgrBoldFaintControl?: boolean;
|
|
896
|
-
/** win32-input-mode (DECSET 9001). Padrão false. */
|
|
897
|
-
win32InputMode?: boolean;
|
|
898
|
-
/** Consulta e aviso do esquema de cores (`CSI ? 996 n`, DECSET 2031). Padrão true. */
|
|
899
|
-
colorSchemeQuery?: boolean;
|
|
900
|
-
}
|
|
901
|
-
interface IWindowOptions {
|
|
902
|
-
restoreWin?: boolean;
|
|
903
|
-
minimizeWin?: boolean;
|
|
904
|
-
setWinPosition?: boolean;
|
|
905
|
-
setWinSizePixels?: boolean;
|
|
906
|
-
raiseWin?: boolean;
|
|
907
|
-
lowerWin?: boolean;
|
|
908
|
-
refreshWin?: boolean;
|
|
909
|
-
setWinSizeChars?: boolean;
|
|
910
|
-
maximizeWin?: boolean;
|
|
911
|
-
fullscreenWin?: boolean;
|
|
912
|
-
getWinState?: boolean;
|
|
913
|
-
getWinPosition?: boolean;
|
|
914
|
-
getWinSizePixels?: boolean;
|
|
915
|
-
getScreenSizePixels?: boolean;
|
|
916
|
-
getCellSizePixels?: boolean;
|
|
917
|
-
getWinSizeChars?: boolean;
|
|
918
|
-
getScreenSizeChars?: boolean;
|
|
919
|
-
getIconTitle?: boolean;
|
|
920
|
-
getWinTitle?: boolean;
|
|
921
|
-
pushTitle?: boolean;
|
|
922
|
-
popTitle?: boolean;
|
|
923
|
-
/** Também liga o DECCOLM (132/80 colunas). */
|
|
924
|
-
setWinLines?: boolean;
|
|
925
|
-
}
|
|
926
|
-
interface ILogger {
|
|
927
|
-
trace(message: string, ...args: any[]): void;
|
|
928
|
-
debug(message: string, ...args: any[]): void;
|
|
929
|
-
info(message: string, ...args: any[]): void;
|
|
930
|
-
warn(message: string, ...args: any[]): void;
|
|
931
|
-
error(message: string | Error, ...args: any[]): void;
|
|
932
|
-
}
|
|
933
|
-
interface IDimensions {
|
|
934
|
-
width: number;
|
|
935
|
-
height: number;
|
|
936
|
-
}
|
|
937
|
-
interface IOffset {
|
|
938
|
-
top: number;
|
|
939
|
-
left: number;
|
|
940
|
-
}
|
|
941
|
-
/** Medidas da tela, depois do `open`. */
|
|
942
|
-
interface IRenderDimensions {
|
|
943
|
-
css: {
|
|
944
|
-
canvas: IDimensions;
|
|
945
|
-
cell: IDimensions;
|
|
946
|
-
};
|
|
947
|
-
device: {
|
|
948
|
-
canvas: IDimensions;
|
|
949
|
-
cell: IDimensions;
|
|
950
|
-
char: IDimensions & IOffset;
|
|
951
|
-
};
|
|
952
|
-
}
|
|
953
|
-
/** Textos que o terminal mesmo mostra ou anuncia. */
|
|
954
|
-
interface ILocalizableStrings {
|
|
955
|
-
/** Nome acessível da área de texto que recebe o teclado. */
|
|
956
|
-
promptLabel: string;
|
|
957
|
-
/** Aviso quando sai texto demais para o leitor de tela acompanhar. */
|
|
958
|
-
tooMuchOutput: string;
|
|
959
|
-
}
|
|
960
|
-
interface ITerminalOptions {
|
|
961
|
-
allowProposedApi?: boolean;
|
|
962
|
-
allowTransparency?: boolean;
|
|
963
|
-
altClickMovesCursor?: boolean;
|
|
964
|
-
/** Meio período do piscar do atributo SGR 5, em ms (0 = não pisca, o padrão). */
|
|
965
|
-
blinkIntervalDuration?: number;
|
|
966
|
-
/** Outro `Document` para criar os elementos (apps com várias janelas). */
|
|
967
|
-
documentOverride?: any | null;
|
|
968
|
-
logger?: ILogger | null;
|
|
969
|
-
/** Com o mouse pedido pelo processo, os cliques só vão para ele com Alt (o Alt não entra no relatório). */
|
|
970
|
-
mouseEventsRequireAlt?: boolean;
|
|
971
|
-
quirks?: ITerminalQuirks;
|
|
972
|
-
reflowCursorLine?: boolean;
|
|
973
|
-
/** Encolhe na horizontal glifos que passam da célula (fontes CJK, GB18030). */
|
|
974
|
-
rescaleOverlappingGlyphs?: boolean;
|
|
975
|
-
scrollbar?: IScrollbarOptions;
|
|
976
|
-
vtExtensions?: IVtExtensions;
|
|
977
|
-
windowOptions?: IWindowOptions;
|
|
978
|
-
convertEol?: boolean;
|
|
979
|
-
cursorBlink?: boolean;
|
|
980
|
-
cursorStyle?: 'block' | 'underline' | 'bar';
|
|
981
|
-
cursorWidth?: number;
|
|
982
|
-
cursorInactiveStyle?: 'outline' | 'block' | 'bar' | 'underline' | 'none';
|
|
983
|
-
customGlyphs?: boolean;
|
|
984
|
-
disableStdin?: boolean;
|
|
985
|
-
drawBoldTextInBrightColors?: boolean;
|
|
986
|
-
fastScrollModifier?: 'none' | 'alt' | 'ctrl' | 'shift';
|
|
987
|
-
fastScrollSensitivity?: number;
|
|
988
|
-
fontSize?: number;
|
|
989
|
-
fontFamily?: string;
|
|
990
|
-
fontWeight?: FontWeight;
|
|
991
|
-
fontWeightBold?: FontWeight;
|
|
992
|
-
ignoreBracketedPasteMode?: boolean;
|
|
993
|
-
letterSpacing?: number;
|
|
994
|
-
lineHeight?: number;
|
|
995
|
-
linkHandler?: ILinkHandler | null;
|
|
996
|
-
logLevel?: LogLevel;
|
|
997
|
-
macOptionIsMeta?: boolean;
|
|
998
|
-
macOptionClickForcesSelection?: boolean;
|
|
999
|
-
minimumContrastRatio?: number;
|
|
1000
|
-
rightClickSelectsWord?: boolean;
|
|
1001
|
-
screenReaderMode?: boolean;
|
|
1002
|
-
scrollback?: number;
|
|
1003
|
-
scrollOnEraseInDisplay?: boolean;
|
|
1004
|
-
scrollOnUserInput?: boolean;
|
|
1005
|
-
scrollSensitivity?: number;
|
|
1006
|
-
smoothScrollDuration?: number;
|
|
1007
|
-
tabStopWidth?: number;
|
|
1008
|
-
theme?: ITheme;
|
|
1009
|
-
windowsPty?: IWindowsPty;
|
|
1010
|
-
wordSeparator?: string;
|
|
1011
|
-
}
|
|
1012
|
-
interface ITerminalInitOnlyOptions {
|
|
1013
|
-
cols?: number;
|
|
1014
|
-
rows?: number;
|
|
1015
|
-
}
|
|
1016
|
-
interface IBufferCellPosition {
|
|
1017
|
-
/** Coluna, a partir de 1. */
|
|
1018
|
-
x: number;
|
|
1019
|
-
/** Linha do buffer (histórico incluído), a partir de 1. */
|
|
1020
|
-
y: number;
|
|
1021
|
-
}
|
|
1022
|
-
interface IBufferRange {
|
|
1023
|
-
start: IBufferCellPosition;
|
|
1024
|
-
end: IBufferCellPosition;
|
|
1025
|
-
}
|
|
1026
|
-
interface IBufferCell {
|
|
1027
|
-
getWidth(): number;
|
|
1028
|
-
getChars(): string;
|
|
1029
|
-
getCode(): number;
|
|
1030
|
-
getFgColorMode(): number;
|
|
1031
|
-
getBgColorMode(): number;
|
|
1032
|
-
getFgColor(): number;
|
|
1033
|
-
getBgColor(): number;
|
|
1034
|
-
isBold(): number;
|
|
1035
|
-
isItalic(): number;
|
|
1036
|
-
isDim(): number;
|
|
1037
|
-
isUnderline(): number;
|
|
1038
|
-
isBlink(): number;
|
|
1039
|
-
isInverse(): number;
|
|
1040
|
-
isInvisible(): number;
|
|
1041
|
-
isStrikethrough(): number;
|
|
1042
|
-
isOverline(): number;
|
|
1043
|
-
isFgRGB(): boolean;
|
|
1044
|
-
isBgRGB(): boolean;
|
|
1045
|
-
isFgPalette(): boolean;
|
|
1046
|
-
isBgPalette(): boolean;
|
|
1047
|
-
isFgDefault(): boolean;
|
|
1048
|
-
isBgDefault(): boolean;
|
|
1049
|
-
isAttributeDefault(): boolean;
|
|
1050
|
-
getUnderlineStyle(): number;
|
|
1051
|
-
getUnderlineColor(): number;
|
|
1052
|
-
getUnderlineColorMode(): number;
|
|
1053
|
-
isUnderlineColorRGB(): boolean;
|
|
1054
|
-
isUnderlineColorPalette(): boolean;
|
|
1055
|
-
isUnderlineColorDefault(): boolean;
|
|
1056
|
-
/** Mesmas cores e estilos (sem comparar o conteúdo nem o link). */
|
|
1057
|
-
attributesEquals(other: IBufferCell): boolean;
|
|
1058
|
-
}
|
|
1059
|
-
interface IBufferLine {
|
|
1060
|
-
readonly isWrapped: boolean;
|
|
1061
|
-
readonly length: number;
|
|
1062
|
-
getCell(x: number, cell?: IBufferCell): IBufferCell | undefined;
|
|
1063
|
-
translateToString(trimRight?: boolean, startColumn?: number, endColumn?: number): string;
|
|
1064
|
-
}
|
|
1065
|
-
interface IBuffer {
|
|
1066
|
-
readonly type: 'normal' | 'alternate';
|
|
1067
|
-
readonly cursorY: number;
|
|
1068
|
-
readonly cursorX: number;
|
|
1069
|
-
readonly viewportY: number;
|
|
1070
|
-
readonly baseY: number;
|
|
1071
|
-
readonly length: number;
|
|
1072
|
-
getLine(y: number): IBufferLine | undefined;
|
|
1073
|
-
getNullCell(): IBufferCell;
|
|
1074
|
-
}
|
|
1075
|
-
interface IBufferNamespace {
|
|
1076
|
-
readonly active: IBuffer;
|
|
1077
|
-
readonly normal: IBuffer;
|
|
1078
|
-
readonly alternate: IBuffer;
|
|
1079
|
-
readonly onBufferChange: IEvent<IBuffer>;
|
|
1080
|
-
}
|
|
1081
|
-
interface IMarker extends IDisposable {
|
|
1082
|
-
readonly id: number;
|
|
1083
|
-
readonly isDisposed: boolean;
|
|
1084
|
-
readonly line: number;
|
|
1085
|
-
readonly onDispose: IEvent<void>;
|
|
1086
|
-
}
|
|
1087
|
-
interface IDecorationOverviewRulerOptions {
|
|
1088
|
-
color: string;
|
|
1089
|
-
position?: 'left' | 'center' | 'right' | 'full';
|
|
1090
|
-
}
|
|
1091
|
-
interface IDecorationOptions {
|
|
1092
|
-
readonly marker: IMarker;
|
|
1093
|
-
readonly anchor?: 'right' | 'left';
|
|
1094
|
-
readonly x?: number;
|
|
1095
|
-
readonly width?: number;
|
|
1096
|
-
readonly height?: number;
|
|
1097
|
-
readonly backgroundColor?: string;
|
|
1098
|
-
readonly foregroundColor?: string;
|
|
1099
|
-
readonly layer?: 'bottom' | 'top';
|
|
1100
|
-
overviewRulerOptions?: IDecorationOverviewRulerOptions;
|
|
1101
|
-
}
|
|
1102
|
-
interface IDecoration extends IDisposable {
|
|
1103
|
-
readonly marker: IMarker;
|
|
1104
|
-
readonly onRender: IEvent<HTMLElement>;
|
|
1105
|
-
readonly onDispose: IEvent<void>;
|
|
1106
|
-
readonly isDisposed: boolean;
|
|
1107
|
-
element: HTMLElement | undefined;
|
|
1108
|
-
options: Pick<IDecorationOptions, 'overviewRulerOptions'>;
|
|
1109
|
-
}
|
|
1110
|
-
interface ILinkDecorations {
|
|
1111
|
-
pointerCursor: boolean;
|
|
1112
|
-
underline: boolean;
|
|
1113
|
-
}
|
|
1114
|
-
interface ILink {
|
|
1115
|
-
range: IBufferRange;
|
|
1116
|
-
text: string;
|
|
1117
|
-
decorations?: ILinkDecorations;
|
|
1118
|
-
activate(event: MouseEvent, text: string): void;
|
|
1119
|
-
hover?(event: MouseEvent, text: string): void;
|
|
1120
|
-
leave?(event: MouseEvent, text: string): void;
|
|
1121
|
-
dispose?(): void;
|
|
1122
|
-
}
|
|
1123
|
-
interface ILinkProvider {
|
|
1124
|
-
/** `bufferLineNumber` a partir de 1. */
|
|
1125
|
-
provideLinks(bufferLineNumber: number, callback: (links: ILink[] | undefined) => void): void;
|
|
1126
|
-
}
|
|
1127
|
-
interface IParser {
|
|
1128
|
-
registerCsiHandler(id: IFunctionIdentifier, callback: (params: Params) => boolean | Promise<boolean>): IDisposable;
|
|
1129
|
-
registerDcsHandler(id: IFunctionIdentifier, callback: (data: string, param: Params) => boolean | Promise<boolean>): IDisposable;
|
|
1130
|
-
registerEscHandler(id: IFunctionIdentifier, handler: () => boolean | Promise<boolean>): IDisposable;
|
|
1131
|
-
registerOscHandler(ident: number, callback: (data: string) => boolean | Promise<boolean>): IDisposable;
|
|
1132
|
-
registerApcHandler(id: IFunctionIdentifier, callback: (data: string) => boolean | Promise<boolean>): IDisposable;
|
|
1133
|
-
}
|
|
1134
|
-
interface IUnicodeHandling {
|
|
1135
|
-
register(provider: IUnicodeVersionProvider): void;
|
|
1136
|
-
readonly versions: ReadonlyArray<string>;
|
|
1137
|
-
activeVersion: string;
|
|
1138
|
-
}
|
|
1139
|
-
interface IModes {
|
|
1140
|
-
readonly applicationCursorKeysMode: boolean;
|
|
1141
|
-
readonly applicationKeypadMode: boolean;
|
|
1142
|
-
readonly bracketedPasteMode: boolean;
|
|
1143
|
-
readonly insertMode: boolean;
|
|
1144
|
-
readonly mouseTrackingMode: 'none' | 'x10' | 'vt200' | 'drag' | 'any';
|
|
1145
|
-
readonly originMode: boolean;
|
|
1146
|
-
readonly reverseWraparoundMode: boolean;
|
|
1147
|
-
readonly sendFocusMode: boolean;
|
|
1148
|
-
readonly showCursor: boolean;
|
|
1149
|
-
readonly synchronizedOutputMode: boolean;
|
|
1150
|
-
readonly wraparoundMode: boolean;
|
|
1151
|
-
}
|
|
1152
|
-
interface ITerminalAddon extends IDisposable {
|
|
1153
|
-
activate(terminal: ITerminalLike): void;
|
|
1154
|
-
}
|
|
1155
|
-
/** O que um complemento enxerga do terminal (a classe `Terminal` satisfaz). */
|
|
1156
|
-
interface ITerminalLike {
|
|
1157
|
-
readonly element: HTMLElement | undefined;
|
|
1158
|
-
readonly cols: number;
|
|
1159
|
-
readonly rows: number;
|
|
1160
|
-
readonly buffer: IBufferNamespace;
|
|
1161
|
-
readonly options: Required<Pick<ITerminalOptions, 'fontSize' | 'lineHeight'>> & ITerminalOptions;
|
|
1162
|
-
resize(cols: number, rows: number): void;
|
|
1163
|
-
registerLinkProvider(provider: ILinkProvider): IDisposable;
|
|
1164
|
-
registerMarker(cursorYOffset?: number): IMarker | undefined;
|
|
1165
|
-
registerDecoration(options: IDecorationOptions): IDecoration | undefined;
|
|
1166
|
-
select(column: number, row: number, length: number): void;
|
|
1167
|
-
clearSelection(): void;
|
|
1168
|
-
scrollToLine(line: number): void;
|
|
1169
|
-
readonly onWriteParsed: IEvent<void>;
|
|
1170
|
-
readonly onResize: IEvent<{
|
|
1171
|
-
cols: number;
|
|
1172
|
-
rows: number;
|
|
1173
|
-
}>;
|
|
1174
|
-
/** Medidas da célula em pixels (zero antes do `open`). */
|
|
1175
|
-
readonly cellSize: {
|
|
1176
|
-
readonly width: number;
|
|
1177
|
-
readonly height: number;
|
|
1178
|
-
};
|
|
1179
|
-
}
|
|
1180
|
-
interface IViewportRange {
|
|
1181
|
-
start: {
|
|
1182
|
-
x: number;
|
|
1183
|
-
y: number;
|
|
1184
|
-
};
|
|
1185
|
-
end: {
|
|
1186
|
-
x: number;
|
|
1187
|
-
y: number;
|
|
1188
|
-
};
|
|
1189
|
-
}
|
|
1190
|
-
|
|
1191
|
-
type ResolvedOptions = Required<Omit<ITerminalOptions, 'linkHandler' | 'theme' | 'windowsPty'>> & Pick<ITerminalOptions, 'linkHandler' | 'windowsPty'> & {
|
|
1192
|
-
theme: ITheme;
|
|
1193
|
-
cols: number;
|
|
1194
|
-
rows: number;
|
|
1195
|
-
};
|
|
1196
|
-
declare class Terminal implements ITerminalLike, IDisposable {
|
|
1197
|
-
/** O elemento do terminal, depois do `open`. */
|
|
1198
|
-
element: HTMLElement | undefined;
|
|
1199
|
-
/** A área de texto escondida que recebe o foco e o teclado (IME incluído). */
|
|
1200
|
-
textarea: HTMLTextAreaElement | undefined;
|
|
1201
|
-
private readonly core;
|
|
1202
|
-
private readonly store;
|
|
1203
|
-
private readonly resolved;
|
|
1204
|
-
readonly options: ResolvedOptions;
|
|
1205
|
-
private renderer;
|
|
1206
|
-
private viewport;
|
|
1207
|
-
private scrollArea;
|
|
1208
|
-
private a11yTree;
|
|
1209
|
-
private liveRegion;
|
|
1210
|
-
private liveText;
|
|
1211
|
-
private liveTimer;
|
|
1212
|
-
private customKeyHandler;
|
|
1213
|
-
private customWheelHandler;
|
|
1214
|
-
private readonly linkProviders;
|
|
1215
|
-
private readonly decorations;
|
|
1216
|
-
private readonly addons;
|
|
1217
|
-
private hoveredLink;
|
|
1218
|
-
private linkRequest;
|
|
1219
|
-
private selecting;
|
|
1220
|
-
private mouseButton;
|
|
1221
|
-
private lastMouseCell;
|
|
1222
|
-
private composing;
|
|
1223
|
-
private keyHandled;
|
|
1224
|
-
private disposed;
|
|
1225
|
-
private readonly keyEmitter;
|
|
1226
|
-
private readonly renderEmitter;
|
|
1227
|
-
private readonly scrollEmitter;
|
|
1228
|
-
private readonly selectionEmitter;
|
|
1229
|
-
private readonly bufferEmitter;
|
|
1230
|
-
private readonly dimensionsEmitter;
|
|
1231
|
-
/** As medidas da tela mudaram (fonte, entrelinha, tamanho). */
|
|
1232
|
-
readonly onDimensionsChange: _trismegisto_terminal.IEvent<IRenderDimensions>;
|
|
1233
|
-
/** Textos que o terminal mesmo usa; troque para traduzir (vale para os terminais abertos depois). */
|
|
1234
|
-
static strings: ILocalizableStrings;
|
|
1235
|
-
private nextJoinerId;
|
|
1236
|
-
private blinkTimer;
|
|
1237
|
-
private smoothTarget;
|
|
1238
|
-
private smoothFrame;
|
|
1239
|
-
private overviewRuler;
|
|
1240
|
-
private announcedLines;
|
|
1241
|
-
private announceWindow;
|
|
1242
|
-
readonly onKey: _trismegisto_terminal.IEvent<{
|
|
1243
|
-
key: string;
|
|
1244
|
-
domEvent: KeyboardEvent;
|
|
1245
|
-
}>;
|
|
1246
|
-
readonly onRender: _trismegisto_terminal.IEvent<{
|
|
1247
|
-
start: number;
|
|
1248
|
-
end: number;
|
|
1249
|
-
}>;
|
|
1250
|
-
readonly onScroll: _trismegisto_terminal.IEvent<number>;
|
|
1251
|
-
readonly onSelectionChange: _trismegisto_terminal.IEvent<void>;
|
|
1252
|
-
readonly buffer: IBufferNamespace;
|
|
1253
|
-
readonly parser: IParser;
|
|
1254
|
-
readonly unicode: IUnicodeHandling;
|
|
1255
|
-
constructor(options?: ITerminalOptions & ITerminalInitOnlyOptions);
|
|
1256
|
-
get cols(): number;
|
|
1257
|
-
get rows(): number;
|
|
1258
|
-
get modes(): IModes;
|
|
1259
|
-
/** O elemento das camadas de desenho (linhas, cursor, seleção, decorações), sem o viewport nem a barra. */
|
|
1260
|
-
get screenElement(): HTMLElement | undefined;
|
|
1261
|
-
/** Medidas da tela e da célula; `undefined` antes do `open`. */
|
|
1262
|
-
get dimensions(): IRenderDimensions | undefined;
|
|
1263
|
-
/**
|
|
1264
|
-
* Juntor de caracteres: recebe o texto de cada linha desenhada e devolve faixas `[início, fim)` que viram uma unidade
|
|
1265
|
-
* (ligaduras, grafemas). Devolve o id para `deregisterCharacterJoiner`.
|
|
1266
|
-
*/
|
|
1267
|
-
registerCharacterJoiner(handler: (text: string) => [number, number][]): number;
|
|
1268
|
-
deregisterCharacterJoiner(joinerId: number): void;
|
|
1269
|
-
private readonly pendingJoiners;
|
|
1270
|
-
get markers(): ReadonlyArray<IMarker>;
|
|
1271
|
-
get cellSize(): {
|
|
1272
|
-
width: number;
|
|
1273
|
-
height: number;
|
|
1274
|
-
};
|
|
1275
|
-
get onData(): _trismegisto_terminal.IEvent<string>;
|
|
1276
|
-
get onBinary(): _trismegisto_terminal.IEvent<string>;
|
|
1277
|
-
get onBell(): _trismegisto_terminal.IEvent<void>;
|
|
1278
|
-
get onTitleChange(): _trismegisto_terminal.IEvent<string>;
|
|
1279
|
-
get onLineFeed(): _trismegisto_terminal.IEvent<void>;
|
|
1280
|
-
get onCursorMove(): _trismegisto_terminal.IEvent<void>;
|
|
1281
|
-
get onResize(): _trismegisto_terminal.IEvent<{
|
|
1282
|
-
cols: number;
|
|
1283
|
-
rows: number;
|
|
1284
|
-
}>;
|
|
1285
|
-
get onWriteParsed(): _trismegisto_terminal.IEvent<void>;
|
|
1286
|
-
private applyOption;
|
|
1287
|
-
private applyTheme;
|
|
1288
|
-
private applyBackground;
|
|
1289
|
-
private renderOptions;
|
|
1290
|
-
open(parent: HTMLElement): void;
|
|
1291
|
-
private bindEvents;
|
|
1292
|
-
private setFocused;
|
|
1293
|
-
focus(): void;
|
|
1294
|
-
blur(): void;
|
|
1295
|
-
attachCustomKeyEventHandler(handler: (event: KeyboardEvent) => boolean): void;
|
|
1296
|
-
attachCustomWheelEventHandler(handler: (event: WheelEvent) => boolean): void;
|
|
1297
|
-
private handleKeyDown;
|
|
1298
|
-
private handleKeyUp;
|
|
1299
|
-
/** Codificação nos protocolos estendidos; `null` = segue o teclado legado, `''` = engole a tecla. */
|
|
1300
|
-
private extendedKey;
|
|
1301
|
-
/** Texto que chega sem `keydown` útil (teclado virtual, ditado): vai como digitado. */
|
|
1302
|
-
private handleInput;
|
|
1303
|
-
private sendUserInput;
|
|
1304
|
-
private handleCopy;
|
|
1305
|
-
/** Manda dados como se o usuário tivesse digitado (`wasUserInput` false: não rola nem limpa a seleção). */
|
|
1306
|
-
input(data: string, wasUserInput?: boolean): void;
|
|
1307
|
-
paste(data: string): void;
|
|
1308
|
-
private mouseReportingActive;
|
|
1309
|
-
private reportMouse;
|
|
1310
|
-
private handleMouseDown;
|
|
1311
|
-
/** Ponto do buffer (coluna/linha absoluta) sob o mouse. */
|
|
1312
|
-
private bufferPoint;
|
|
1313
|
-
private extendSelection;
|
|
1314
|
-
private logicalStart;
|
|
1315
|
-
private logicalEnd;
|
|
1316
|
-
/** Limites da palavra em `(x, y)`: de separador a separador, atravessando quebras automáticas. */
|
|
1317
|
-
private wordBounds;
|
|
1318
|
-
private selectWordAt;
|
|
1319
|
-
/** Alt+clique: move o cursor do prompt até o ponto com setas (como o xterm faz). */
|
|
1320
|
-
private moveCursorTo;
|
|
1321
|
-
private handleWheel;
|
|
1322
|
-
/** Rolagem suave: anda até o alvo ao longo de `smoothScrollDuration`, linha a linha (a grade é por linhas). */
|
|
1323
|
-
private smoothScrollBy;
|
|
1324
|
-
private applyScrollbar;
|
|
1325
|
-
private renderOverviewRuler;
|
|
1326
|
-
/** Volta a piscar e agenda a parada por inatividade (5 minutos). */
|
|
1327
|
-
private wakeBlink;
|
|
1328
|
-
registerLinkProvider(provider: ILinkProvider): IDisposable;
|
|
1329
|
-
private handleHover;
|
|
1330
|
-
private clearHoveredLink;
|
|
1331
|
-
private activateLinkAt;
|
|
1332
|
-
/** Procura o link sob `point`: primeiro os hiperlinks OSC 8, depois os provedores, na ordem de registro. */
|
|
1333
|
-
private findLink;
|
|
1334
|
-
private hyperlinkAt;
|
|
1335
|
-
private openLink;
|
|
1336
|
-
registerMarker(cursorYOffset?: number): IMarker | undefined;
|
|
1337
|
-
registerDecoration(options: IDecorationOptions): IDecoration | undefined;
|
|
1338
|
-
private renderDecorations;
|
|
1339
|
-
private setupA11y;
|
|
1340
|
-
private updateA11yRows;
|
|
1341
|
-
/** Anuncia o que foi escrito (o leitor de tela lê a região viva), em lotes. */
|
|
1342
|
-
private announce;
|
|
1343
|
-
write(data: string | Uint8Array, callback?: () => void): void;
|
|
1344
|
-
writeln(data: string | Uint8Array, callback?: () => void): void;
|
|
1345
|
-
resize(columns: number, rows: number): void;
|
|
1346
|
-
refresh(start: number, end: number): void;
|
|
1347
|
-
/** Para a renderização por textura do xterm; aqui a renderização é DOM e não há o que limpar. */
|
|
1348
|
-
clearTextureAtlas(): void;
|
|
1349
|
-
reset(): void;
|
|
1350
|
-
/** Apaga tudo, deixando a linha do cursor (o prompt) como a primeira. */
|
|
1351
|
-
clear(): void;
|
|
1352
|
-
scrollLines(amount: number): void;
|
|
1353
|
-
scrollPages(pageCount: number): void;
|
|
1354
|
-
scrollToTop(): void;
|
|
1355
|
-
scrollToBottom(): void;
|
|
1356
|
-
scrollToLine(line: number): void;
|
|
1357
|
-
private syncScrollArea;
|
|
1358
|
-
hasSelection(): boolean;
|
|
1359
|
-
getSelection(): string;
|
|
1360
|
-
/** Posição da seleção, a partir de 1; `end` é exclusivo. */
|
|
1361
|
-
getSelectionPosition(): IBufferRange | undefined;
|
|
1362
|
-
clearSelection(): void;
|
|
1363
|
-
select(column: number, row: number, length: number): void;
|
|
1364
|
-
selectAll(): void;
|
|
1365
|
-
selectLines(start: number, end: number): void;
|
|
1366
|
-
loadAddon(addon: ITerminalAddon): void;
|
|
1367
|
-
dispose(): void;
|
|
1368
|
-
/** Só para os testes e para o componente Angular: desenha já o que está pendente. */
|
|
1369
|
-
renderNow(): void;
|
|
1370
|
-
/**
|
|
1371
|
-
* Partes internas para os complementos deste pacote (imagens, renderizador WebGL…). Não é API pública estável:
|
|
1372
|
-
* fora do pacote, use a API no formato do xterm.js.
|
|
1373
|
-
*/
|
|
1374
|
-
get _internals(): TerminalInternals;
|
|
1375
|
-
}
|
|
1376
|
-
interface TerminalInternals {
|
|
1377
|
-
readonly core: TerminalCore;
|
|
1378
|
-
readonly renderer: DomRenderer | undefined;
|
|
1379
|
-
readonly element: HTMLElement | undefined;
|
|
1380
|
-
/** A cada quadro desenhado (linhas `start`–`end` da tela, ou -1/-1 quando só as camadas mudaram). */
|
|
1381
|
-
onFrame(listener: (start: number, end: number) => void): IDisposable;
|
|
1382
|
-
refreshAll(): void;
|
|
1383
|
-
}
|
|
1384
|
-
|
|
1385
|
-
declare const TERMINAL_CSS = "\n.hmt {\n position: relative;\n overflow: hidden;\n block-size: 100%;\n inline-size: 100%;\n background: var(--hmt-background, #000);\n color: var(--hmt-foreground, #fff);\n cursor: text;\n user-select: none;\n -webkit-user-select: none;\n contain: strict;\n}\n.hmt.hmt-link-hover { cursor: pointer; }\n.hmt-viewport {\n position: absolute;\n inset: 0;\n /* A barra s\u00F3 aparece com hist\u00F3rico para rolar (auto), e sobre ela vale o cursor padr\u00E3o, n\u00E3o o de texto. */\n overflow-y: auto;\n overflow-x: hidden;\n cursor: default;\n background: transparent;\n scrollbar-color: var(--hmt-scrollbar, rgba(127, 127, 127, 0.5)) transparent;\n}\n.hmt-scroll-area { inline-size: 1px; }\n.hmt-screen {\n position: absolute;\n inset-block-start: 0;\n inset-inline-start: 0;\n white-space: pre;\n font-kerning: none;\n font-variant-ligatures: none;\n line-height: var(--hmt-cell-height);\n}\n.hmt-rows, .hmt-selection, .hmt-links, .hmt-decorations { position: absolute; inset: 0; pointer-events: none; }\n.hmt-row { display: block; overflow: hidden; white-space: pre; line-height: var(--hmt-cell-height); }\n.hmt-row span { display: inline; }\n.hmt-glyph { display: inline-block !important; inline-size: var(--hmt-cell-width); block-size: var(--hmt-cell-height); vertical-align: top; }\n.hmt-wide { display: inline-block !important; inline-size: calc(var(--hmt-cell-width) * 2); text-align: center; }\n.hmt-bold { font-weight: var(--hmt-font-weight-bold, bold); }\n.hmt-dim { opacity: 0.5; }\n.hmt-italic { font-style: italic; }\n.hmt-blink { animation: hmt-blink var(--hmt-blink-duration, 1s) step-end infinite; }\n.hmt-blink-off .hmt-blink { animation: none; }\n.hmt-joined { display: inline-block !important; white-space: pre; overflow: visible; vertical-align: top; }\n.hmt-rescaled { display: inline-block !important; inline-size: var(--hmt-cell-width); white-space: pre; transform-origin: left center; vertical-align: top; }\n.hmt-no-scrollbar .hmt-viewport { scrollbar-width: none; }\n.hmt-no-scrollbar .hmt-viewport::-webkit-scrollbar { display: none; }\n.hmt-scrollbar-sized .hmt-viewport::-webkit-scrollbar { inline-size: var(--hmt-scrollbar-width); }\n.hmt-scrollbar-sized .hmt-viewport::-webkit-scrollbar-thumb { background: var(--hmt-scrollbar, rgba(127, 127, 127, 0.5)); border-radius: 4px; }\n.hmt-scrollbar-arrows .hmt-viewport::-webkit-scrollbar-button:single-button { display: block; block-size: var(--hmt-scrollbar-width, 12px); }\n.hmt-overview-ruler { position: absolute; inset-block: 0; inset-inline-end: 0; inline-size: var(--hmt-scrollbar-width, 14px); pointer-events: none; z-index: 1; }\n.hmt-overview-ruler .hmt-ruler-mark { position: absolute; min-block-size: 2px; }\n.hmt-overview-ruler.hmt-ruler-top { border-block-start: 1px solid var(--hmt-ruler-border, transparent); }\n.hmt-overview-ruler.hmt-ruler-bottom { border-block-end: 1px solid var(--hmt-ruler-border, transparent); }\n.hmt-hyperlink { text-decoration-line: underline; text-decoration-style: dashed; text-underline-offset: 2px; }\n.hmt-selection-range { position: absolute; }\n.hmt-link-underline { position: absolute; border-block-end: 1px solid currentColor; box-sizing: border-box; color: var(--hmt-foreground, #fff); }\n.hmt-decoration { position: absolute; pointer-events: auto; }\n.hmt-cursor {\n position: absolute;\n pointer-events: none;\n box-sizing: border-box;\n overflow: hidden;\n text-align: center;\n line-height: var(--hmt-cell-height);\n}\n.hmt-cursor-block.hmt-cursor-focus { color: var(--hmt-background, #000); }\n.hmt-cursor-block:not(.hmt-cursor-focus), .hmt-cursor-outline { outline: 1px solid var(--hmt-cursor-color); outline-offset: -1px; }\n.hmt-cursor-underline { box-shadow: inset 0 -2px 0 var(--hmt-cursor-color); }\n.hmt-cursor-bar { background-color: var(--hmt-cursor-color); }\n.hmt-cursor-blink { animation: hmt-blink 1s step-end infinite; }\n@keyframes hmt-blink { 50% { opacity: 0; } }\n@media (prefers-reduced-motion: reduce) { .hmt-cursor-blink, .hmt-blink { animation: none; } }\n.hmt-helper-textarea {\n position: absolute;\n inset-block-start: 0;\n inset-inline-start: -9999em;\n inline-size: 0;\n block-size: 0;\n opacity: 0;\n padding: 0;\n border: 0;\n resize: none;\n overflow: hidden;\n white-space: nowrap;\n z-index: -5;\n}\n.hmt-measure {\n position: absolute;\n inset-block-start: 0;\n inset-inline-start: -9999em;\n visibility: hidden;\n white-space: pre;\n line-height: normal;\n}\n.hmt-a11y-tree, .hmt-a11y-live {\n position: absolute;\n inline-size: 1px;\n block-size: 1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: pre;\n}\n";
|
|
1386
|
-
declare function ensureStyles(doc: Document): void;
|
|
1387
|
-
|
|
1388
|
-
/**
|
|
1389
|
-
* Lê as cores dos tokens no elemento (com uma sonda, para resolver `var()` e `color-mix()`). A seleção vai como
|
|
1390
|
-
* `var(...)`: é uma camada CSS e acompanha o tema sem reler. Sem os tokens (CSS do Trismegisto ausente), as chaves
|
|
1391
|
-
* ficam `undefined` e o terminal usa as cores padrão.
|
|
1392
|
-
*/
|
|
1393
|
-
declare function terminalThemeFromTokens(element: HTMLElement): ITheme;
|
|
1394
|
-
|
|
1395
|
-
interface ITerminalDimensions {
|
|
1396
|
-
cols: number;
|
|
1397
|
-
rows: number;
|
|
1398
|
-
}
|
|
1399
|
-
declare class FitAddon implements ITerminalAddon {
|
|
1400
|
-
private terminal;
|
|
1401
|
-
activate(terminal: ITerminalLike): void;
|
|
1402
|
-
dispose(): void;
|
|
1403
|
-
fit(): void;
|
|
1404
|
-
/**
|
|
1405
|
-
* Largura reservada para a barra de rolagem. Ela só aparece quando há histórico para rolar; reservar sempre (com
|
|
1406
|
-
* histórico ligado) evita que a barra, ao surgir, cubra a última coluna e roube os cliques da tela.
|
|
1407
|
-
*/
|
|
1408
|
-
private scrollbarWidth;
|
|
1409
|
-
private measuredScrollbar;
|
|
1410
|
-
/** O que caberia no pai, descontados o preenchimento do elemento e a barra de rolagem. */
|
|
1411
|
-
proposeDimensions(): ITerminalDimensions | undefined;
|
|
1412
|
-
}
|
|
1413
|
-
|
|
1414
|
-
interface ISearchDecorationOptions {
|
|
1415
|
-
matchBackground?: string;
|
|
1416
|
-
matchBorder?: string;
|
|
1417
|
-
matchOverviewRuler: string;
|
|
1418
|
-
activeMatchBackground?: string;
|
|
1419
|
-
activeMatchBorder?: string;
|
|
1420
|
-
activeMatchColorOverviewRuler: string;
|
|
1421
|
-
}
|
|
1422
|
-
interface ISearchOptions {
|
|
1423
|
-
regex?: boolean;
|
|
1424
|
-
wholeWord?: boolean;
|
|
1425
|
-
caseSensitive?: boolean;
|
|
1426
|
-
incremental?: boolean;
|
|
1427
|
-
decorations?: ISearchDecorationOptions;
|
|
1428
|
-
}
|
|
1429
|
-
interface ISearchResultChange {
|
|
1430
|
-
resultIndex: number;
|
|
1431
|
-
resultCount: number;
|
|
1432
|
-
}
|
|
1433
|
-
declare class SearchAddon implements ITerminalAddon {
|
|
1434
|
-
private readonly config;
|
|
1435
|
-
private terminal;
|
|
1436
|
-
private readonly resultsEmitter;
|
|
1437
|
-
readonly onDidChangeResults: _trismegisto_terminal.IEvent<ISearchResultChange>;
|
|
1438
|
-
private matches;
|
|
1439
|
-
private current;
|
|
1440
|
-
private previousMatch;
|
|
1441
|
-
private lastTerm;
|
|
1442
|
-
private lastOptions;
|
|
1443
|
-
private highlights;
|
|
1444
|
-
private writeSub;
|
|
1445
|
-
constructor(config?: {
|
|
1446
|
-
highlightLimit?: number;
|
|
1447
|
-
});
|
|
1448
|
-
activate(terminal: ITerminalLike): void;
|
|
1449
|
-
dispose(): void;
|
|
1450
|
-
findNext(term: string, options?: ISearchOptions): boolean;
|
|
1451
|
-
findPrevious(term: string, options?: ISearchOptions): boolean;
|
|
1452
|
-
clearDecorations(retainActiveDecoration?: boolean): void;
|
|
1453
|
-
clearActiveDecoration(): void;
|
|
1454
|
-
private find;
|
|
1455
|
-
private reset;
|
|
1456
|
-
private search;
|
|
1457
|
-
private highlight;
|
|
1458
|
-
}
|
|
1459
|
-
|
|
1460
|
-
interface ILinkProviderOptions {
|
|
1461
|
-
hover?(event: MouseEvent, text: string, location: IBufferRange): void;
|
|
1462
|
-
leave?(event: MouseEvent, text: string): void;
|
|
1463
|
-
urlRegex?: RegExp;
|
|
1464
|
-
}
|
|
1465
|
-
declare class WebLinksAddon implements ITerminalAddon {
|
|
1466
|
-
private readonly handler;
|
|
1467
|
-
private readonly options;
|
|
1468
|
-
private registration;
|
|
1469
|
-
constructor(handler?: (event: MouseEvent, uri: string) => void, options?: ILinkProviderOptions);
|
|
1470
|
-
activate(terminal: ITerminalLike): void;
|
|
1471
|
-
dispose(): void;
|
|
1472
|
-
}
|
|
1473
|
-
/** Procura URLs na linha lógica (as linhas unidas por quebra automática), devolvendo as que passam pela linha pedida. */
|
|
1474
|
-
declare class WebLinkProvider implements ILinkProvider {
|
|
1475
|
-
private readonly terminal;
|
|
1476
|
-
private readonly handler;
|
|
1477
|
-
private readonly options;
|
|
1478
|
-
constructor(terminal: ITerminalLike, handler: (event: MouseEvent, uri: string) => void, options: ILinkProviderOptions);
|
|
1479
|
-
provideLinks(bufferLineNumber: number, callback: (links: ILink[] | undefined) => void): void;
|
|
1480
|
-
}
|
|
1481
|
-
|
|
1482
|
-
interface IAttachOptions {
|
|
1483
|
-
/** O que se digita vai para o socket (padrão `true`). */
|
|
1484
|
-
bidirectional?: boolean;
|
|
1485
|
-
}
|
|
1486
|
-
declare class AttachAddon implements ITerminalAddon {
|
|
1487
|
-
private readonly socket;
|
|
1488
|
-
private readonly store;
|
|
1489
|
-
private readonly bidirectional;
|
|
1490
|
-
constructor(socket: WebSocket, options?: IAttachOptions);
|
|
1491
|
-
activate(terminal: ITerminalLike): void;
|
|
1492
|
-
dispose(): void;
|
|
1493
|
-
private open;
|
|
1494
|
-
private send;
|
|
1495
|
-
private sendBinary;
|
|
1496
|
-
}
|
|
1497
|
-
|
|
1498
|
-
interface IBase64 {
|
|
1499
|
-
encodeText(data: string): string;
|
|
1500
|
-
/** Lança se `data` não for base64 válido. */
|
|
1501
|
-
decodeText(data: string): string;
|
|
1502
|
-
}
|
|
1503
|
-
interface IClipboardProvider {
|
|
1504
|
-
readText(selection: string): string | Promise<string>;
|
|
1505
|
-
writeText(selection: string, text: string): void | Promise<void>;
|
|
1506
|
-
}
|
|
1507
|
-
/** Base64 de texto UTF-8 (RFC 4648, alfabeto padrão, preenchimento opcional). */
|
|
1508
|
-
declare class Base64 implements IBase64 {
|
|
1509
|
-
encodeText(data: string): string;
|
|
1510
|
-
decodeText(data: string): string;
|
|
1511
|
-
}
|
|
1512
|
-
/** Usa `navigator.clipboard` para qualquer seleção (não há buffers de recorte separados no navegador). */
|
|
1513
|
-
declare class BrowserClipboardProvider implements IClipboardProvider {
|
|
1514
|
-
readText(_selection: string): Promise<string>;
|
|
1515
|
-
writeText(_selection: string, data: string): Promise<void>;
|
|
1516
|
-
}
|
|
1517
|
-
declare class ClipboardAddon implements ITerminalAddon {
|
|
1518
|
-
private readonly base64;
|
|
1519
|
-
private readonly provider;
|
|
1520
|
-
private registration;
|
|
1521
|
-
private terminal;
|
|
1522
|
-
constructor(base64?: IBase64, provider?: IClipboardProvider);
|
|
1523
|
-
activate(terminal: ITerminalLike): void;
|
|
1524
|
-
dispose(): void;
|
|
1525
|
-
private handle;
|
|
1526
|
-
private reply;
|
|
1527
|
-
}
|
|
1528
|
-
|
|
1529
|
-
interface IProgressState {
|
|
1530
|
-
/** 0 nenhum, 1 normal, 2 erro, 3 indeterminado, 4 pausa/aviso. */
|
|
1531
|
-
state: 0 | 1 | 2 | 3 | 4;
|
|
1532
|
-
/** Percentual de 0 a 100. */
|
|
1533
|
-
value: number;
|
|
1534
|
-
}
|
|
1535
|
-
declare class ProgressAddon implements ITerminalAddon, IDisposable {
|
|
1536
|
-
private registration;
|
|
1537
|
-
private readonly changeEmitter;
|
|
1538
|
-
readonly onChange: _trismegisto_terminal.IEvent<IProgressState>;
|
|
1539
|
-
private current;
|
|
1540
|
-
activate(terminal: ITerminalLike): void;
|
|
1541
|
-
dispose(): void;
|
|
1542
|
-
get progress(): IProgressState;
|
|
1543
|
-
set progress(next: IProgressState);
|
|
1544
|
-
private update;
|
|
1545
|
-
/** Só `9;4;…` é progresso; outros OSC 9 ficam para outros manipuladores (`false`). */
|
|
1546
|
-
private handle;
|
|
1547
|
-
}
|
|
1548
|
-
|
|
1549
|
-
interface IProgramStatusRecord {
|
|
1550
|
-
readonly id: string;
|
|
1551
|
-
readonly state: 'idle' | 'working' | 'done' | 'blocked' | 'error';
|
|
1552
|
-
readonly kind?: 'permission' | 'question' | 'auth';
|
|
1553
|
-
readonly progress?: number;
|
|
1554
|
-
readonly app?: string;
|
|
1555
|
-
readonly effectiveApp?: string;
|
|
1556
|
-
readonly title?: string;
|
|
1557
|
-
readonly message?: string;
|
|
1558
|
-
}
|
|
1559
|
-
declare class ProgramStatusAddon implements ITerminalAddon, IDisposable {
|
|
1560
|
-
private readonly store;
|
|
1561
|
-
private terminal;
|
|
1562
|
-
private readonly changeEmitter;
|
|
1563
|
-
readonly onChange: _trismegisto_terminal.IEvent<readonly IProgramStatusRecord[]>;
|
|
1564
|
-
/** Ordem de inserção = menos atualizado primeiro (atualizar move para o fim). */
|
|
1565
|
-
private map;
|
|
1566
|
-
activate(terminal: ITerminalLike): void;
|
|
1567
|
-
dispose(): void;
|
|
1568
|
-
get records(): ReadonlyArray<IProgramStatusRecord>;
|
|
1569
|
-
/** Apaga `id` e tudo abaixo dele; sem argumento (id da raiz), apaga tudo. */
|
|
1570
|
-
clear(id?: string): void;
|
|
1571
|
-
processExited(): void;
|
|
1572
|
-
promptStarted(): void;
|
|
1573
|
-
private dropActive;
|
|
1574
|
-
private remove;
|
|
1575
|
-
private withApp;
|
|
1576
|
-
private emit;
|
|
1577
|
-
private handle;
|
|
1578
|
-
}
|
|
1579
|
-
|
|
1580
|
-
/**
|
|
1581
|
-
* Espera as fontes web carregarem. Sem argumento, todas as de `document.fonts`; com nomes de família, as faces
|
|
1582
|
-
* dessas famílias; com objetos `FontFace`, carrega e acrescenta ao documento.
|
|
1583
|
-
*/
|
|
1584
|
-
declare function loadFonts(fonts?: (string | FontFace)[]): Promise<FontFace[]>;
|
|
1585
|
-
declare class WebFontsAddon implements ITerminalAddon {
|
|
1586
|
-
private readonly initialRelayout;
|
|
1587
|
-
private terminal;
|
|
1588
|
-
/** `initialRelayout`: se a fonte do terminal é web, mede de novo assim que ela carrega (padrão `true`). */
|
|
1589
|
-
constructor(initialRelayout?: boolean);
|
|
1590
|
-
activate(terminal: ITerminalLike): void;
|
|
1591
|
-
dispose(): void;
|
|
1592
|
-
loadFonts(fonts?: (string | FontFace)[]): Promise<FontFace[]>;
|
|
1593
|
-
/**
|
|
1594
|
-
* Força nova medida: tira as famílias web de `fontFamily` enquanto carregam e devolve a lista original depois
|
|
1595
|
-
* (a troca de opção mede a célula de novo).
|
|
1596
|
-
*/
|
|
1597
|
-
relayout(): Promise<void>;
|
|
1598
|
-
/** Famílias da fonte do terminal que têm faces em `document.fonts`. */
|
|
1599
|
-
private webFamilies;
|
|
1600
|
-
}
|
|
1601
|
-
|
|
1602
|
-
interface ISerializeRange {
|
|
1603
|
-
/** Linha inicial (inclusiva). */
|
|
1604
|
-
start: IMarker | number;
|
|
1605
|
-
/** Linha final (inclusiva). */
|
|
1606
|
-
end: IMarker | number;
|
|
1607
|
-
}
|
|
1608
|
-
interface ISerializeOptions {
|
|
1609
|
-
range?: ISerializeRange;
|
|
1610
|
-
/** Linhas do histórico a incluir, contando de baixo (sem valor, todas). Ignorado com `range`. */
|
|
1611
|
-
scrollback?: number;
|
|
1612
|
-
excludeModes?: boolean;
|
|
1613
|
-
excludeAltBuffer?: boolean;
|
|
1614
|
-
}
|
|
1615
|
-
interface ISerializeBufferRange {
|
|
1616
|
-
startLine: number;
|
|
1617
|
-
endLine: number;
|
|
1618
|
-
startCol: number;
|
|
1619
|
-
}
|
|
1620
|
-
interface IHTMLSerializeOptions {
|
|
1621
|
-
scrollback: number;
|
|
1622
|
-
onlySelection: boolean;
|
|
1623
|
-
includeGlobalBackground: boolean;
|
|
1624
|
-
range?: ISerializeBufferRange;
|
|
1625
|
-
}
|
|
1626
|
-
declare class SerializeAddon implements ITerminalAddon {
|
|
1627
|
-
private terminal;
|
|
1628
|
-
activate(terminal: ITerminalLike): void;
|
|
1629
|
-
dispose(): void;
|
|
1630
|
-
private get core();
|
|
1631
|
-
serialize(options?: ISerializeOptions): string;
|
|
1632
|
-
private serializeLines;
|
|
1633
|
-
private serializeModes;
|
|
1634
|
-
serializeAsHTML(options?: Partial<IHTMLSerializeOptions>): string;
|
|
1635
|
-
}
|
|
1636
|
-
|
|
1637
|
-
/** Larguras do Unicode 11 (emoji mais novos com largura 1, como em programas com tabelas antigas). */
|
|
1638
|
-
declare class Unicode11Addon implements ITerminalAddon {
|
|
1639
|
-
private terminal;
|
|
1640
|
-
private previous;
|
|
1641
|
-
activate(terminal: ITerminalLike): void;
|
|
1642
|
-
dispose(): void;
|
|
1643
|
-
}
|
|
1644
|
-
/**
|
|
1645
|
-
* Grafemas inteiros numa célula (UAX #29): emoji com ZWJ, bandeiras, tons de pele, VS16 e sílabas Hangul por jamos.
|
|
1646
|
-
* Registra a versão `15-graphemes` e a ativa.
|
|
1647
|
-
*/
|
|
1648
|
-
declare class UnicodeGraphemesAddon implements ITerminalAddon {
|
|
1649
|
-
private terminal;
|
|
1650
|
-
private previous;
|
|
1651
|
-
private readonly provider;
|
|
1652
|
-
activate(terminal: ITerminalLike): void;
|
|
1653
|
-
dispose(): void;
|
|
1654
|
-
}
|
|
1655
|
-
|
|
1656
|
-
interface ILigatureOptions {
|
|
1657
|
-
/** Sequências usadas quando não dá para ler as ligaduras da fonte (o padrão é o conjunto "calt" do Iosevka). */
|
|
1658
|
-
fallbackLigatures: string[];
|
|
1659
|
-
/** Valor de `font-feature-settings` (padrão `"calt" on`). */
|
|
1660
|
-
fontFeatureSettings: string;
|
|
1661
|
-
}
|
|
1662
|
-
declare class LigaturesAddon implements ITerminalAddon {
|
|
1663
|
-
private terminal;
|
|
1664
|
-
private joinerId;
|
|
1665
|
-
private frame;
|
|
1666
|
-
private readonly options;
|
|
1667
|
-
private readonly pattern;
|
|
1668
|
-
constructor(options?: Partial<ILigatureOptions>);
|
|
1669
|
-
activate(terminal: ITerminalLike): void;
|
|
1670
|
-
dispose(): void;
|
|
1671
|
-
}
|
|
1672
|
-
|
|
1673
|
-
interface IWebglAddonOptions {
|
|
1674
|
-
/** Caixa e blocos desenhados pela célula (padrão: a opção `customGlyphs` do terminal, que é verdadeira). */
|
|
1675
|
-
customGlyphs?: boolean;
|
|
1676
|
-
/** `preserveDrawingBuffer` do contexto WebGL (útil em testes de captura). Padrão: falso. */
|
|
1677
|
-
preserveDrawingBuffer?: boolean;
|
|
1678
|
-
}
|
|
1679
|
-
declare class WebglAddon implements ITerminalAddon {
|
|
1680
|
-
private readonly options;
|
|
1681
|
-
private readonly contextLossEmitter;
|
|
1682
|
-
private readonly changeAtlasEmitter;
|
|
1683
|
-
private readonly addAtlasEmitter;
|
|
1684
|
-
private readonly removeAtlasEmitter;
|
|
1685
|
-
/** O contexto da GPU foi perdido (o app costuma descartar o complemento e criar outro). */
|
|
1686
|
-
readonly onContextLoss: IEvent<void>;
|
|
1687
|
-
/** O atlas de glifos foi trocado (limpo e recomeçado). */
|
|
1688
|
-
readonly onChangeTextureAtlas: IEvent<HTMLCanvasElement>;
|
|
1689
|
-
readonly onAddTextureAtlasCanvas: IEvent<HTMLCanvasElement>;
|
|
1690
|
-
readonly onRemoveTextureAtlasCanvas: IEvent<HTMLCanvasElement>;
|
|
1691
|
-
private terminal;
|
|
1692
|
-
private internals;
|
|
1693
|
-
private canvas;
|
|
1694
|
-
private layer;
|
|
1695
|
-
private gl;
|
|
1696
|
-
private atlas;
|
|
1697
|
-
private atlasKey;
|
|
1698
|
-
private frameSub;
|
|
1699
|
-
private lost;
|
|
1700
|
-
private readonly onLost;
|
|
1701
|
-
constructor(options?: IWebglAddonOptions);
|
|
1702
|
-
/** A primeira página do atlas de glifos (para depuração). */
|
|
1703
|
-
get textureAtlas(): HTMLCanvasElement | undefined;
|
|
1704
|
-
activate(terminal: ITerminalLike): void;
|
|
1705
|
-
/** Limpa o atlas e redesenha (útil depois de trocar a fonte por fora). */
|
|
1706
|
-
clearTextureAtlas(): void;
|
|
1707
|
-
private resetAtlas;
|
|
1708
|
-
/** Atlas da fonte e da célula atuais; refeito quando um dos dois muda. */
|
|
1709
|
-
private ensureAtlas;
|
|
1710
|
-
private draw;
|
|
1711
|
-
dispose(): void;
|
|
1712
|
-
}
|
|
1713
|
-
|
|
1714
|
-
interface IImageAddonOptions {
|
|
1715
|
-
enableSizeReports?: boolean;
|
|
1716
|
-
pixelLimit?: number;
|
|
1717
|
-
storageLimit?: number;
|
|
1718
|
-
showPlaceholder?: boolean;
|
|
1719
|
-
sixelSupport?: boolean;
|
|
1720
|
-
sixelScrolling?: boolean;
|
|
1721
|
-
sixelPaletteLimit?: number;
|
|
1722
|
-
sixelSizeLimit?: number;
|
|
1723
|
-
iipSupport?: boolean;
|
|
1724
|
-
iipSizeLimit?: number;
|
|
1725
|
-
kittySupport?: boolean;
|
|
1726
|
-
kittySizeLimit?: number;
|
|
1727
|
-
}
|
|
1728
|
-
declare class ImageAddon implements ITerminalAddon {
|
|
1729
|
-
private readonly options;
|
|
1730
|
-
private readonly storage;
|
|
1731
|
-
private readonly store;
|
|
1732
|
-
private readonly imageAddedEmitter;
|
|
1733
|
-
readonly onImageAdded: IEvent<void>;
|
|
1734
|
-
private terminal;
|
|
1735
|
-
private core;
|
|
1736
|
-
private sixelScrolling;
|
|
1737
|
-
private paletteLimit;
|
|
1738
|
-
private palette;
|
|
1739
|
-
private placeholder;
|
|
1740
|
-
private kitty;
|
|
1741
|
-
private readonly kittyImages;
|
|
1742
|
-
private layer;
|
|
1743
|
-
private canvas;
|
|
1744
|
-
private frame;
|
|
1745
|
-
private originalPrint;
|
|
1746
|
-
private wrappedPrint;
|
|
1747
|
-
constructor(options?: IImageAddonOptions);
|
|
1748
|
-
activate(terminal: ITerminalLike): void;
|
|
1749
|
-
dispose(): void;
|
|
1750
|
-
/** Volta as opções de execução ao que o construtor recebeu e esvazia o armazenamento. */
|
|
1751
|
-
reset(): void;
|
|
1752
|
-
private resetRuntime;
|
|
1753
|
-
private resetPalette;
|
|
1754
|
-
get storageLimit(): number;
|
|
1755
|
-
set storageLimit(limit: number);
|
|
1756
|
-
get storageUsage(): number;
|
|
1757
|
-
get showPlaceholder(): boolean;
|
|
1758
|
-
set showPlaceholder(value: boolean);
|
|
1759
|
-
/** O canvas com a imagem original (sem redimensionar) na posição do buffer (0-based, histórico incluído). */
|
|
1760
|
-
getImageAtBufferCell(x: number, y: number): HTMLCanvasElement | undefined;
|
|
1761
|
-
/** Um canvas novo com só o pedaço da imagem naquela célula (no tamanho da célula). */
|
|
1762
|
-
extractTileAtBufferCell(x: number, y: number): HTMLCanvasElement | undefined;
|
|
1763
|
-
private onSixel;
|
|
1764
|
-
/** DECSET/DECRST 80 (DECSDM): `h` desliga a rolagem do SIXEL; `l` liga. O resto segue para o núcleo. */
|
|
1765
|
-
private decset;
|
|
1766
|
-
private decrqm;
|
|
1767
|
-
/** XTSMGRAPHICS (`CSI ? Pi ; Pa ; Pv S`): registradores de cor (1) e geometria do SIXEL (2). */
|
|
1768
|
-
private xtsmgraphics;
|
|
1769
|
-
private onIip;
|
|
1770
|
-
private onKitty;
|
|
1771
|
-
private kittyTransmit;
|
|
1772
|
-
private kittyPlace;
|
|
1773
|
-
private kittyDelete;
|
|
1774
|
-
/** Respostas só quando a imagem tem id; `q=1` cala o OK, `q=2` cala tudo. */
|
|
1775
|
-
private kittyRespond;
|
|
1776
|
-
/**
|
|
1777
|
-
* Põe a imagem no cursor. Com rolagem, o cursor desce as linhas da imagem (rolando a tela se precisar) e para na
|
|
1778
|
-
* primeira coluna da última linha (SIXEL) ou na célula seguinte a ela (IIP e kitty). Sem rolagem, a imagem vai para o
|
|
1779
|
-
* canto de cima da tela e o cursor fica onde estava.
|
|
1780
|
-
*/
|
|
1781
|
-
private place;
|
|
1782
|
-
/** Linha absoluta da primeira linha da imagem; -1 se ela saiu do buffer. */
|
|
1783
|
-
private topLine;
|
|
1784
|
-
/** A imagem (e a célula dentro dela) na posição do buffer ativo, se a célula não foi apagada. */
|
|
1785
|
-
private placementAt;
|
|
1786
|
-
/** Apaga as células de um retângulo (linhas absolutas) nas imagens que já estavam lá. */
|
|
1787
|
-
private eraseRect;
|
|
1788
|
-
/** Texto impresso: apaga a imagem nas células escritas (do cursor de antes até o de depois, em ordem de leitura). */
|
|
1789
|
-
private print;
|
|
1790
|
-
private eraseInDisplay;
|
|
1791
|
-
/** Cria a camada assim que a tela existe (o complemento pode ser carregado antes do `open`). */
|
|
1792
|
-
private attach;
|
|
1793
|
-
private refresh;
|
|
1794
|
-
private draw;
|
|
1795
|
-
private drawable;
|
|
1796
|
-
/** O canvas da imagem original (criado uma vez). Sem contexto 2D (ambiente de teste), volta vazio no tamanho certo. */
|
|
1797
|
-
private toCanvas;
|
|
1798
|
-
private document;
|
|
1799
|
-
/** Tamanho da célula: o medido pela tela; antes de abrir, o informado ao núcleo; sem nada, 8×16. */
|
|
1800
|
-
private cell;
|
|
1801
|
-
private reply;
|
|
1802
|
-
}
|
|
1803
|
-
|
|
1804
|
-
declare const DEFAULT_TERMINAL_STRINGS: ILocalizableStrings;
|
|
1805
|
-
|
|
1806
|
-
/**
|
|
1807
|
-
* Terminal com o tema dos tokens (`--hm-terminal-*`: tema claro/escuro e accent da família), ajuste automático ao
|
|
1808
|
-
* tamanho, busca (Ctrl+Shift+F), links clicáveis e i18n. O `Terminal` por baixo fica em `terminal()` para o que a
|
|
1809
|
-
* API completa oferecer (parser, marcadores, decorações, complementos).
|
|
1810
|
-
*/
|
|
1811
|
-
declare class TerminalComponent {
|
|
1812
|
-
#private;
|
|
1813
|
-
protected readonly text: _trismegisto_terminal.TerminalMessages;
|
|
1814
|
-
private readonly host;
|
|
1815
|
-
private readonly zone;
|
|
1816
|
-
private readonly injector;
|
|
1817
|
-
protected readonly id: string;
|
|
1818
|
-
/** Nome acessível (por exemplo, "Console do contêiner api"). */
|
|
1819
|
-
readonly label: _angular_core.InputSignal<string>;
|
|
1820
|
-
readonly scrollback: _angular_core.InputSignal<number>;
|
|
1821
|
-
readonly cursorStyle: _angular_core.InputSignal<"block" | "underline" | "bar">;
|
|
1822
|
-
readonly cursorBlink: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
1823
|
-
readonly convertEol: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
1824
|
-
readonly disableStdin: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
1825
|
-
readonly screenReaderMode: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
1826
|
-
/** Tamanho da fonte em px; sem valor, `--hm-terminal-font-size`. */
|
|
1827
|
-
readonly fontSize: _angular_core.InputSignal<number | null>;
|
|
1828
|
-
readonly lineHeight: _angular_core.InputSignal<number>;
|
|
1829
|
-
/** Ajusta colunas e linhas ao tamanho do componente (e a cada mudança de tamanho). */
|
|
1830
|
-
readonly autoFit: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
1831
|
-
/** URLs escritas no terminal viram links. */
|
|
1832
|
-
readonly webLinks: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
1833
|
-
/** Busca no histórico (Ctrl+Shift+F). */
|
|
1834
|
-
readonly searchable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
1835
|
-
/** Opções avançadas repassadas ao `Terminal` (ganham das acima). */
|
|
1836
|
-
readonly options: _angular_core.InputSignal<ITerminalOptions>;
|
|
1837
|
-
/** O que a pessoa digita (e as respostas do terminal às consultas): mande ao processo. */
|
|
1838
|
-
readonly data: _angular_core.OutputEmitterRef<string>;
|
|
1839
|
-
readonly binary: _angular_core.OutputEmitterRef<string>;
|
|
1840
|
-
readonly resized: _angular_core.OutputEmitterRef<{
|
|
1841
|
-
cols: number;
|
|
1842
|
-
rows: number;
|
|
1843
|
-
}>;
|
|
1844
|
-
readonly titleChange: _angular_core.OutputEmitterRef<string>;
|
|
1845
|
-
readonly bell: _angular_core.OutputEmitterRef<void>;
|
|
1846
|
-
/** O terminal está aberto (para escrever o que já chegou ou carregar complementos). */
|
|
1847
|
-
readonly ready: _angular_core.OutputEmitterRef<Terminal>;
|
|
1848
|
-
/** O `Terminal` por baixo (depois do primeiro render no navegador). */
|
|
1849
|
-
readonly terminal: _angular_core.Signal<Terminal | undefined>;
|
|
1850
|
-
protected readonly searchOpen: _angular_core.WritableSignal<boolean>;
|
|
1851
|
-
protected readonly query: _angular_core.WritableSignal<string>;
|
|
1852
|
-
protected readonly caseSensitive: _angular_core.WritableSignal<boolean>;
|
|
1853
|
-
protected readonly wholeWord: _angular_core.WritableSignal<boolean>;
|
|
1854
|
-
protected readonly regex: _angular_core.WritableSignal<boolean>;
|
|
1855
|
-
private readonly results;
|
|
1856
|
-
protected readonly status: _angular_core.Signal<string>;
|
|
1857
|
-
private readonly screen;
|
|
1858
|
-
private readonly searchInput;
|
|
1859
|
-
private fit;
|
|
1860
|
-
private search;
|
|
1861
|
-
private webLinksAddon;
|
|
1862
|
-
private resizeObserver;
|
|
1863
|
-
private scopeObserver;
|
|
1864
|
-
private fitFrame;
|
|
1865
|
-
/** O que foi escrito antes do terminal abrir (SSR, primeiro render). */
|
|
1866
|
-
private pending;
|
|
1867
|
-
constructor();
|
|
1868
|
-
private resolvedOptions;
|
|
1869
|
-
private open;
|
|
1870
|
-
/** Cores dos tokens resolvidas no próprio elemento (herda tema, família e paleta do escopo). */
|
|
1871
|
-
private readTheme;
|
|
1872
|
-
private readTypography;
|
|
1873
|
-
/** Tema, família e paleta mudam por atributo num ancestral: relê o tema quando um deles muda acima do terminal. */
|
|
1874
|
-
private watchScope;
|
|
1875
|
-
private scheduleFit;
|
|
1876
|
-
private fitNow;
|
|
1877
|
-
/** Escreve a saída do processo. Antes de abrir, guarda e escreve depois. */
|
|
1878
|
-
write(data: string | Uint8Array): void;
|
|
1879
|
-
writeln(data: string): void;
|
|
1880
|
-
clear(): void;
|
|
1881
|
-
reset(): void;
|
|
1882
|
-
focus(): void;
|
|
1883
|
-
/** Ajusta ao tamanho agora (o `autoFit` já faz isso a cada mudança de tamanho). */
|
|
1884
|
-
fitToContainer(): void;
|
|
1885
|
-
openSearch(): void;
|
|
1886
|
-
closeSearch(): void;
|
|
1887
|
-
findNext(): void;
|
|
1888
|
-
findPrevious(): void;
|
|
1889
|
-
private searchOptions;
|
|
1890
|
-
protected onQuery(value: string): void;
|
|
1891
|
-
protected toggle(which: 'case' | 'word' | 'regex'): void;
|
|
1892
|
-
protected onSearchKeydown(e: KeyboardEvent): void;
|
|
1893
|
-
protected onHostKeydown(e: KeyboardEvent): void;
|
|
1894
|
-
/** Atalhos do componente antes do terminal: Ctrl+Shift+F abre a busca; Ctrl+Shift+C copia a seleção. */
|
|
1895
|
-
private handleTerminalKey;
|
|
1896
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<TerminalComponent, never>;
|
|
1897
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<TerminalComponent, "hm-terminal", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "scrollback": { "alias": "scrollback"; "required": false; "isSignal": true; }; "cursorStyle": { "alias": "cursorStyle"; "required": false; "isSignal": true; }; "cursorBlink": { "alias": "cursorBlink"; "required": false; "isSignal": true; }; "convertEol": { "alias": "convertEol"; "required": false; "isSignal": true; }; "disableStdin": { "alias": "disableStdin"; "required": false; "isSignal": true; }; "screenReaderMode": { "alias": "screenReaderMode"; "required": false; "isSignal": true; }; "fontSize": { "alias": "fontSize"; "required": false; "isSignal": true; }; "lineHeight": { "alias": "lineHeight"; "required": false; "isSignal": true; }; "autoFit": { "alias": "autoFit"; "required": false; "isSignal": true; }; "webLinks": { "alias": "webLinks"; "required": false; "isSignal": true; }; "searchable": { "alias": "searchable"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; }, { "data": "data"; "binary": "binary"; "resized": "resized"; "titleChange": "titleChange"; "bell": "bell"; "ready": "ready"; }, never, never, true, never>;
|
|
1898
|
-
}
|
|
1899
|
-
|
|
1900
|
-
/**
|
|
1901
|
-
* Textos de interface do @trismegisto/terminal (pt-BR, o catálogo base). en e es ficam nos arquivos vizinhos; o
|
|
1902
|
-
* idioma ativo vem do `HermesI18nService` de `@trismegisto/angular` (ver `terminal-i18n.ts`).
|
|
1903
|
-
*/
|
|
1904
|
-
interface TerminalMessages {
|
|
1905
|
-
readonly terminal: {
|
|
1906
|
-
/** Nome acessível padrão (o app deve passar um mais específico em `label`). */
|
|
1907
|
-
readonly label: string;
|
|
1908
|
-
/** `aria-roledescription` da região. */
|
|
1909
|
-
readonly roleDescription: string;
|
|
1910
|
-
/** Instruções de teclado, lidas junto com o nome. */
|
|
1911
|
-
readonly instructions: string;
|
|
1912
|
-
};
|
|
1913
|
-
readonly search: {
|
|
1914
|
-
readonly label: string;
|
|
1915
|
-
readonly placeholder: string;
|
|
1916
|
-
readonly previous: string;
|
|
1917
|
-
readonly next: string;
|
|
1918
|
-
readonly close: string;
|
|
1919
|
-
readonly caseSensitive: string;
|
|
1920
|
-
/** Texto curto do botão de maiúsculas (o nome acessível é `caseSensitive`). */
|
|
1921
|
-
readonly caseSensitiveGlyph: string;
|
|
1922
|
-
readonly wholeWord: string;
|
|
1923
|
-
readonly wholeWordGlyph: string;
|
|
1924
|
-
readonly regex: string;
|
|
1925
|
-
readonly regexGlyph: string;
|
|
1926
|
-
/** Posição do resultado. Parâmetros: `{index}`, `{count}`. */
|
|
1927
|
-
readonly status: string;
|
|
1928
|
-
readonly none: string;
|
|
1929
|
-
};
|
|
1930
|
-
}
|
|
1931
|
-
declare const TERMINAL_MESSAGES_PT_BR: TerminalMessages;
|
|
1932
|
-
|
|
1933
|
-
type TerminalMessagesOverride = CatalogOverride<TerminalMessages>;
|
|
1934
|
-
interface TerminalI18nConfig {
|
|
1935
|
-
/** Catálogos extras ou substitutos, por idioma (mesmas chaves de `TerminalMessages`). */
|
|
1936
|
-
readonly catalogs?: Readonly<Record<string, TerminalMessages>>;
|
|
1937
|
-
/** Textos avulsos sobrescritos por cima do catálogo ativo, em qualquer idioma. */
|
|
1938
|
-
readonly override?: TerminalMessagesOverride;
|
|
1939
|
-
}
|
|
1940
|
-
declare const TERMINAL_I18N_CONFIG: InjectionToken<TerminalI18nConfig>;
|
|
1941
|
-
/** Textos do terminal no idioma ativo da lib (`HermesI18nService.locale`), como vista viva. */
|
|
1942
|
-
declare const TERMINAL_MESSAGES: InjectionToken<TerminalMessages>;
|
|
1943
|
-
/** Sobrescreve textos do terminal e/ou acrescenta idiomas. O idioma em si vem de `provideHermesI18n`. */
|
|
1944
|
-
declare function provideTerminalMessages(config: TerminalI18nConfig): Provider;
|
|
1945
|
-
|
|
1946
|
-
declare const TERMINAL_MESSAGES_EN: TerminalMessages;
|
|
1947
|
-
|
|
1948
|
-
declare const TERMINAL_MESSAGES_ES: TerminalMessages;
|
|
1949
|
-
|
|
1950
|
-
export { ANSI_DEFAULTS, AttachAddon, AttributeData, Base64, BrowserClipboardProvider, Buffer, BufferLine, CHARSETS, CircularList, ClipboardAddon, ColorMode, ColorState, DEFAULT_COLOR, DEFAULT_CORE_OPTIONS, DEFAULT_TERMINAL_STRINGS, DEFAULT_UNICODE_PROVIDER, DisposableStore, Emitter, FitAddon, Flags, ImageAddon, LigaturesAddon, Marker, Modes, NO_EXTENDED, Parser, ProgramStatusAddon, ProgressAddon, SearchAddon, SerializeAddon, TERMINAL_CSS, TERMINAL_I18N_CONFIG, TERMINAL_MESSAGES, TERMINAL_MESSAGES_EN, TERMINAL_MESSAGES_ES, TERMINAL_MESSAGES_PT_BR, Terminal, TerminalComponent, TerminalCore, UnderlineStyle, Unicode11Addon, UnicodeGraphemesAddon, UnicodeService, WebFontsAddon, WebLinkProvider, WebLinksAddon, WebglAddon, color, colorMode, colorValue, controlCharacter, defaultPalette, emptyCell, encodeKey, encodeMouse, encodePaste, ensureStyles, formatColorSpec, identifierKey, loadFonts, parseColorSpec, parseCssColor, provideTerminalMessages, terminalThemeFromTokens, toCss, toDisposable, translate, wcwidth };
|
|
1951
|
-
export type { ApcHandler, BufferPoint, CellData, Charset, CoreOptions, CsiHandler, CursorStyle, DcsHandler, EscHandler, ExtendedAttributes, FontWeight, FunctionIdentifier, Hyperlink, IAttachOptions, IBase64, IBuffer, IBufferCell, IBufferCellPosition, IBufferLine, IBufferNamespace, IBufferRange, IClipboardProvider, IDecoration, IDecorationOptions, IDecorationOverviewRulerOptions, IDimensions, IDisposable, IEvent, IFunctionIdentifier, IHTMLSerializeOptions, IImageAddonOptions, ILigatureOptions, ILink, ILinkDecorations, ILinkHandler, ILinkProvider, ILinkProviderOptions, ILocalizableStrings, ILogger, IMarker, IModes, IOffset, IOverviewRulerOptions, IParser, IProgramStatusRecord, IProgressState, IRenderDimensions, IScrollbarOptions, ISearchDecorationOptions, ISearchOptions, ISearchResultChange, ISerializeBufferRange, ISerializeOptions, ISerializeRange, ITerminalAddon, ITerminalDimensions, ITerminalInitOnlyOptions, ITerminalLike, ITerminalOptions, ITerminalQuirks, ITheme, IUnicodeHandling, IUnicodeVersionProvider, IViewportRange, IVtExtensions, IWebglAddonOptions, IWindowOptions, IWindowsPty, KeyInput, KeyOptions, KeyResult, LogLevel, MouseReport, MouseTrackingMode, OscHandler, Params, SavedCursor, TerminalI18nConfig, TerminalInternals, TerminalMessages, TerminalMessagesOverride };
|
|
1952
|
-
//# sourceMappingURL=trismegisto-terminal.d.ts.map
|