aspen-tree-model
Version:
State container for aspen trees
27 lines (26 loc) • 868 B
TypeScript
export interface ISerializableState {
/**
* Future proofing
*
* Lib consumers are likely to store the `ISerilizableState` somewhere to let users resume where they left of last time. But that "last time" could be years!!
* Given that, should things move around in internal/external API/behaviour (like path resolution, encoding method etc.) this will allow us to provide backwards compatibilty.
*/
specVersion: number;
scrollPosition: number;
expandedDirectories: {
atSurface: string[];
buried: string[];
};
}
export declare enum TreeStateEvent {
DidChangeScrollOffset = 1,
DidChangeDirExpansionState = 2,
DidChangeRelativePath = 3,
DidChange = 4,
DidLoadState = 5
}
export declare enum TreeStateWatcherChangeType {
ScrollOffset = 1,
DirExpansionState = 2,
PathsUpdated = 3
}