"use strict";
/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.WrapperTreeView = exports.TreeConfiguration = void 0;
const util_1 = require("../util");
const simple_tree_1 = require("../simple-tree");
/**
 * @beta
 */
class TreeConfiguration {
    /**
     * @param schema - The schema which the application wants to view the tree with.
     * @param initialTree - Default tree content to initialize the tree with iff the tree is uninitialized
     * (meaning it does not even have any schema set at all).
     * If the `initialTree` returns any actual node instances, they should be recreated each time the `initialTree` runs.
     * This is because if the config is used a second time any nodes that were not recreated could error since nodes cannot be inserted into the tree multiple times.
     */
    constructor(schema, initialTree) {
        this.schema = schema;
        this.initialTree = initialTree;
    }
}
exports.TreeConfiguration = TreeConfiguration;
/**
 * Implementation of TreeView wrapping a FlexTreeView.
 */
class WrapperTreeView {
    constructor(view) {
        this.view = view;
    }
    [util_1.disposeSymbol]() {
        this.view[util_1.disposeSymbol]();
    }
    get events() {
        return this.view.checkout.events;
    }
    get root() {
        return (0, simple_tree_1.getProxyForField)(this.view.editableTree);
    }
}
exports.WrapperTreeView = WrapperTreeView;
//# sourceMappingURL=tree.js.map