UNPKG

node-pkware

Version:

nodejs implementation of StormLib's pkware compressor/de-compressor

39 lines (38 loc) 1.24 kB
import { Compression, DictionarySize } from './constants.js'; import { type StreamHandler } from './stream.js'; import { type Config } from './types.js'; export declare class Implode { private readonly verbose; private isFirstChunk; private readonly inputBuffer; private readonly outputBuffer; private readonly stats; private readonly compressionType; private readonly dictionarySize; private dictionarySizeMask; private streamEnded; private readonly distCodes; private readonly distBits; private startIndex; private handledFirstTwoBytes; private outBits; private nChBits; private nChCodes; constructor(compressionType: Compression, dictionarySize: DictionarySize, config: Config); getHandler(): StreamHandler; private onInputFinished; private processChunkData; /** * @returns false - non flushable * @returns true - flushable * @returns null - flushable, but there might be a better repetition */ private isRepetitionFlushable; /** * repetitions are at least 2 bytes long, * so the initial 2 bytes can be moved to the output as is */ private handleFirstTwoBytes; private setup; private outputBits; }