Package-level declarations

Types

Link copied to clipboard
sealed external interface ArrayOptions
Link copied to clipboard
typealias ComposeFnParam = (source: Any?) -> Unit
Link copied to clipboard
open external class Duplex

Duplex streams are streams that implement both the Readable and Writable interfaces.

Link copied to clipboard
sealed external interface DuplexEvent
Link copied to clipboard
sealed external interface DuplexFromWebDuplexStream
Link copied to clipboard
sealed external interface DuplexOptions : ReadableOptions, WritableOptions
Link copied to clipboard
sealed external interface DuplexToWebResult
Link copied to clipboard
sealed external interface FinishedOptions : Abortable
Link copied to clipboard
external class PassThrough : Transform

The stream.PassThrough class is a trivial implementation of a Transform stream that simply passes the input bytes across to the output. Its purpose is primarily for examples and testing, but there are some use cases where stream.PassThrough is useful as a building block for novel sorts of streams.

Link copied to clipboard
sealed external interface Pipe
Link copied to clipboard
typealias PipelineCallback<S> = Any
Link copied to clipboard
typealias PipelineDestination<S, P> = Any
Link copied to clipboard
Link copied to clipboard
sealed external interface PipelineOptions
Link copied to clipboard
typealias PipelinePromise<S> = Promise<*>
Link copied to clipboard
typealias PipelineSource<T> = Any
Link copied to clipboard
typealias PipelineSourceFunction<T> = () -> Any
Link copied to clipboard
typealias PipelineTransform<S, U> = Any
Link copied to clipboard
Link copied to clipboard
open external class Readable : Stream, ReadableStream
Link copied to clipboard
sealed external interface ReadableBaseIteratorOptions
Link copied to clipboard
sealed external interface ReadableEvent
Link copied to clipboard
sealed external interface ReadableOptions : StreamOptions<Stream>
Link copied to clipboard
open external class Stream : EventEmitter
Link copied to clipboard
sealed external interface StreamComposeOptions
Link copied to clipboard
sealed external interface StreamOptions<T : Stream> : Abortable
Link copied to clipboard
sealed external interface StreamPipeOptions
Link copied to clipboard
open external class Transform : Duplex

Transform streams are Duplex streams where the output is in some way related to the input. Like all Duplex streams, Transform streams implement both the Readable and Writable interfaces.

Link copied to clipboard
typealias TransformCallback = (error: JsError?, data: Any?) -> Unit
Link copied to clipboard
external interface TransformOptions : DuplexOptions
Link copied to clipboard
open external class Writable : Stream, WritableStream
Link copied to clipboard
sealed external interface WritableEvent
Link copied to clipboard
sealed external interface WritableOptions : StreamOptions<Stream>
Link copied to clipboard
sealed external interface WritableOptionsWritevChunksItem
Link copied to clipboard
sealed external interface WritableWritevChunksItem

Properties

Link copied to clipboard
external val consumers: Any
Link copied to clipboard
external val promises: Any

Functions

Link copied to clipboard
external fun <T : Stream> addAbortSignal(signal: AbortSignal, stream: T): T

A stream to attach a signal to.

Link copied to clipboard
external fun finished(stream: ReadWriteStream, callback: (err: ErrnoException?) -> Unit): () -> Unit
suspend fun finished(stream: ReadWriteStream, options: FinishedOptions = undefined.unsafeCast<Nothing>()): Void
external fun finished(stream: ReadableStream, callback: (err: ErrnoException?) -> Unit): () -> Unit
suspend fun finished(stream: ReadableStream, options: FinishedOptions = undefined.unsafeCast<Nothing>()): Void
external fun finished(stream: WritableStream, callback: (err: ErrnoException?) -> Unit): () -> Unit
suspend fun finished(stream: WritableStream, options: FinishedOptions = undefined.unsafeCast<Nothing>()): Void

external fun finished(stream: ReadWriteStream, options: FinishedOptions, callback: (err: ErrnoException?) -> Unit): () -> Unit
external fun finished(stream: ReadableStream, options: FinishedOptions, callback: (err: ErrnoException?) -> Unit): () -> Unit
external fun finished(stream: WritableStream, options: FinishedOptions, callback: (err: ErrnoException?) -> Unit): () -> Unit

A readable and/or writable stream/webstream.

Link copied to clipboard
external fun finishedAsync(stream: ReadWriteStream, options: FinishedOptions = definedExternally): Promise<Void>
external fun finishedAsync(stream: ReadableStream, options: FinishedOptions = definedExternally): Promise<Void>
external fun finishedAsync(stream: WritableStream, options: FinishedOptions = definedExternally): Promise<Void>
Link copied to clipboard
external fun getDefaultHighWaterMark(objectMode: Boolean): Double

Returns the default highWaterMark used by streams. Defaults to 65536 (64 KiB), or 16 for objectMode.

Link copied to clipboard
external fun isErrored(stream: ReadableStream): Boolean
external fun isErrored(stream: WritableStream): Boolean
external fun isErrored(stream: Readable): Boolean
external fun isErrored(stream: Writable): Boolean

Returns whether the stream has encountered an error.

Link copied to clipboard
external fun isReadable(stream: ReadableStream): Boolean
external fun isReadable(stream: Readable): Boolean

Returns whether the stream is readable.

