ReadableStream
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:2553
The ReadableStream interface of the Streams API represents a readable stream of byte data.
Type Parameters
Section titled “Type Parameters”R = any
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:2559
The locked read-only property of the ReadableStream interface returns whether or not the readable stream is locked to a reader.
Methods
Section titled “Methods”[asyncIterator]()
Section titled “[asyncIterator]()”[asyncIterator](
options?):AsyncIterableIterator<R>
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:2603
Parameters
Section titled “Parameters”options?
Section titled “options?”Returns
Section titled “Returns”AsyncIterableIterator<R>
cancel()
Section titled “cancel()”cancel(
reason?):Promise<void>
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:2565
The cancel() method of the ReadableStream interface returns a Promise that resolves when the stream is canceled.
Parameters
Section titled “Parameters”reason?
Section titled “reason?”any
Returns
Section titled “Returns”Promise<void>
getReader()
Section titled “getReader()”Call Signature
Section titled “Call Signature”getReader():
ReadableStreamDefaultReader<R>
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:2571
The getReader() method of the ReadableStream interface creates a reader and locks the stream to it.
Returns
Section titled “Returns”ReadableStreamDefaultReader<R>
Call Signature
Section titled “Call Signature”getReader(
options):ReadableStreamBYOBReader
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:2577
The getReader() method of the ReadableStream interface creates a reader and locks the stream to it.
Parameters
Section titled “Parameters”options
Section titled “options”ReadableStreamGetReaderOptions
Returns
Section titled “Returns”pipeThrough()
Section titled “pipeThrough()”pipeThrough<
T>(transform,options?):ReadableStream<T>
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:2583
The pipeThrough() method of the ReadableStream interface provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”transform
Section titled “transform”ReadableWritablePair<T, R>
options?
Section titled “options?”Returns
Section titled “Returns”ReadableStream<T>
pipeTo()
Section titled “pipeTo()”pipeTo(
destination,options?):Promise<void>
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:2592
The pipeTo() method of the ReadableStream interface pipes the current ReadableStream to a given WritableStream and returns a Promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.
Parameters
Section titled “Parameters”destination
Section titled “destination”options?
Section titled “options?”Returns
Section titled “Returns”Promise<void>
tee(): [
ReadableStream<R>,ReadableStream<R>]
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:2601
The tee() method of the two-element array containing the two resulting branches as new ReadableStream instances.
Returns
Section titled “Returns”[ReadableStream<R>, ReadableStream<R>]
values()
Section titled “values()”values(
options?):AsyncIterableIterator<R>
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:2602
Parameters
Section titled “Parameters”options?
Section titled “options?”Returns
Section titled “Returns”AsyncIterableIterator<R>