nanolith
Version:
Multi-threading in no time with seamless TypeScript support.
19 lines (18 loc) • 748 B
TypeScript
/// <reference types="node" resolution-mode="require"/>
/// <reference types="node" resolution-mode="require"/>
import { Writable } from 'stream';
import type { Messagable } from '../types/streams.js';
/**
* A `Writable` stream that a `Readable` stream can pipe into in order to
* stream data between threads.
*/
export declare class WritableToPort<Target extends Messagable> extends Writable {
#private;
/**
* The object containing any meta data about the stream that can be
* used to identify it.
*/
get metaData(): Record<any, any>;
constructor(target: Target, id: string, metaData?: Record<any, any>);
_write(chunk: Buffer, _: BufferEncoding, callback: (error?: Error | null | undefined) => void): void;
}