WritableStream

open class WritableStream<W : JsAny?>(    underlyingSink: UnderlyingSink<W> = definedExternally,     strategy: QueuingStrategy<W> = definedExternally) : Transferable(source)

The WritableStream interface of the Streams API provides a standard abstraction for writing streaming data to a destination, known as a sink.

MDN Reference

Constructors

Link copied to clipboard
constructor(underlyingSink: UnderlyingSink<W> = definedExternally, strategy: QueuingStrategy<W> = definedExternally)

Properties

Link copied to clipboard

The locked read-only property of the WritableStream interface returns a boolean indicating whether the WritableStream is locked to a writer.

Functions

Link copied to clipboard
suspend fun abort(reason: JsError? = definedExternally)

The abort() method of the WritableStream interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded.

Link copied to clipboard
fun abortAsync(reason: JsError? = definedExternally): Promise<Void>
Link copied to clipboard
suspend fun close()

The close() method of the WritableStream interface closes the associated stream.

Link copied to clipboard
Link copied to clipboard

The getWriter() method of the WritableStream interface returns a new instance of WritableStreamDefaultWriter and locks the stream to that instance.