import type { Duplex } from "node:stream";
/**
 * Receives data from a stream, looking for specific starting bytes.
 *
 * @param stream - The read/write stream to receive data from.
 * @param timeout - The maximum time to wait for data, in milliseconds.
 * @param responseLength - The expected length of the response.
 * @returns A promise that resolves with the received data as a Uint8Array.
 * @throws Will throw an error if the timeout is reached or if the received data exceeds the expected length.
 */
export default function receiveData(stream: Duplex, timeout: number, responseLength: number): Promise<Uint8Array>;
