"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 core_utils_1 = require("@fluidframework/core-utils");
const tree_1 = require("../tree");
/**
 * 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) {
    (0, core_utils_1.assert)(forest.isEmpty, 0x747 /* forest must be empty */);
    const insert = { type: tree_1.Delta.MarkType.Insert, content };
    (0, tree_1.applyDelta)(new Map([[tree_1.rootFieldKey, [insert]]]), forest);
}
exports.initializeForest = initializeForest;
function isFieldLocation(range) {
    return typeof range === "object";
}
exports.isFieldLocation = isFieldLocation;
//# sourceMappingURL=editableForest.js.map