/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
import { type InboundSequencedContainerRuntimeMessageOrSystemMessage } from "../messageTypes.js";
import { OpDecompressor } from "./opDecompressor.js";
import { OpGroupingManager } from "./opGroupingManager.js";
import { OpSplitter } from "./opSplitter.js";
/**
 * Stateful class for processing incoming remote messages as the virtualization measures are unwrapped,
 * potentially across numerous inbound ops.
 *
 * @internal
 */
export declare class RemoteMessageProcessor {
    private readonly opSplitter;
    private readonly opDecompressor;
    private readonly opGroupingManager;
    constructor(opSplitter: OpSplitter, opDecompressor: OpDecompressor, opGroupingManager: OpGroupingManager);
    get partialMessages(): ReadonlyMap<string, string[]>;
    clearPartialMessagesFor(clientId: string): void;
    /**
     * Ungroups and Unchunks the runtime ops encapsulated by the single remoteMessage received over the wire
     * @param remoteMessageCopy - A shallow copy of a message from another client, possibly virtualized
     * (grouped, compressed, and/or chunked).
     * Being a shallow copy, it's considered mutable, meaning no other Container or other parallel procedure
     * depends on this object instance.
     * Note remoteMessageCopy.contents (and other object props) MUST not be modified,
     * but may be overwritten (as is the case with contents).
     *
     * Incoming messages will always have compression, chunking, and grouped batching happen in a defined order and that order cannot be changed.
     * When processing these messages, the order is:
     * 1. If chunked, process the chunk and only continue if this is a final chunk
     * 2. If compressed, decompress the message and store for further unrolling of the decompressed content
     * 3. If grouped, ungroup the message
     * For more details, see https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/container-runtime/src/opLifecycle/README.md#inbound
     *
     * @returns the unchunked, decompressed, ungrouped, unpacked SequencedContainerRuntimeMessages encapsulated in the remote message.
     * For ops that weren't virtualized (e.g. System ops that the ContainerRuntime will ultimately ignore),
     * a singleton array [remoteMessageCopy] is returned
     */
    process(remoteMessageCopy: ISequencedDocumentMessage): InboundSequencedContainerRuntimeMessageOrSystemMessage[];
}
/**
 * Unpacks runtime messages.
 *
 * @remarks This API makes no promises regarding backward-compatibility. This is internal API.
 * @param message - message (as it observed in storage / service)
 * @returns whether the given message was unpacked
 *
 * @internal
 */
export declare function unpackRuntimeMessage(message: ISequencedDocumentMessage): boolean;
//# sourceMappingURL=remoteMessageProcessor.d.ts.map