Skip to content

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.

MDN Reference

W = any

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

UnderlyingSink<any>

QueuingStrategy<any>

WritableStream<W>

readonly locked: 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.

MDN Reference

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.

MDN Reference

any

Promise<void>


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.

MDN Reference

Promise<void>


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.

MDN Reference

WritableStreamDefaultWriter<W>