/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { IFluidHandle } from "@fluidframework/core-interfaces";
import { IFluidSerializer } from "@fluidframework/shared-object-base";
import { ITelemetryLogger } from "@fluidframework/common-definitions";
import { PropertySet } from "./properties";
import { IJSONSegment } from "./ops";
export interface VersionedMergeTreeChunk {
    version: undefined | "1";
}
export declare 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;
}
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;
}
/**
 * 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;
    /**
     * @deprecated - use removedClientIds instead. this only exists for back-compat
     */
    removedClient?: string;
    removedClientIds?: string[];
    removedSeq?: 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: ITelemetryLogger, options: PropertySet | undefined, serializer: IFluidSerializer, bind: IFluidHandle): string;
export declare function serializeAsMaxSupportedVersion(path: string, chunk: VersionedMergeTreeChunk, logger: ITelemetryLogger, options: PropertySet | undefined, serializer: IFluidSerializer, bind: IFluidHandle): string;
export declare function toLatestVersion(path: string, chunk: VersionedMergeTreeChunk, logger: ITelemetryLogger, options: PropertySet | undefined): MergeTreeChunkV1;
//# sourceMappingURL=snapshotChunks.d.ts.map