/*! * Copyright (c) Microsoft Corporation and contributors. All rights reserved. * Licensed under the MIT License. */ import type { ITelemetryBaseLogger } from "@fluidframework/core-interfaces"; import type { ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal"; /** * State machine that "unrolls" contents of compressed batches of ops after decompressing them. * This class relies on some implicit contracts defined below: * 1. A compressed batch will have its first message with batch metadata set to true and compressed set to true * 2. Messages in the middle of a compressed batch will have neither batch metadata nor the compression property set * 3. The final message of a batch will have batch metadata set to false * 4. An individually compressed op will have undefined batch metadata and compression set to true * * Compressed batches from current code are always a single message but this class needs to handle a legacy compressed batch with multiple messages * because we need that functionality for back compat. */ export declare class OpDecompressor { private activeBatch; private rootMessageContents; private processedCount; private readonly logger; constructor(logger: ITelemetryBaseLogger); isCompressedMessage(message: ISequencedDocumentMessage): boolean; get currentlyUnrolling(): boolean; /** * Is the decompressed and stored batch only comprised of a single message */ private isSingleMessageBatch; /** * Decompress the given compressed message and store it to be subsequently unrolled. * The stored message will be of type `any[]` where each element represents a message's `contents` */ decompressAndStore(message: ISequencedDocumentMessage): void; /** * Unroll the next message from the decompressed content provided to {@link decompressAndStore} * @returns the unrolled `ISequencedDocumentMessage` */ unroll(message: ISequencedDocumentMessage): ISequencedDocumentMessage; } //# sourceMappingURL=opDecompressor.d.ts.map