Skip to content

Interface: NVEFileTreeNode

Represents a node in the NVEFileTree hierarchy.

This class is not meant to be constructed directly. Instead, access instances via the NVEFileTree.tree getter, which provides the root nodes for the file tree structure.

Each node wraps a file or directory entry (real or virtual) and provides access to its children, selection state, and folding/collapsing state for use in UI components or programmatic traversal.

Remarks

  • Use NVEFileTree.tree to obtain root nodes.
  • The dirent property provides the underlying file or directory entry.
  • The children property provides child nodes if the entry is a directory.
  • The folded, collapsable, and selected properties manage UI state for tree views.

Example

ts
const fs = new NVEFileSystem();
const tree = fs.asTree;
const rootNodes = tree.tree;
rootNodes.forEach((node) => {
  console.log(node.dirent.name);
  if (node.children) {
    node.children.forEach((child) => console.log(child.dirent.name));
  }
});

Accessors

children

Get Signature

ts
get children(): NVEFileTreeNode[] | undefined;

The child nodes of this directory, if any. Returns undefined if not a directory.

Returns

NVEFileTreeNode[] | undefined


collapsable

Get Signature

ts
get collapsable(): boolean;

Whether this node is collapsable (i.e., a directory with 1 or fewer children).

Returns

boolean


depth

Get Signature

ts
get depth(): number;

The depth of this node in the file tree hierarchy.

The root node has a depth of 0, its children have a depth of 1, and so on.

Returns

number


dirent

Get Signature

ts
get dirent(): NVEDirent | NVEVirtualDirent;

The underlying file or directory entry for this node.

Returns

NVEDirent | NVEVirtualDirent


folded

Get Signature

ts
get folded(): boolean;

Whether this node is currently folded (collapsed) in the UI.

Returns

boolean

Set Signature

ts
set folded(value: boolean): void;
Parameters
ParameterType
valueboolean
Returns

void


selected

Get Signature

ts
get selected(): boolean;

Whether this node is currently selected in the UI.

Returns

boolean

Set Signature

ts
set selected(value: boolean): void;
Parameters
ParameterType
valueboolean
Returns

void

Methods

deselect()

ts
deselect(): void;

Returns

void


fold()

ts
fold(): void;

Returns

void


select()

ts
select(): void;

Returns

void


toggleFold()

ts
toggleFold(): void;

Returns

void


toggleSelect()

ts
toggleSelect(): void;

Returns

void


unfold()

ts
unfold(): void;

Returns

void