/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { FieldKey, TreeNavigationResult, ITreeSubscriptionCursor, FieldAnchor, FieldUpPath } from "../../core/index.js";
import { FlexFieldKind } from "../modular-schema/index.js";
import { FieldKinds } from "../default-schema/index.js";
import { FlexAllowedTypes, FlexFieldSchema } from "../typed-schema/index.js";
import { LocalNodeKey, StableNodeKey } from "../node-key/index.js";
import { Context } from "./context.js";
import { FlexibleNodeContent, FlexTreeOptionalField, FlexTreeSequenceField, FlexTreeTypedField, FlexTreeTypedNodeUnion, FlexTreeUnboxNodeUnion, FlexTreeField, FlexTreeNode, FlexTreeRequiredField, TreeStatus, FlexTreeNodeKeyField, FlexibleNodeSubSequence, FlexTreeEntityKind, flexTreeMarker } from "./flexTreeTypes.js";
import { LazyEntity, forgetAnchorSymbol, tryMoveCursorToAnchorSymbol } from "./lazyEntity.js";
export declare function makeField(context: Context, schema: FlexFieldSchema, cursor: ITreeSubscriptionCursor): FlexTreeField;
/**
 * A Proxy target, which together with a `fieldProxyHandler` implements a basic access to
 * the nodes of {@link EditableField} by means of the cursors.
 */
export declare abstract class LazyField<TKind extends FlexFieldKind, TTypes extends FlexAllowedTypes> extends LazyEntity<FlexFieldSchema<TKind, TTypes>, FieldAnchor> implements FlexTreeField {
    get [flexTreeMarker](): FlexTreeEntityKind.Field;
    readonly key: FieldKey;
    constructor(context: Context, schema: FlexFieldSchema<TKind, TTypes>, cursor: ITreeSubscriptionCursor, fieldAnchor: FieldAnchor);
    is<TSchema extends FlexFieldSchema>(schema: TSchema): this is FlexTreeTypedField<TSchema>;
    isSameAs(other: FlexTreeField): boolean;
    get parent(): FlexTreeNode | undefined;
    protected [tryMoveCursorToAnchorSymbol](anchor: FieldAnchor, cursor: ITreeSubscriptionCursor): TreeNavigationResult;
    protected [forgetAnchorSymbol](anchor: FieldAnchor): void;
    get length(): number;
    atIndex(index: number): FlexTreeUnboxNodeUnion<TTypes>;
    boxedAt(index: number): FlexTreeTypedNodeUnion<TTypes> | undefined;
    map<U>(callbackfn: (value: FlexTreeUnboxNodeUnion<TTypes>, index: number) => U): U[];
    mapBoxed<U>(callbackfn: (value: FlexTreeTypedNodeUnion<TTypes>, index: number) => U): U[];
    boxedIterator(): IterableIterator<FlexTreeTypedNodeUnion<TTypes>>;
    [Symbol.iterator](): IterableIterator<FlexTreeUnboxNodeUnion<TTypes>>;
    treeStatus(): TreeStatus;
    getFieldPath(): FieldUpPath;
    /**
     * Returns the path to this field to use for editing. Throws iff this path is not {@link TreeStatus#InDocument}.
     * This path is not valid to hold onto across edits: this must be recalled for each edit.
     */
    getFieldPathForEditing(): FieldUpPath;
}
export declare class LazySequence<TTypes extends FlexAllowedTypes> extends LazyField<typeof FieldKinds.sequence, TTypes> implements FlexTreeSequenceField<TTypes> {
    constructor(context: Context, schema: FlexFieldSchema<typeof FieldKinds.sequence, TTypes>, cursor: ITreeSubscriptionCursor, fieldAnchor: FieldAnchor);
    at(index: number): FlexTreeUnboxNodeUnion<TTypes> | undefined;
    get asArray(): readonly FlexTreeUnboxNodeUnion<TTypes>[];
    private sequenceEditor;
    insertAt(index: number, value: FlexibleNodeSubSequence<TTypes>): void;
    insertAtStart(value: FlexibleNodeSubSequence<TTypes>): void;
    insertAtEnd(value: FlexibleNodeSubSequence<TTypes>): void;
    removeAt(index: number): void;
    removeRange(start?: number, end?: number): void;
    moveToStart(sourceIndex: number): void;
    moveToStart(sourceIndex: number, source: FlexTreeSequenceField<FlexAllowedTypes>): void;
    moveToEnd(sourceIndex: number): void;
    moveToEnd(sourceIndex: number, source: FlexTreeSequenceField<FlexAllowedTypes>): void;
    moveToIndex(index: number, sourceIndex: number): void;
    moveToIndex(index: number, sourceIndex: number, source: FlexTreeSequenceField<FlexAllowedTypes>): void;
    moveRangeToStart(sourceStart: number, sourceEnd: number): void;
    moveRangeToStart(sourceStart: number, sourceEnd: number, source: FlexTreeSequenceField<FlexAllowedTypes>): void;
    moveRangeToEnd(sourceStart: number, sourceEnd: number): void;
    moveRangeToEnd(sourceStart: number, sourceEnd: number, source: FlexTreeSequenceField<FlexAllowedTypes>): void;
    moveRangeToIndex(index: number, sourceStart: number, sourceEnd: number): void;
    moveRangeToIndex(index: number, sourceStart: number, sourceEnd: number, source: FlexTreeSequenceField<FlexAllowedTypes>): void;
    private _moveRangeToIndex;
}
export declare class LazyValueField<TTypes extends FlexAllowedTypes> extends LazyField<typeof FieldKinds.required, TTypes> implements FlexTreeRequiredField<TTypes> {
    constructor(context: Context, schema: FlexFieldSchema<typeof FieldKinds.required, TTypes>, cursor: ITreeSubscriptionCursor, fieldAnchor: FieldAnchor);
    private valueFieldEditor;
    get content(): FlexTreeUnboxNodeUnion<TTypes>;
    set content(newContent: FlexibleNodeContent<TTypes>);
    get boxedContent(): FlexTreeTypedNodeUnion<TTypes>;
}
export declare class LazyOptionalField<TTypes extends FlexAllowedTypes> extends LazyField<typeof FieldKinds.optional, TTypes> implements FlexTreeOptionalField<TTypes> {
    constructor(context: Context, schema: FlexFieldSchema<typeof FieldKinds.optional, TTypes>, cursor: ITreeSubscriptionCursor, fieldAnchor: FieldAnchor);
    private optionalEditor;
    get content(): FlexTreeUnboxNodeUnion<TTypes> | undefined;
    set content(newContent: FlexibleNodeContent<TTypes> | undefined);
    get boxedContent(): FlexTreeTypedNodeUnion<TTypes> | undefined;
}
export declare class LazyNodeKeyField<TTypes extends FlexAllowedTypes> extends LazyField<typeof FieldKinds.nodeKey, TTypes> implements FlexTreeNodeKeyField {
    constructor(context: Context, schema: FlexFieldSchema<typeof FieldKinds.nodeKey, TTypes>, cursor: ITreeSubscriptionCursor, fieldAnchor: FieldAnchor);
    get localNodeKey(): LocalNodeKey;
    get stableNodeKey(): StableNodeKey;
}
export declare class LazyForbiddenField<TTypes extends FlexAllowedTypes> extends LazyField<typeof FieldKinds.forbidden, TTypes> {
}
//# sourceMappingURL=lazyField.d.ts.map