/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import type { IChannelStorageService } from "@fluidframework/datastore-definitions/internal";
import type { IExperimentalIncrementalSummaryContext, ISummaryTreeWithStats, ITelemetryContext } from "@fluidframework/runtime-definitions/internal";
import { SummaryTreeBuilder } from "@fluidframework/runtime-utils/internal";
import { type Summarizable, type SummaryElementParser, type SummaryElementStringifier } from "./summaryTypes.js";
/**
 * Utility for implementing {@link Summarizable}s classes with versioning.
 * It handles versioning of summaries - writing version metadata to summaries
 * and checking version compatibility when loading.
 */
export declare abstract class VersionedSummarizer<TVersion extends number> implements Summarizable {
    /** {@link Summarizable.key} */
    readonly key: string;
    /** The format version of the summary to write in the summary metadata. */
    private readonly writeVersion;
    /** The set of supported versions that a summary can have for this summarizer to load it. */
    private readonly supportedVersions;
    /**
     * Whether to support loading summaries before versioning was added, i.e., summaries without metadata blob.
     * @remarks
     * This version may not be supported if the support for the version before metadata blob was dropped.
     * In that case, this will not be present in `supportedVersions` and an error will be thrown during load.
     */
    private readonly supportPreVersioningFormat;
    constructor(
    /** {@link Summarizable.key} */
    key: string, 
    /** The format version of the summary to write in the summary metadata. */
    writeVersion: TVersion, 
    /** The set of supported versions that a summary can have for this summarizer to load it. */
    supportedVersions: ReadonlySet<TVersion>, 
    /**
     * Whether to support loading summaries before versioning was added, i.e., summaries without metadata blob.
     * @remarks
     * This version may not be supported if the support for the version before metadata blob was dropped.
     * In that case, this will not be present in `supportedVersions` and an error will be thrown during load.
     */
    supportPreVersioningFormat: boolean);
    /**
     * The summarize function that derived classes must implement. They should use the passed summary tree builder to
     * add their summary data.
     */
    protected abstract summarizeInternal(props: {
        stringify: SummaryElementStringifier;
        fullTree?: boolean;
        trackState?: boolean;
        telemetryContext?: ITelemetryContext;
        incrementalSummaryContext?: IExperimentalIncrementalSummaryContext;
        builder: SummaryTreeBuilder;
    }): void;
    /**
     * The load function that derived classes must implement to load their summary data.
     */
    protected abstract loadInternal(services: IChannelStorageService, parse: SummaryElementParser, 
    /**
     * The format version of the summary being loaded, or undefined if this is pre-versioning format,
     * i.e., the summary has no version metadata.
     */
    version: TVersion | undefined): Promise<void>;
    summarize(props: {
        stringify: SummaryElementStringifier;
        fullTree?: boolean;
        trackState?: boolean;
        telemetryContext?: ITelemetryContext;
        incrementalSummaryContext?: IExperimentalIncrementalSummaryContext;
    }): ISummaryTreeWithStats;
    load(services: IChannelStorageService, parse: SummaryElementParser): Promise<void>;
}
//# sourceMappingURL=versionedSummarizer.d.ts.map