"use strict";
/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.TreeBeta = void 0;
const index_js_1 = require("../core/index.js");
const treeNodeApi_js_1 = require("./treeNodeApi.js");
const create_js_1 = require("./create.js");
/**
 * Extensions to {@link Tree} which are not yet stable.
 * @sealed @beta
 */
exports.TreeBeta = {
    on(node, eventName, listener) {
        return treeNodeApi_js_1.treeNodeApi.on(node, eventName, listener);
    },
    clone(node) {
        /** The only non-TreeNode cases are {@link TreeLeafValue} and `undefined` (for an empty optional field) which can be returned as is. */
        if (!(0, index_js_1.isTreeNode)(node)) {
            return node;
        }
        const kernel = (0, index_js_1.getKernel)(node);
        const cursor = kernel.getOrCreateInnerNode().borrowCursor();
        return (0, create_js_1.createFromCursor)(kernel.schema, cursor);
    },
};
//# sourceMappingURL=treeApiBeta.js.map