import { Uint8ArrayList } from 'uint8arraylist';
export interface LengthPrefixedDecoderInit {
    /**
     * How large the internal buffer is allowed to grow - attempting to store more
     * data than this will throw
     */
    maxBufferSize?: number;
    /**
     * Throw an error if the message that would be read from the buffer is larger
     * than this value
     */
    maxDataLength?: number;
    /**
     * Read a varint from the buffer
     */
    lengthDecoder?(data: Uint8ArrayList | Uint8Array): number;
    /**
     * Return how many bytes it takes to encode the passed value
     */
    encodingLength?(length: number): number;
}
/**
 * Decode length-prefixed data from a buffer
 */
export declare class LengthPrefixedDecoder {
    private readonly buffer;
    private readonly maxBufferSize;
    private readonly lengthDecoder;
    private readonly maxDataLength;
    private readonly encodingLength;
    constructor(init?: LengthPrefixedDecoderInit);
    /**
     * Decodes length-prefixed data
     */
    decode(buf: Uint8Array | Uint8ArrayList): Generator<Uint8ArrayList>;
}
//# sourceMappingURL=length-prefixed-decoder.d.ts.map