ReadableStream

Interfacein globals@fastly/js-compute 4.0.0View source
interface ReadableStream<R = any>

This Streams API interface represents a readable stream of byte data. The Fetch API offers a concrete instance of a ReadableStream through the body property of a Response object.

Constructor

new ReadableStream(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>)

The ReadableStream class as specified by WHATWG

See also

Parameters

underlyingSource: UnderlyingSource<R>optional
strategy: QueuingStrategy<R>optional

Properties

locked

booleanread-onlyView source

Methods

cancel(reason?: any): Promise<void>

Parameters

reason: anyoptional

Returns

Promise<void>

pipeThrough

View source
pipeThrough(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>

Parameters

transform: ReadableWritablePair<T, R>
options: StreamPipeOptionsoptional

Returns

pipeTo(dest: WritableStream<R>, options?: StreamPipeOptions): Promise<void>

Parameters

dest: WritableStream<R>
options: StreamPipeOptionsoptional

Returns

Promise<void>
tee(): [ReadableStream<R>, ReadableStream<R>]

Returns