# Interface ReadableStream<R>

This Streams API interface represents a readable stream of byte data.

interface ReadableStream<R> {
locked: boolean;
cancel(reason?: any): Promise<void>;
getReader(options: {
mode: "byob";
}): ReadableStreamBYOBReader;
getReader(): ReadableStreamDefaultReader<R>;
getReader(options?: ReadableStreamGetReaderOptions): ReadableStreamReader<R>;
pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;
pipeTo(destination: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;
tee(): [ReadableStream<R>, ReadableStream<R>];
values(options?: {
preventCancel?: boolean;
}): AsyncIterableIterator<R, any, any>;
[asyncIterator](): AsyncIterableIterator<R, any, any>;
}

#### Type Parameters

- R = any

- Defined in node_modules/@types/node/stream/web.d.ts:170
- Defined in node_modules/@types/node/stream/web.d.ts:182

#####
Index

### Properties

locked

### Methods

cancel
getReader
pipeThrough
pipeTo
tee
values
[asyncIterator]

##
Properties

### `Readonly` locked

locked: boolean

- Defined in node_modules/@types/node/stream/web.d.ts:171

##
Methods

### cancel

- cancel(reason?): Promise<void>

- #### Parameters

  - `Optional` reason: any

  #### Returns Promise<void>

  - Defined in node_modules/@types/node/stream/web.d.ts:172

### getReader

- getReader(options): ReadableStreamBYOBReader

- #### Parameters

  - options: {
    mode: "byob";
    }

    - ##### mode: "byob"

  #### Returns ReadableStreamBYOBReader

  - Defined in node_modules/@types/node/stream/web.d.ts:173
- getReader(): ReadableStreamDefaultReader<R>

- #### Returns ReadableStreamDefaultReader<R>

  - Defined in node_modules/@types/node/stream/web.d.ts:174
- getReader(options?): ReadableStreamReader<R>

- #### Parameters

  - `Optional` options: ReadableStreamGetReaderOptions

  #### Returns ReadableStreamReader<R>

  - Defined in node_modules/@types/node/stream/web.d.ts:175

### pipeThrough

- pipeThrough<T>(transform, options?): ReadableStream<T>

- #### Type Parameters

  - T

  #### Parameters

  - transform: ReadableWritablePair<T, R>
  - `Optional` options: StreamPipeOptions

  #### Returns ReadableStream<T>

  - Defined in node_modules/@types/node/stream/web.d.ts:176

### pipeTo

- pipeTo(destination, options?): Promise<void>

- #### Parameters

  - destination: WritableStream<R>
  - `Optional` options: StreamPipeOptions

  #### Returns Promise<void>

  - Defined in node_modules/@types/node/stream/web.d.ts:177

### tee

- tee(): [ReadableStream<R>, ReadableStream<R>]

- #### Returns [ReadableStream<R>, ReadableStream<R>]

  - Defined in node_modules/@types/node/stream/web.d.ts:178

### values

- values(options?): AsyncIterableIterator<R, any, any>

- #### Parameters

  - `Optional` options: {
    preventCancel?: boolean;
    }

    - ##### `Optional` preventCancel?: boolean

  #### Returns AsyncIterableIterator<R, any, any>

  - Defined in node_modules/@types/node/stream/web.d.ts:179

### [asyncIterator]

- [asyncIterator](): AsyncIterableIterator<R, any, any>

- #### Returns AsyncIterableIterator<R, any, any>

  - Defined in node_modules/@types/node/stream/web.d.ts:180