/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { EndOfTreeSegment } from "./endOfTreeSegment.js";
import { LocalReferencePosition } from "./localReference.js";
import { MergeTree } from "./mergeTree.js";
import { IMergeTreeDeltaCallbackArgs } from "./mergeTreeDeltaCallback.js";
import { ITrackingGroup } from "./mergeTreeTracking.js";
import { IJSONSegment, MergeTreeDeltaType } from "./ops.js";
import { PropertySet } from "./properties.js";
/**
 * @legacy
 * @alpha
 */
export type MergeTreeDeltaRevertible = {
    operation: typeof MergeTreeDeltaType.INSERT;
    trackingGroup: ITrackingGroup;
} | {
    operation: typeof MergeTreeDeltaType.REMOVE;
    trackingGroup: ITrackingGroup;
} | {
    operation: typeof MergeTreeDeltaType.ANNOTATE;
    trackingGroup: ITrackingGroup;
    propertyDeltas: PropertySet;
};
/**
 * Tests whether x is a MergeTreeDeltaRevertible
 * @internal
 */
export declare function isMergeTreeDeltaRevertible(x: unknown): x is MergeTreeDeltaRevertible;
/**
 * @legacy
 * @alpha
 */
export interface MergeTreeRevertibleDriver {
    insertFromSpec(pos: number, spec: IJSONSegment): void;
    removeRange(start: number, end: number): void;
    annotateRange(start: number, end: number, props: PropertySet): void;
}
/**
 * exported for test only. should not be exported out the the package
 * @internal
 */
export interface MergeTreeWithRevert extends MergeTree {
    __mergeTreeRevertible: {
        detachedReferences: EndOfTreeSegment;
        refCallbacks: LocalReferencePosition["callbacks"];
    };
}
export type PickPartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
/**
 * Appends a merge tree delta to the list of revertibles.
 *
 * @legacy
 * @alpha
 */
export declare function appendToMergeTreeDeltaRevertibles(deltaArgs: IMergeTreeDeltaCallbackArgs, revertibles: MergeTreeDeltaRevertible[]): void;
/**
 * Removes all revertibles from the list of revertibles.
 *
 * @legacy
 * @alpha
 */
export declare function discardMergeTreeDeltaRevertible(revertibles: MergeTreeDeltaRevertible[]): void;
/**
 * Reverts all operations in the list of revertibles.
 *
 * @legacy
 * @alpha
 */
export declare function revertMergeTreeDeltaRevertibles(driver: MergeTreeRevertibleDriver, revertibles: MergeTreeDeltaRevertible[]): void;
//# sourceMappingURL=revertibles.d.ts.map