Graphity for TypeScript 3.0.0
    Preparing search index...

    Interface TextSink

    Where DotWriter.write puts its text: anything with a write(text) method. That is a Node.js Writable such as process.stdout or a file stream, a WritableStreamDefaultWriter, or a collector of one's own. It is the counterpart of Java's Appendable.

    The writer passes the text in chunks of about 8 KiB characters, not piece by piece, and ignores what write returns: a Node.js stream buffers past its high-water mark, and the promise of a stream writer is not awaited. A write that throws ends the writing with its error.

    Only a write that throws fails the call, as Java's IOException does. A Node.js stream reports its errors through its 'error' event, and a WritableStreamDefaultWriter through its promises (writer.closed, writer.close()), after the call has returned. The caller must watch these, as Node.js otherwise ends the process on such an error. For an error that fails the call itself, use a sink that writes synchronously, such as one that calls fs.writeSync.

    interface TextSink {
        write(text: string): unknown;
    }
    Index