import { Uint8ArrayList } from 'uint8arraylist'; import type { AbortOptions } from 'abort-error'; import type { ByteStreamOpts } from 'it-byte-stream'; import type { Duplex } from 'it-stream-types'; export interface LengthPrefixedStream { /** * Read the next length-prefixed number of bytes from the stream */ read(options?: AbortOptions): Promise>; /** * Write the passed bytes to the stream prefixed by their length */ write(input: Uint8Array | Uint8ArrayList, options?: AbortOptions): Promise; /** * Write passed list of bytes, prefix by their individual lengths to the stream as a single write */ writeV(input: Array, options?: AbortOptions): Promise; /** * Returns the underlying stream */ unwrap(): Stream; } export interface LengthPrefixedStreamOpts extends ByteStreamOpts { lengthEncoder(value: number): Uint8ArrayList | Uint8Array; lengthDecoder(data: Uint8ArrayList): number; maxLengthLength: number; maxDataLength: number; } export declare function lpStream>(duplex: Stream, opts?: Partial): LengthPrefixedStream; //# sourceMappingURL=index.d.ts.map