ZstdDecompress

sealed external interface ZstdDecompress : Transform, Zlib(source)

Since

v22.15.0

Properties

Link copied to clipboard
open override val _construct: (callback: (@R|kotlin/ParameterName|(name = String(error)) ERROR CLASS: Symbol not found for js.errors.JsError??) -> Unit) -> Unit?
Link copied to clipboard
open val _writev: (chunks: Array<WritableWritevChunksItem>, callback: (@R|kotlin/ParameterName|(name = String(error)) ERROR CLASS: Symbol not found for js.errors.JsError??) -> Unit) -> Unit?
Link copied to clipboard

If false then the stream will automatically end the writable side when the readable side ends. Set initially by the allowHalfOpen constructor option, which defaults to true.

Link copied to clipboard
abstract val bytesWritten: Double
Link copied to clipboard
open override val closed: Boolean

Is true after 'close' has been emitted.

Link copied to clipboard
open override val closeEvent: EventInstance<ERROR CLASS: Symbol not found for js.array.Tuple>
Link copied to clipboard
open override val dataEvent: EventInstance<ERROR CLASS: Symbol not found for js.array.Tuple1<kotlin/Any?>>
Link copied to clipboard
open override var destroyed: Boolean

Is true after readable.destroy() has been called.

Link copied to clipboard
open override val drainEvent: EventInstance<ERROR CLASS: Symbol not found for js.array.Tuple>
Link copied to clipboard
open override val endEvent: EventInstance<ERROR CLASS: Symbol not found for js.array.Tuple>
Link copied to clipboard
open override val errored: ERROR CLASS: Symbol not found for js.errors.JsError??

Returns error if the stream has been destroyed with an error.

Link copied to clipboard
open override val errorEvent: EventInstance<ERROR CLASS: Symbol not found for js.array.Tuple1<ERROR CLASS: Symbol not found for js.errors.JsError>>
Link copied to clipboard
open override val finishEvent: EventInstance<ERROR CLASS: Symbol not found for js.array.Tuple>
Link copied to clipboard
open override val pauseEvent: EventInstance<ERROR CLASS: Symbol not found for js.array.Tuple>
Link copied to clipboard
open override val pipeEvent: EventInstance<ERROR CLASS: Symbol not found for js.array.Tuple1<node/stream/Readable>>
Link copied to clipboard
open var readable: Boolean

Is true if it is safe to call {@link read}, which means the stream has not been destroyed or emitted 'error' or 'end'.

Link copied to clipboard

Returns whether the stream was destroyed or errored before emitting 'end'.

Link copied to clipboard

Returns whether 'data' has been emitted.

Link copied to clipboard

Getter for the property encoding of a given Readable stream. The encoding property can be set using the {@link setEncoding} method.

Link copied to clipboard

Becomes true when 'end' event is emitted.

Link copied to clipboard
open override val readableEvent: EventInstance<ERROR CLASS: Symbol not found for js.array.Tuple>
Link copied to clipboard

This property reflects the current state of a Readable stream as described in the Three states section.

Link copied to clipboard

Returns the value of highWaterMark passed when creating this Readable.

Link copied to clipboard

This property contains the number of bytes (or objects) in the queue ready to be read. The value provides introspection data regarding the status of the highWaterMark.

Link copied to clipboard

Getter for the property objectMode of a given Readable stream.

Link copied to clipboard

Is true if it is safe to call writable.write(), which means the stream has not been destroyed, errored, or ended.

Link copied to clipboard
open override val resumeEvent: EventInstance<ERROR CLASS: Symbol not found for js.array.Tuple>
Link copied to clipboard
abstract var shell: Any?
Link copied to clipboard
open override val unpipeEvent: EventInstance<ERROR CLASS: Symbol not found for js.array.Tuple1<node/stream/Readable>>
Link copied to clipboard
open var writable: Boolean
Link copied to clipboard

Returns whether the stream was destroyed or errored before emitting 'finish'.

