Interface Pushable<T, R, N>

An iterable that you can push values into.

Type Parameters

  • T

  • R = void

  • N = unknown

Hierarchy

Properties

readableLength: number

This property contains the number of bytes (or objects) in the queue ready to be read.

If objectMode is true, this is the number of objects in the queue, if false it's the total number of bytes in the queue.

Methods

  • Returns AsyncGenerator<T, R, N>

  • End the iterable after all values in the buffer (if any) have been yielded. If an error is passed the buffer is cleared immediately and the next iteration will throw the passed error

    Parameters

    Returns Pushable<T, R, N>

  • Parameters

    • Rest ...args: [] | [N]

    Returns Promise<IteratorResult<T, R>>

  • Returns a promise that resolves when the underlying queue becomes empty (e.g. this.readableLength === 0).

    If an AbortSignal is passed as an option and that signal aborts, it only causes the returned promise to reject - it does not end the pushable.

    Parameters

    Returns Promise<void>

  • Push a value into the iterable. Values are yielded from the iterable in the order they are pushed. Values not yet consumed from the iterable are buffered.

    Parameters

    • value: T

    Returns Pushable<T, R, N>

  • Parameters

    • value: R | PromiseLike<R>

    Returns Promise<IteratorResult<T, R>>

  • Parameters

    • e: any

    Returns Promise<IteratorResult<T, R>>

Generated using TypeDoc