WritableStream
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:2842
The WritableStream interface of the Streams API provides a standard abstraction for writing streaming data to a destination, known as a sink.
Extended by
Section titled “Extended by”Type Parameters
Section titled “Type Parameters”W = any
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new WritableStream<
W>(underlyingSink?,queuingStrategy?):WritableStream<W>
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:2843
Parameters
Section titled “Parameters”underlyingSink?
Section titled “underlyingSink?”UnderlyingSink<any>
queuingStrategy?
Section titled “queuingStrategy?”QueuingStrategy<any>
Returns
Section titled “Returns”WritableStream<W>
Properties
Section titled “Properties”locked
Section titled “locked”
readonlylocked:boolean
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:2852
The locked read-only property of the WritableStream interface returns a boolean indicating whether the WritableStream is locked to a writer.
Methods
Section titled “Methods”abort()
Section titled “abort()”abort(
reason?):Promise<void>
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:2858
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.
Parameters
Section titled “Parameters”reason?
Section titled “reason?”any
Returns
Section titled “Returns”Promise<void>
close()
Section titled “close()”close():
Promise<void>
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:2864
The close() method of the WritableStream interface closes the associated stream.
Returns
Section titled “Returns”Promise<void>
getWriter()
Section titled “getWriter()”getWriter():
WritableStreamDefaultWriter<W>
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:2870
The getWriter() method of the WritableStream interface returns a new instance of WritableStreamDefaultWriter and locks the stream to that instance.