Link copied to clipboard

Number of times writable.uncork() needs to be called in order to fully uncork the stream.

Link copied to clipboard

Is true after writable.end() has been called. This property does not indicate whether the data has been flushed, for this use writable.writableFinished instead.

Link copied to clipboard

Is set to true immediately before the 'finish' event is emitted.

Link copied to clipboard

Return the value of highWaterMark passed when creating this Writable.

Link copied to clipboard

This property contains the number of bytes (or objects) in the queue ready to be written. The value provides introspection data regarding the status of the highWaterMark.

Link copied to clipboard

Is true if the stream's buffer has been full and stream will emit 'drain'.

Link copied to clipboard

Getter for the property objectMode of a given Writable stream.

Functions

Link copied to clipboard
open override fun _destroy(error: ERROR CLASS: Symbol not found for js.errors.JsError??, callback: (@R|kotlin/ParameterName|(name = String(error)) ERROR CLASS: Symbol not found for js.errors.JsError??) -> Unit)
open fun _destroy(error: ERROR CLASS: Symbol not found for js.errors.JsError??, callback: (@R|kotlin/ParameterName|(name = String(error)) ERROR CLASS: Symbol not found for js.errors.JsError??) -> Unit)
open fun _destroy(error: ERROR CLASS: Symbol not found for js.errors.JsError??, callback: (@R|kotlin/ParameterName|(name = String(error)) ERROR CLASS: Symbol not found for js.errors.JsError??) -> Unit)
Link copied to clipboard
open fun _final(callback: (@R|kotlin/ParameterName|(name = String(error)) ERROR CLASS: Symbol not found for js.errors.JsError??) -> Unit)
Link copied to clipboard
fun _flush(callback: TransformCallback)
Link copied to clipboard
fun _read(size: Number)
Link copied to clipboard
fun _transform(chunk: Any?, encoding: BufferEncoding, callback: TransformCallback)
Link copied to clipboard
open fun _write(chunk: Any?, encoding: BufferEncoding, callback: (@R|kotlin/ParameterName|(name = String(error)) ERROR CLASS: Symbol not found for js.errors.JsError??) -> Unit)
Link copied to clipboard
fun addListener(type: EventType, listener: EventListener)

Alias for emitter.on(eventName, listener).

open override fun addListener(event: ERROR CLASS: Symbol not found for js.symbol.Symbol, listener: Function<Unit>)

open override fun addListener(event: String, listener: Function<Unit>)

Event emitter The defined events on documents including:

Link copied to clipboard
fun asIndexedPairs(options: ArrayOptions = definedExternally): Readable

This method returns a new stream with chunks of the underlying stream paired with a counter in the form [index, chunk]. The first index value is 0 and it increases by 1 for each chunk produced.

Link copied to clipboard
abstract fun close(callback: () -> Unit = definedExternally)
Link copied to clipboard
fun <T : ReadableStream> compose(stream: ERROR CLASS: Symbol not found for AsyncIterable<T>, options: StreamComposeOptions = definedExternally): T
fun <T : ReadableStream> compose(stream: ERROR CLASS: Symbol not found for js.iterable.JsIterable<T>, options: StreamComposeOptions = definedExternally): T
fun <T : ReadableStream> compose(stream: T, options: StreamComposeOptions = definedExternally): T
fun <T : ReadableStream> compose(stream: ComposeFnParam, options: StreamComposeOptions = definedExternally): T
Link copied to clipboard
open fun cork()

The writable.cork() method forces all written data to be buffered in memory. The buffered data will be flushed when either the {@link uncork} or {@link end} methods are called.

Link copied to clipboard
open override fun destroy()

Destroy the stream. Optionally emit an 'error' event, and emit a 'close' event (unless emitClose is set to false). After this call, the readable stream will release any internal resources and subsequent calls to push() will be ignored.

open override fun destroy(error: ERROR CLASS: Symbol not found for js.errors.JsError)
Link copied to clipboard
fun drop(limit: Number, options: ArrayOptions = definedExternally): Readable

