/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { type ChangeAtomId, type FieldKindIdentifier, forbiddenFieldKindIdentifier, Multiplicity } from "../../core/index.js";
import { type FieldChangeHandler, type FieldEditor, type FieldKindConfiguration, FlexFieldKind, type FullSchemaPolicy } from "../modular-schema/index.js";
import { type OptionalChangeset, type OptionalFieldEditor } from "../optional-field/index.js";
import { type SequenceFieldEditor } from "../sequence-field/index.js";
import type { CodecTree } from "../../codec/index.js";
import { type Brand } from "../../util/index.js";
/**
 * ChangeHandler that only handles no-op / identity changes.
 */
export declare const noChangeHandler: FieldChangeHandler<0>;
/**
 * {@link FieldEditor} for required fields (always contain exactly 1 child).
 * @remarks
 * This shares code with optional fields, since they are the same edit wise except setting to empty is not allowed,
 * and the content is always assumed to not be empty.
 * This means the actual edits implemented for optional fields are sufficient to support required fields
 * which is why this is defined and implemented in terms of optional fields.
 */
export interface RequiredFieldEditor extends FieldEditor<OptionalChangeset> {
    /**
     * Creates a change which replaces the current value of the field with `newValue`.
     * @param ids - The ids for the fill and detach fields.
     */
    set(ids: {
        fill: ChangeAtomId;
        detach: ChangeAtomId;
    }): OptionalChangeset;
}
declare const optionalIdentifier: import("../../util/brand.js").BrandedType<string, "tree.FieldKindIdentifier"> & "Optional";
declare const requiredIdentifier: import("../../util/brand.js").BrandedType<string, "tree.FieldKindIdentifier"> & "Value";
declare const sequenceIdentifier: import("../../util/brand.js").BrandedType<string, "tree.FieldKindIdentifier"> & "Sequence";
declare const identifierFieldIdentifier: import("../../util/brand.js").BrandedType<string, "tree.FieldKindIdentifier"> & "Identifier";
/**
 * 0 or 1 items.
 */
export declare const optional: FlexFieldKind<OptionalFieldEditor, import("../../util/brand.js").BrandedType<string, "tree.FieldKindIdentifier"> & "Optional", Multiplicity.Optional>;
export declare const requiredFieldEditor: RequiredFieldEditor;
export declare const requiredFieldChangeHandler: FieldChangeHandler<OptionalChangeset, RequiredFieldEditor>;
/**
 * Exactly one item.
 */
export declare const required: FlexFieldKind<RequiredFieldEditor, import("../../util/brand.js").BrandedType<string, "tree.FieldKindIdentifier"> & "Value", Multiplicity.Single>;
/**
 * 0 or more items.
 */
export declare const sequence: FlexFieldKind<SequenceFieldEditor, import("../../util/brand.js").BrandedType<string, "tree.FieldKindIdentifier"> & "Sequence", Multiplicity.Sequence>;
/**
 * Exactly one identifier.
 */
export declare const identifier: FlexFieldKind<FieldEditor<0>, import("../../util/brand.js").BrandedType<string, "tree.FieldKindIdentifier"> & "Identifier", Multiplicity.Single>;
/**
 * Exactly 0 items.
 *
 * Using Forbidden makes what types are listed for allowed in a field irrelevant
 * since the field will never have values in it.
 *
 * Using Forbidden is equivalent to picking a kind that permits empty (like sequence or optional)
 * and having no allowed types (or only never types).
 * Because of this, its possible to express everything constraint wise without Forbidden,
 * but using Forbidden can be more semantically clear than optional with no allowed types.
 *
 * For view schema, this can be useful if you need to:
 * - run a specific out of schema handler when a field is present,
 * but otherwise are ignoring or tolerating (ex: via extra fields) unmentioned fields.
 * - prevent a specific field from being used as an extra field
 * (perhaps for some past of future compatibility reason)
 * - keep a field in a schema for metadata purposes
 * (ex: for improved error messaging, error handling or documentation)
 * that is not used in this specific version of the schema (ex: to document what it was or will be used for).
 *
 * For stored schema, this can be useful if you need to:
 * - have a field which can have its schema updated to Optional or Sequence of any type.
 * - to exclude a field from extra fields
 * - for the schema system to use as a default for fields which aren't declared
 * (ex: when updating a field that did not exist into one that does)
 *
 * See {@link emptyField} for a constant, reusable field using Forbidden.
 */
export declare const forbidden: FlexFieldKind<FieldEditor<0>, import("../../util/brand.js").BrandedType<string, "tree.FieldKindIdentifier"> & "Forbidden", Multiplicity.Forbidden>;
export declare const fieldKindConfigurations: ReadonlyMap<ModularChangeFormatVersion, FieldKindConfiguration>;
export type ModularChangeFormatVersion = Brand<3 | 4 | 101, "ModularChangeFormatVersion">;
export declare function getCodecTreeForModularChangeFormat(version: ModularChangeFormatVersion): CodecTree;
/**
 * All supported field kinds.
 *
 * @privateRemarks
 * Before making a SharedTree format change which impacts which set of field kinds are allowed,
 * code which uses this should be audited for compatibility considerations.
 */
export declare const fieldKinds: ReadonlyMap<FieldKindIdentifier, FlexFieldKind>;
export interface Required extends FlexFieldKind<RequiredFieldEditor, typeof requiredIdentifier, Multiplicity.Single> {
}
export interface Optional extends FlexFieldKind<OptionalFieldEditor, typeof optionalIdentifier, Multiplicity.Optional> {
}
export interface Sequence extends FlexFieldKind<SequenceFieldEditor, typeof sequenceIdentifier, Multiplicity.Sequence> {
}
export interface Identifier extends FlexFieldKind<FieldEditor<0>, typeof identifierFieldIdentifier, Multiplicity.Single> {
}
export interface Forbidden extends FlexFieldKind<FieldEditor<0>, typeof forbiddenFieldKindIdentifier, Multiplicity.Forbidden> {
}
/**
 * Default FieldKinds with their editor types erased.
 */
export declare const FieldKinds: {
    readonly required: Required;
    readonly optional: Optional;
    readonly sequence: Sequence;
    readonly identifier: Identifier;
    readonly forbidden: Forbidden;
};
/**
 * FullSchemaPolicy with the default field kinds.
 */
export declare const defaultSchemaPolicy: FullSchemaPolicy;
export {};
//# sourceMappingURL=defaultFieldKinds.d.ts.map