/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { FieldKey, TreeNavigationResult, ITreeSubscriptionCursor, FieldAnchor, FieldUpPath, ITreeCursor } from "../../core";
import { NewFieldContent } from "../contextuallyTyped";
import { FieldKindTypes, FieldKinds } from "../default-field-kinds";
import { AllowedTypes, FieldSchema } from "../typed-schema";
import { TreeStatus } from "../editable-tree";
import { Context } from "./context";
import { FlexibleNodeContent, OptionalField, Sequence, TypedField, TypedNodeUnion, UnboxField, UnboxNodeUnion, UntypedField, UntypedTree, RequiredField } from "./editableTreeTypes";
import { LazyEntity, forgetAnchorSymbol, tryMoveCursorToAnchorSymbol } from "./lazyEntity";
export declare function makeField(context: Context, schema: FieldSchema, cursor: ITreeSubscriptionCursor): UntypedField;
/**
 * 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 FieldKindTypes, TTypes extends AllowedTypes> extends LazyEntity<FieldSchema<TKind, TTypes>, FieldAnchor> implements UntypedField {
    readonly key: FieldKey;
    constructor(context: Context, schema: FieldSchema<TKind, TTypes>, cursor: ITreeSubscriptionCursor, fieldAnchor: FieldAnchor);
    is<TSchema extends FieldSchema>(schema: TSchema): this is TypedField<TSchema>;
    isSameAs(other: UntypedField): boolean;
    normalizeNewContent(content: NewFieldContent): readonly ITreeCursor[];
    get parent(): UntypedTree | 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, array: this) => U): U[];
    mapBoxed<U>(callbackfn: (value: TypedNodeUnion<TTypes>, index: number, array: this) => U): U[];
    [Symbol.iterator](): IterableIterator<TypedNodeUnion<TTypes>>;
    treeStatus(): TreeStatus;
    getFieldPath(): FieldUpPath;
}
export declare class LazySequence<TTypes extends AllowedTypes> extends LazyField<typeof FieldKinds.sequence, TTypes> implements Sequence<TTypes> {
    constructor(context: Context, schema: FieldSchema<typeof FieldKinds.sequence, TTypes>, cursor: ITreeSubscriptionCursor, fieldAnchor: FieldAnchor);
    private sequenceEditor;
    replaceRange(index: number, count: number, newContent: Iterable<FlexibleNodeContent<TTypes>>): void;
    get asArray(): readonly UnboxNodeUnion<TTypes>[];
}
export declare class LazyValueField<TTypes extends AllowedTypes> extends LazyField<typeof FieldKinds.value, TTypes> implements RequiredField<TTypes> {
    constructor(context: Context, schema: FieldSchema<typeof FieldKinds.value, TTypes>, cursor: ITreeSubscriptionCursor, fieldAnchor: FieldAnchor);
    private valueFieldEditor;
    get content(): UnboxNodeUnion<TTypes>;
    get boxedContent(): TypedNodeUnion<TTypes>;
    setContent(newContent: FlexibleNodeContent<TTypes>): void;
}
export declare class LazyOptionalField<TTypes extends AllowedTypes> extends LazyField<typeof FieldKinds.optional, TTypes> implements OptionalField<TTypes> {
    constructor(context: Context, schema: FieldSchema<typeof FieldKinds.optional, TTypes>, cursor: ITreeSubscriptionCursor, fieldAnchor: FieldAnchor);
    private optionalEditor;
    get content(): UnboxNodeUnion<TTypes> | undefined;
    get boxedContent(): TypedNodeUnion<TTypes> | undefined;
    setContent(newContent: FlexibleNodeContent<TTypes> | undefined): void;
}
export declare class LazyForbiddenField<TTypes extends AllowedTypes> extends LazyField<typeof FieldKinds.forbidden, TTypes> {
}
/**
 * @param context - the common context of the field.
 * @param schema - the FieldStoredSchema of the field.
 * @param cursor - the cursor, which must point to the field being proxified.
 */
export declare function unboxedField<TSchema extends FieldSchema>(context: Context, schema: TSchema, cursor: ITreeSubscriptionCursor): UnboxField<TSchema>;
//# sourceMappingURL=lazyField.d.ts.map