/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { RevisionTag } from "../../core";
import { CrossFieldManager, CrossFieldTarget } from "../modular-schema";
import { Mark, MoveId, MoveIn, MoveOut, ReturnFrom, ReturnTo } from "./format";
export declare type MoveEffectTable<T> = CrossFieldManager<MoveEffect<T>>;
/**
 * Changes to be applied to a move mark.
 */
export interface MoveEffect<T> {
    /**
     * The size of the mark after splitting. Only defined if child is defined.
     */
    count?: number;
    /**
     * The ID of a new mark which should be created by splitting off a portion of the end of this mark.
     * There should be an entry in the MoveEffectTable for this ID.
     */
    child?: MoveId;
    /**
     * When true, this mark should be deleted.
     */
    shouldRemove?: boolean;
    /**
     * If defined, this move mark should be replaced by `mark`.
     */
    mark?: Mark<T>;
    /**
     * The ID of a mark which this mark is allowed to merge left into.
     */
    mergeLeft?: MoveId;
    /**
     * The ID of a mark which can be merged into this mark from the right.
     */
    mergeRight?: MoveId;
    /**
     * Node changes which should be applied to this mark.
     * If this mark already has node changes, `modifyAfter` should be composed as later changes.
     */
    modifyAfter?: T;
    /**
     * A mark which should be moved to the same position as this mark.
     */
    movedMark?: Mark<T>;
    /**
     * Represents the new value for the `isSrcConflicted` or `isDstConflicted` field of this mark.
     */
    pairedMarkStatus?: PairedMarkUpdate;
    /**
     * The new value for this mark's `detachedBy` field.
     */
    detacher?: RevisionTag;
}
export declare enum MoveEnd {
    Source = 0,
    Dest = 1
}
export declare enum PairedMarkUpdate {
    /**
     * Indicates that the mark's matching mark is now inactive.
     */
    Deactivated = 0,
    /**
     * Indicates that the mark's matching mark is now active.
     */
    Reactivated = 1
}
export interface MovePartition<TNodeChange> {
    id: MoveId;
    count?: number;
    replaceWith?: Mark<TNodeChange>[];
    modifyAfter?: TNodeChange;
    /**
     * When set, updates the mark's paired mark status.
     */
    pairedMarkStatus?: PairedMarkUpdate;
}
export declare function splitMove<T>(effects: MoveEffectTable<T>, target: CrossFieldTarget, revision: RevisionTag | undefined, id: MoveId, newId: MoveId, count1: number, count2: number): void;
export declare function getOrAddEffect<T>(moveEffects: MoveEffectTable<T>, target: CrossFieldTarget, revision: RevisionTag | undefined, id: MoveId, resetMerges?: boolean, invalidate?: boolean): MoveEffect<T>;
export declare function getMoveEffect<T>(moveEffects: MoveEffectTable<T>, target: CrossFieldTarget, revision: RevisionTag | undefined, id: MoveId, addDependency?: boolean): MoveEffect<T>;
export declare function clearMergeability<T>(moveEffects: MoveEffectTable<T>, target: CrossFieldTarget, revision: RevisionTag | undefined, id: MoveId): void;
export declare function makeMergeable<T>(moveEffects: MoveEffectTable<T>, target: CrossFieldTarget, revision: RevisionTag | undefined, leftId: MoveId, rightId: MoveId): void;
export declare type MoveMark<T> = MoveOut<T> | MoveIn | ReturnFrom<T> | ReturnTo;
export declare function isMoveMark<T>(mark: Mark<T>): mark is MoveMark<T>;
export declare function applyMoveEffectsToMark<T>(mark: Mark<T>, revision: RevisionTag | undefined, effects: MoveEffectTable<T>, consumeEffect: boolean, composeChildren?: (a: T | undefined, b: T | undefined) => T | undefined): Mark<T>[];
//# sourceMappingURL=moveEffectTable.d.ts.map