Skip to content

Interface: NVEFileTree

Represents a reactive file tree structure for the NVEFileSystem.

This class is not meant to be constructed directly. Instead, access an instance via the NVEFileSystem.asTree getter. The file tree provides both a flat and hierarchical (tree) view of all files and directories in the file system, including virtual directories.

The tree automatically updates in response to changes in the file system.

Remarks

  • Use NVEFileSystem.asTree to obtain an instance.
  • The flat property provides a flat map of all dirents and virtual directories.
  • The tree property provides a hierarchical array of root nodes for rendering or traversal.

Example

ts
const fs = new NVEFileSystem();
const tree = fs.asTree;
console.log(tree.flat); // Flat map of all dirents
console.log(tree.tree); // Hierarchical tree structure

Accessors

flat

Get Signature

ts
get flat(): Record<string, NVEDirent | NVEVirtualDirent>;

Returns a flat map of all file and directory entries (including virtual directories).

The keys are full paths, and the values are NVEDirent or NVEVirtualDirent instances.

Returns

Record<string, NVEDirent | NVEVirtualDirent>

A record mapping full paths to dirent or virtual dirent instances.


tree

Get Signature

ts
get tree(): NVEFileTreeNode[];

Returns the file system as a hierarchical tree of NVEFileTreeNode root nodes.

Each node represents a file or directory (real or virtual). The tree is suitable for rendering in UI components or for programmatic traversal.

Returns

NVEFileTreeNode[]

An array of root NVEFileTreeNode instances.