TransformStreamDefaultController
The TransformStreamDefaultController interface of the Streams API provides methods to manipulate the associated ReadableStream and WritableStream.
Type Parameters
| Type Parameter | Default type |
|---|---|
O | any |
Methods
enqueue()
enqueue(chunk?): void;
The enqueue() method of the TransformStreamDefaultController interface enqueues the given chunk in the readable side of the stream.
Parameters
| Parameter | Type |
|---|---|
chunk? | O |
Returns
void
error()
error(reason?): void;
The error() method of the TransformStreamDefaultController interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded.
Parameters
| Parameter | Type |
|---|---|
reason? | any |
Returns
void
terminate()
terminate(): void;
The terminate() method of the TransformStreamDefaultController interface closes the readable side and errors the writable side of the stream.
Returns
void
Properties
desiredSize
readonly desiredSize: number | null;
The desiredSize read-only property of the TransformStreamDefaultController interface returns the desired size to fill the queue of the associated ReadableStream.