"use strict";
/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.ProgressiveEditBuilderBase = void 0;
/**
 * @alpha
 */
class ProgressiveEditBuilderBase {
    constructor(changeFamily, changeReceiver, anchorSet) {
        this.changeFamily = changeFamily;
        this.changeReceiver = changeReceiver;
        this.anchorSet = anchorSet;
        this.changes = [];
    }
    /**
     * Subclasses add editing methods which call this with their generated edits.
     *
     * @sealed
     */
    applyChange(change) {
        this.changes.push(change);
        this.changeFamily.rebaser.rebaseAnchors(this.anchorSet, change);
        this.changeReceiver(change);
    }
    /**
     * {@inheritDoc (ProgressiveEditBuilder:interface).getChanges}
     * @sealed
     */
    getChanges() {
        return [...this.changes];
    }
    enterTransaction() { }
    exitTransaction() { }
}
exports.ProgressiveEditBuilderBase = ProgressiveEditBuilderBase;
//# sourceMappingURL=progressiveEditBuilder.js.map