/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { ITreeSubscriptionCursor, IEditableForest, TreeNavigationResult, TreeStoredSchemaSubscription, FieldKey, DetachedField, AnchorSet, UpPath, Anchor, FieldAnchor, ForestEvents, ITreeSubscriptionCursorState, DeltaVisitor, ITreeCursorSynchronous } from "../../core/index.js";
import { BasicChunk, BasicChunkCursor, SiblingsOrKey } from "./basicChunk.js";
import { IChunker } from "./chunkTree.js";
import { ChunkedCursor, TreeChunk } from "./chunk.js";
/**
 * Implementation of IEditableForest based on copy on write chunks.
 *
 * This implementation focuses on performance.
 */
export declare class ChunkedForest implements IEditableForest {
    roots: BasicChunk;
    readonly schema: TreeStoredSchemaSubscription;
    readonly chunker: IChunker;
    readonly anchors: AnchorSet;
    private activeVisitor?;
    private readonly events;
    /**
     * @param roots - dummy node above the root under which detached fields are stored. All content of the forest is reachable from this.
     * @param schema - schema which all content in this forest is assumed to comply with.
     * @param chunker - Chunking policy. TODO: dispose of this when forest is disposed.
     * @param anchors - anchorSet used to track location in this forest across changes. Callers of applyDelta must ensure this is updated accordingly.
     */
    constructor(roots: BasicChunk, schema: TreeStoredSchemaSubscription, chunker: IChunker, anchors?: AnchorSet);
    get isEmpty(): boolean;
    on<K extends keyof ForestEvents>(eventName: K, listener: ForestEvents[K]): () => void;
    clone(schema: TreeStoredSchemaSubscription, anchors: AnchorSet): ChunkedForest;
    forgetAnchor(anchor: Anchor): void;
    acquireVisitor(): DeltaVisitor;
    private nextDetachedFieldIdentifier;
    newDetachedField(): DetachedField;
    allocateCursor(): Cursor;
    tryMoveCursorToNode(destination: Anchor, cursorToMove: ITreeSubscriptionCursor): TreeNavigationResult;
    tryMoveCursorToField(destination: FieldAnchor, cursorToMove: ITreeSubscriptionCursor): TreeNavigationResult;
    moveCursorToPath(destination: UpPath, cursorToMove: ITreeSubscriptionCursor): void;
    getCursorAboveDetachedFields(): ITreeCursorSynchronous;
}
declare class Cursor extends BasicChunkCursor implements ITreeSubscriptionCursor {
    readonly forest: ChunkedForest;
    state: ITreeSubscriptionCursorState;
    constructor(forest: ChunkedForest, state: ITreeSubscriptionCursorState, root: readonly TreeChunk[], siblingStack: SiblingsOrKey[], indexStack: number[], indexOfChunkStack: number[], indexWithinChunkStack: number[], siblings: SiblingsOrKey, index: number, indexOfChunk: number, indexWithinChunk: number, nestedCursor: ChunkedCursor | undefined);
    setToDetachedSequence(key: FieldKey): void;
    fork(): Cursor;
    buildFieldAnchor(): FieldAnchor;
    free(): void;
    buildAnchor(): Anchor;
    clear(): void;
}
/**
 * @returns an implementation of {@link IEditableForest} with no data or schema.
 */
export declare function buildChunkedForest(chunker: IChunker, anchors?: AnchorSet): ChunkedForest;
export {};
//# sourceMappingURL=chunkedForest.d.ts.map