This method returns a new stream with the first limit chunks dropped from the start.

Link copied to clipboard
fun emit(type: EventType, vararg args: Any?): Boolean

Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments to each.

open override fun emit(event: ERROR CLASS: Symbol not found for js.symbol.Symbol, vararg args: Any?): Boolean
open override fun emit(event: String, vararg args: Any?): Boolean
Link copied to clipboard
open fun end(cb: () -> Unit)

Calling the writable.end() method signals that no more data will be written to the Writable. The optional chunk and encoding arguments allow one final additional chunk of data to be written immediately before closing the stream.

open fun end(data: ERROR CLASS: Symbol not found for Uint8Array<*>, cb: () -> Unit)
open fun end(data: String, cb: () -> Unit)
open fun end(str: String, encoding: BufferEncoding, cb: () -> Unit)
open fun end(chunk: Any?, cb: () -> Unit = definedExternally)
open fun end(chunk: Any?, encoding: BufferEncoding, cb: () -> Unit = definedExternally)
Link copied to clipboard

Returns an array listing the events for which the emitter has registered listeners. The values in the array are strings or Symbols.

Link copied to clipboard
suspend fun every(fn: (data: Any?, options: ArrayOptions?) -> ERROR CLASS: Symbol not found for js.promise.PromiseResult<kotlin/Boolean>, options: ArrayOptions = definedExternally): Boolean
Link copied to clipboard
fun everyAsync(fn: (data: Any?, options: ArrayOptions?) -> ERROR CLASS: Symbol not found for js.promise.PromiseResult<kotlin/Boolean>, options: ArrayOptions = definedExternally): ERROR CLASS: Symbol not found for Promise<kotlin/Boolean>

This method is similar to Array.prototype.every and calls fn on each chunk in the stream to check if all awaited return values are truthy value for fn. Once an fn call on a chunk awaited return value is falsy, the stream is destroyed and the promise is fulfilled with false. If all of the fn calls on the chunks return a truthy value, the promise is fulfilled with true.

Link copied to clipboard
fun filter(fn: (data: Any?, options: ArrayOptions?) -> ERROR CLASS: Symbol not found for js.promise.PromiseResult<kotlin/Boolean>, options: ArrayOptions = definedExternally): Readable

This method allows filtering the stream. For each chunk in the stream the fn function will be called and if it returns a truthy value, the chunk will be passed to the result stream. If the fn function returns a promise - that promise will be awaited.

Link copied to clipboard
suspend fun find(fn: (data: Any?, options: ArrayOptions?) -> ERROR CLASS: Symbol not found for js.promise.PromiseResult<kotlin/Boolean>, options: ArrayOptions = definedExternally): Any?
suspend fun <T> find(fn: (data: Any?, options: ArrayOptions?) -> Boolean, options: ArrayOptions = definedExternally): T?
Link copied to clipboard
fun findAsync(fn: (data: Any?, options: ArrayOptions?) -> ERROR CLASS: Symbol not found for js.promise.PromiseResult<kotlin/Boolean>, options: ArrayOptions = definedExternally): ERROR CLASS: Symbol not found for Promise<kotlin/Any?>

fun <T> findAsync(fn: (data: Any?, options: ArrayOptions?) -> Boolean, options: ArrayOptions = definedExternally): ERROR CLASS: Symbol not found for Promise<T?>

This method is similar to Array.prototype.find and calls fn on each chunk in the stream to find a chunk with a truthy value for fn. Once an fn call's awaited return value is truthy, the stream is destroyed and the promise is fulfilled with value for which fn returned a truthy value. If all of the fn calls on the chunks return a falsy value, the promise is fulfilled with undefined.

Link copied to clipboard
fun flatMap(fn: (data: Any?, options: ArrayOptions?) -> Any?, options: ArrayOptions = definedExternally): Readable

