/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { SharedTree } from "./sharedTree";
/**
 * A channel factory that creates a {@link TreeField}.
 * @alpha
 */
export class TypedTreeFactory {
    constructor(options) {
        this.options = options;
        this.type = `https://graph.microsoft.com/types/tree/${options.subtype}`;
        this.attributes = {
            type: this.type,
            snapshotFormatVersion: "0.0.0",
            packageVersion: "0.0.0",
        };
    }
    async load(runtime, id, services, channelAttributes) {
        const tree = new SharedTree(id, runtime, channelAttributes, this.options, "SharedTree");
        await tree.load(services);
        return tree;
    }
    create(runtime, id) {
        const tree = new SharedTree(id, runtime, this.attributes, this.options, "SharedTree");
        tree.initializeLocal();
        return tree;
    }
}
//# sourceMappingURL=typedTree.js.map