useVirtualTree
Reads the filesystem tree and its mutation actions.
import { useVirtualTree } from 'filedom';
const { tree, isLoading, error, refresh } = useVirtualTree();
Call it inside a VirtualTreeProvider; outside one it throws. The actions change real files.
Returns
tree: VirtualDesktop | null,isLoading: boolean,error: Error | null.refresh(): Promise<void>.renameItem(id, newName): Promise<void>.deleteItem(id): Promise<void>.addItem(parentId, name, type): Promise<void>; type isfileorfolder, and null parent means the root.