/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { Anchor, AnchorNode, FieldKey, ITreeSubscriptionCursor, TreeNavigationResult, TreeNodeSchemaIdentifier, TreeValue, Value } from "../../core/index.js";
import { LocalNodeKey } from "../node-key/index.js";
import { FlexFieldNodeSchema, FlexMapNodeSchema, FlexObjectNodeSchema, FlexTreeNodeSchema, LeafNodeSchema } from "../typed-schema/index.js";
import { Context } from "./context.js";
import { FlexTreeEntityKind, FlexTreeField, FlexTreeFieldNode, FlexTreeLeafNode, FlexTreeMapNode, FlexTreeNode, FlexTreeObjectNode, FlexTreeObjectNodeTyped, FlexTreeTypedField, FlexTreeTypedNode, FlexTreeUnboxField, FlexibleFieldContent, PropertyNameFromFieldKey, TreeStatus, flexTreeMarker } from "./flexTreeTypes.js";
import { LazyEntity, forgetAnchorSymbol, tryMoveCursorToAnchorSymbol } from "./lazyEntity.js";
import { FlexTreeNodeEvents } from "./treeEvents.js";
/**
 * @param cursor - This does not take ownership of this cursor: Node will fork it as needed.
 */
export declare function makeTree(context: Context, cursor: ITreeSubscriptionCursor): LazyTreeNode;
/**
 * Lazy implementation of {@link FlexTreeNode}.
 */
export declare abstract class LazyTreeNode<TSchema extends FlexTreeNodeSchema = FlexTreeNodeSchema> extends LazyEntity<TSchema, Anchor> implements FlexTreeNode {
    #private;
    readonly anchorNode: AnchorNode;
    get [flexTreeMarker](): FlexTreeEntityKind.Node;
    /**
     * 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 FlexTreeNodeSchema>(schema: TSchemaInner): this is FlexTreeTypedNode<TSchemaInner>;
    protected [tryMoveCursorToAnchorSymbol](cursor: ITreeSubscriptionCursor): TreeNavigationResult;
    protected [forgetAnchorSymbol](): void;
    get value(): Value;
    tryGetField(fieldKey: FieldKey): FlexTreeField | undefined;
    getBoxed(key: FieldKey): FlexTreeField;
    boxedIterator(): IterableIterator<FlexTreeField>;
    get parentField(): {
        readonly parent: FlexTreeField;
        readonly index: number;
    };
    treeStatus(): TreeStatus;
    on<K extends keyof FlexTreeNodeEvents>(eventName: K, listener: FlexTreeNodeEvents[K]): () => void;
}
export declare class LazyMap<TSchema extends FlexMapNodeSchema> extends LazyTreeNode<TSchema> implements FlexTreeMapNode<TSchema> {
    constructor(context: Context, schema: TSchema, cursor: ITreeSubscriptionCursor, anchorNode: AnchorNode, anchor: Anchor);
    get size(): number;
    keys(): IterableIterator<FieldKey>;
    values(): IterableIterator<FlexTreeUnboxField<TSchema["info"], "notEmpty">>;
    entries(): IterableIterator<[
        FieldKey,
        FlexTreeUnboxField<TSchema["info"], "notEmpty">
    ]>;
    forEach(callbackFn: (value: FlexTreeUnboxField<TSchema["info"], "notEmpty">, key: FieldKey, map: FlexTreeMapNode<TSchema>) => void, thisArg?: any): void;
    has(key: string): boolean;
    get(key: string): FlexTreeUnboxField<TSchema["info"]>;
    getBoxed(key: string): FlexTreeTypedField<TSchema["info"]>;
    set(key: string, content: FlexibleFieldContent<TSchema["info"]> | undefined): void;
    delete(key: FieldKey): void;
    boxedIterator(): IterableIterator<FlexTreeTypedField<TSchema["info"]>>;
    [Symbol.iterator](): IterableIterator<[
        FieldKey,
        FlexTreeUnboxField<TSchema["info"], "notEmpty">
    ]>;
}
export declare class LazyLeaf<TSchema extends LeafNodeSchema> extends LazyTreeNode<TSchema> implements FlexTreeLeafNode<TSchema> {
    constructor(context: Context, schema: TSchema, cursor: ITreeSubscriptionCursor, anchorNode: AnchorNode, anchor: Anchor);
    get value(): TreeValue<TSchema["info"]>;
}
export declare class LazyFieldNode<TSchema extends FlexFieldNodeSchema> extends LazyTreeNode<TSchema> implements FlexTreeFieldNode<TSchema> {
    get content(): FlexTreeUnboxField<TSchema["info"]>;
    get boxedContent(): FlexTreeTypedField<TSchema["info"]>;
}
/**
 * {@link reservedObjectNodeFieldPropertyNames} but as a set.
 */
export declare const reservedObjectNodeFieldPropertyNameSet: ReadonlySet<string>;
export declare function propertyNameFromFieldKey<T extends string>(key: T): PropertyNameFromFieldKey<T>;
export declare abstract class LazyObjectNode<TSchema extends FlexObjectNodeSchema> extends LazyTreeNode<TSchema> implements FlexTreeObjectNode {
    get localNodeKey(): LocalNodeKey | undefined;
}
export declare function buildLazyObjectNode<TSchema extends FlexObjectNodeSchema>(context: Context, schema: TSchema, cursor: ITreeSubscriptionCursor, anchorNode: AnchorNode, anchor: Anchor): LazyObjectNode<TSchema> & FlexTreeObjectNodeTyped<TSchema>;
//# sourceMappingURL=lazyNode.d.ts.map