/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { type ChangesetLocalId, type DeltaFieldChanges, type RevisionTag } from "../../core/index.js";
import { type FieldChangeHandler, type FieldChangeRebaser, type FieldEditor, type ToDelta } from "../modular-schema/index.js";
import type { OptionalChangeset, RegisterId } from "./optionalFieldChangeTypes.js";
export interface IRegisterMap<T> {
    set(id: RegisterId, childChange: T): void;
    get(id: RegisterId): T | undefined;
    delete(id: RegisterId): boolean;
    keys(): Iterable<RegisterId>;
    values(): Iterable<T>;
    entries(): Iterable<[RegisterId, T]>;
    readonly size: number;
}
export declare class RegisterMap<T> implements IRegisterMap<T> {
    private readonly nestedMapData;
    clone(): RegisterMap<T>;
    set(id: RegisterId, childChange: T): void;
    get(id: RegisterId): T | undefined;
    has(id: RegisterId): boolean;
    delete(id: RegisterId): boolean;
    keys(): Iterable<RegisterId>;
    values(): Iterable<T>;
    entries(): Iterable<[RegisterId, T]>;
    get size(): number;
}
export declare const optionalChangeRebaser: FieldChangeRebaser<OptionalChangeset>;
export declare function taggedRegister(id: RegisterId, revision: RevisionTag | undefined): RegisterId;
export interface OptionalFieldEditor extends FieldEditor<OptionalChangeset> {
    /**
     * Creates a change which replaces the field with `newContent`
     * @param newContent - the new content for the field
     * @param wasEmpty - whether the field is empty when creating this change
     * @param changeId - the ID associated with the replacement of the current content.
     * @param buildId - the ID associated with the creation of the `newContent`.
     */
    set(wasEmpty: boolean, ids: {
        fill: ChangesetLocalId;
        detach: ChangesetLocalId;
    }): OptionalChangeset;
    /**
     * Creates a change which clears the field's contents (if any).
     * @param wasEmpty - whether the field is empty when creating this change
     * @param changeId - the ID associated with the detach.
     */
    clear(wasEmpty: boolean, id: ChangesetLocalId): OptionalChangeset;
}
export declare const optionalFieldEditor: OptionalFieldEditor;
export declare function optionalFieldIntoDelta(change: OptionalChangeset, deltaFromChild: ToDelta): DeltaFieldChanges;
export declare const optionalChangeHandler: FieldChangeHandler<OptionalChangeset, OptionalFieldEditor>;
//# sourceMappingURL=optionalField.d.ts.map