/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import type { ITelemetryContext } from "@fluidframework/runtime-definitions/internal";
import type { BatchStartInfo } from "./remoteMessageProcessor.js";
/**
 * This class tracks recent batchIds we've seen, and checks incoming batches for duplicates.
 */
export declare class DuplicateBatchDetector {
    /**
     * All batchIds we've seen recently enough (based on MSN) that we need to watch for duplicates
     */
    private readonly batchIdsAll;
    /**
     * We map from sequenceNumber to batchId to find which ones we can stop tracking as MSN advances
     */
    private readonly batchIdsBySeqNum;
    /**
     * Initialize from snapshot data if provided - otherwise initialize empty
     */
    constructor(batchIdsFromSnapshot: [number, string][] | undefined);
    /**
     * Records this batch's batchId, and checks if it's a duplicate of a batch we've already seen.
     * If it's a duplicate, also return the sequence number of the other batch for logging.
     *
     * @remarks We also use the minimumSequenceNumber to clear out old batchIds that are no longer at risk for duplicates.
     */
    processInboundBatch(batchStart: BatchStartInfo): {
        duplicate: true;
        otherSequenceNumber: number;
    } | {
        duplicate: false;
    };
    /**
     * Batches that started before the MSN are not at risk for a sequenced duplicate to arrive,
     * since the batch start has been processed by all clients, and local batches are deduped and the forked client would close.
     */
    private clearOldBatchIds;
    /**
     * Returns a snapshot of the state of the detector which can be included in a summary
     * and used to "rehydrate" this class when loading from a snapshot.
     *
     * @returns A serializable object representing the state of the detector, or undefined if there is nothing to save.
     */
    getRecentBatchInfoForSummary(telemetryContext?: ITelemetryContext): [number, string][] | undefined;
}
//# sourceMappingURL=duplicateBatchDetector.d.ts.map