/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import type { IIdCompressor } from "@fluidframework/id-compressor";
import type { CodecWriteOptions } from "../../codec/index.js";
import type { RevisionTag, RevisionTagCodec } from "../rebase/index.js";
import type { FieldKey } from "../schema-stored/index.js";
import type { ITreeCursorSynchronous } from "./cursor.js";
import type { Root } from "./delta.js";
import { DetachedFieldIndex } from "./detachedFieldIndex.js";
import type { PlaceIndex, Range } from "./pathTree.js";
import { type DeltaVisitor } from "./visitDelta.js";
export declare function makeDetachedFieldIndex(prefix: string | undefined, revisionTagCodec: RevisionTagCodec, idCompressor: IIdCompressor, options?: CodecWriteOptions): DetachedFieldIndex;
export declare function applyDelta(delta: Root, latestRevision: RevisionTag | undefined, deltaProcessor: {
    acquireVisitor: () => DeltaVisitor;
}, detachedFieldIndex: DetachedFieldIndex): void;
export declare function announceDelta(delta: Root, latestRevision: RevisionTag | undefined, deltaProcessor: {
    acquireVisitor: () => DeltaVisitor & AnnouncedVisitor;
}, detachedFieldIndex: DetachedFieldIndex): void;
export interface CombinedVisitor extends DeltaVisitor {
    readonly type: "Combined";
    readonly visitors: readonly CombinableVisitor[];
}
export type CombinableVisitor = (DeltaVisitor & {
    type?: never;
}) | AnnouncedVisitor | CombinedVisitor;
/**
 * Combines multiple visitors into a single visitor.
 * @param visitors - The returned visitor invokes the corresponding events for all these visitors, in order.
 * @returns a DeltaVisitor combining all `visitors`.
 */
export declare function combineVisitors(visitors: readonly CombinableVisitor[]): CombinedVisitor;
/**
 * Visitor that is notified of changes before, after, and when changes are made.
 * Must be freed after use.
 */
export interface AnnouncedVisitor extends DeltaVisitor {
    readonly type: "Announced";
    /**
     * A hook that is called after all nodes have been created.
     */
    afterCreate(content: readonly ITreeCursorSynchronous[], 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, isReplaced: boolean): void;
    afterDetach(source: PlaceIndex, count: number, destination: FieldKey, isReplaced: boolean): void;
}
/**
 * Creates an announced visitor with only the provided functions and uses a no op for the rest.
 * This is provided to make some of the delta visitor definitions cleaner.
 */
export declare function createAnnouncedVisitor(visitorFunctions: Partial<AnnouncedVisitor>): AnnouncedVisitor;
//# sourceMappingURL=visitorUtils.d.ts.map