@simon_he/vue-tui 0.0.2 → 0.0.5
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 +137 -74
- package/dist/index.cjs +13160 -3910
- package/dist/index.d.ts +672 -77
- package/dist/index.js +12723 -5381
- package/dist/path-suggest-CZQYJIIg.js +473 -0
- package/dist/path-suggest-DIMby3r0.js +3 -0
- package/package.json +22 -17
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,298 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
4
|
-
import { App, Component as Component$1, ComputedRef, Ref, VNode } from "vue";
|
|
1
|
+
import * as vue15 from "vue";
|
|
2
|
+
import * as vue16 from "vue";
|
|
3
|
+
import { App, Component as Component$1, ComputedRef, InjectionKey, Ref, VNode } from "vue";
|
|
5
4
|
|
|
5
|
+
//#region src/core/render-plane.d.ts
|
|
6
|
+
declare const TERMINAL_RENDER_PLANES: readonly ["default", "transcript", "chrome", "overlay"];
|
|
7
|
+
type TerminalRenderPlane = (typeof TERMINAL_RENDER_PLANES)[number];
|
|
8
|
+
type TerminalRenderPlanes = readonly TerminalRenderPlane[];
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/core/types.d.ts
|
|
12
|
+
type AnsiColorName = 'black' | 'red' | 'green' | 'yellow' | 'blue' | 'magenta' | 'cyan' | 'white' | 'blackBright' | 'redBright' | 'greenBright' | 'yellowBright' | 'blueBright' | 'magentaBright' | 'cyanBright' | 'whiteBright';
|
|
13
|
+
type Style = Readonly<{
|
|
14
|
+
fg?: AnsiColorName;
|
|
15
|
+
bg?: AnsiColorName;
|
|
16
|
+
bold?: boolean;
|
|
17
|
+
dim?: boolean;
|
|
18
|
+
italic?: boolean;
|
|
19
|
+
underline?: boolean;
|
|
20
|
+
inverse?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Optional terminal hyperlink target (OSC 8).
|
|
23
|
+
* When set, renderers may emit a clickable hyperlink while keeping text width unchanged.
|
|
24
|
+
*/
|
|
25
|
+
href?: string;
|
|
26
|
+
}>;
|
|
27
|
+
type Cell = Readonly<{
|
|
28
|
+
ch: string;
|
|
29
|
+
width: 1 | 2;
|
|
30
|
+
continuation?: true;
|
|
31
|
+
style: Style;
|
|
32
|
+
}>;
|
|
33
|
+
type BufferSnapshot = Readonly<{
|
|
34
|
+
cols: number;
|
|
35
|
+
rows: number;
|
|
36
|
+
lines: readonly string[];
|
|
37
|
+
}>;
|
|
38
|
+
type TerminalSize = Readonly<{
|
|
39
|
+
cols: number;
|
|
40
|
+
rows: number;
|
|
41
|
+
}>;
|
|
42
|
+
type TerminalCommitEvent = Readonly<{
|
|
43
|
+
dirtyRows: readonly number[] | null;
|
|
44
|
+
planes: TerminalRenderPlanes | null;
|
|
45
|
+
}>;
|
|
46
|
+
type TerminalResizeEvent = Readonly<{
|
|
47
|
+
cols: number;
|
|
48
|
+
rows: number;
|
|
49
|
+
}>;
|
|
50
|
+
interface TerminalEventMap {
|
|
51
|
+
commit: TerminalCommitEvent;
|
|
52
|
+
resize: TerminalResizeEvent;
|
|
53
|
+
}
|
|
54
|
+
interface Terminal {
|
|
55
|
+
resize: (cols: number, rows: number) => void;
|
|
56
|
+
clear: (x?: number, y?: number, w?: number, h?: number) => void;
|
|
57
|
+
write: (text: string, opts?: {
|
|
58
|
+
x?: number;
|
|
59
|
+
y?: number;
|
|
60
|
+
style?: Style;
|
|
61
|
+
}) => void;
|
|
62
|
+
writeAnsi: (text: string, opts?: {
|
|
63
|
+
x?: number;
|
|
64
|
+
y?: number;
|
|
65
|
+
}) => void;
|
|
66
|
+
put: (x: number, y: number, ch: string, style?: Style) => void;
|
|
67
|
+
fill: (x: number, y: number, w: number, h: number, ch?: string, style?: Style) => void;
|
|
68
|
+
scroll: (lines: number) => void;
|
|
69
|
+
setCursor: (x: number, y: number, visible?: boolean) => void;
|
|
70
|
+
batch: <T>(fn: () => T) => T;
|
|
71
|
+
commit: (meta?: {
|
|
72
|
+
planes?: TerminalRenderPlanes | null;
|
|
73
|
+
}) => readonly number[] | null;
|
|
74
|
+
on: <K extends keyof TerminalEventMap>(event: K, cb: (payload: TerminalEventMap[K]) => void) => () => void;
|
|
75
|
+
dispose: () => void;
|
|
76
|
+
size: () => TerminalSize;
|
|
77
|
+
snapshot: () => BufferSnapshot;
|
|
78
|
+
getCell: (x: number, y: number) => Cell;
|
|
79
|
+
getRow: (y: number) => readonly Cell[];
|
|
80
|
+
setScrollbackLimit: (limit: number) => void;
|
|
81
|
+
getScrollbackLines: (count?: number) => readonly string[];
|
|
82
|
+
} //#endregion
|
|
83
|
+
//#region src/core/ansi/colors.d.ts
|
|
84
|
+
type TerminalColorMode = 'ansi8' | 'ansi16' | 'ansi256' | 'truecolor';
|
|
85
|
+
type TerminalColorLevel = 8 | 16 | 256;
|
|
86
|
+
type AnsiRgb = Readonly<{
|
|
87
|
+
r: number;
|
|
88
|
+
g: number;
|
|
89
|
+
b: number;
|
|
90
|
+
}>;
|
|
91
|
+
declare const SGR_RESET = "\u001B[0m";
|
|
92
|
+
declare function truecolorFgOpen(rgb: AnsiRgb): string;
|
|
93
|
+
declare function truecolorBgOpen(rgb: AnsiRgb): string;
|
|
94
|
+
declare function rgbToAnsi256(rgb: AnsiRgb): number;
|
|
95
|
+
|
|
96
|
+
//#endregion
|
|
97
|
+
//#region src/ansi-styles.d.ts
|
|
98
|
+
declare const ansiStyles: Readonly<{
|
|
99
|
+
reset: Readonly<{
|
|
100
|
+
open: string;
|
|
101
|
+
close: string;
|
|
102
|
+
}>;
|
|
103
|
+
bold: Readonly<{
|
|
104
|
+
open: string;
|
|
105
|
+
close: string;
|
|
106
|
+
}>;
|
|
107
|
+
dim: Readonly<{
|
|
108
|
+
open: string;
|
|
109
|
+
close: string;
|
|
110
|
+
}>;
|
|
111
|
+
italic: Readonly<{
|
|
112
|
+
open: string;
|
|
113
|
+
close: string;
|
|
114
|
+
}>;
|
|
115
|
+
underline: Readonly<{
|
|
116
|
+
open: string;
|
|
117
|
+
close: string;
|
|
118
|
+
}>;
|
|
119
|
+
inverse: Readonly<{
|
|
120
|
+
open: string;
|
|
121
|
+
close: string;
|
|
122
|
+
}>;
|
|
123
|
+
black: Readonly<{
|
|
124
|
+
open: string;
|
|
125
|
+
close: string;
|
|
126
|
+
}>;
|
|
127
|
+
red: Readonly<{
|
|
128
|
+
open: string;
|
|
129
|
+
close: string;
|
|
130
|
+
}>;
|
|
131
|
+
green: Readonly<{
|
|
132
|
+
open: string;
|
|
133
|
+
close: string;
|
|
134
|
+
}>;
|
|
135
|
+
yellow: Readonly<{
|
|
136
|
+
open: string;
|
|
137
|
+
close: string;
|
|
138
|
+
}>;
|
|
139
|
+
blue: Readonly<{
|
|
140
|
+
open: string;
|
|
141
|
+
close: string;
|
|
142
|
+
}>;
|
|
143
|
+
magenta: Readonly<{
|
|
144
|
+
open: string;
|
|
145
|
+
close: string;
|
|
146
|
+
}>;
|
|
147
|
+
cyan: Readonly<{
|
|
148
|
+
open: string;
|
|
149
|
+
close: string;
|
|
150
|
+
}>;
|
|
151
|
+
white: Readonly<{
|
|
152
|
+
open: string;
|
|
153
|
+
close: string;
|
|
154
|
+
}>;
|
|
155
|
+
blackBright: Readonly<{
|
|
156
|
+
open: string;
|
|
157
|
+
close: string;
|
|
158
|
+
}>;
|
|
159
|
+
redBright: Readonly<{
|
|
160
|
+
open: string;
|
|
161
|
+
close: string;
|
|
162
|
+
}>;
|
|
163
|
+
greenBright: Readonly<{
|
|
164
|
+
open: string;
|
|
165
|
+
close: string;
|
|
166
|
+
}>;
|
|
167
|
+
yellowBright: Readonly<{
|
|
168
|
+
open: string;
|
|
169
|
+
close: string;
|
|
170
|
+
}>;
|
|
171
|
+
blueBright: Readonly<{
|
|
172
|
+
open: string;
|
|
173
|
+
close: string;
|
|
174
|
+
}>;
|
|
175
|
+
magentaBright: Readonly<{
|
|
176
|
+
open: string;
|
|
177
|
+
close: string;
|
|
178
|
+
}>;
|
|
179
|
+
cyanBright: Readonly<{
|
|
180
|
+
open: string;
|
|
181
|
+
close: string;
|
|
182
|
+
}>;
|
|
183
|
+
whiteBright: Readonly<{
|
|
184
|
+
open: string;
|
|
185
|
+
close: string;
|
|
186
|
+
}>;
|
|
187
|
+
bgBlack: Readonly<{
|
|
188
|
+
open: string;
|
|
189
|
+
close: string;
|
|
190
|
+
}>;
|
|
191
|
+
bgRed: Readonly<{
|
|
192
|
+
open: string;
|
|
193
|
+
close: string;
|
|
194
|
+
}>;
|
|
195
|
+
bgGreen: Readonly<{
|
|
196
|
+
open: string;
|
|
197
|
+
close: string;
|
|
198
|
+
}>;
|
|
199
|
+
bgYellow: Readonly<{
|
|
200
|
+
open: string;
|
|
201
|
+
close: string;
|
|
202
|
+
}>;
|
|
203
|
+
bgBlue: Readonly<{
|
|
204
|
+
open: string;
|
|
205
|
+
close: string;
|
|
206
|
+
}>;
|
|
207
|
+
bgMagenta: Readonly<{
|
|
208
|
+
open: string;
|
|
209
|
+
close: string;
|
|
210
|
+
}>;
|
|
211
|
+
bgCyan: Readonly<{
|
|
212
|
+
open: string;
|
|
213
|
+
close: string;
|
|
214
|
+
}>;
|
|
215
|
+
bgWhite: Readonly<{
|
|
216
|
+
open: string;
|
|
217
|
+
close: string;
|
|
218
|
+
}>;
|
|
219
|
+
bgBlackBright: Readonly<{
|
|
220
|
+
open: string;
|
|
221
|
+
close: string;
|
|
222
|
+
}>;
|
|
223
|
+
bgRedBright: Readonly<{
|
|
224
|
+
open: string;
|
|
225
|
+
close: string;
|
|
226
|
+
}>;
|
|
227
|
+
bgGreenBright: Readonly<{
|
|
228
|
+
open: string;
|
|
229
|
+
close: string;
|
|
230
|
+
}>;
|
|
231
|
+
bgYellowBright: Readonly<{
|
|
232
|
+
open: string;
|
|
233
|
+
close: string;
|
|
234
|
+
}>;
|
|
235
|
+
bgBlueBright: Readonly<{
|
|
236
|
+
open: string;
|
|
237
|
+
close: string;
|
|
238
|
+
}>;
|
|
239
|
+
bgMagentaBright: Readonly<{
|
|
240
|
+
open: string;
|
|
241
|
+
close: string;
|
|
242
|
+
}>;
|
|
243
|
+
bgCyanBright: Readonly<{
|
|
244
|
+
open: string;
|
|
245
|
+
close: string;
|
|
246
|
+
}>;
|
|
247
|
+
bgWhiteBright: Readonly<{
|
|
248
|
+
open: string;
|
|
249
|
+
close: string;
|
|
250
|
+
}>;
|
|
251
|
+
color: Readonly<{
|
|
252
|
+
ansi256: (idx: number) => string;
|
|
253
|
+
ansi16m: (r: number, g: number, b: number) => string;
|
|
254
|
+
}>;
|
|
255
|
+
bgColor: Readonly<{
|
|
256
|
+
ansi256: (idx: number) => string;
|
|
257
|
+
ansi16m: (r: number, g: number, b: number) => string;
|
|
258
|
+
}>;
|
|
259
|
+
}>;
|
|
260
|
+
/**
|
|
261
|
+
* Cached palettes for convenience.
|
|
262
|
+
* Note: ANSI 0..15 are terminal-theme-dependent in many terminals; treat `rgb` as an approximation.
|
|
263
|
+
*/
|
|
264
|
+
declare const ANSI8_COLORS: readonly Readonly<{
|
|
265
|
+
level: TerminalColorLevel;
|
|
266
|
+
index: number;
|
|
267
|
+
name?: AnsiColorName;
|
|
268
|
+
rgb: AnsiRgb;
|
|
269
|
+
fgOpen: string;
|
|
270
|
+
bgOpen: string;
|
|
271
|
+
}>[];
|
|
272
|
+
declare const ANSI16_COLORS: readonly Readonly<{
|
|
273
|
+
level: TerminalColorLevel;
|
|
274
|
+
index: number;
|
|
275
|
+
name?: AnsiColorName;
|
|
276
|
+
rgb: AnsiRgb;
|
|
277
|
+
fgOpen: string;
|
|
278
|
+
bgOpen: string;
|
|
279
|
+
}>[];
|
|
280
|
+
declare const ANSI256_COLORS: readonly Readonly<{
|
|
281
|
+
level: TerminalColorLevel;
|
|
282
|
+
index: number;
|
|
283
|
+
name?: AnsiColorName;
|
|
284
|
+
rgb: AnsiRgb;
|
|
285
|
+
fgOpen: string;
|
|
286
|
+
bgOpen: string;
|
|
287
|
+
}>[];
|
|
288
|
+
declare function ansiColors(level: 8 | 16 | 256): readonly Readonly<{
|
|
289
|
+
level: TerminalColorLevel;
|
|
290
|
+
index: number;
|
|
291
|
+
name?: AnsiColorName;
|
|
292
|
+
rgb: AnsiRgb;
|
|
293
|
+
fgOpen: string;
|
|
294
|
+
bgOpen: string;
|
|
295
|
+
}>[]; //#endregion
|
|
6
296
|
//#region src/events/recording.d.ts
|
|
7
297
|
type TerminalEventRecord = Readonly<{
|
|
8
298
|
type: 'keydown' | 'keyup';
|
|
@@ -46,20 +336,44 @@ type TerminalEventRecord = Readonly<{
|
|
|
46
336
|
isComposing?: boolean;
|
|
47
337
|
text?: string;
|
|
48
338
|
time?: number;
|
|
49
|
-
}>;
|
|
339
|
+
}>;
|
|
340
|
+
|
|
341
|
+
//#endregion
|
|
50
342
|
//#region src/cli/input.d.ts
|
|
51
343
|
type Stdin = NodeJS.ReadStream;
|
|
52
344
|
type StdinDriver = Readonly<{
|
|
53
345
|
dispose: () => void;
|
|
54
346
|
}>;
|
|
55
347
|
declare function createStdinDriver(options: Readonly<{
|
|
56
|
-
dispatch: (event: TerminalEventRecord) => void;
|
|
348
|
+
dispatch: (event: TerminalEventRecord) => boolean | void;
|
|
57
349
|
stdin?: Stdin;
|
|
58
350
|
stdout?: NodeJS.WriteStream;
|
|
59
351
|
enableMouse?: boolean;
|
|
352
|
+
/**
|
|
353
|
+
* Enable "any-motion" mouse tracking (xterm DECSET ?1003).
|
|
354
|
+
* This is required for hover interactions in the CLI, but can increase event volume.
|
|
355
|
+
*/
|
|
356
|
+
enableMouseMotion?: boolean;
|
|
357
|
+
onTerminalFocusChange?: (focused: boolean) => void;
|
|
60
358
|
onExit?: () => void;
|
|
61
359
|
}>): StdinDriver;
|
|
62
360
|
|
|
361
|
+
//#endregion
|
|
362
|
+
//#region src/cli/path-suggest-core.d.ts
|
|
363
|
+
type PathPickMode = 'directory' | 'file' | 'any';
|
|
364
|
+
type PathSuggestion = Readonly<{
|
|
365
|
+
kind: 'directory' | 'file';
|
|
366
|
+
display: string;
|
|
367
|
+
completion: string;
|
|
368
|
+
absPath: string;
|
|
369
|
+
}>;
|
|
370
|
+
type SuggestPathsResult = Readonly<{
|
|
371
|
+
baseDirAbs: string;
|
|
372
|
+
dirPrefix: string;
|
|
373
|
+
query: string;
|
|
374
|
+
suggestions: PathSuggestion[];
|
|
375
|
+
}>;
|
|
376
|
+
|
|
63
377
|
//#endregion
|
|
64
378
|
//#region src/cli/path-provider.d.ts
|
|
65
379
|
type FsEntryKind = 'file' | 'directory' | 'other';
|
|
@@ -74,11 +388,31 @@ type FsStat = Readonly<{
|
|
|
74
388
|
type PathPickerProvider = Readonly<{
|
|
75
389
|
listDir: (absDir: string) => Promise<FsDirEntry[]>;
|
|
76
390
|
stat: (absPath: string) => Promise<FsStat>;
|
|
391
|
+
suggest?: (info: Readonly<{
|
|
392
|
+
workspaceAbs: string;
|
|
393
|
+
input: string;
|
|
394
|
+
mode: PathPickMode;
|
|
395
|
+
max: number;
|
|
396
|
+
showHidden?: boolean;
|
|
397
|
+
maxDepth?: number;
|
|
398
|
+
gitignore?: 'blocking' | 'nonBlocking';
|
|
399
|
+
}>) => Promise<SuggestPathsResult>;
|
|
400
|
+
resolvePath?: (workspaceAbs: string, input: string) => string | Promise<string>;
|
|
77
401
|
}>;
|
|
78
402
|
declare function createNodePathPickerProvider(): PathPickerProvider;
|
|
79
403
|
|
|
80
404
|
//#endregion
|
|
81
405
|
//#region src/cli/path-suggest.d.ts
|
|
406
|
+
declare function suggestPaths(options: Readonly<{
|
|
407
|
+
workspaceAbs: string;
|
|
408
|
+
input: string;
|
|
409
|
+
mode: PathPickMode;
|
|
410
|
+
max: number;
|
|
411
|
+
showHidden?: boolean;
|
|
412
|
+
listDir: (absDir: string) => Promise<FsDirEntry[]>;
|
|
413
|
+
maxDepth?: number;
|
|
414
|
+
gitignore?: 'blocking' | 'nonBlocking';
|
|
415
|
+
}>): Promise<SuggestPathsResult>;
|
|
82
416
|
declare function resolveUserPath(workspaceAbs: string, input: string): string;
|
|
83
417
|
|
|
84
418
|
//#endregion
|
|
@@ -88,65 +422,26 @@ declare function writeSnapshot(path: string, lines: readonly string[]): Promise<
|
|
|
88
422
|
declare function readEventLog(path: string): Promise<TerminalEventRecord[]>;
|
|
89
423
|
|
|
90
424
|
//#endregion
|
|
91
|
-
//#region src/core/
|
|
92
|
-
type
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
bg?: AnsiColorName;
|
|
96
|
-
bold?: boolean;
|
|
97
|
-
dim?: boolean;
|
|
98
|
-
italic?: boolean;
|
|
99
|
-
underline?: boolean;
|
|
100
|
-
inverse?: boolean;
|
|
101
|
-
}>;
|
|
102
|
-
type Cell = Readonly<{
|
|
103
|
-
ch: string;
|
|
104
|
-
width: 1 | 2;
|
|
105
|
-
continuation?: true;
|
|
106
|
-
style: Style;
|
|
107
|
-
}>;
|
|
108
|
-
type BufferSnapshot = Readonly<{
|
|
109
|
-
cols: number;
|
|
110
|
-
rows: number;
|
|
111
|
-
lines: readonly string[];
|
|
112
|
-
}>;
|
|
113
|
-
type TerminalCommitEvent = Readonly<{
|
|
114
|
-
dirtyRows: readonly number[];
|
|
115
|
-
}>;
|
|
116
|
-
type TerminalResizeEvent = Readonly<{
|
|
117
|
-
cols: number;
|
|
118
|
-
rows: number;
|
|
425
|
+
//#region src/core/ansi/capability.d.ts
|
|
426
|
+
type TerminalColorCapability = Readonly<{
|
|
427
|
+
mode: TerminalColorMode;
|
|
428
|
+
level: TerminalColorLevel;
|
|
119
429
|
}>;
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}) => void;
|
|
136
|
-
put: (x: number, y: number, ch: string, style?: Style) => void;
|
|
137
|
-
fill: (x: number, y: number, w: number, h: number, ch?: string, style?: Style) => void;
|
|
138
|
-
scroll: (lines: number) => void;
|
|
139
|
-
setCursor: (x: number, y: number, visible?: boolean) => void;
|
|
140
|
-
batch: <T>(fn: () => T) => T;
|
|
141
|
-
commit: () => readonly number[];
|
|
142
|
-
on: <K extends keyof TerminalEventMap>(event: K, cb: (payload: TerminalEventMap[K]) => void) => () => void;
|
|
143
|
-
dispose: () => void;
|
|
144
|
-
snapshot: () => BufferSnapshot;
|
|
145
|
-
getCell: (x: number, y: number) => Cell;
|
|
146
|
-
getRow: (y: number) => readonly Cell[];
|
|
147
|
-
setScrollbackLimit: (limit: number) => void;
|
|
148
|
-
getScrollbackLines: (count?: number) => readonly string[];
|
|
149
|
-
}
|
|
430
|
+
/**
|
|
431
|
+
* Detect terminal output color capability.
|
|
432
|
+
*
|
|
433
|
+
* - `mode` is the best-effort actual output mode.
|
|
434
|
+
* - `level` is the CLI theme tier (256/16/8). `truecolor` folds into `256`.
|
|
435
|
+
* - Pass `platform` (e.g. `process.platform`) to improve Windows detection.
|
|
436
|
+
*
|
|
437
|
+
* Env overrides (prefer `DIMCODE_` but keep `VUE_TUI_*` for library consumers):
|
|
438
|
+
* - `DIMCODE_COLOR_MODE` / `VUE_TUI_COLOR_MODE`
|
|
439
|
+
*/
|
|
440
|
+
declare function detectTerminalColorCapability(opts?: Readonly<{
|
|
441
|
+
env?: Record<string, unknown>;
|
|
442
|
+
isTTY?: boolean;
|
|
443
|
+
platform?: string;
|
|
444
|
+
}>): TerminalColorCapability;
|
|
150
445
|
|
|
151
446
|
//#endregion
|
|
152
447
|
//#region src/core/ansi/sgr.d.ts
|
|
@@ -189,7 +484,7 @@ type Rect = Readonly<{
|
|
|
189
484
|
w: number;
|
|
190
485
|
h: number;
|
|
191
486
|
}>;
|
|
192
|
-
type TerminalEventType = 'click' | 'dblclick' | 'contextmenu' | 'pointerdown' | 'pointerup' | 'pointermove' | 'wheel' | 'keydown' | 'keyup' | 'beforeinput' | 'input' | 'compositionstart' | 'compositionupdate' | 'compositionend' | 'paste' | 'focus' | 'blur';
|
|
487
|
+
type TerminalEventType = 'click' | 'dblclick' | 'contextmenu' | 'pointerdown' | 'pointerup' | 'pointermove' | 'pointerenter' | 'pointerleave' | 'wheel' | 'keydown' | 'keyup' | 'beforeinput' | 'input' | 'compositionstart' | 'compositionupdate' | 'compositionend' | 'paste' | 'focus' | 'blur';
|
|
193
488
|
interface TerminalBaseEvent {
|
|
194
489
|
type: TerminalEventType;
|
|
195
490
|
target: TerminalNode | null;
|
|
@@ -246,6 +541,10 @@ type TerminalEventHandlerMap = Partial<{
|
|
|
246
541
|
pointerup: (e: TerminalPointerEvent) => void;
|
|
247
542
|
pointermoveCapture: (e: TerminalPointerEvent) => void;
|
|
248
543
|
pointermove: (e: TerminalPointerEvent) => void;
|
|
544
|
+
pointerenterCapture: (e: TerminalPointerEvent) => void;
|
|
545
|
+
pointerenter: (e: TerminalPointerEvent) => void;
|
|
546
|
+
pointerleaveCapture: (e: TerminalPointerEvent) => void;
|
|
547
|
+
pointerleave: (e: TerminalPointerEvent) => void;
|
|
249
548
|
wheelCapture: (e: TerminalPointerEvent) => void;
|
|
250
549
|
wheel: (e: TerminalPointerEvent) => void;
|
|
251
550
|
keydownCapture: (e: TerminalKeyboardEvent) => void;
|
|
@@ -297,7 +596,7 @@ interface CliEventManager {
|
|
|
297
596
|
setMetrics: (next: CellMetrics) => void;
|
|
298
597
|
focus: (id: string | null) => void;
|
|
299
598
|
getFocused: () => string | null;
|
|
300
|
-
dispatch: (event: TerminalEventRecord) =>
|
|
599
|
+
dispatch: (event: TerminalEventRecord) => boolean;
|
|
301
600
|
debugNodes: () => TerminalDebugNode[];
|
|
302
601
|
dispose: () => void;
|
|
303
602
|
}
|
|
@@ -327,6 +626,106 @@ declare function createEventManager(container: HTMLElement, metrics: CellMetrics
|
|
|
327
626
|
onFocusChange?: (prev: string | null, next: string | null) => void;
|
|
328
627
|
}>): EventManager;
|
|
329
628
|
|
|
629
|
+
//#endregion
|
|
630
|
+
//#region src/vue/components/input/host.d.ts
|
|
631
|
+
type ResolveTInputPathInfo = Readonly<{
|
|
632
|
+
workspace: string;
|
|
633
|
+
input: string;
|
|
634
|
+
preserveBackslash?: boolean;
|
|
635
|
+
homeDir?: string;
|
|
636
|
+
}>;
|
|
637
|
+
type TInputHostAdapter = Readonly<{
|
|
638
|
+
isTerminalLike?: boolean;
|
|
639
|
+
resolvePath?: (info: ResolveTInputPathInfo) => string;
|
|
640
|
+
pathToHref?: (pathLike: string) => string | undefined;
|
|
641
|
+
readClipboardText?: () => Promise<string>;
|
|
642
|
+
writeClipboardText?: (text: string) => Promise<boolean>;
|
|
643
|
+
showToast?: (message: string) => void;
|
|
644
|
+
}>;
|
|
645
|
+
|
|
646
|
+
//#endregion
|
|
647
|
+
//#region src/vue/components/input/plugins/types.d.ts
|
|
648
|
+
type PromptSuggestion = Readonly<{
|
|
649
|
+
value: string;
|
|
650
|
+
insert?: string;
|
|
651
|
+
label?: string;
|
|
652
|
+
detail?: string;
|
|
653
|
+
keywords?: readonly string[];
|
|
654
|
+
mentionValue?: string;
|
|
655
|
+
mentionBehavior?: 'collect' | 'inline';
|
|
656
|
+
onSelect?: (info: Readonly<{
|
|
657
|
+
value: string;
|
|
658
|
+
query: string;
|
|
659
|
+
}>) => void | boolean;
|
|
660
|
+
}>;
|
|
661
|
+
type TInputPluginContext = Readonly<{
|
|
662
|
+
getProps: () => Readonly<{
|
|
663
|
+
zIndex: number;
|
|
664
|
+
style?: Style;
|
|
665
|
+
promptSuggestions: readonly PromptSuggestion[];
|
|
666
|
+
promptTrigger: string;
|
|
667
|
+
promptTriggers?: readonly string[];
|
|
668
|
+
promptMaxItems: number;
|
|
669
|
+
promptAlign: 'input' | 'center';
|
|
670
|
+
promptSelectedStyle?: Style;
|
|
671
|
+
mentionTrigger: string;
|
|
672
|
+
mentionWorkspace: string;
|
|
673
|
+
mentionMode: PathPickMode;
|
|
674
|
+
mentionShowHidden: boolean;
|
|
675
|
+
mentionSuggestions: readonly PromptSuggestion[];
|
|
676
|
+
mentionMaxItems: number;
|
|
677
|
+
collectMentions: boolean;
|
|
678
|
+
mentions: readonly string[];
|
|
679
|
+
skillTrigger?: string;
|
|
680
|
+
skillSuggestions?: readonly PromptSuggestion[];
|
|
681
|
+
}>;
|
|
682
|
+
emit: (event: string, ...args: any[]) => void;
|
|
683
|
+
terminal: Terminal;
|
|
684
|
+
scheduler: Readonly<{
|
|
685
|
+
invalidate: () => void;
|
|
686
|
+
}>;
|
|
687
|
+
defaultStyle: Ref<Style>;
|
|
688
|
+
render: Readonly<{
|
|
689
|
+
rootStack: any;
|
|
690
|
+
createStack: (parent: any, z: number) => any;
|
|
691
|
+
}>;
|
|
692
|
+
visible: Ref<boolean>;
|
|
693
|
+
rawAbsRect: ComputedRef<Rect>;
|
|
694
|
+
eventZ: ComputedRef<number>;
|
|
695
|
+
focused: Ref<boolean>;
|
|
696
|
+
cursor: Ref<number>;
|
|
697
|
+
getValue: () => string;
|
|
698
|
+
insertText: (text: string) => void;
|
|
699
|
+
pushUndoSnapshot: (nextValue: string) => void;
|
|
700
|
+
applyEdit: (nextValue: string, nextCursor: number) => void;
|
|
701
|
+
registerKeydownInterceptor: (fn: (e: TerminalKeyboardEvent) => boolean) => void;
|
|
702
|
+
registerTextFilter: (fn: (info: Readonly<{
|
|
703
|
+
text: string;
|
|
704
|
+
value: string;
|
|
705
|
+
cursor: number;
|
|
706
|
+
selection: null | Readonly<{
|
|
707
|
+
start: number;
|
|
708
|
+
end: number;
|
|
709
|
+
}>;
|
|
710
|
+
}>) => string) => void;
|
|
711
|
+
registerChipStyleProvider: (provider: Readonly<{
|
|
712
|
+
getStyle: (baseStyle: Style, chip: Readonly<{
|
|
713
|
+
kind: 'multiline' | 'mention';
|
|
714
|
+
absPath?: string;
|
|
715
|
+
}>) => Style | null | undefined;
|
|
716
|
+
version: Ref<number>;
|
|
717
|
+
}> | null) => void;
|
|
718
|
+
registerHostAdapter: (adapter: TInputHostAdapter | null) => void;
|
|
719
|
+
resolvePath: (input: string, opts?: Readonly<{
|
|
720
|
+
preserveBackslash?: boolean;
|
|
721
|
+
}>) => string;
|
|
722
|
+
mentionToken: string;
|
|
723
|
+
}>;
|
|
724
|
+
type TInputPlugin = Readonly<{
|
|
725
|
+
name: string;
|
|
726
|
+
install: (ctx: TInputPluginContext) => void;
|
|
727
|
+
}>;
|
|
728
|
+
|
|
330
729
|
//#endregion
|
|
331
730
|
//#region src/observability/trace.d.ts
|
|
332
731
|
type TraceRecord = Readonly<{
|
|
@@ -341,7 +740,8 @@ type TraceRecord = Readonly<{
|
|
|
341
740
|
}> | Readonly<{
|
|
342
741
|
type: 'commit';
|
|
343
742
|
at: number;
|
|
344
|
-
dirtyRows: readonly number[];
|
|
743
|
+
dirtyRows: readonly number[] | null;
|
|
744
|
+
planes: TerminalRenderPlanes | null;
|
|
345
745
|
focusedId: string | null;
|
|
346
746
|
}>;
|
|
347
747
|
type TraceStore = Readonly<{
|
|
@@ -369,8 +769,13 @@ type StdoutRenderer = Readonly<{
|
|
|
369
769
|
setCursor: (x: number, y: number) => void;
|
|
370
770
|
/** Show or hide the terminal cursor */
|
|
371
771
|
showCursor: (visible: boolean) => void;
|
|
772
|
+
/** Update palette/default background without recreating the renderer. */
|
|
773
|
+
updateTheme?: (next: Readonly<{
|
|
774
|
+
defaultBg?: AnsiColorName;
|
|
775
|
+
palette?: Partial<Record<AnsiColorName, string>>;
|
|
776
|
+
}>) => void;
|
|
372
777
|
}>;
|
|
373
|
-
type StdoutColorMode = 'auto' | 'truecolor' | 'ansi16' | '
|
|
778
|
+
type StdoutColorMode = 'auto' | 'truecolor' | 'ansi256' | 'ansi16' | 'ansi8';
|
|
374
779
|
declare function createStdoutRenderer(terminal: Terminal, options?: Readonly<{
|
|
375
780
|
output?: CliOutput;
|
|
376
781
|
clear?: boolean;
|
|
@@ -383,6 +788,13 @@ declare function createStdoutRenderer(terminal: Terminal, options?: Readonly<{
|
|
|
383
788
|
trackResize?: boolean;
|
|
384
789
|
/** Color mode for ANSI output (auto detects truecolor via env). */
|
|
385
790
|
colorMode?: StdoutColorMode;
|
|
791
|
+
/** Optional function to get IME cursor position, included in render output for atomic write */
|
|
792
|
+
getImeAnchor?: () => {
|
|
793
|
+
cellX: number;
|
|
794
|
+
cellY: number;
|
|
795
|
+
} | null;
|
|
796
|
+
/** Use DEC 2026 synchronized output mode (default: false for compatibility) */
|
|
797
|
+
useSyncOutput?: boolean;
|
|
386
798
|
}>): StdoutRenderer;
|
|
387
799
|
|
|
388
800
|
//#endregion
|
|
@@ -402,9 +814,12 @@ type RenderStack = Readonly<{
|
|
|
402
814
|
type RenderNode = Readonly<{
|
|
403
815
|
id: string;
|
|
404
816
|
stack: RenderStack;
|
|
817
|
+
plane: TerminalRenderPlane;
|
|
405
818
|
zIndex: number;
|
|
406
819
|
order: number;
|
|
407
820
|
rect: RenderRect | null;
|
|
821
|
+
rectY0: number;
|
|
822
|
+
rectY1: number;
|
|
408
823
|
paint: (dirtyRows?: readonly number[]) => void;
|
|
409
824
|
}>;
|
|
410
825
|
type RenderManager = Readonly<{
|
|
@@ -412,18 +827,28 @@ type RenderManager = Readonly<{
|
|
|
412
827
|
createStack: (parent: RenderStack, zIndex: number) => RenderStack;
|
|
413
828
|
register: (node: {
|
|
414
829
|
stack: RenderStack;
|
|
830
|
+
plane?: TerminalRenderPlane;
|
|
415
831
|
zIndex?: number;
|
|
416
832
|
rect?: RenderRect | null;
|
|
417
833
|
paint: (dirtyRows?: readonly number[]) => void;
|
|
418
834
|
}) => RenderNode;
|
|
419
835
|
update: (id: string, next: Partial<{
|
|
420
836
|
stack: RenderStack;
|
|
837
|
+
plane: TerminalRenderPlane;
|
|
421
838
|
zIndex: number;
|
|
422
839
|
rect: RenderRect | null;
|
|
423
840
|
paint: (dirtyRows?: readonly number[]) => void;
|
|
424
841
|
}>) => void;
|
|
425
842
|
unregister: (id: string) => void;
|
|
426
|
-
render: (
|
|
843
|
+
render: (options?: {
|
|
844
|
+
activePlanes?: TerminalRenderPlanes | null;
|
|
845
|
+
}) => RenderStats | null;
|
|
846
|
+
}>;
|
|
847
|
+
type RenderStats = Readonly<{
|
|
848
|
+
rows: number;
|
|
849
|
+
scannedNodes: number;
|
|
850
|
+
paintedNodes: number;
|
|
851
|
+
candidatePlanes: readonly TerminalRenderPlane[];
|
|
427
852
|
}>;
|
|
428
853
|
|
|
429
854
|
//#endregion
|
|
@@ -433,9 +858,15 @@ interface LayoutContext {
|
|
|
433
858
|
originY: number;
|
|
434
859
|
clipRect: Rect | null;
|
|
435
860
|
}
|
|
861
|
+
type TerminalSchedulerPriority = 'high' | 'normal' | 'low';
|
|
862
|
+
type TerminalSchedulerInvalidateOptions = Readonly<{
|
|
863
|
+
priority?: TerminalSchedulerPriority;
|
|
864
|
+
plane?: TerminalRenderPlane;
|
|
865
|
+
}>;
|
|
436
866
|
type TerminalScheduler = Readonly<{
|
|
437
|
-
invalidate: () => void;
|
|
867
|
+
invalidate: (options?: TerminalSchedulerInvalidateOptions) => void;
|
|
438
868
|
flush: () => void;
|
|
869
|
+
flushNow: () => void;
|
|
439
870
|
}>;
|
|
440
871
|
type TerminalRuntimeHandle = Readonly<{
|
|
441
872
|
update: (props: Record<string, unknown>) => void;
|
|
@@ -443,11 +874,14 @@ type TerminalRuntimeHandle = Readonly<{
|
|
|
443
874
|
unmount: () => void;
|
|
444
875
|
}>;
|
|
445
876
|
type TerminalRuntime = Readonly<{
|
|
446
|
-
mount: (component: Component$1, props: Record<string, unknown
|
|
877
|
+
mount: (component: Component$1, props: Record<string, unknown>, options?: Readonly<{
|
|
878
|
+
plane?: TerminalRenderPlane;
|
|
879
|
+
}>) => TerminalRuntimeHandle;
|
|
447
880
|
}>;
|
|
448
881
|
type ImeAnchor = Readonly<{
|
|
449
882
|
cellX: number;
|
|
450
883
|
cellY: number;
|
|
884
|
+
ownerId?: string;
|
|
451
885
|
}>;
|
|
452
886
|
type TerminalContext = Readonly<{
|
|
453
887
|
terminal: Terminal;
|
|
@@ -461,6 +895,7 @@ type TerminalContext = Readonly<{
|
|
|
461
895
|
defaultStyle: Ref<Style>;
|
|
462
896
|
render: RenderManager;
|
|
463
897
|
}>;
|
|
898
|
+
declare const TInputPluginsContextKey: InjectionKey<Readonly<Ref<readonly TInputPlugin[]>>>;
|
|
464
899
|
|
|
465
900
|
//#endregion
|
|
466
901
|
//#region src/create-terminal-app.d.ts
|
|
@@ -469,9 +904,11 @@ type TerminalApp = Readonly<{
|
|
|
469
904
|
terminal: Terminal;
|
|
470
905
|
events: CliEventManager;
|
|
471
906
|
scheduler: {
|
|
472
|
-
invalidate: () => void;
|
|
907
|
+
invalidate: (options?: TerminalSchedulerInvalidateOptions) => void;
|
|
473
908
|
flush: () => void;
|
|
909
|
+
flushNow: () => void;
|
|
474
910
|
};
|
|
911
|
+
defaultStyle: Ref<Style>;
|
|
475
912
|
/** Returns the current IME anchor position (cursor position in cell coordinates), or null if no input is focused */
|
|
476
913
|
getImeAnchor: () => ImeAnchor | null;
|
|
477
914
|
mount: () => void;
|
|
@@ -483,9 +920,25 @@ type CreateTerminalAppOptions = Readonly<{
|
|
|
483
920
|
component: Component$1;
|
|
484
921
|
props?: Record<string, unknown>;
|
|
485
922
|
defaultStyle?: Style;
|
|
923
|
+
inputPlugins?: readonly TInputPlugin[];
|
|
924
|
+
pathPickerProvider?: PathPickerProvider;
|
|
486
925
|
}>;
|
|
487
926
|
declare function createTerminalApp(options: CreateTerminalAppOptions): TerminalApp;
|
|
488
927
|
|
|
928
|
+
//#endregion
|
|
929
|
+
//#region src/renderer/cli/stdout-metrics.d.ts
|
|
930
|
+
type StdoutRendererWriteMode = 'stream' | 'sync' | 'chunked';
|
|
931
|
+
interface StdoutRendererMetrics {
|
|
932
|
+
lastFrameAt: number;
|
|
933
|
+
lastFrameBytes: number;
|
|
934
|
+
lastWriteMs: number;
|
|
935
|
+
writeEmaMs: number;
|
|
936
|
+
writeMode: StdoutRendererWriteMode;
|
|
937
|
+
fps: number;
|
|
938
|
+
bytesPerSec: number;
|
|
939
|
+
}
|
|
940
|
+
declare function getStdoutRendererMetrics(): StdoutRendererMetrics;
|
|
941
|
+
|
|
489
942
|
//#endregion
|
|
490
943
|
//#region src/runtime/index.d.ts
|
|
491
944
|
type RuntimeEnv = 'browser' | 'terminal' | 'unknown';
|
|
@@ -526,6 +979,90 @@ declare function createRuntime(kind?: RuntimeEnv): Runtime;
|
|
|
526
979
|
//#region src/utils/newlines.d.ts
|
|
527
980
|
declare function normalizeNewlines(text: string): string;
|
|
528
981
|
|
|
982
|
+
//#endregion
|
|
983
|
+
//#region src/vue/components/input/plugins/hostPlugin.d.ts
|
|
984
|
+
declare function createTInputHostPlugin(adapterOrFactory: TInputHostAdapter | (() => TInputHostAdapter)): TInputPlugin;
|
|
985
|
+
declare function createDefaultTInputHostAdapter(): TInputHostAdapter;
|
|
986
|
+
declare const defaultTInputHostPlugin: Readonly<{
|
|
987
|
+
name: string;
|
|
988
|
+
install: (ctx: TInputPluginContext) => void;
|
|
989
|
+
}>;
|
|
990
|
+
|
|
991
|
+
//#endregion
|
|
992
|
+
//#region src/vue/components/input/plugins/promptMentionState.d.ts
|
|
993
|
+
type PromptSuggestion$1 = Readonly<{
|
|
994
|
+
value: string;
|
|
995
|
+
insert?: string;
|
|
996
|
+
label?: string;
|
|
997
|
+
detail?: string;
|
|
998
|
+
keywords?: readonly string[];
|
|
999
|
+
mentionValue?: string;
|
|
1000
|
+
mentionBehavior?: 'collect' | 'inline';
|
|
1001
|
+
onSelect?: (info: Readonly<{
|
|
1002
|
+
value: string;
|
|
1003
|
+
query: string;
|
|
1004
|
+
}>) => void | boolean;
|
|
1005
|
+
}>;
|
|
1006
|
+
type MentionSuggestionProvider = (info: Readonly<{
|
|
1007
|
+
query: string;
|
|
1008
|
+
tokenText: string;
|
|
1009
|
+
trigger: string;
|
|
1010
|
+
workspace: string;
|
|
1011
|
+
maxItems: number;
|
|
1012
|
+
}>) => readonly PromptSuggestion$1[] | Promise<readonly PromptSuggestion$1[]>;
|
|
1013
|
+
type MentionPathProvider = Readonly<{
|
|
1014
|
+
stat?: (absPath: string) => FsEntryKind | null | undefined | Promise<FsEntryKind | null | undefined>;
|
|
1015
|
+
suggest?: (info: Readonly<{
|
|
1016
|
+
workspaceAbs: string;
|
|
1017
|
+
input: string;
|
|
1018
|
+
mode: PathPickMode;
|
|
1019
|
+
max: number;
|
|
1020
|
+
showHidden: boolean;
|
|
1021
|
+
maxDepth: number;
|
|
1022
|
+
}>) => readonly PathSuggestion[] | Promise<readonly PathSuggestion[]>;
|
|
1023
|
+
}>;
|
|
1024
|
+
|
|
1025
|
+
//#endregion
|
|
1026
|
+
//#region src/vue/components/input/plugins/nodeMentionPathProvider.d.ts
|
|
1027
|
+
declare function createNodeMentionPathProvider(): MentionPathProvider;
|
|
1028
|
+
|
|
1029
|
+
//#endregion
|
|
1030
|
+
//#region src/vue/components/input/plugins/promptMentionPlugin.d.ts
|
|
1031
|
+
type PromptMentionPluginOptions = Readonly<{
|
|
1032
|
+
mentionSuggestionProviders?: readonly MentionSuggestionProvider[];
|
|
1033
|
+
mentionPathProvider?: MentionPathProvider;
|
|
1034
|
+
}>;
|
|
1035
|
+
declare function createPromptMentionPlugin(options?: PromptMentionPluginOptions): TInputPlugin;
|
|
1036
|
+
|
|
1037
|
+
//#endregion
|
|
1038
|
+
//#region src/vue/components/input/plugins/restrictText.d.ts
|
|
1039
|
+
type TextRestrictionRule = Readonly<{
|
|
1040
|
+
allowChars: RegExp;
|
|
1041
|
+
} | {
|
|
1042
|
+
denyChars: RegExp;
|
|
1043
|
+
} | {
|
|
1044
|
+
replace: Readonly<{
|
|
1045
|
+
from: RegExp;
|
|
1046
|
+
to: string;
|
|
1047
|
+
}>;
|
|
1048
|
+
} | {
|
|
1049
|
+
allow: RegExp;
|
|
1050
|
+
} | {
|
|
1051
|
+
filter: (info: Readonly<{
|
|
1052
|
+
text: string;
|
|
1053
|
+
value: string;
|
|
1054
|
+
cursor: number;
|
|
1055
|
+
selection: null | Readonly<{
|
|
1056
|
+
start: number;
|
|
1057
|
+
end: number;
|
|
1058
|
+
}>;
|
|
1059
|
+
}>) => string;
|
|
1060
|
+
}>;
|
|
1061
|
+
declare function createTextRestrictionPlugin(options: Readonly<{
|
|
1062
|
+
name?: string;
|
|
1063
|
+
rules: readonly TextRestrictionRule[];
|
|
1064
|
+
}>): TInputPlugin;
|
|
1065
|
+
|
|
529
1066
|
//#endregion
|
|
530
1067
|
//#region src/vue/components/TAnchor.d.ts
|
|
531
1068
|
declare const TAnchor: any;
|
|
@@ -558,14 +1095,37 @@ declare const TInput: any;
|
|
|
558
1095
|
//#region src/vue/components/TInputBox.d.ts
|
|
559
1096
|
declare const TInputBox: any;
|
|
560
1097
|
|
|
1098
|
+
//#endregion
|
|
1099
|
+
//#region src/vue/components/TJsonEditor.d.ts
|
|
1100
|
+
type JsonLintStatus = Readonly<{
|
|
1101
|
+
state: 'idle' | 'success' | 'error';
|
|
1102
|
+
message?: string;
|
|
1103
|
+
line?: number;
|
|
1104
|
+
column?: number;
|
|
1105
|
+
}>;
|
|
1106
|
+
declare function lintJsonText(input: string): JsonLintStatus;
|
|
1107
|
+
declare const TJsonEditor: any;
|
|
1108
|
+
|
|
561
1109
|
//#endregion
|
|
562
1110
|
//#region src/vue/components/TList.d.ts
|
|
563
1111
|
declare const TList: any;
|
|
564
1112
|
|
|
1113
|
+
//#endregion
|
|
1114
|
+
//#region src/vue/components/TMultilineModal.d.ts
|
|
1115
|
+
declare const TMultilineModal: any;
|
|
1116
|
+
|
|
565
1117
|
//#endregion
|
|
566
1118
|
//#region src/vue/components/TPathPicker.d.ts
|
|
567
1119
|
declare const TPathPicker: any;
|
|
568
1120
|
|
|
1121
|
+
//#endregion
|
|
1122
|
+
//#region src/vue/components/TRenderLayer.d.ts
|
|
1123
|
+
declare const TRenderLayer: any;
|
|
1124
|
+
|
|
1125
|
+
//#endregion
|
|
1126
|
+
//#region src/vue/components/TRenderPlane.d.ts
|
|
1127
|
+
declare const TRenderPlane: any;
|
|
1128
|
+
|
|
569
1129
|
//#endregion
|
|
570
1130
|
//#region src/vue/components/TSelect.d.ts
|
|
571
1131
|
declare const TSelect: any;
|
|
@@ -586,10 +1146,25 @@ declare const TView: any;
|
|
|
586
1146
|
//#region src/vue/composables/use-layout.d.ts
|
|
587
1147
|
declare function useLayout(): LayoutContext;
|
|
588
1148
|
|
|
1149
|
+
//#endregion
|
|
1150
|
+
//#region src/vue/composables/use-render-node.d.ts
|
|
1151
|
+
interface RenderNodeOptions {
|
|
1152
|
+
zIndex?: number;
|
|
1153
|
+
stack?: RenderStack;
|
|
1154
|
+
rect?: RenderRect | null;
|
|
1155
|
+
deps?: unknown;
|
|
1156
|
+
paint: (dirtyRows?: readonly number[]) => void;
|
|
1157
|
+
}
|
|
1158
|
+
declare function useRenderNode(getOptions: () => RenderNodeOptions): {
|
|
1159
|
+
id: Ref<string | null>;
|
|
1160
|
+
};
|
|
1161
|
+
|
|
589
1162
|
//#endregion
|
|
590
1163
|
//#region src/vue/composables/use-runtime.d.ts
|
|
591
1164
|
declare function useTerminalRuntime(): Readonly<{
|
|
592
|
-
mount: (component: Component, props: Record<string, unknown
|
|
1165
|
+
mount: (component: Component, props: Record<string, unknown>, options?: Readonly<{
|
|
1166
|
+
plane?: TerminalRenderPlane;
|
|
1167
|
+
}>) => TerminalRuntimeHandle;
|
|
593
1168
|
}>;
|
|
594
1169
|
|
|
595
1170
|
//#endregion
|
|
@@ -645,14 +1220,14 @@ type TerminalRouteLocationRaw = string | Readonly<{
|
|
|
645
1220
|
type NavigationGuardReturn = void | boolean | TerminalRouteLocationRaw;
|
|
646
1221
|
type NavigationGuard = (to: TerminalRoute, from: TerminalRoute | null) => NavigationGuardReturn | Promise<NavigationGuardReturn>;
|
|
647
1222
|
type TerminalRouter = Readonly<{
|
|
648
|
-
currentRoute:
|
|
1223
|
+
currentRoute: vue15.Ref<TerminalRoute>;
|
|
649
1224
|
push: (to: TerminalRouteLocationRaw) => Promise<void>;
|
|
650
1225
|
replace: (to: TerminalRouteLocationRaw) => Promise<void>;
|
|
651
1226
|
back: () => Promise<void>;
|
|
652
1227
|
beforeEach: (guard: NavigationGuard) => () => void;
|
|
653
1228
|
beforeResolve: (guard: NavigationGuard) => () => void;
|
|
654
1229
|
afterEach: (guard: (to: TerminalRoute, from: TerminalRoute | null) => void) => () => void;
|
|
655
|
-
install: (app:
|
|
1230
|
+
install: (app: vue16.App) => void;
|
|
656
1231
|
}>;
|
|
657
1232
|
|
|
658
1233
|
//#endregion
|
|
@@ -676,9 +1251,29 @@ declare const TRouterView: any;
|
|
|
676
1251
|
declare function sanitizeInlineText(text: string): string;
|
|
677
1252
|
declare function sanitizeTextBlock(text: string): string;
|
|
678
1253
|
declare function textCellWidth(text: string): number;
|
|
1254
|
+
declare function spaces(count: number): string;
|
|
679
1255
|
declare function sliceByCells(text: string, maxCells: number): string;
|
|
1256
|
+
declare function sliceByCellsRange(text: string, startCells: number, endCells: number): string;
|
|
680
1257
|
declare function padEndByCells(text: string, width: number): string;
|
|
681
|
-
declare function
|
|
1258
|
+
declare function formatInlineCellLine(text: string, width: number): string;
|
|
1259
|
+
declare function clearTextCaches(): void;
|
|
1260
|
+
declare function wrapByCells(text: string, width: number): readonly string[];
|
|
1261
|
+
|
|
1262
|
+
//#endregion
|
|
1263
|
+
//#region src/vue/utils/wheel-scroll.d.ts
|
|
1264
|
+
interface WheelScrollState {
|
|
1265
|
+
accumulator: number;
|
|
1266
|
+
lastAt: number;
|
|
1267
|
+
lastEdgeDir: number;
|
|
1268
|
+
lastEdgeAt: number;
|
|
1269
|
+
}
|
|
1270
|
+
interface WheelScrollResult {
|
|
1271
|
+
nextTop: number;
|
|
1272
|
+
dir: -1 | 0 | 1;
|
|
1273
|
+
lines: number;
|
|
1274
|
+
}
|
|
1275
|
+
declare function createWheelScrollState(): WheelScrollState;
|
|
1276
|
+
declare function applyWheelScroll(state: WheelScrollState, deltaY: number, scrollTop: number, maxTop: number, now?: number): WheelScrollResult;
|
|
682
1277
|
|
|
683
1278
|
//#endregion
|
|
684
|
-
export { AnsiColorName, BufferSnapshot, Cell, CellMetrics, CliEventManager, ClipboardApi, CreateTerminalAppOptions, DomRenderer, EventManager, FsDirEntry, FsEntryKind, FsStat, LayoutContext, PathPickerProvider, RafApi, Rect, Runtime, RuntimeEnv, StdinDriver, StdoutRenderer, Style, TAnchor, TBox, TDebugOverlay, TDialog, TFlow, TInput, TInputBox, TList, TPathPicker, TRouterView, TSelect, TText, TTransition, TView, Terminal, TerminalApp, TerminalBaseEvent, TerminalCommitEvent, TerminalContext, TerminalDebugNode, TerminalEventHandlerMap, TerminalEventMap, TerminalEventRecord, TerminalEventType, TerminalInputEvent, TerminalKeyboardEvent, TerminalNode, TerminalPointerEvent, TerminalProvider, TerminalResizeEvent, TerminalRoute, TerminalRouteLocationRaw, TerminalRouteRecord, TerminalRouter, TerminalRuntime, TerminalRuntimeHandle, TerminalScheduler, TimerApi, TraceRecord, TraceStore, ansiStyles, charCellWidth, createCliEventManager, createDomRenderer, createEventManager, createNodePathPickerProvider, createRuntime, createStdinDriver, createStdoutRenderer, createTerminal, createTerminalApp, createTerminalRouter, createTraceStore, normalizeNewlines, padEndByCells, parseAnsiSgr, readEventLog, resolveUserPath, sanitizeInlineText, sanitizeTextBlock, sliceByCells, textCellWidth, useLayout, useRoute, useRouter, useTerminal, useTerminalNode, useTerminalRuntime, useVisibility, wrapByCells, writeEventLog, writeSnapshot };
|
|
1279
|
+
export { ANSI16_COLORS, ANSI256_COLORS, ANSI8_COLORS, AnsiColorName, BufferSnapshot, Cell, CellMetrics, CliEventManager, ClipboardApi, CreateTerminalAppOptions, DomRenderer, EventManager, FsDirEntry, FsEntryKind, FsStat, LayoutContext, MentionPathProvider, MentionSuggestionProvider, PathPickMode, PathPickerProvider, PathSuggestion, PromptMentionPluginOptions, PromptSuggestion, RafApi, Rect, Runtime, RuntimeEnv, SGR_RESET, StdinDriver, StdoutRenderer, StdoutRendererMetrics, Style, SuggestPathsResult, TAnchor, TBox, TDebugOverlay, TDialog, TERMINAL_RENDER_PLANES, TFlow, TInput, TInputBox, TInputHostAdapter, TInputPlugin, TInputPluginContext, TInputPluginsContextKey, TJsonEditor, TList, TMultilineModal, TPathPicker, TRenderLayer, TRenderPlane, TRouterView, TSelect, TText, TTransition, TView, Terminal, TerminalApp, TerminalBaseEvent, TerminalColorCapability, TerminalColorLevel, TerminalColorMode, TerminalCommitEvent, TerminalContext, TerminalDebugNode, TerminalEventHandlerMap, TerminalEventMap, TerminalEventRecord, TerminalEventType, TerminalInputEvent, TerminalKeyboardEvent, TerminalNode, TerminalPointerEvent, TerminalProvider, TerminalRenderPlane, TerminalRenderPlanes, TerminalResizeEvent, TerminalRoute, TerminalRouteLocationRaw, TerminalRouteRecord, TerminalRouter, TerminalRuntime, TerminalRuntimeHandle, TerminalScheduler, TerminalSchedulerInvalidateOptions, TimerApi, TraceRecord, TraceStore, ansiColors, ansiStyles, applyWheelScroll, charCellWidth, clearTextCaches, createCliEventManager, createDefaultTInputHostAdapter, createDomRenderer, createEventManager, createNodeMentionPathProvider, createNodePathPickerProvider, createPromptMentionPlugin, createRuntime, createStdinDriver, createStdoutRenderer, createTInputHostPlugin, createTerminal, createTerminalApp, createTerminalRouter, createTextRestrictionPlugin, createTraceStore, createWheelScrollState, defaultTInputHostPlugin, detectTerminalColorCapability, formatInlineCellLine, getStdoutRendererMetrics, lintJsonText, normalizeNewlines, padEndByCells, parseAnsiSgr, readEventLog, resolveUserPath, rgbToAnsi256, sanitizeInlineText, sanitizeTextBlock, sliceByCells, sliceByCellsRange, spaces, suggestPaths, textCellWidth, truecolorBgOpen, truecolorFgOpen, useLayout, useRenderNode, useRoute, useRouter, useTerminal, useTerminalNode, useTerminalRuntime, useVisibility, wrapByCells, writeEventLog, writeSnapshot };
|