/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { FieldKey } from "../core";
import { TreeFieldSchema, TreeSchema, FlexTreeTypedField, FlexTreeContext, NodeKeyManager, Context } from "../feature-libraries";
import { IDisposable, disposeSymbol } from "../util";
import { ITreeCheckoutFork, ITreeCheckout } from "./treeCheckout";
/**
 * An editable view of a (version control style) branch of a shared tree.
 * @privateRemarks
 * TODO:
 * 1. Once ISharedTreeView is renamed this can become ISharedTreeView.
 * 2. This object should be combined with or accessible from the TreeContext to allow easy access to thinks like branching.
 * @alpha
 */
export interface FlexTreeView<in out TRoot extends TreeFieldSchema> extends IDisposable {
    /**
     * Context for controlling the EditableTree nodes produced from {@link FlexTreeView.editableTree}.
     *
     * @remarks
     * This is an owning reference: disposing of this view disposes its context.
     */
    readonly context: FlexTreeContext;
    /**
     * Access non-view schema specific aspects of of this branch.
     *
     * @remarks
     * This is a non-owning reference: disposing of this view does not impact the branch.
     */
    readonly checkout: ITreeCheckout;
    /**
     * Get a typed view of the tree content using the editable-tree-2 API.
     */
    readonly editableTree: FlexTreeTypedField<TRoot>;
    /**
     * Spawn a new view which is based off of the current state of this view.
     * Any mutations of the new view will not apply to this view until the new view is merged back into this view via `merge()`.
     */
    fork(): ITreeViewFork<TRoot>;
}
/**
 * Branch (like in a version control system) of SharedTree.
 *
 * {@link FlexTreeView} that has forked off of the main trunk/branch.
 * @alpha
 */
export interface ITreeViewFork<in out TRoot extends TreeFieldSchema> extends FlexTreeView<TRoot> {
    readonly checkout: ITreeCheckoutFork;
}
/**
 * Implementation of FlexTreeView wrapping a ITreeCheckout.
 */
export declare class CheckoutFlexTreeView<in out TRoot extends TreeFieldSchema, out TCheckout extends ITreeCheckout = ITreeCheckout> implements FlexTreeView<TRoot> {
    readonly checkout: TCheckout;
    readonly schema: TreeSchema<TRoot>;
    readonly nodeKeyManager: NodeKeyManager;
    readonly nodeKeyFieldKey: FieldKey;
    private readonly onDispose?;
    readonly context: Context;
    readonly editableTree: FlexTreeTypedField<TRoot>;
    constructor(checkout: TCheckout, schema: TreeSchema<TRoot>, nodeKeyManager: NodeKeyManager, nodeKeyFieldKey: FieldKey, onDispose?: (() => void) | undefined);
    [disposeSymbol](): void;
    fork(): CheckoutFlexTreeView<TRoot, ITreeCheckoutFork>;
}
//# sourceMappingURL=treeView.d.ts.map