/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
/**
 * Allows reversion of a change made to SharedTree.
 *
 * Applications wanting to implement undo/redo support might typically maintain two stacks of Revertibles, with optional eviction policy to free up memory.
 * @beta
 */
export interface Revertible {
    /** Indicates the type of edit that produced this revertible. */
    readonly kind: RevertibleKind;
    readonly origin: {
        readonly isLocal: boolean;
    };
    /**
     * Can be called in order to revert a change. A successful revert will automatically discard resources.
     */
    revert(): RevertResult;
    /**
     * Should be called to garbage collect any resources associated with the revertible.
     */
    discard(): DiscardResult;
}
/**
 * The type of revertible commit.
 *
 * @beta
 */
export declare enum RevertibleKind {
    /** A typical local commit */
    Default = 0,
    /** A revertible that is the result of an undo. */
    Undo = 1,
    /** A revertible that is the result of a redo. */
    Redo = 2,
    /**
     * A revertible that is the result of a rebase and should replace a previously generated revertible.
     * todo: improve error reporting in this case
     */
    Rebase = 3
}
/**
 * The result of a revert operation.
 *
 * @beta
 */
export declare enum RevertResult {
    /** The revert was successful. */
    Success = 0,
    /** The revert failed. */
    Failure = 1
}
/**
 * The result of a discard operation.
 *
 * @beta
 */
export declare enum DiscardResult {
    /** The discard was successful. */
    Success = 0,
    /** The discard failed. */
    Failure = 1
}
//# sourceMappingURL=revertible.d.ts.map