WritableStreamDefaultWriter

The WritableStreamDefaultWriter interface of the Streams API is the object returned by WritableStream.getWriter() and once created locks the writer to the WritableStream ensuring that no other streams can write to the underlying sink.

MDN Reference

Constructors

Link copied to clipboard
constructor(stream: WritableStream<W>)

Properties

Link copied to clipboard

The closed read-only property of the the stream errors or the writer's lock is released.

Link copied to clipboard

The desiredSize read-only property of the to fill the stream's internal queue.

Link copied to clipboard

The ready read-only property of the that resolves when the desired size of the stream's internal queue transitions from non-positive to positive, signaling that it is no longer applying backpressure.

Functions

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

The abort() method of the 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 stream.

Link copied to clipboard
Link copied to clipboard

The releaseLock() method of the corresponding stream.

Link copied to clipboard
suspend fun write(chunk: W = definedExternally)

The write() method of the operation.

Link copied to clipboard
fun writeAsync(chunk: W = definedExternally): Promise<Void>