Skip to main content

TransformStreamDefaultController

The TransformStreamDefaultController interface of the Streams API provides methods to manipulate the associated ReadableStream and WritableStream.

MDN Reference

Type Parameters

Type ParameterDefault type
Oany

Methods

enqueue()

enqueue(chunk?): void;

The enqueue() method of the TransformStreamDefaultController interface enqueues the given chunk in the readable side of the stream.

MDN Reference

Parameters

ParameterType
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.

MDN Reference

Parameters

ParameterType
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.

MDN Reference

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.

MDN Reference