/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { ChangeAtomId, RevisionTag, TaggedChange } from "../../core";
import { CrossFieldManager, CrossFieldTarget } from "../modular-schema";
import { RangeQueryResult } from "../../util";
import { CellMark, Mark, MarkEffect, MoveId, MoveIn, MoveOut } from "./types";
import { MoveMarkEffect } from "./helperTypes";
export type MoveEffectTable<T> = CrossFieldManager<MoveEffect<T>>;
/**
 * Changes to be applied to a move mark.
 */
export interface MoveEffect<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?: TaggedChange<T>;
    /**
     * A mark which should be moved to the same position as this mark.
     */
    movedMark?: Mark<T>;
    /**
     * The ID of the new endpoint associated with this mark.
     */
    endpoint?: ChangeAtomId;
}
export declare enum MoveEnd {
    Source = 0,
    Dest = 1
}
export interface MovePartition<TNodeChange> {
    id: MoveId;
    count?: number;
    replaceWith?: Mark<TNodeChange>[];
    modifyAfter?: TaggedChange<TNodeChange>;
}
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): RangeQueryResult<MoveEffect<T>>;
export type MoveMark<T> = CellMark<MoveMarkEffect, T>;
export declare function isMoveMark(effect: MarkEffect): effect is MoveMarkEffect;
export declare function isMoveOut(effect: MarkEffect): effect is MoveOut;
export declare function isMoveIn(effect: MarkEffect): effect is MoveIn;
export declare function getMoveIn(effect: MarkEffect): MoveIn | undefined;
export declare function applyMoveEffectsToMark<T>(mark: Mark<T>, revision: RevisionTag | undefined, effects: MoveEffectTable<T>, consumeEffect: boolean, composeChildren?: (a: T | undefined, b: TaggedChange<T>) => T | undefined): Mark<T>[];
export declare function getModifyAfter<T>(moveEffects: MoveEffectTable<T>, revision: RevisionTag | undefined, id: MoveId, count: number, consumeEffect?: boolean): TaggedChange<T> | undefined;
//# sourceMappingURL=moveEffectTable.d.ts.map