import { Event } from '@opensumi/ide-utils';
import { ITreeNodeOrCompositeTreeNode } from '../../../types';
import { CompositeTreeNode } from '../../TreeNode';
import { ISerializableState } from './types';
export declare enum Operation {
    SetExpanded = 1,
    SetCollapsed = 2,
    SetActive = 3
}
export interface IPathChange {
    prevPath: string;
    newPath: string;
}
export interface IExpansionStateChange {
    relativePath: string;
    isExpanded: boolean;
    isVisibleAtSurface: boolean;
}
export declare class TreeStateManager {
    private root;
    private expandedDirectories;
    private _scrollOffset;
    private stashing;
    private stashKeyframes;
    private stashLockingItems;
    private onDidLoadStateEmitter;
    private onChangeScrollOffsetEmitter;
    private onDidChangeExpansionStateEmitter;
    private onDidChangeRelativePathEmitter;
    constructor(root: CompositeTreeNode);
    get scrollOffset(): number;
    saveScrollOffset(scrollOffset: number): void;
    get onDidLoadState(): Event<void>;
    get onChangeScrollOffset(): Event<number>;
    get onDidChangeExpansionState(): Event<IExpansionStateChange>;
    get onDidChangeRelativePath(): Event<IPathChange>;
    loadTreeState(state: ISerializableState): Promise<void>;
    /**
     * 确保在调用`reverseStash`时，目录扩展不会被更改，以免导致节点内文件被排除
     */
    excludeFromStash(file: ITreeNodeOrCompositeTreeNode): void;
    /**
     * 处理展开状态的变更
     * @private
     * @memberof TreeStateManager
     */
    private handleExpansionChange;
    private handleDidChangePath;
    /**
     * 开始记录点
     */
    beginStashing(): void;
    /**
     * 结束记录点
     */
    endStashing(): void;
    /**
     * 反转记录的所有折叠/展开状态
     * 用于实现一些临时的查看操作
     * 例如：
     * 调用beginStashing ==> 展开/折叠某个目录 ==> 调用endStashing ==> 处理完毕后调用reverseStash，回到原来的状态
     */
    reverseStash(): Promise<void>;
}
//# sourceMappingURL=TreeStateManager.d.ts.map