UNPKG

@johngw/stream

Version:

Reactive programming tools using the WHATWG Streams API.

23 lines 1.23 kB
import type { ReadableWritablePair, UnderlyingDefaultSource, UnderlyingSink } from 'node:stream/web'; export interface WritableReadablePairSink<W, R> extends Omit<UnderlyingSink<W>, 'write'> { write?(chunk: W, readableController: ReadableStreamDefaultController<R>, writableController: WritableStreamDefaultController): void | PromiseLike<void>; } /** * A much less abstract version of the {@see TransformStream} that lets you interact * with both the `Readable` and `Writable` side of the stream. * * @remarks * We're implementing the {@see ReadableWritablePair} interface here, but the name * `WritableReadablePair` is closer to the truth. Chunks are first given to the `WritableStream` * which is then read from the `ReadableStream`. */ export declare class WritableReadablePair<W, R> implements ReadableWritablePair<R, W> { #private; readonly writable: WritableStream<W>; readonly readable: ReadableStream<R>; constructor(sink?: WritableReadablePairSink<W, R>, source?: UnderlyingDefaultSource<R>, { readableStrategy, writableStrategy, }?: { readableStrategy?: QueuingStrategy<R>; writableStrategy?: QueuingStrategy<W>; }); } //# sourceMappingURL=WritableReadablePair.d.ts.map