Package-level declarations

Types

Link copied to clipboard

The ByteLengthQueuingStrategy interface of the Streams API provides a built-in byte length queuing strategy that can be used when constructing streams.

Link copied to clipboard

The CountQueuingStrategy interface of the Streams API provides a built-in chunk counting queuing strategy that can be used when constructing streams.

Link copied to clipboard
Link copied to clipboard
interface QueuingStrategy<T : JsAny?>
Link copied to clipboard
Link copied to clipboard
typealias QueuingStrategySize<T> = (chunk: T) -> Int
Link copied to clipboard

The ReadableByteStreamController interface of the Streams API represents a controller for a readable byte stream.

Link copied to clipboard
open class ReadableStream<R : JsAny?>(underlyingSource: UnderlyingByteSource, strategy: QueuingStrategy<R> = definedExternally) : Transferable, AsyncIterable<R> , AsyncCloseableDisposable

The ReadableStream interface of the Streams API represents a readable stream of byte data.

Link copied to clipboard

The ReadableStreamBYOBReader interface of the Streams API defines a reader for a ReadableStream that supports zero-copy reading from an underlying byte source.

Link copied to clipboard

The ReadableStreamBYOBRequest interface of the Streams API represents a 'pull request' for data from an underlying source that will made as a zero-copy transfer to a consumer (bypassing the stream's internal queues).

Link copied to clipboard

Union of:

Link copied to clipboard

The ReadableStreamDefaultController interface of the Streams API represents a controller allowing control of a ReadableStream's state and internal queue.

Link copied to clipboard

The ReadableStreamDefaultReader interface of the Streams API represents a default reader that can be used to read stream data supplied from a network (such as a fetch request).

Link copied to clipboard
Link copied to clipboard
sealed interface ReadableStreamReaderMode
Link copied to clipboard
Link copied to clipboard
sealed interface ReadableStreamType
Link copied to clipboard
interface ReadableWritablePair<R : JsAny?, W : JsAny?>
Link copied to clipboard
Link copied to clipboard
interface Transformer<I : JsAny?, O : JsAny?>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open class TransformStream<I : JsAny?, O : JsAny?>(transformer: Transformer<I, O> = definedExternally, writableStrategy: QueuingStrategy<I> = definedExternally, readableStrategy: QueuingStrategy<O> = definedExternally) : Transferable

The TransformStream interface of the Streams API represents a concrete implementation of the pipe chain transform stream concept.

Link copied to clipboard

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

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
interface UnderlyingSink<W : JsAny?>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
interface UnderlyingSource<R : JsAny?>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open class WritableStream<W : JsAny?>(underlyingSink: UnderlyingSink<W> = definedExternally, strategy: QueuingStrategy<W> = definedExternally) : Transferable, AsyncCloseableDisposable

The WritableStream interface of the Streams API provides a standard abstraction for writing streaming data to a destination, known as a sink.

Link copied to clipboard

The WritableStreamDefaultController interface of the Streams API represents a controller allowing control of a WritableStream's state.

Link copied to clipboard

The WritableStreamDefaultWriter interface of the Streams API is the object returned by WritableStream.getWriter() and once created locks the writer to the WritableStream ensuring that no other streams can write to the underlying sink.

Functions

Link copied to clipboard
inline suspend fun <W : JsAny?> WritableStreamDefaultWriter<W>.abort()
inline suspend fun <W : JsAny?> WritableStreamDefaultWriter<W>.abort(reason: JsError?)

The abort() method of the WritableStreamDefaultWriter interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded.

inline suspend fun <W : JsAny?> WritableStream<W>.abort()
inline suspend fun <W : JsAny?> WritableStream<W>.abort(reason: JsError?)

The abort() method of the WritableStream interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded.

Link copied to clipboard
inline suspend fun ReadableStreamGenericReader.cancel()
inline suspend fun ReadableStreamGenericReader.cancel(reason: JsError?)
inline suspend fun <R : JsAny?> ReadableStream<R>.cancel()
inline suspend fun <R : JsAny?> ReadableStream<R>.cancel(reason: JsError?)

The cancel() method of the ReadableStream interface returns a Promise that resolves when the stream is canceled.

Link copied to clipboard
inline suspend fun <W : JsAny?> WritableStreamDefaultWriter<W>.close()

The close() method of the WritableStreamDefaultWriter interface closes the associated writable stream.

inline suspend fun <W : JsAny?> WritableStream<W>.close()

The close() method of the WritableStream interface closes the associated stream.

Link copied to clipboard
suspend fun <R : JsAny?> ReadableStream<R>.pipeTo(destination: WritableStream<R>)
suspend fun <R : JsAny?> ReadableStream<R>.pipeTo(destination: WritableStream<R>, options: StreamPipeOptions)

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.

Link copied to clipboard

The read() method of the ReadableStreamDefaultReader interface returns a Promise providing access to the next chunk in the stream's internal queue.

The read() method of the ReadableStreamBYOBReader interface is used to read data into a view on a user-supplied buffer from an associated readable byte stream.

Link copied to clipboard
inline suspend fun <W : JsAny?> WritableStreamDefaultWriter<W>.write()
inline suspend fun <W : JsAny?> WritableStreamDefaultWriter<W>.write(chunk: W)

The write() method of the WritableStreamDefaultWriter interface writes a passed chunk of data to a WritableStream and its underlying sink, then returns a Promise that resolves to indicate the success or failure of the write operation.