Link copied to clipboard
external fun pipeline(streams: ReadonlyArray<Any>, callback: (err: ErrnoException?) -> Unit): WritableStream
suspend fun pipeline(streams: ReadonlyArray<Any>, options: PipelineOptions = undefined.unsafeCast<Nothing>()): Void
suspend fun <A : PipelineSource<Any?>, B : PipelineDestination<A, Any?>> pipeline(source: A, destination: B, options: PipelineOptions = undefined.unsafeCast<Nothing>()): Any?
suspend fun pipeline(stream1: ReadableStream, stream2: ReadWriteStream, vararg streams: Any): Void
suspend fun pipeline(stream1: ReadableStream, stream2: WritableStream, vararg streams: Any): Void
external fun <A : PipelineSource<Any?>, T1 : PipelineTransform<A, Any?>, B : PipelineDestination<T1, Any?>> pipeline(source: A, transform1: T1, destination: B, callback: PipelineCallback<B>): Any
suspend fun <A : PipelineSource<Any?>, T1 : PipelineTransform<A, Any?>, B : PipelineDestination<T1, Any?>> pipeline(source: A, transform1: T1, destination: B, options: PipelineOptions = undefined.unsafeCast<Nothing>()): Any?
external fun <A : PipelineSource<Any?>, T1 : PipelineTransform<A, Any?>, T2 : PipelineTransform<T1, Any?>, B : PipelineDestination<T2, Any?>> pipeline(source: A, transform1: T1, transform2: T2, destination: B, callback: PipelineCallback<B>): Any
suspend fun <A : PipelineSource<Any?>, T1 : PipelineTransform<A, Any?>, T2 : PipelineTransform<T1, Any?>, B : PipelineDestination<T2, Any?>> pipeline(source: A, transform1: T1, transform2: T2, destination: B, options: PipelineOptions = undefined.unsafeCast<Nothing>()): Any?
external fun <A : PipelineSource<Any?>, T1 : PipelineTransform<A, Any?>, T2 : PipelineTransform<T1, Any?>, T3 : PipelineTransform<T2, Any?>, B : PipelineDestination<T3, Any?>> pipeline(source: A, transform1: T1, transform2: T2, transform3: T3, destination: B, callback: PipelineCallback<B>): Any
suspend fun <A : PipelineSource<Any?>, T1 : PipelineTransform<A, Any?>, T2 : PipelineTransform<T1, Any?>, T3 : PipelineTransform<T2, Any?>, B : PipelineDestination<T3, Any?>> pipeline(source: A, transform1: T1, transform2: T2, transform3: T3, destination: B, options: PipelineOptions = undefined.unsafeCast<Nothing>()): Any?
external fun <A : PipelineSource<Any?>, T1 : PipelineTransform<A, Any?>, T2 : PipelineTransform<T1, Any?>, T3 : PipelineTransform<T2, Any?>, T4 : PipelineTransform<T3, Any?>, B : PipelineDestination<T4, Any?>> pipeline(source: A, transform1: T1, transform2: T2, transform3: T3, transform4: T4, destination: B, callback: PipelineCallback<B>): Any
suspend fun <A : PipelineSource<Any?>, T1 : PipelineTransform<A, Any?>, T2 : PipelineTransform<T1, Any?>, T3 : PipelineTransform<T2, Any?>, T4 : PipelineTransform<T3, Any?>, B : PipelineDestination<T4, Any?>> pipeline(source: A, transform1: T1, transform2: T2, transform3: T3, transform4: T4, destination: B, options: PipelineOptions = undefined.unsafeCast<Nothing>()): Any?

external fun <A : PipelineSource<Any?>, B : PipelineDestination<A, Any?>> pipeline(source: A, destination: B, callback: PipelineCallback<B>): Any

A module method to pipe between streams and generators forwarding errors and properly cleaning up and provide a callback when the pipeline is complete.

Link copied to clipboard
external fun pipelineAsync(streams: ReadonlyArray<Any>, options: PipelineOptions = definedExternally): Promise<Void>
external fun <A : PipelineSource<Any?>, B : PipelineDestination<A, Any?>> pipelineAsync(source: A, destination: B, options: PipelineOptions = definedExternally): PipelinePromise<B>
external fun pipelineAsync(stream1: ReadableStream, stream2: ReadWriteStream, vararg streams: Any): Promise<Void>
external fun pipelineAsync(stream1: ReadableStream, stream2: WritableStream, vararg streams: Any): Promise<Void>
external fun <A : PipelineSource<Any?>, T1 : PipelineTransform<A, Any?>, B : PipelineDestination<T1, Any?>> pipelineAsync(source: A, transform1: T1, destination: B, options: PipelineOptions = definedExternally): PipelinePromise<B>
external fun <A : PipelineSource<Any?>, T1 : PipelineTransform<A, Any?>, T2 : PipelineTransform<T1, Any?>, B : PipelineDestination<T2, Any?>> pipelineAsync(source: A, transform1: T1, transform2: T2, destination: B, options: PipelineOptions = definedExternally): PipelinePromise<B>
external fun <A : PipelineSource<Any?>, T1 : PipelineTransform<A, Any?>, T2 : PipelineTransform<T1, Any?>, T3 : PipelineTransform<T2, Any?>, B : PipelineDestination<T3, Any?>> pipelineAsync(source: A, transform1: T1, transform2: T2, transform3: T3, destination: B, options: PipelineOptions = definedExternally): PipelinePromise<B>
external fun <A : PipelineSource<Any?>, T1 : PipelineTransform<A, Any?>, T2 : PipelineTransform<T1, Any?>, T3 : PipelineTransform<T2, Any?>, T4 : PipelineTransform<T3, Any?>, B : PipelineDestination<T4, Any?>> pipelineAsync(source: A, transform1: T1, transform2: T2, transform3: T3, transform4: T4, destination: B, options: PipelineOptions = definedExternally): PipelinePromise<B>
Link copied to clipboard
external fun setDefaultHighWaterMark(objectMode: Boolean, value: Number)

Sets the default highWaterMark used by streams.