This method returns a new stream by applying the given callback to each chunk of the stream and then flattening the result.

Link copied to clipboard
abstract fun flush(callback: () -> Unit = definedExternally)
abstract fun flush(kind: Number = definedExternally, callback: () -> Unit = definedExternally)
Link copied to clipboard
suspend fun forEach(fn: (data: Any?, options: ArrayOptions?) -> ERROR CLASS: Symbol not found for js.promise.PromiseResult<ERROR CLASS: Symbol not found for js.core.Void>, options: ArrayOptions = definedExternally): ERROR CLASS: Symbol not found for js.core.Void
Link copied to clipboard
fun forEachAsync(fn: (data: Any?, options: ArrayOptions?) -> ERROR CLASS: Symbol not found for js.promise.PromiseResult<ERROR CLASS: Symbol not found for js.core.Void>, options: ArrayOptions = definedExternally): ERROR CLASS: Symbol not found for Promise<ERROR CLASS: Symbol not found for js.core.Void>

This method allows iterating a stream. For each chunk in the stream the fn function will be called. If the fn function returns a promise - that promise will be awaited.

Link copied to clipboard

Returns the current max listener value for the EventEmitter which is either set by emitter.setMaxListeners(n) or defaults to {@link EventEmitter.defaultMaxListeners}.

Link copied to clipboard
open fun isPaused(): Boolean

The readable.isPaused() method returns the current operating state of the Readable. This is used primarily by the mechanism that underlies the readable.pipe() method. In most typical cases, there will be no reason to use this method directly.

Link copied to clipboard
fun iterator(options: ReadableIteratorOptions = definedExternally): ERROR CLASS: Symbol not found for js.iterable.AsyncIterator<kotlin/Any?>

The iterator created by this method gives users the option to cancel the destruction of the stream if the for await...of loop is exited by return, break, or throw, or if the iterator should destroy the stream if the stream emitted an error during iteration.

Link copied to clipboard
fun listenerCount(type: EventType, listener: EventListener = definedExternally): Double

Returns the number of listeners listening for the event named eventName. If listener is provided, it will return how many times the listener is found in the list of the listeners of the event.

Link copied to clipboard

Returns a copy of the array of listeners for the event named eventName.

Link copied to clipboard
fun map(fn: (data: Any?, options: ArrayOptions?) -> Any?, options: ArrayOptions = definedExternally): Readable

This method allows mapping over the stream. The fn function will be called for every chunk in the stream. If the fn function returns a promise - that promise will be awaited before being passed to the result stream.

Link copied to clipboard
fun off(type: EventType, listener: EventListener)

Alias for emitter.removeListener().

Link copied to clipboard
fun on(type: EventType, listener: EventListener)

Adds the listener function to the end of the listeners array for the event named eventName. No checks are made to see if the listener has already been added. Multiple calls passing the same combination of eventName and listener will result in the listener being added, and called, multiple times.

open override fun on(event: ERROR CLASS: Symbol not found for js.symbol.Symbol, listener: Function<Unit>)
open override fun on(event: String, listener: Function<Unit>)
Link copied to clipboard
fun once(type: EventType, listener: EventListener)

Adds a one-time listener function for the event named eventName. The next time eventName is triggered, this listener is removed and then invoked.

open override fun once(event: ERROR CLASS: Symbol not found for js.symbol.Symbol, listener: Function<Unit>)
open override fun once(event: String, listener: Function<Unit>)
Link copied to clipboard
open fun pause()

The readable.pause() method will cause a stream in flowing mode to stop emitting 'data' events, switching out of flowing mode. Any data that becomes available will remain in the internal buffer.

Link copied to clipboard
open fun <T : WritableStream> pipe(destination: T, options: ReadableStreamPipeOptions): T
fun <T : WritableStream> pipe(destination: T, options: StreamPipeOptions = definedExternally): T
Link copied to clipboard

