"use strict";
/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.TreeConfiguration = exports.TreeViewConfiguration = void 0;
const defaultTreeConfigurationOptions = {
    enableSchemaValidation: false,
};
/**
 * Configuration for {@link ITree.viewWith}.
 * @sealed @public
 */
class TreeViewConfiguration {
    /**
     * @param props - Property bag of configuration options.
     */
    constructor(props) {
        const config = { ...defaultTreeConfigurationOptions, ...props };
        this.schema = config.schema;
        this.enableSchemaValidation = config.enableSchemaValidation;
    }
}
exports.TreeViewConfiguration = TreeViewConfiguration;
/**
 * Configuration for how to {@link ITree.schematize | schematize} a tree.
 * @sealed @public
 * @deprecated Please migrate to use {@link TreeViewConfiguration} with {@link ITree.viewWith} instead.
 */
class TreeConfiguration {
    /**
     * @param schema - The schema which the application wants to view the tree with.
     * @param initialTree - A function that returns the 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 `initialTree` returns any actual node instances, they should be recreated each time `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.
     * @param options - Additional options that can be specified when {@link ITree.schematize | schematizing } a tree.
     */
    constructor(schema, initialTree, options) {
        this.schema = schema;
        this.initialTree = initialTree;
        this.enableSchemaValidation =
            options?.enableSchemaValidation ??
                defaultTreeConfigurationOptions.enableSchemaValidation;
    }
}
exports.TreeConfiguration = TreeConfiguration;
//# sourceMappingURL=tree.js.map