/*!
 * 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 { RangeEntry } from "../../util";
import { Mark, MoveId, MoveIn, MoveOut, ReturnFrom } from "./format";
export type MoveEffectTable<T> = CrossFieldManager<MoveEffect<T>>;
/**
 * Changes to be applied to a move mark.
 */
export interface MoveEffect<T> {
    /**
     * If defined, this move mark should be replaced by `mark`.
     */
    mark?: Mark<T>;
    /**
     * 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 setMoveEffect<T>(moveEffects: MoveEffectTable<T>, target: CrossFieldTarget, revision: RevisionTag | undefined, id: MoveId, count: number, effect: MoveEffect<T>, invalidate?: boolean): void;
export declare function getMoveEffect<T>(moveEffects: MoveEffectTable<T>, target: CrossFieldTarget, revision: RevisionTag | undefined, id: MoveId, count: number, addDependency?: boolean): RangeEntry<MoveEffect<T>> | undefined;
export type MoveMark<T> = MoveOut<T> | MoveIn | ReturnFrom<T>;
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>[];
export declare function getModifyAfter<T>(moveEffects: MoveEffectTable<T>, revision: RevisionTag | undefined, id: MoveId, count: number, consumeEffect?: boolean): T | undefined;
//# sourceMappingURL=moveEffectTable.d.ts.map