/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { FieldKindIdentifier, ITreeCursor, forbiddenFieldKindIdentifier, ChangesetLocalId } from "../../core";
import { FieldKind, Multiplicity, FieldChangeHandler, FieldEditor, BrandedFieldKind } from "../modular-schema";
import { SequenceFieldEditor } from "../sequence-field";
import { OptionalChangeset } from "./defaultFieldChangeTypes";
import { OptionalFieldEditor } from "./optionalField";
/**
 * ChangeHandler that only handles no-op / identity changes.
 */
export declare const noChangeHandler: FieldChangeHandler<0>;
export interface ValueFieldEditor extends FieldEditor<OptionalChangeset> {
    /**
     * Creates a change which replaces the current value of the field with `newValue`.
     */
    set(newValue: ITreeCursor, id: ChangesetLocalId): OptionalChangeset;
}
/**
 * 0 or 1 items.
 */
export declare const optional: BrandedFieldKind<"Optional", Multiplicity.Optional, OptionalFieldEditor>;
export declare const valueFieldEditor: ValueFieldEditor;
export declare const valueChangeHandler: FieldChangeHandler<OptionalChangeset, ValueFieldEditor>;
/**
 * Exactly one item.
 */
export declare const value: BrandedFieldKind<"Value", Multiplicity.Value, ValueFieldEditor>;
/**
 * 0 or more items.
 */
export declare const sequence: BrandedFieldKind<"Sequence", Multiplicity.Sequence, SequenceFieldEditor>;
/**
 * Exactly one identifier.
 */
export declare const nodeKey: BrandedFieldKind<"NodeKey", Multiplicity.Value, FieldEditor<0>>;
/**
 * 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: BrandedFieldKind<"Forbidden", Multiplicity.Forbidden, FieldEditor<0>>;
/**
 * Default field kinds by identifier
 */
export declare const fieldKinds: ReadonlyMap<FieldKindIdentifier, FieldKind>;
/**
 * @public
 */
export interface ValueFieldKind extends BrandedFieldKind<"Value", Multiplicity.Value, FieldEditor<any>> {
}
/**
 * @public
 */
export interface Optional extends BrandedFieldKind<"Optional", Multiplicity.Optional, FieldEditor<any>> {
}
/**
 * @public
 */
export interface Sequence extends BrandedFieldKind<"Sequence", Multiplicity.Sequence, FieldEditor<any>> {
}
/**
 * @public
 */
export interface NodeKeyFieldKind extends BrandedFieldKind<"NodeKey", Multiplicity.Value, FieldEditor<any>> {
}
/**
 * @public
 */
export interface Forbidden extends BrandedFieldKind<typeof forbiddenFieldKindIdentifier, Multiplicity.Forbidden, FieldEditor<any>> {
}
/**
 * Default FieldKinds with their editor types erased.
 * @public
 */
export declare const FieldKinds: {
    readonly value: ValueFieldKind;
    readonly optional: Optional;
    readonly sequence: Sequence;
    readonly nodeKey: NodeKeyFieldKind;
    readonly forbidden: Forbidden;
};
/**
 * @public
 */
export declare type FieldKindTypes = typeof FieldKinds[keyof typeof FieldKinds];
//# sourceMappingURL=defaultFieldKinds.d.ts.map