-
Notifications
You must be signed in to change notification settings - Fork 618
/
Copy pathITerminal.ts
97 lines (82 loc) · 2.56 KB
/
ITerminal.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.
import type { ITerminalProvider } from './ITerminalProvider';
/**
* @beta
*/
export interface ITerminalWriteOptions {
/**
* If set to true, SGR parameters will not be replaced by the terminal
* standard (i.e. - red for errors, yellow for warnings).
*/
doNotOverrideSgrCodes?: boolean;
}
/**
* @beta
*/
export type TerminalWriteParameters = string[] | [...string[], ITerminalWriteOptions];
/**
* @beta
*/
export interface ITerminal {
/**
* Subscribe a new terminal provider.
*/
registerProvider(provider: ITerminalProvider): void;
/**
* Unsubscribe a terminal provider. If the provider isn't subscribed, this function does nothing.
*/
unregisterProvider(provider: ITerminalProvider): void;
/**
* Write a generic message to the terminal
*/
write(...messageParts: TerminalWriteParameters): void;
/**
* Write a generic message to the terminal, followed by a newline
*/
writeLine(...messageParts: TerminalWriteParameters): void;
/**
* Write a warning message to the console with yellow text.
*
* @remarks
* The yellow color takes precedence over any other foreground colors set.
*/
writeWarning(...messageParts: TerminalWriteParameters): void;
/**
* Write a warning message to the console with yellow text, followed by a newline.
*
* @remarks
* The yellow color takes precedence over any other foreground colors set.
*/
writeWarningLine(...messageParts: TerminalWriteParameters): void;
/**
* Write an error message to the console with red text.
*
* @remarks
* The red color takes precedence over any other foreground colors set.
*/
writeError(...messageParts: TerminalWriteParameters): void;
/**
* Write an error message to the console with red text, followed by a newline.
*
* @remarks
* The red color takes precedence over any other foreground colors set.
*/
writeErrorLine(...messageParts: TerminalWriteParameters): void;
/**
* Write a verbose-level message.
*/
writeVerbose(...messageParts: TerminalWriteParameters): void;
/**
* Write a verbose-level message followed by a newline.
*/
writeVerboseLine(...messageParts: TerminalWriteParameters): void;
/**
* Write a debug-level message.
*/
writeDebug(...messageParts: TerminalWriteParameters): void;
/**
* Write a debug-level message followed by a newline.
*/
writeDebugLine(...messageParts: TerminalWriteParameters): void;
}