/** * A typescript implementation of the heatshrink compression library. * * Heatshrink is an open-source LZSS based compression library suitable * for use in embedded systems since it has a very small and bounded * memory footprint. This is an adaptation of the heatshink code to * typescript with a slightly more user-fiendly API. */ export declare class HeatshrinkDecoder { inputBuffer: Uint8Array; outputBuffer: Uint8Array; outputSize: number; private windowBuffer; private headIndex; private outputIndex; private outputCount; private state; private inputState; private windowBits; private lookaheadBits; constructor(windowBits: number, lookaheadBits: number, inputBufferSize: number); reset(): void; /** * Feed data into the heatshrink decoder state machine. * * This function will take the chunk of input data and turn it into as * much expanded output as it can. Decoding a stream of data should be * done by calling this function repeatedly with chunks of data from the * stream. * * You can call isFinished() to check and see if all of the data that you * have fed in from previous calls to process() has been successfully * decoded. * * @param rawInput A chunk of data that has encoded using the heatshrink * library. You can push data a little bit at a time and stop at * any byte boundary. */ process(rawInput: Uint8Array | ArrayBuffer): void; sink(input: Uint8Array): number; poll(): void; isFinished(): boolean; /** * Get all output data and truncate the output buffer. * * Calling this function repeatedly will have the effect of * pulling the output in chunks from the HeatshrinkDecoder. * It will return all data currently available and remove it * from the output buffer so another call to getOutput() will * not return duplicate data. * * @returns All data currently in the output buffer. */ getOutput(): Uint8Array; private assureUint8Array(buffer); private processTag(); private yieldLiteral(); private processBackrefIndexMSB(); private processBackrefIndexLSB(); private processBackrefCountMSB(); private processBackrefCountLSB(); private yieldBackref(); private ensureOutputSpace(neededBytes); private emitByte(byte); private storeByte(byte); }