import { Event } from '@opensumi/ide-utils';
import { ICompositeTreeNode } from '../../types';
import { CompositeTreeNode, TreeNode } from '../TreeNode';
import { ISerializableState, TreeStateManager, TreeStateWatcher } from './treeState';
export declare class TreeModel {
    private _state;
    private _root;
    private _ensureReady;
    private onChangeEmitter;
    get onChange(): Event<void>;
    get ensureReady(): Promise<boolean | void>;
    get root(): CompositeTreeNode;
    set root(root: CompositeTreeNode);
    get state(): TreeStateManager;
    set state(state: TreeStateManager);
    init(root: CompositeTreeNode): void;
    initState(root: ICompositeTreeNode): void;
    dispatchChange: () => void;
    /**
     * 根据给定的状态信息还原Tree组件
     *
     * TreeState中包含:
     *  - 可展开节点的展开状态
     *  - 滚动偏移
     *
     * TreeState中不包含:
     *  - 装饰器
     *  - 临时的输入框节点
     *
     */
    loadTreeState(state: ISerializableState | string): Promise<void>;
    /**
     * 返回一个与实际树状态同步的`TreeStateWatcher`
     *
     * TreeState中包含:
     *  - 可展开节点的展开状态
     *  - 滚动偏移
     *
     * TreeState中不包含:
     *  - 装饰器
     *  - 临时的输入框节点
     *
     * `TreeStateWatcher#onDidChange` 用于在状态变更时绑定监听函数
     *
     * `TreeStateWatcher#snapshot` 用于获取当前树的快照信息（用于状态恢复），返回state对象
     *
     * `TreeStateWatcher#toString` 用于将当前状态转换为JSON字符串
     */
    getTreeStateWatcher(atSurfaceExpandedDirsOnly?: boolean): TreeStateWatcher;
    protected resolveChildren(parent: CompositeTreeNode): Promise<TreeNode[]>;
}
//# sourceMappingURL=TreeModel.d.ts.map