import { Writable } from "node:stream";
import type { MessagePort } from "node:worker_threads";
/**
 * A Writable stream that wraps a MessagePort for sending data to the main thread
 *
 * This provides a proper Node.js stream interface for data going to the main thread,
 * with proper backpressure handling through drain events.
 */
export declare class MessagePortWritable extends Writable {
    private fromWorker;
    private toWorker?;
    private isBackpressured;
    private closeHandler;
    private messageHandler;
    constructor(fromWorker: MessagePort, toWorker?: MessagePort);
    private setupMessageListener;
    private removeListeners;
    _write(chunk: any, _encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
    _final(callback: (error?: Error | null) => void): void;
    _destroy(error: Error | null, callback: (error?: Error | null) => void): void;
}
//# sourceMappingURL=MessagePortWritable.d.ts.map