Adds the listener function to the beginning of the listeners array for the event named eventName. No checks are made to see if the listener has already been added. Multiple calls passing the same combination of eventName and listener will result in the listener being added, and called, multiple times.

open override fun prependListener(event: ERROR CLASS: Symbol not found for js.symbol.Symbol, listener: Function<Unit>)
open override fun prependListener(event: String, listener: Function<Unit>)
Link copied to clipboard

Adds a one-timelistener function for the event named eventName to the beginning of the listeners array. The next time eventName is triggered, this listener is removed, and then invoked.

open override fun prependOnceListener(event: ERROR CLASS: Symbol not found for js.symbol.Symbol, listener: Function<Unit>)
open override fun prependOnceListener(event: String, listener: Function<Unit>)
Link copied to clipboard
fun push(chunk: Any?, encoding: BufferEncoding = definedExternally): Boolean
Link copied to clipboard

Returns a copy of the array of listeners for the event named eventName, including any wrappers (such as those created by .once()).

Link copied to clipboard
open fun read(size: Number): Any
Link copied to clipboard
open fun readOrNull(size: Number = definedExternally): Any?

The readable.read() method reads data out of the internal buffer and returns it. If no data is available to be read, null is returned. By default, the data is returned as a Buffer object unless an encoding has been specified using the readable.setEncoding() method or the stream is operating in object mode.

Link copied to clipboard
suspend fun <T> reduce(fn: (previous: T, data: Any?, options: ArrayOptions?) -> T, initial: T, options: ArrayOptions = definedExternally): T
suspend fun <T> reduce(fn: (previous: Any?, data: Any?, options: ArrayOptions?) -> T, initial: Nothing? = definedExternally, options: ArrayOptions = definedExternally): T
Link copied to clipboard
fun <T> reduceAsync(fn: (previous: T, data: Any?, options: ArrayOptions?) -> T, initial: T, options: ArrayOptions = definedExternally): ERROR CLASS: Symbol not found for Promise<T>

fun <T> reduceAsync(fn: (previous: Any?, data: Any?, options: ArrayOptions?) -> T, initial: Nothing? = definedExternally, options: ArrayOptions = definedExternally): ERROR CLASS: Symbol not found for Promise<T>

This method calls fn on each chunk of the stream in order, passing it the result from the calculation on the previous element. It returns a promise for the final value of the reduction.

Link copied to clipboard
fun removeAllListeners(type: EventType = definedExternally)

Removes all listeners, or those of the specified eventName.

Link copied to clipboard
fun removeListener(type: EventType, listener: EventListener)

Removes the specified listener from the listener array for the event named eventName.

open override fun removeListener(event: ERROR CLASS: Symbol not found for js.symbol.Symbol, listener: Function<Unit>)
open override fun removeListener(event: String, listener: Function<Unit>)
Link copied to clipboard
open fun resume()

The readable.resume() method causes an explicitly paused Readable stream to resume emitting 'data' events, switching the stream into flowing mode.

Link copied to clipboard

The writable.setDefaultEncoding() method sets the default encoding for a Writable stream.

Link copied to clipboard
open fun setEncoding(encoding: BufferEncoding)

The readable.setEncoding() method sets the character encoding for data read from the Readable stream.

Link copied to clipboard

By default EventEmitters will print a warning if more than 10 listeners are added for a particular event. This is a useful default that helps finding memory leaks. The emitter.setMaxListeners() method allows the limit to be modified for this specific EventEmitter instance. The value can be set to Infinity (or 0) to indicate an unlimited number of listeners.

Link copied to clipboard
suspend fun some(fn: (data: Any?, options: ArrayOptions?) -> ERROR CLASS: Symbol not found for js.promise.PromiseResult<kotlin/Boolean>, options: ArrayOptions = definedExternally): Boolean
Link copied to clipboard
fun someAsync(fn: (data: Any?, options: ArrayOptions?) -> ERROR CLASS: Symbol not found for js.promise.PromiseResult<kotlin/Boolean>, options: ArrayOptions = definedExternally): ERROR CLASS: Symbol not found for Promise<kotlin/Boolean>

