Calling this method flushes any remaining outputs and permanently transitions the
TerminalWritable to a “closed” state, where no further chunks can be written.
/** @sealed */ close(): void;
The subclass provides its implementation via the the TerminalWritable.onClose() method, which is called by
If this method is called more than once, the additional calls are ignored;
TerminalWritable.onClose will be called at most once.