/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { assert } from "@fluidframework/core-utils/internal";
import { applyDelta, deltaForRootInitialization, makeDetachedFieldIndex, } from "../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.
 */
export function initializeForest(forest, content, revisionTagCodec, idCompressor) {
    assert(forest.isEmpty, 0x747 /* forest must be empty */);
    const delta = deltaForRootInitialization(content);
    applyDelta(delta, forest, makeDetachedFieldIndex("init", revisionTagCodec, idCompressor));
}
export function isFieldLocation(range) {
    return typeof range === "object";
}
//# sourceMappingURL=editableForest.js.map