This method is similar to Array.prototype.some and calls fn on each chunk in the stream until the awaited return value is true (or any truthy value). Once an fn call on a chunk awaited return value is truthy, the stream is destroyed and the promise is fulfilled with true. If none of the fn calls on the chunks return a truthy value, the promise is fulfilled with false.

Link copied to clipboard
fun take(limit: Number, options: ArrayOptions = definedExternally): Readable

This method returns a new stream with the first limit chunks.

Link copied to clipboard
suspend fun toArray(options: ArrayOptions = definedExternally): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<kotlin/Any?>
Link copied to clipboard
fun toArrayAsync(options: ArrayOptions = definedExternally): ERROR CLASS: Symbol not found for Promise<ERROR CLASS: Symbol not found for js.array.ReadonlyArray<kotlin/Any?>>

This method allows easily obtaining the contents of a stream.

Link copied to clipboard
open fun uncork()

The writable.uncork() method flushes all data buffered since {@link cork} was called.

Link copied to clipboard
open fun unpipe(destination: WritableStream)

The readable.unpipe() method detaches a Writable stream previously attached using the {@link pipe} method.

Link copied to clipboard
open fun unshift(chunk: ERROR CLASS: Symbol not found for Uint8Array<*>, encoding: BufferEncoding)
open fun unshift(chunk: String, encoding: BufferEncoding)

fun unshift(chunk: Any?, encoding: BufferEncoding = definedExternally)

Passing chunk as null signals the end of the stream (EOF) and behaves the same as readable.push(null), after which no more data can be written. The EOF signal is put at the end of the buffer and any buffered data will still be flushed.

Link copied to clipboard
open fun wrap(stream: ReadableStream)

Prior to Node.js 0.10, streams did not implement the entire node:stream module API as it is currently defined. (See Compatibility for more information.)

Link copied to clipboard
abstract fun write(buffer: ERROR CLASS: Symbol not found for Uint8Array<*>, cb: (@R|kotlin/ParameterName|(name = String(err)) ERROR CLASS: Symbol not found for js.errors.JsError??) -> Unit = definedExternally): Boolean
abstract fun write(buffer: String, cb: (@R|kotlin/ParameterName|(name = String(err)) ERROR CLASS: Symbol not found for js.errors.JsError??) -> Unit = definedExternally): Boolean
abstract fun write(str: String, encoding: BufferEncoding = definedExternally, cb: (@R|kotlin/ParameterName|(name = String(err)) ERROR CLASS: Symbol not found for js.errors.JsError??) -> Unit = definedExternally): Boolean
open override fun write(buffer: ERROR CLASS: Symbol not found for Uint8Array<*>, cb: (@R|kotlin/ParameterName|(name = String(err)) ERROR CLASS: Symbol not found for js.errors.JsError??) -> Unit): Boolean
open override fun write(buffer: String, cb: (@R|kotlin/ParameterName|(name = String(err)) ERROR CLASS: Symbol not found for js.errors.JsError??) -> Unit): Boolean
open fun write(chunk: Any?, encoding: BufferEncoding, callback: (@R|kotlin/ParameterName|(name = String(error)) ERROR CLASS: Symbol not found for js.errors.JsError??) -> Unit = definedExternally): Boolean
open override fun write(str: String, encoding: BufferEncoding, cb: (@R|kotlin/ParameterName|(name = String(err)) ERROR CLASS: Symbol not found for js.errors.JsError??) -> Unit): Boolean

open fun write(chunk: Any?, callback: (@R|kotlin/ParameterName|(name = String(error)) ERROR CLASS: Symbol not found for js.errors.JsError??) -> Unit = definedExternally): Boolean

The writable.write() method writes some data to the stream, and calls the supplied callback once the data has been fully handled. If an error occurs, the callback will be called with the error as its first argument. The callback is called asynchronously and before 'error' is emitted.