/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { TypedEventEmitter } from "@fluid-internal/client-utils";
import type { IEvent, IEventProvider } from "@fluidframework/core-interfaces";
import type { IClientDetails } from "@fluidframework/driver-definitions";
import type { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
import type { IOrderedClientElection, ISerializedElection, ITrackedClient } from "./orderedClientElection.js";
import type { ISummaryCollectionOpEvents } from "./summaryCollection.js";
export interface ISummarizerClientElectionEvents extends IEvent {
    (event: "electedSummarizerChanged", handler: () => void): void;
}
export interface ISummarizerClientElection extends IEventProvider<ISummarizerClientElectionEvents> {
    readonly electedClientId: string | undefined;
    readonly electedParentId: string | undefined;
}
/**
 * This class encapsulates logic around tracking the elected summarizer client.
 * It will handle updating the elected client when a summary ack hasn't been seen
 * for some configured number of ops.
 */
export declare class SummarizerClientElection extends TypedEventEmitter<ISummarizerClientElectionEvents> implements ISummarizerClientElection {
    private readonly logger;
    private readonly summaryCollection;
    readonly clientElection: IOrderedClientElection;
    private readonly maxOpsSinceLastSummary;
    /**
     * Used to calculate number of ops since last summary ack for the current elected client.
     * This will be undefined if there is no elected summarizer, or no summary ack has been
     * observed since this client was elected.
     * When a summary ack comes in, this will be set to the sequence number of the summary ack.
     */
    private lastSummaryAckSeqForClient;
    /**
     * Used to prevent excess logging by recording the sequence number that we last reported at,
     * and making sure we don't report another event to telemetry. If things work as intended,
     * this is not needed, otherwise it could report an event on every op in worst case scenario.
     */
    private lastReportedSeq;
    get electedClientId(): string | undefined;
    get electedParentId(): string | undefined;
    constructor(logger: ITelemetryLoggerExt, summaryCollection: IEventProvider<ISummaryCollectionOpEvents>, clientElection: IOrderedClientElection, maxOpsSinceLastSummary: number);
    serialize(): ISerializedElection;
    static isClientEligible(client: ITrackedClient): boolean;
    static readonly clientDetailsPermitElection: (details: IClientDetails) => boolean;
}
//# sourceMappingURL=summarizerClientElection.d.ts.map