"use strict";
/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.isFieldLocation = exports.initializeForest = void 0;
const internal_1 = require("@fluidframework/core-utils/internal");
const index_js_1 = require("../tree/index.js");
/**
 * Sets the contents of the forest via delta.
 * Requires the fores starts empty.
 *
 * @remarks
 * This does not perform an edit: it updates the forest content as if there was an edit that did that.
 */
function initializeForest(forest, content, revisionTagCodec) {
    (0, internal_1.assert)(forest.isEmpty, 0x747 /* forest must be empty */);
    const delta = (0, index_js_1.deltaForRootInitialization)(content);
    (0, index_js_1.applyDelta)(delta, forest, (0, index_js_1.makeDetachedFieldIndex)("init", revisionTagCodec));
}
exports.initializeForest = initializeForest;
function isFieldLocation(range) {
    return typeof range === "object";
}
exports.isFieldLocation = isFieldLocation;
//# sourceMappingURL=editableForest.js.map