import IOBuffer from './iobuffer'; /** * Decode the incoming data from the server */ declare class ChunkDecoder { private static readonly _SEAL; private _currentState; private _currentChunkRemaining; private readonly _onDecode; private readonly _currentDecodedSlices; /** * This constructor should not be called directly * * @param onDecode callback that will be called when a chunk is decoded */ constructor(onDecode: (iobuffer: IOBuffer) => void); /** * Initialize the decoding loop until no data is remaining * * @param iobuffer the data to decode */ decode(iobuffer: IOBuffer): void; private _handleHeaderFirstByte; private _handleHeaderSecondByte; private _joinDecodedBody; private _handleDecodedHeader; private _handleBody; } declare namespace ChunkDecoder { enum State { READING_HEADER_FIRST_BYTE = 0, READING_HEADER_SECOND_BYTE = 1, READING_BODY = 2 } } export default ChunkDecoder;