"use strict";
/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.SharedTreeEditBuilder = void 0;
const index_js_1 = require("../feature-libraries/index.js");
/**
 * Implementation of {@link IDefaultEditBuilder} based on the default set of supported field kinds.
 * @sealed
 */
class SharedTreeEditBuilder extends index_js_1.DefaultEditBuilder {
    constructor(modularChangeFamily, mintRevisionTag, changeReceiver) {
        super(modularChangeFamily, mintRevisionTag, (taggedChange) => changeReceiver({
            ...taggedChange,
            change: { changes: [{ type: "data", innerChange: taggedChange.change }] },
        }));
        this.changeReceiver = changeReceiver;
        this.schema = {
            setStoredSchema: (oldSchema, newSchema) => {
                this.changeReceiver({
                    revision: mintRevisionTag(),
                    change: {
                        changes: [
                            {
                                type: "schema",
                                innerChange: {
                                    schema: { new: newSchema, old: oldSchema },
                                    isInverse: false,
                                },
                            },
                        ],
                    },
                });
            },
        };
    }
}
exports.SharedTreeEditBuilder = SharedTreeEditBuilder;
//# sourceMappingURL=sharedTreeEditBuilder.js.map