/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { Value, Anchor, FieldKey, TreeNavigationResult, ITreeSubscriptionCursor, AnchorNode, TreeNodeSchemaIdentifier, TreeValue } from "../../core";
import { TreeFieldSchema, TreeNodeSchema, MapSchema, FieldNodeSchema, LeafSchema, ObjectNodeSchema } from "../typed-schema";
import { EditableTreeEvents } from "../untypedTree";
import { LocalNodeKey } from "../node-key";
import { Context } from "./context";
import { FieldNode, Leaf, MapNode, ObjectNode, ObjectNodeTyped, TypedField, TypedNode, UnboxField, TreeField, TreeNode, boxedIterator, TreeStatus } from "./editableTreeTypes";
import { LazyEntity, forgetAnchorSymbol, tryMoveCursorToAnchorSymbol } from "./lazyEntity";
export declare function makeTree(context: Context, cursor: ITreeSubscriptionCursor): LazyTreeNode;
/**
 * Lazy implementation of {@link TreeNode}.
 */
export declare abstract class LazyTreeNode<TSchema extends TreeNodeSchema = TreeNodeSchema> extends LazyEntity<TSchema, Anchor> implements TreeNode {
    #private;
    /**
     * Enumerable own property providing a more JS object friendly alternative to "schema".
     */
    readonly type: TreeNodeSchemaIdentifier;
    constructor(context: Context, schema: TSchema, cursor: ITreeSubscriptionCursor, anchorNode: AnchorNode, anchor: Anchor);
    is<TSchemaInner extends TreeNodeSchema>(schema: TSchemaInner): this is TypedNode<TSchemaInner>;
    protected [tryMoveCursorToAnchorSymbol](anchor: Anchor, cursor: ITreeSubscriptionCursor): TreeNavigationResult;
    protected [forgetAnchorSymbol](anchor: Anchor): void;
    get value(): Value;
    tryGetField(fieldKey: FieldKey): TreeField | undefined;
    [boxedIterator](): IterableIterator<TreeField>;
    get parentField(): {
        readonly parent: TreeField;
        readonly index: number;
    };
    treeStatus(): TreeStatus;
    on<K extends keyof EditableTreeEvents>(eventName: K, listener: EditableTreeEvents[K]): () => void;
}
export declare class LazyMap<TSchema extends MapSchema> extends LazyTreeNode<TSchema> implements MapNode<TSchema> {
    constructor(context: Context, schema: TSchema, cursor: ITreeSubscriptionCursor, anchorNode: AnchorNode, anchor: Anchor);
    get size(): number;
    keys(): IterableIterator<FieldKey>;
    values(): IterableIterator<UnboxField<TSchema["mapFields"], "notEmpty">>;
    entries(): IterableIterator<[FieldKey, UnboxField<TSchema["mapFields"], "notEmpty">]>;
    forEach(callbackFn: (value: UnboxField<TSchema["mapFields"], "notEmpty">, key: FieldKey, map: MapNode<TSchema>) => void, thisArg?: any): void;
    has(key: FieldKey): boolean;
    get(key: FieldKey): UnboxField<TSchema["mapFields"]>;
    getBoxed(key: FieldKey): TypedField<TSchema["mapFields"]>;
    [boxedIterator](): IterableIterator<TypedField<TSchema["mapFields"]>>;
    [Symbol.iterator](): IterableIterator<[
        FieldKey,
        UnboxField<TSchema["mapFields"], "notEmpty">
    ]>;
    get asObject(): {
        readonly [P in FieldKey]?: UnboxField<TSchema["mapFields"], "notEmpty">;
    };
}
export declare class LazyLeaf<TSchema extends LeafSchema> extends LazyTreeNode<TSchema> implements Leaf<TSchema> {
    constructor(context: Context, schema: TSchema, cursor: ITreeSubscriptionCursor, anchorNode: AnchorNode, anchor: Anchor);
    get value(): TreeValue<TSchema["leafValue"]>;
}
export declare class LazyFieldNode<TSchema extends FieldNodeSchema> extends LazyTreeNode<TSchema> implements FieldNode<TSchema> {
    get content(): UnboxField<TSchema["objectNodeFieldsObject"][""]>;
    get boxedContent(): TypedField<TSchema["objectNodeFieldsObject"][""]>;
}
export declare abstract class LazyObjectNode<TSchema extends ObjectNodeSchema> extends LazyTreeNode<TSchema> implements ObjectNode {
    get localNodeKey(): LocalNodeKey | undefined;
}
export declare function buildLazyObjectNode<TSchema extends ObjectNodeSchema>(context: Context, schema: TSchema, cursor: ITreeSubscriptionCursor, anchorNode: AnchorNode, anchor: Anchor): LazyObjectNode<TSchema> & ObjectNodeTyped<TSchema>;
export declare function getBoxedField(objectNode: LazyTreeNode, key: FieldKey, fieldSchema: TreeFieldSchema): TreeField;
export declare function getFieldSchema(field: FieldKey, schema: TreeNodeSchema): TreeFieldSchema;
//# sourceMappingURL=lazyTree.d.ts.map