/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import type { IFluidHandle } from "@fluidframework/core-interfaces";
import type { IFluidSerializer } from "@fluidframework/shared-object-base/internal";
import type { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
import type { SerializedAttributionCollection } from "./attributionCollection.js";
import type { IJSONSegment } from "./ops.js";
import type { PropertySet } from "./properties.js";
export interface VersionedMergeTreeChunk {
    version: undefined | "1";
}
export type JsonSegmentSpecs = IJSONSegment | IJSONSegmentWithMergeInfo;
export interface MergeTreeChunkLegacy extends VersionedMergeTreeChunk {
    version: undefined;
    chunkStartSegmentIndex: number;
    chunkSegmentCount: number;
    chunkLengthChars: number;
    totalLengthChars?: number;
    totalSegmentCount?: number;
    chunkSequenceNumber?: number;
    chunkMinSequenceNumber?: number;
    segmentTexts: JsonSegmentSpecs[];
    headerMetadata?: MergeTreeHeaderMetadata;
    attribution?: SerializedAttributionCollection;
}
export interface MergeTreeHeaderChunkMetadata {
    id: string;
}
export interface MergeTreeHeaderMetadata {
    totalLength: number;
    totalSegmentCount: number;
    orderedChunkMetadata: MergeTreeHeaderChunkMetadata[];
    sequenceNumber: number;
    minSequenceNumber: number;
}
export interface MergeTreeChunkV1 extends VersionedMergeTreeChunk {
    version: "1";
    startIndex: number;
    segmentCount: number;
    length: number;
    segments: JsonSegmentSpecs[];
    headerMetadata: MergeTreeHeaderMetadata | undefined;
    attribution?: SerializedAttributionCollection;
}
/**
 * Used during snapshotting to record the metadata required to merge segments above the MSN
 * to the raw output of `ISegment.toJSONObject()`.  (Note that IJSONSegment may be a raw
 * string or array, which is why this interface wraps the original IJSONSegment instead of
 * extending it.)
 */
export interface IJSONSegmentWithMergeInfo {
    json: IJSONSegment;
    client?: string;
    seq?: number;
    removedClientIds?: string[];
    removedSeq?: number;
    movedClientIds?: string[];
    movedSeq?: number;
    movedSeqs?: number[];
}
/**
 * Returns true if the given 'spec' is an IJSONSegmentWithMergeInfo.
 */
export declare function hasMergeInfo(spec: IJSONSegment | IJSONSegmentWithMergeInfo): spec is IJSONSegmentWithMergeInfo;
export declare function serializeAsMinSupportedVersion(path: string, chunk: VersionedMergeTreeChunk, logger: ITelemetryLoggerExt, options: PropertySet | undefined, serializer: IFluidSerializer, bind: IFluidHandle): string;
export declare function serializeAsMaxSupportedVersion(path: string, chunk: VersionedMergeTreeChunk, logger: ITelemetryLoggerExt, options: PropertySet | undefined, serializer: IFluidSerializer, bind: IFluidHandle): string;
export declare function toLatestVersion(path: string, chunk: VersionedMergeTreeChunk, logger: ITelemetryLoggerExt, options: PropertySet | undefined): MergeTreeChunkV1;
//# sourceMappingURL=snapshotChunks.d.ts.map