MCPcopy Create free account
hub / github.com/cloudflare/computer / ReadableStream

Interface ReadableStream

examples/think/worker-configuration.d.ts:2235–2283  ·  view source on GitHub ↗

* The `ReadableStream` interface of the Streams API represents a readable stream of byte data. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)

Source from the content-addressed store, hash-verified

2233 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
2234 */
2235interface ReadableStream<R = any> {
2236 /**
2237 * The **`locked`** read-only property of the ReadableStream interface returns whether or not the readable stream is locked to a reader.
2238 *
2239 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/locked)
2240 */
2241 get locked(): boolean;
2242 /**
2243 * The **`cancel()`** method of the ReadableStream interface returns a Promise that resolves when the stream is canceled.
2244 *
2245 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/cancel)
2246 */
2247 cancel(reason?: any): Promise<void>;
2248 /**
2249 * The **`getReader()`** method of the ReadableStream interface creates a reader and locks the stream to it.
2250 *
2251 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader)
2252 */
2253 getReader(): ReadableStreamDefaultReader<R>;
2254 /**
2255 * The **`getReader()`** method of the ReadableStream interface creates a reader and locks the stream to it.
2256 *
2257 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader)
2258 */
2259 getReader(options: ReadableStreamGetReaderOptions): ReadableStreamBYOBReader;
2260 /**
2261 * 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.
2262 *
2263 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeThrough)
2264 */
2265 pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;
2266 /**
2267 * 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.
2268 *
2269 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo)
2270 */
2271 pipeTo(destination: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;
2272 /**
2273 * The **`tee()`** method of the two-element array containing the two resulting branches as new ReadableStream instances.
2274 *
2275 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee)
2276 */
2277 tee(): [
2278 ReadableStream<R>,
2279 ReadableStream<R>
2280 ];
2281 values(options?: ReadableStreamValuesOptions): AsyncIterableIterator<R>;
2282 [Symbol.asyncIterator](options?: ReadableStreamValuesOptions): AsyncIterableIterator<R>;
2283}
2284/**
2285 * The `ReadableStream` interface of the Streams API represents a readable stream of byte data.
2286 *

Callers 27

waitForWorkspaceHealthFunction · 0.65
writeFileStreamingFunction · 0.65
scanFileFunction · 0.65
drainFunction · 0.65
readFile.test.tsFile · 0.65
readBytesFunction · 0.65
computerd.test.tsFile · 0.65
drainFunction · 0.65
dropHeartbeatsFunction · 0.65
encodeExecEventsFunction · 0.65
decodeExecEventsFunction · 0.65

Calls

no outgoing calls

Tested by

no test coverage detected