/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { RevisionMetadataSource, RevisionTag, TaggedChange } from "../../core";
import { IdAllocator } from "../../util";
import { CrossFieldManager } from "../modular-schema";
import { Changeset, Mark, MarkList } from "./types";
import { MoveEffectTable } from "./moveEffectTable";
/**
 * @alpha
 */
export type NodeChangeComposer<TNodeChange> = (changes: TaggedChange<TNodeChange>[]) => TNodeChange;
/**
 * Composes a sequence of changesets into a single changeset.
 * @param changes - The changesets to be applied.
 * Parts of the input may be reused in the output, but the input is not mutated.
 * Each changeset in the list is assumed to be applicable after the previous one.
 * @returns A changeset that is equivalent to applying each of the given `changes` in order.
 *
 * WARNING! This implementation is incomplete:
 * - Tombstone information is ignored.
 * - Support for moves is not implemented.
 * - Support for slices is not implemented.
 */
export declare function compose<TNodeChange>(changes: TaggedChange<Changeset<TNodeChange>>[], composeChild: NodeChangeComposer<TNodeChange>, genId: IdAllocator, manager: CrossFieldManager, revisionMetadata: RevisionMetadataSource): Changeset<TNodeChange>;
export declare function amendCompose<TNodeChange>(marks: MarkList<TNodeChange>, composeChild: NodeChangeComposer<TNodeChange>, genId: IdAllocator, manager: CrossFieldManager): MarkList<TNodeChange>;
export declare class ComposeQueue<T> {
    private readonly newRevision;
    private readonly moveEffects;
    private readonly revisionMetadata;
    private readonly baseMarks;
    private readonly newMarks;
    private readonly cancelledInserts;
    constructor(baseRevision: RevisionTag | undefined, baseMarks: Changeset<T>, newRevision: RevisionTag | undefined, newMarks: Changeset<T>, genId: IdAllocator, moveEffects: MoveEffectTable<T>, revisionMetadata: RevisionMetadataSource, composeChanges?: (a: T | undefined, b: T | undefined) => T | undefined);
    isEmpty(): boolean;
    pop(): ComposeMarks<T>;
    private dequeueBase;
    private dequeueNew;
    private dequeueBoth;
}
interface ComposeMarks<T> {
    baseMark?: Mark<T>;
    newMark?: Mark<T>;
}
export {};
//# sourceMappingURL=compose.d.ts.map