/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { ICodecFamily, ICodecOptions } from "../../codec";
import { ChangeFamily, ChangeRebaser, Delta, UpPath, ITreeCursor, ChangeFamilyEditor, FieldUpPath, TaggedChange } from "../../core";
import { ModularChangeset } from "../modular-schema";
export type DefaultChangeset = ModularChangeset;
/**
 * Implementation of {@link ChangeFamily} based on the default set of supported field kinds.
 *
 * @sealed
 */
export declare class DefaultChangeFamily implements ChangeFamily<DefaultEditBuilder, DefaultChangeset> {
    private readonly modularFamily;
    constructor(codecOptions: ICodecOptions);
    get rebaser(): ChangeRebaser<DefaultChangeset>;
    get codecs(): ICodecFamily<DefaultChangeset>;
    intoDelta(change: TaggedChange<DefaultChangeset>): Delta.Root;
    buildEditor(changeReceiver: (change: DefaultChangeset) => void): DefaultEditBuilder;
}
/**
 * Default editor for transactions.
 * @alpha
 */
export interface IDefaultEditBuilder {
    /**
     * @param field - the value field which is being edited under the parent node
     * @returns An object with methods to edit the given field of the given parent.
     * The returned object can be used (i.e., have its methods called) multiple times but its lifetime
     * is bounded by the lifetime of this edit builder.
     */
    valueField(field: FieldUpPath): ValueFieldEditBuilder;
    /**
     * @param field - the optional field which is being edited under the parent node
     * @returns An object with methods to edit the given field of the given parent.
     * The returned object can be used (i.e., have its methods called) multiple times but its lifetime
     * is bounded by the lifetime of this edit builder.
     */
    optionalField(field: FieldUpPath): OptionalFieldEditBuilder;
    /**
     * @param field - the sequence field which is being edited under the parent node
     * @returns An object with methods to edit the given field of the given parent.
     * The returned object can be used (i.e., have its methods called) multiple times but its lifetime
     * is bounded by the lifetime of this edit builder.
     */
    sequenceField(field: FieldUpPath): SequenceFieldEditBuilder;
    /**
     * Moves a subsequence from one sequence field to another sequence field.
     *
     * Note that the `destinationIndex` is the final index the first node moved should end up at.
     * Thus if moving nodes from a lower to a higher index within the same field, the `destinationIndex` must be computed as if the subsequence being moved has already been removed.
     * See {@link SequenceFieldEditBuilder.move} for details.
     */
    move(sourceField: FieldUpPath, sourceIndex: number, count: number, destinationField: FieldUpPath, destinationIndex: number): void;
    addNodeExistsConstraint(path: UpPath): void;
}
/**
 * Implementation of {@link IDefaultEditBuilder} based on the default set of supported field kinds.
 * @sealed
 */
export declare class DefaultEditBuilder implements ChangeFamilyEditor, IDefaultEditBuilder {
    private readonly modularBuilder;
    constructor(family: ChangeFamily<ChangeFamilyEditor, DefaultChangeset>, changeReceiver: (change: DefaultChangeset) => void);
    enterTransaction(): void;
    exitTransaction(): void;
    apply(change: DefaultChangeset): void;
    addNodeExistsConstraint(path: UpPath): void;
    valueField(field: FieldUpPath): ValueFieldEditBuilder;
    optionalField(field: FieldUpPath): OptionalFieldEditBuilder;
    move(sourceField: FieldUpPath, sourceIndex: number, count: number, destinationField: FieldUpPath, destIndex: number): void;
    sequenceField(field: FieldUpPath): SequenceFieldEditBuilder;
}
/**
 * @alpha
 */
export interface ValueFieldEditBuilder {
    /**
     * Issues a change which replaces the current newContent of the field with `newContent`.
     * @param newContent - the new content for the field
     */
    set(newContent: ITreeCursor): void;
}
/**
 * @alpha
 */
export interface OptionalFieldEditBuilder {
    /**
     * Issues a change which replaces the current newContent of the field with `newContent`
     * @param newContent - the new content for the field
     * @param wasEmpty - whether the field is empty when creating this change
     */
    set(newContent: ITreeCursor | undefined, wasEmpty: boolean): void;
}
/**
 * @alpha
 */
export interface SequenceFieldEditBuilder {
    /**
     * Issues a change which inserts the `newContent` at the given `index`.
     * @param index - the index at which to insert the `newContent`.
     * @param newContent - the new content to be inserted in the field
     */
    insert(index: number, newContent: ITreeCursor | readonly ITreeCursor[]): void;
    /**
     * Issues a change which deletes `count` elements starting at the given `index`.
     * @param index - The index of the first deleted element.
     * @param count - The number of elements to delete.
     */
    delete(index: number, count: number): void;
    /**
     * Issues a change which moves `count` elements starting at `sourceIndex` to `destIndex`.
     * @param sourceIndex - the index of the first moved element.
     * @param count - the number of elements to move.
     * @param destIndex - the index the elements are moved to, interpreted after removing the moving elements.
     */
    move(sourceIndex: number, count: number, destIndex: number): void;
}
//# sourceMappingURL=defaultChangeFamily.d.ts.map