/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { EndOfTreeSegment } from "./endOfTreeSegment";
import { LocalReferencePosition } from "./localReference";
import { IMergeTreeDeltaCallbackArgs } from "./mergeTreeDeltaCallback";
import { ISegment } from "./mergeTreeNodes";
import { ITrackingGroup } from "./mergeTreeTracking";
import { IJSONSegment, MergeTreeDeltaType, ReferenceType } from "./ops";
import { PropertySet } from "./properties";
import { MergeTree } from "./mergeTree";
/**
 * Revertibles are new and require the option
 * mergeTreeUseNewLengthCalculations to be set as true on the underlying merge tree
 * in order to function correctly.
 *
 * @alpha
 */
export declare type MergeTreeDeltaRevertible = {
    operation: typeof MergeTreeDeltaType.INSERT;
    trackingGroup: ITrackingGroup;
} | {
    operation: typeof MergeTreeDeltaType.REMOVE;
    trackingGroup: ITrackingGroup;
} | {
    operation: typeof MergeTreeDeltaType.ANNOTATE;
    trackingGroup: ITrackingGroup;
    propertyDeltas: PropertySet;
};
/**
 * Revertibles are new and require the option
 * mergeTreeUseNewLengthCalculations to be set as true on the underlying merge tree
 * in order to function correctly.
 *
 * @alpha
 */
export interface MergeTreeRevertibleDriver {
    insertFromSpec(pos: number, spec: IJSONSegment): any;
    removeRange(start: number, end: number): any;
    annotateRange(start: number, end: number, props: PropertySet): any;
    /**
     * @deprecated This function will be removed from this interface in the next release
     */
    createLocalReferencePosition(segment: ISegment, offset: number, refType: ReferenceType, properties: PropertySet | undefined): LocalReferencePosition;
    /**
     * @deprecated This function will be removed from this interface in the next release
     */
    localReferencePositionToPosition(lref: LocalReferencePosition): number;
    /**
     * @deprecated This function will be removed from this interface in the next release
     */
    getPosition(segment: ISegment): number;
    /**
     * @deprecated This function will be removed from this interface in the next release
     */
    getContainingSegment(pos: number): {
        segment: ISegment | undefined;
        offset: number | undefined;
    };
}
/**
 * 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 declare type PickPartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
/**
 * Revertibles are new and require the option
 * mergeTreeUseNewLengthCalculations to be set as true on the underlying merge tree
 * in order to function correctly.
 * @alpha
 */
export declare function appendToMergeTreeDeltaRevertibles(driver: MergeTreeRevertibleDriver, deltaArgs: IMergeTreeDeltaCallbackArgs, revertibles: MergeTreeDeltaRevertible[]): void;
/**
 * Revertibles are new and require the option
 * mergeTreeUseNewLengthCalculations to be set as true on the underlying merge tree
 * in order to function correctly.
 * @alpha
 */
export declare function discardMergeTreeDeltaRevertible(revertibles: MergeTreeDeltaRevertible[]): void;
/**
 * Revertibles are new and require the option
 * mergeTreeUseNewLengthCalculations to be set as true on the underlying merge tree
 * in order to function correctly.
 * @alpha
 */
export declare function revertMergeTreeDeltaRevertibles(driver: MergeTreeRevertibleDriver, revertibles: MergeTreeDeltaRevertible[]): void;
//# sourceMappingURL=revertibles.d.ts.map