/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { ITreeSubscriptionCursor, IEditableForest, ITreeSubscriptionCursorState, TreeNavigationResult, TreeStoredSchemaSubscription, FieldKey, DetachedField, AnchorSet, UpPath, Anchor, CursorLocationType, TreeNodeSchemaIdentifier, MapTree, FieldAnchor, FieldUpPath, ForestEvents, PathRootPrefix, DeltaVisitor, Value, ITreeCursorSynchronous } from "../../core/index.js";
import { CursorWithNode, SynchronousCursor } from "../treeCursorUtils.js";
/**
 * Reference implementation of IEditableForest.
 *
 * This implementation focuses on correctness and simplicity, not performance.
 * It does not use compressed chunks: instead nodes are implemented using objects.
 */
export declare class ObjectForest implements IEditableForest {
    readonly anchors: AnchorSet;
    private activeVisitor?;
    readonly roots: MapTree;
    readonly currentCursors: Set<Cursor>;
    private readonly events;
    constructor(anchors?: AnchorSet);
    get isEmpty(): boolean;
    on<K extends keyof ForestEvents>(eventName: K, listener: ForestEvents[K]): () => void;
    clone(_: TreeStoredSchemaSubscription, anchors: AnchorSet): ObjectForest;
    forgetAnchor(anchor: Anchor): void;
    acquireVisitor(): DeltaVisitor;
    private nextRange;
    newDetachedField(): DetachedField;
    private add;
    private addFieldAsDetached;
    private delete;
    allocateCursor(): Cursor;
    tryMoveCursorToNode(destination: Anchor, cursorToMove: ITreeSubscriptionCursor): TreeNavigationResult;
    tryMoveCursorToField(destination: FieldAnchor, cursorToMove: ITreeSubscriptionCursor): TreeNavigationResult;
    moveCursorToPath(destination: UpPath | undefined, cursorToMove: ITreeSubscriptionCursor): void;
    getCursorAboveDetachedFields(): ITreeCursorSynchronous;
}
/**
 * Cursor implementation for ObjectForest.
 */
declare class Cursor extends SynchronousCursor implements ITreeSubscriptionCursor {
    readonly forest: ObjectForest;
    private innerCursor?;
    state: ITreeSubscriptionCursorState;
    /**
     * @param forest - forest this cursor navigates
     * @param innerCursor - underlying cursor implementation this wraps. `undefined` when state is not `Current`
     */
    constructor(forest: ObjectForest, innerCursor?: CursorWithNode<MapTree> | undefined);
    buildFieldAnchor(): FieldAnchor;
    getFieldPath(prefix?: PathRootPrefix): FieldUpPath;
    get mode(): CursorLocationType;
    nextField(): boolean;
    exitField(): void;
    skipPendingFields(): boolean;
    getFieldKey(): FieldKey;
    getFieldLength(): number;
    firstNode(): boolean;
    enterNode(childIndex: number): void;
    getPath(prefix?: PathRootPrefix): UpPath;
    get fieldIndex(): number;
    get chunkStart(): number;
    get chunkLength(): number;
    seekNodes(offset: number): boolean;
    nextNode(): boolean;
    exitNode(): void;
    firstField(): boolean;
    enterField(key: FieldKey): void;
    get type(): TreeNodeSchemaIdentifier;
    get value(): Value;
    clear(): void;
    /**
     * Move this cursor to the special dummy node above the detached sequences.
     * Can be used when cleared (but not freed).
     */
    setToAboveDetachedSequences(): void;
    getNode(): MapTree;
    getParent(): [MapTree, FieldKey];
    fork(): ITreeSubscriptionCursor;
    free(): void;
    buildAnchor(): Anchor;
}
/**
 * @returns an implementation of {@link IEditableForest} with no data or schema.
 */
export declare function buildForest(anchors?: AnchorSet): ObjectForest;
export {};
//# sourceMappingURL=objectForest.d.ts.map