WritableStreamDefaultWriter
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:2877
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.
Type Parameters
Section titled “Type Parameters”W = any
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new WritableStreamDefaultWriter<
W>(stream):WritableStreamDefaultWriter<W>
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:2878
Parameters
Section titled “Parameters”stream
Section titled “stream”Returns
Section titled “Returns”WritableStreamDefaultWriter<W>
Properties
Section titled “Properties”closed
Section titled “closed”
readonlyclosed:Promise<void>
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:2884
The closed read-only property of the the stream errors or the writer’s lock is released.
desiredSize
Section titled “desiredSize”
readonlydesiredSize:null|number
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:2896
The desiredSize read-only property of the to fill the stream’s internal queue.
readonlyready:Promise<void>
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:2890
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.
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:2902
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.
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:2908
The close() method of the stream.
Returns
Section titled “Returns”Promise<void>
releaseLock()
Section titled “releaseLock()”releaseLock():
void
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:2920
The releaseLock() method of the corresponding stream.
Returns
Section titled “Returns”void
write()
Section titled “write()”write(
chunk?):Promise<void>
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:2914
The write() method of the operation.
Parameters
Section titled “Parameters”chunk?
Section titled “chunk?”W
Returns
Section titled “Returns”Promise<void>