terminal package
This library implements a system for processing human readable text that will be output by console applications.
Remarks
See the TerminalWritable documentation for an overview of the major concepts.
Classes
| Class | Description |
|---|---|
| CallbackWritable | This class enables very basic TerminalWritable.onWriteChunk() operations to be implemented as a callback function, avoiding the need to define a subclass of TerminalWritable. |
| DiscardStdoutTransform | (BETA) DiscardStdoutTransform discards stdout chunks while fixing up malformed stderr lines. |
| MockWritable | (BETA) A TerminalWritable subclass for use by unit tests. |
| NormalizeNewlinesTextRewriter | For use with TextRewriterTransform, this rewriter converts all newlines to a standard format. |
| PrintUtilities | A collection of utilities for printing messages to the console. |
| RemoveColorsTextRewriter | For use with TextRewriterTransform, this rewriter removes ANSI escape codes including colored text. |
| SplitterTransform | Use this instead of TerminalTransform if you need to output ITerminalChunk data to more than one destination. |
| StderrLineTransform | (BETA) StderrLineTransform normalizes lines that mix characters from stdout and stderr, so that each output line is routed entirely to stdout or stderr. |
| StdioSummarizer | (BETA) Summarizes the results of a failed build task by returning a subset of stderr output not to exceed a specified maximum number of lines. |
| StdioWritable | A TerminalWritable subclass that writes its output directly to the process stdout and stderr streams. |
| TextRewriterTransform | A TerminalTransform subclass that performs one or more TextRewriter operations. The most common operations are NormalizeNewlinesTextRewriter and RemoveColorsTextRewriter. |
Abstract Classes
| Abstract Class | Description |
|---|---|
| TerminalTransform | The abstract base class for TerminalWritable objects that receive an input, transform it somehow, and then write the output to another TerminalWritable. |
| TerminalWritable | The abstract base class for objects that can present, route, or process text output for a console application. This output is typically prepared using the Terminal API. |
| TextRewriter | The abstract base class for operations that can be applied by TextRewriterTransform. |
Enumerations
| Enumeration | Description |
|---|---|
| TerminalChunkKind | Specifies the kind of data represented by a ITerminalChunk object. |
Interfaces
| Interface | Description |
|---|---|
| ICallbackWritableOptions | Constructor options for CallbackWritable. |
| IDiscardStdoutTransformOptions | (BETA) Constructor options for DiscardStdoutTransform |
| INormalizeNewlinesTextRewriterOptions | Constructor options for NormalizeNewlinesTextRewriter |
| ISplitterTransformOptions | Constructor options for SplitterTransform. |
| IStdioLineTransformOptions | (BETA) Constructor options for StderrLineTransform |
| IStdioSummarizerOptions | (BETA) Constructor options for StdioSummarizer. |
| ITerminalChunk | Represents a chunk of output that will ultimately be written to a TerminalWritable. |
| ITerminalTransformOptions | Constructor options for TerminalTransform. |
| ITerminalWritableOptions | Constructor options for TerminalWritable |
| ITextRewriterTransformOptions | Constructor options for TextRewriterTransform. |
Variables
| Variable | Description |
|---|---|
| DEFAULT_CONSOLE_WIDTH | A sensible fallback column width for consoles. |
Type Aliases
| Type Alias | Description |
|---|---|
| TextRewriterState | Represents the internal state of a TextRewriter subclass. |