/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { FieldKey, TreeNavigationResult, ITreeSubscriptionCursor, FieldAnchor, FieldUpPath, ITreeCursor } from "../../core";
import { FieldKind } from "../modular-schema";
import { NewFieldContent } from "../contextuallyTyped";
import { FieldKinds } from "../default-field-kinds";
import { AllowedTypes, TreeFieldSchema } from "../typed-schema";
import { LocalNodeKey, StableNodeKey } from "../node-key";
import { Context } from "./context";
import { FlexibleNodeContent, OptionalField, Sequence, TypedField, TypedNodeUnion, UnboxNodeUnion, TreeField, TreeNode, RequiredField, boxedIterator, CheckTypesOverlap, TreeStatus, NodeKeyField } from "./editableTreeTypes";
import { LazyEntity, forgetAnchorSymbol, tryMoveCursorToAnchorSymbol } from "./lazyEntity";
export declare function makeField(context: Context, schema: TreeFieldSchema, cursor: ITreeSubscriptionCursor): TreeField;
/**
 * 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 FieldKind, TTypes extends AllowedTypes> extends LazyEntity<TreeFieldSchema<TKind, TTypes>, FieldAnchor> implements TreeField {
    readonly key: FieldKey;
    constructor(context: Context, schema: TreeFieldSchema<TKind, TTypes>, cursor: ITreeSubscriptionCursor, fieldAnchor: FieldAnchor);
    is<TSchema extends TreeFieldSchema>(schema: TSchema): this is TypedField<TSchema>;
    isSameAs(other: TreeField): boolean;
    normalizeNewContent(content: NewFieldContent): readonly ITreeCursor[];
    get parent(): TreeNode | undefined;
    protected [tryMoveCursorToAnchorSymbol](anchor: FieldAnchor, cursor: ITreeSubscriptionCursor): TreeNavigationResult;
    protected [forgetAnchorSymbol](anchor: FieldAnchor): void;
    get length(): number;
    at(index: number): UnboxNodeUnion<TTypes>;
    boxedAt(index: number): TypedNodeUnion<TTypes>;
    map<U>(callbackfn: (value: UnboxNodeUnion<TTypes>, index: number) => U): U[];
    mapBoxed<U>(callbackfn: (value: TypedNodeUnion<TTypes>, index: number) => U): U[];
    [boxedIterator](): IterableIterator<TypedNodeUnion<TTypes>>;
    [Symbol.iterator](): IterableIterator<UnboxNodeUnion<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 AllowedTypes> extends LazyField<typeof FieldKinds.sequence, TTypes> implements Sequence<TTypes> {
    constructor(context: Context, schema: TreeFieldSchema<typeof FieldKinds.sequence, TTypes>, cursor: ITreeSubscriptionCursor, fieldAnchor: FieldAnchor);
    get asArray(): readonly UnboxNodeUnion<TTypes>[];
    private sequenceEditor;
    insertAt(index: number, value: Iterable<FlexibleNodeContent<TTypes>>): void;
    insertAtStart(value: Iterable<FlexibleNodeContent<TTypes>>): void;
    insertAtEnd(value: Iterable<FlexibleNodeContent<TTypes>>): void;
    removeAt(index: number): void;
    removeRange(start?: number, end?: number): void;
    moveToStart(sourceStart: number, sourceEnd: number): void;
    moveToStart<TTypesSource extends AllowedTypes>(sourceStart: number, sourceEnd: number, source: Sequence<CheckTypesOverlap<TTypesSource, TTypes>>): void;
    moveToEnd(sourceStart: number, sourceEnd: number): void;
    moveToEnd<TTypesSource extends AllowedTypes>(sourceStart: number, sourceEnd: number, source: Sequence<CheckTypesOverlap<TTypesSource, TTypes>>): void;
    moveToIndex(index: number, sourceStart: number, sourceEnd: number): void;
    moveToIndex<TTypesSource extends AllowedTypes>(index: number, sourceStart: number, sourceEnd: number, source: Sequence<CheckTypesOverlap<TTypesSource, TTypes>>): void;
    private _moveToIndex;
}
export declare class LazyValueField<TTypes extends AllowedTypes> extends LazyField<typeof FieldKinds.required, TTypes> implements RequiredField<TTypes> {
    constructor(context: Context, schema: TreeFieldSchema<typeof FieldKinds.required, TTypes>, cursor: ITreeSubscriptionCursor, fieldAnchor: FieldAnchor);
    private valueFieldEditor;
    get content(): UnboxNodeUnion<TTypes>;
    set content(newContent: FlexibleNodeContent<TTypes>);
    get boxedContent(): TypedNodeUnion<TTypes>;
}
export declare class LazyOptionalField<TTypes extends AllowedTypes> extends LazyField<typeof FieldKinds.optional, TTypes> implements OptionalField<TTypes> {
    constructor(context: Context, schema: TreeFieldSchema<typeof FieldKinds.optional, TTypes>, cursor: ITreeSubscriptionCursor, fieldAnchor: FieldAnchor);
    private optionalEditor;
    get content(): UnboxNodeUnion<TTypes> | undefined;
    set content(newContent: FlexibleNodeContent<TTypes> | undefined);
    get boxedContent(): TypedNodeUnion<TTypes> | undefined;
}
export declare class LazyNodeKeyField<TTypes extends AllowedTypes> extends LazyField<typeof FieldKinds.nodeKey, TTypes> implements NodeKeyField {
    constructor(context: Context, schema: TreeFieldSchema<typeof FieldKinds.nodeKey, TTypes>, cursor: ITreeSubscriptionCursor, fieldAnchor: FieldAnchor);
    get localNodeKey(): LocalNodeKey;
    get stableNodeKey(): StableNodeKey;
}
export declare class LazyForbiddenField<TTypes extends AllowedTypes> extends LazyField<typeof FieldKinds.forbidden, TTypes> {
}
//# sourceMappingURL=lazyField.d.ts.map