///
///
import { Duplex, DuplexOptions } from 'stream';
import type { BSONSerializeOptions, Document } from '../bson';
import type { ClientSession } from '../sessions';
import { BufferPool, Callback } from '../utils';
import { WriteProtocolMessageType } from './commands';
import { CompressorName } from './wire_protocol/compression';
/** @internal */
declare const kBuffer: unique symbol;
/** @internal */
export interface MessageStreamOptions extends DuplexOptions {
maxBsonMessageSize?: number;
}
/** @internal */
export interface OperationDescription extends BSONSerializeOptions {
started: number;
cb: Callback;
command: boolean;
documentsReturnedIn?: string;
fullResult: boolean;
noResponse: boolean;
raw: boolean;
requestId: number;
session?: ClientSession;
socketTimeoutOverride?: boolean;
agreedCompressor?: CompressorName;
zlibCompressionLevel?: number;
$clusterTime?: Document;
}
/**
* A duplex stream that is capable of reading and writing raw wire protocol messages, with
* support for optional compression
* @internal
*/
export declare class MessageStream extends Duplex {
/** @internal */
maxBsonMessageSize: number;
/** @internal */
[kBuffer]: BufferPool;
/** @internal */
isMonitoringConnection: boolean;
constructor(options?: MessageStreamOptions);
get buffer(): BufferPool;
_write(chunk: Buffer, _: unknown, callback: Callback): void;
_read(): void;
writeCommand(command: WriteProtocolMessageType, operationDescription: OperationDescription): void;
}
export {};
//# sourceMappingURL=message_stream.d.ts.map