/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { FieldKey } from "../schema-stored/index.js";
import { RevisionTagCodec } from "../rebase/index.js";
import { ICodecOptions } from "../../codec/index.js";
import { PlaceIndex, Range } from "./pathTree.js";
import { DetachedFieldIndex } from "./detachedFieldIndex.js";
import { DeltaVisitor } from "./visitDelta.js";
import { ProtoNodes, Root } from "./delta.js";
export declare function makeDetachedFieldIndex(prefix: string | undefined, revisionTagCodec: RevisionTagCodec, options?: ICodecOptions): DetachedFieldIndex;
export declare function applyDelta(delta: Root, deltaProcessor: {
    acquireVisitor: () => DeltaVisitor;
}, detachedFieldIndex: DetachedFieldIndex): void;
export declare function announceDelta(delta: Root, deltaProcessor: {
    acquireVisitor: () => DeltaVisitor & AnnouncedVisitor;
}, detachedFieldIndex: DetachedFieldIndex): void;
/**
 * @param visitors - The returned visitor invokes the corresponding events for all these visitors, in order.
 * @param announcedVisitors - Subset of `visitors` to also call {@link AnnouncedVisitor} methods on.
 * This must be a subset of `visitors`: if not the visitor will not have its path correctly set when the events are triggered.
 * When `visitors` are making changes to data, `announcedVisitors` can be used to get extra events before or after all the changes from all the visitors have been made.
 * This can, for example, enable visitors to have access to the tree in these extra events despite multiple separate visitors updating different tree related data-structures.
 * @returns a DeltaVisitor combining all `visitors`.
 */
export declare function combineVisitors(visitors: readonly DeltaVisitor[], announcedVisitors?: readonly AnnouncedVisitor[]): DeltaVisitor;
/**
 * Visitor that is notified of changes before, after, and when changes are made.
 * Must be freed after use.
 * @internal
 */
export interface AnnouncedVisitor extends DeltaVisitor {
    /**
     * A hook that is called after all nodes have been created.
     */
    afterCreate(content: ProtoNodes, destination: FieldKey): void;
    beforeDestroy(field: FieldKey, count: number): void;
    beforeAttach(source: FieldKey, count: number, destination: PlaceIndex): void;
    afterAttach(source: FieldKey, destination: Range): void;
    beforeDetach(source: Range, destination: FieldKey): void;
    afterDetach(source: PlaceIndex, count: number, destination: FieldKey): void;
    beforeReplace(newContent: FieldKey, oldContent: Range, oldContentDestination: FieldKey): void;
    afterReplace(newContentSource: FieldKey, newContent: Range, oldContent: FieldKey): void;
}
//# sourceMappingURL=visitorUtils.d.ts.map