/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { TSchema } from "@sinclair/typebox";
import { Brand } from "../util";
import { SessionId, RevisionTag } from "../core";
/**
 * Contains a single change to the `SharedTree` and associated metadata.
 */
export interface Commit<TChangeset> {
    readonly revision: RevisionTag;
    readonly change: TChangeset;
    /** An identifier representing the session/user/client that made this commit */
    readonly sessionId: SessionId;
}
export type SeqNumber = Brand<number, "edit-manager.SeqNumber">;
export interface SequenceId {
    readonly sequenceNumber: SeqNumber;
    readonly indexInBatch?: number;
}
export declare const sequenceIdComparator: (a: SequenceId, b: SequenceId) => number;
export declare const equalSequenceIds: (a: SequenceId, b: SequenceId) => boolean;
export declare const minSequenceId: (a: SequenceId, b: SequenceId) => SequenceId;
/**
 * A commit with a sequence number but no parentage; used for serializing the `EditManager` into a summary
 */
export interface SequencedCommit<TChangeset> extends Commit<TChangeset> {
    sequenceNumber: SeqNumber;
    indexInBatch?: number;
}
/**
 * A branch off of the trunk for use in summaries
 */
export interface SummarySessionBranch<TChangeset> {
    readonly base: RevisionTag;
    readonly commits: Commit<TChangeset>[];
}
export interface EncodedEditManager<TChangeset> {
    readonly trunk: readonly Readonly<SequencedCommit<TChangeset>>[];
    readonly branches: readonly [SessionId, Readonly<SummarySessionBranch<TChangeset>>][];
}
export declare const EncodedEditManager: <ChangeSchema extends TSchema>(tChange: ChangeSchema) => import("@sinclair/typebox").TObject<{
    trunk: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<import("@sinclair/typebox").TCompositeReduce<[import("@sinclair/typebox").TObject<{
        revision: import("@sinclair/typebox").TUnsafe<import("@fluidframework/runtime-definitions").StableId>;
        change: ChangeSchema;
        sessionId: import("@sinclair/typebox").TUnsafe<string>;
    }>, import("@sinclair/typebox").TObject<{
        sequenceNumber: import("@sinclair/typebox").TUnsafe<SeqNumber>;
        indexInBatch: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
    }>]>>>;
    branches: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TTuple<[import("@sinclair/typebox").TUnsafe<string>, import("@sinclair/typebox").TObject<{
        base: import("@sinclair/typebox").TUnsafe<import("@fluidframework/runtime-definitions").StableId>;
        commits: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<import("@sinclair/typebox").TCompositeReduce<[import("@sinclair/typebox").TObject<{
            revision: import("@sinclair/typebox").TUnsafe<import("@fluidframework/runtime-definitions").StableId>;
            change: ChangeSchema;
            sessionId: import("@sinclair/typebox").TUnsafe<string>;
        }>]>>>;
    }>]>>;
}>;
//# sourceMappingURL=editManagerFormat.d.ts.map