import { Duplex } from 'node:stream'; import type { Connection, Stream } from '@libp2p/interface'; import type { Socket, SocketConnectOpts, AddressInfo, SocketReadyState } from 'node:net'; export declare class Libp2pSocket extends Duplex { #private; readonly autoSelectFamilyAttemptedAddresses: never[]; readonly connecting = false; readonly pending = false; remoteAddress: string; bytesRead: number; bytesWritten: number; timeout: number; allowHalfOpen: boolean; remoteFamily: string | undefined; remotePort: number | undefined; constructor(stream: Stream, connection: Connection); constructor(initStream: Promise<{ stream: Stream; connection: Connection; }>); private gotStream; getStream(cb: (stream: Stream) => void): void; destroy(error?: Error): this; _write(chunk: Uint8Array, encoding: string, cb: (err?: Error) => void): void; _read(size: number): void; _destroy(err: Error, cb: (err?: Error) => void): void; _final(cb: (err?: Error) => void): void; get readyState(): SocketReadyState; get bufferSize(): number; destroySoon(): void; connect(options: SocketConnectOpts, connectionListener?: () => void): this; connect(port: number, host: string, connectionListener?: () => void): this; connect(port: number, connectionListener?: () => void): this; connect(path: string, connectionListener?: () => void): this; setEncoding(encoding?: BufferEncoding): this; resetAndDestroy(): this; setTimeout(timeout: number, callback?: () => void): this; setNoDelay(noDelay?: boolean): this; setKeepAlive(enable?: boolean, initialDelay?: number): this; address(): AddressInfo | Record; unref(): this; ref(): this; write(buffer: Uint8Array | string, cb?: (err?: Error) => void): boolean; write(str: Uint8Array | string, encoding?: BufferEncoding, cb?: (err?: Error) => void): boolean; } export declare function streamToSocket(stream: Stream, connection: Connection): Socket; //# sourceMappingURL=stream-to-socket.d.ts.map