Home > @rushstack/terminal > CallbackWritable
CallbackWritable class
This class enables very basic TerminalWritable.onWriteChunk() operations to be implemented as a callback function, avoiding the need to define a subclass of TerminalWritable
.
Signature:
export declare class CallbackWritable extends TerminalWritable
Extends: TerminalWritable
Remarks
CallbackWritable
is provided as a convenience for very simple situations. For most cases, it is generally preferable to create a proper subclass.
Constructors
Constructor | Modifiers | Description |
---|---|---|
(constructor)(options) | Constructs a new instance of the CallbackWritable class |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
isOpen | readonly | boolean | This property is initially (Inherited from TerminalWritable) |
preventAutoclose | readonly | boolean | (Inherited from TerminalWritable) |
Methods
Method | Modifiers | Description |
---|---|---|
close() | Calling this method flushes any remaining outputs and permanently transitions the (Inherited from TerminalWritable) | |
onClose() | protected | Subclasses can override this empty method to perform additional operations such as closing a file handle. (Inherited from TerminalWritable) |
onWriteChunk(chunk) | protected | |
writeChunk(chunk) | Upstream objects call this method to provide inputs to this object. (Inherited from TerminalWritable) |