-
Notifications
You must be signed in to change notification settings - Fork 618
/
Copy pathITerminalChunk.ts
50 lines (46 loc) · 1.65 KB
/
ITerminalChunk.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
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.
/**
* Specifies the kind of data represented by a {@link ITerminalChunk} object.
* @public
*/
export enum TerminalChunkKind {
/**
* Indicates a `ITerminalChunk` object representing `stdout` console output.
*/
Stdout = 'O',
/**
* Indicates a `ITerminalChunk` object representing `stderr` console output.
*/
Stderr = 'E'
}
/**
* Represents a chunk of output that will ultimately be written to a {@link TerminalWritable}.
*
* @remarks
* Today `ITerminalChunk` represents the `stdout` and `stderr` text streams. In the future,
* we plan to expand it to include other console UI elements such as instructions for displaying
* an interactive progress bar. We may also add other metadata, for example tracking whether
* the `text` string is known to contain color codes or not.
*
* The `ITerminalChunk` object should be considered to be immutable once it is created.
* For example, {@link SplitterTransform} may pass the same chunk to multiple destinations.
*
* @public
*/
export interface ITerminalChunk {
/**
* Indicates the kind of information stored in this chunk.
*
* @remarks
* More kinds will be introduced in the future. Implementors of
* {@link TerminalWritable.onWriteChunk} should ignore unrecognized `TerminalChunkKind`
* values. `TerminalTransform` implementors should pass along unrecognized chunks
* rather than discarding them.
*/
kind: TerminalChunkKind;
/**
* The next chunk of text from the `stderr` or `stdout` stream.
*/
text: string;
}