/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { DefaultIdBasedDataEditor, LocationBasedDataEditor, } from "../feature-libraries/index.js";
/**
 * Implementation of {@link DataEditor} based on the default set of supported field kinds.
 * @sealed
 */
export class IdBasedSharedTreeEditBuilder extends DefaultIdBasedDataEditor {
    constructor(modularChangeFamily, mintRevisionTag, changeReceiver, options) {
        super(modularChangeFamily, mintRevisionTag, (taggedChange) => changeReceiver({
            ...taggedChange,
            change: { changes: [{ type: "data", innerChange: taggedChange.change }] },
        }), options);
        this.changeReceiver = changeReceiver;
        this.schema = {
            setStoredSchema: (oldSchema, newSchema) => {
                changeReceiver({
                    revision: mintRevisionTag(),
                    change: {
                        changes: [
                            {
                                type: "schema",
                                innerChange: {
                                    schema: { new: newSchema, old: oldSchema },
                                    isInverse: false,
                                },
                            },
                        ],
                    },
                });
            },
        };
    }
}
export class LocationBasedSharedTreeEditBuilder extends LocationBasedDataEditor {
    constructor(idBasedEditor, locator) {
        super(idBasedEditor, locator);
        this.schema = idBasedEditor.schema;
    }
}
//# sourceMappingURL=sharedTreeEditBuilder.js.map