/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { FieldKindIdentifier, TreeFieldStoredSchema, TreeStoredSchema, TreeTypeSet, Multiplicity } from "../../core/index.js";
import { FieldChangeHandler, FieldEditor } from "./fieldChangeHandler.js";
import { FlexFieldKind, FullSchemaPolicy } from "./fieldKind.js";
/**
 * Functionality for FieldKinds that is stable,
 * meaning that it can not change in any measurable way without providing a new identifier.
 *
 * It is assumed that this information and policy is available on all clients interacting with a document
 * using the identifier.
 *
 * This must contain enough information to process remote edits to this FieldKind consistently with all clients.
 * All behavior must be deterministic, and not change across versions of the app/library.
 *
 * These policies include the data encoding, change encoding, change rebase and change application.
 */
export declare class FieldKindWithEditor<TEditor extends FieldEditor<any> = FieldEditor<any>, TMultiplicity extends Multiplicity = Multiplicity, TName extends string = string> extends FlexFieldKind<TName, TMultiplicity> {
    readonly changeHandler: FieldChangeHandler<any, TEditor>;
    private readonly allowsTreeSupersetOf;
    readonly handlesEditsFrom: ReadonlySet<FieldKindIdentifier>;
    /**
     * @param identifier - Globally scoped identifier.
     * @param multiplicity - bound on the number of children that fields of this kind may have.
     * TODO: replace with numeric upper and lower bounds.
     * @param changeHandler - Change handling policy.
     * @param allowsTreeSupersetOf - returns true iff `superset` supports all that this does
     * and `superset` is an allowed upgrade. Does not have to handle the `never` cases.
     * See {@link isNeverField}.
     * TODO: when used as a method (instead of a free function like the other superset related functions),
     * this name is/signature is confusing and seems backwards.
     * @param handlesEditsFrom - Kinds (in addition to this) whose edits can be processed by changeHandler.
     * If the kind of a field changes, and edits are rebased across that kind change,
     * listing the other old kind here can prevent those edits from being conflicted and
     * provide a chance to handle them.
     */
    constructor(identifier: TName, multiplicity: TMultiplicity, changeHandler: FieldChangeHandler<any, TEditor>, allowsTreeSupersetOf: (originalTypes: TreeTypeSet, superset: TreeFieldStoredSchema) => boolean, handlesEditsFrom: ReadonlySet<FieldKindIdentifier>);
    /**
     * @returns true iff `superset` permits a (non-strict) superset of the subtrees
     * allowed by field made from `this` and `originalTypes`.
     */
    allowsFieldSuperset(policy: FullSchemaPolicy, originalData: TreeStoredSchema, originalTypes: TreeTypeSet, superset: TreeFieldStoredSchema): boolean;
}
/**
 * Downcasts to FieldKindWithEditor.
 */
export declare function withEditor<TName extends string = string, TMultiplicity extends Multiplicity = Multiplicity>(kind: FlexFieldKind<TName, TMultiplicity>): FieldKindWithEditor<FieldEditor<any>, TMultiplicity, TName>;
//# sourceMappingURL=fieldKindWithEditor.d.ts.map