import type * as net from "node:net"; import type * as tls from "node:tls"; import { ByteStream } from "./stream"; export type AnySocket = net.Socket | tls.TLSSocket; /** * Attach data/close/error listeners on `socket` that feed `stream`. * Returns a detacher that removes those listeners (use before swapping * to a TLS-wrapped socket so encrypted bytes don't leak into the stream). */ export declare function attachStream(socket: AnySocket, stream: ByteStream): () => void;