/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { StableId } from "@fluidframework/runtime-definitions";
import { Brand } from "../../util";
import { ReadonlyRepairDataStore } from "../repair";
/**
 * The identifier for a particular session/user/client that can generate `GraphCommit`s
 */
export declare type SessionId = string;
export declare const SessionIdSchema: import("@sinclair/typebox").TUnsafe<string>;
/**
 * A unique identifier for a commit. Commits that have been rebased, but are semantically
 * the same, will share the same revision tag.
 * @public
 */
export declare type RevisionTag = StableId;
export declare const RevisionTagSchema: import("@sinclair/typebox").TUnsafe<StableId>;
/**
 * An ID which is unique within a revision of a `ModularChangeset`.
 * A `ModularChangeset` which is a composition of multiple revisions may contain duplicate `ChangesetLocalId`s,
 * but they are unique when qualified by the revision of the change they are used in.
 * @public
 */
export declare type ChangesetLocalId = Brand<number, "ChangesetLocalId">;
/**
 * A globally unique ID for an atom of change, or a node associated with the atom of change.
 * @public
 *
 * @privateRemarks
 * TODO: Rename this to be more general.
 */
export interface ChangeAtomId {
    /**
     * Uniquely identifies the changeset within which the change was made.
     * Only undefined when referring to an anonymous changesets.
     */
    readonly revision?: RevisionTag;
    /**
     * Uniquely identifies, in the scope of the changeset, the change made to the field.
     */
    readonly localId: ChangesetLocalId;
}
/**
 * @returns a `RevisionTag` from the given string, or fails if the string is not a valid `RevisionTag`
 */
export declare function assertIsRevisionTag(revision: string): RevisionTag;
/**
 * @returns true iff the given string is a valid `RevisionTag`
 */
export declare function isRevisionTag(revision: string): revision is RevisionTag;
/**
 * @returns a random, universally unique `RevisionTag`
 */
export declare function mintRevisionTag(): RevisionTag;
/**
 * A node in a graph of commits. A commit's parent is the commit on which it was based.
 */
export interface GraphCommit<TChange> {
    /** The tag for this commit. If this commit is rebased, the corresponding rebased commit will retain this tag. */
    readonly revision: RevisionTag;
    /** The change that will result from applying this commit */
    readonly change: TChange;
    readonly repairData?: ReadonlyRepairDataStore;
    /** The parent of this commit, on whose change this commit's change is based */
    readonly parent?: GraphCommit<TChange>;
    /** The inverse of this commit */
    inverse?: TChange;
}
/**
 * Creates a new graph commit object. This is useful for creating copies of commits with different parentage.
 * @param parent - the parent of the new commit
 * @param commit - the contents of the new commit object
 * @returns the new commit object
 */
export declare function mintCommit<TChange>(parent: GraphCommit<TChange>, commit: Omit<GraphCommit<TChange>, "parent">): GraphCommit<TChange>;
//# sourceMappingURL=types.d.ts.map