import { Uint8ArrayList } from './thirdparty/uint8arraylist'; import { FrameHeader } from './frame'; export interface DecodedMessage { header: FrameHeader; data: Uint8ArrayList; } /** * Decode a header from the front of a buffer * * @param data - Assumed to have enough bytes for a header */ export declare function decodeHeader(data: Uint8Array): FrameHeader; /** * Decodes yamux frames from a source */ export declare class Decoder { /** Buffer for in-progress frames */ private readonly buffer; /** Used to sanity check against decoding while in an inconsistent state */ private readonly frameInProgress; private _headerInfo; constructor(); /** * Emits frames from the decoder source. * * Note: If `readData` is emitted, it _must_ be called before the next iteration * Otherwise an error is thrown */ emitFrames(chunk: Uint8Array): DecodedMessage[]; private readHeader; } //# sourceMappingURL=decode.d.ts.map