/** A connection whose reads and writes hold the calling thread until they are done. */ interface BlockingStream { /** Reads at least one byte into `into`, starting at `offset`. Returns 0 once the peer has closed. */ read(into: Uint8Array, offset: number): number; write(bytes: Uint8Array): void; } declare class DescriptorStream implements BlockingStream { private readonly descriptor; constructor(descriptor: number); read(into: Uint8Array, offset: number): number; write(bytes: Uint8Array): void; } /** Counts the bytes that cross a stream, in either direction. */ declare class CountedStream implements BlockingStream { private readonly stream; private bytes; constructor(stream: BlockingStream); read(into: Uint8Array, offset: number): number; write(bytes: Uint8Array): void; /** The bytes that crossed since this was last asked. */ take(): number; } export { CountedStream, DescriptorStream }; export type { BlockingStream }; //# sourceMappingURL=blocking-stream.d.ts.map