Skip to content

FileEntry

Defined in: src/widgets/data/file-tree.ts:13

A plain directory-listing entry — however the caller obtained it (fs, Bun’s Glob, a remote API, a mock for tests). ztui’s widgets stay I/O-free by design, so nothing here reads the filesystem: buildFileTree only shapes data the caller already has into TreeNodes for <Tree>. For a directory whose children haven’t been loaded yet (lazy loading), omit children and set hasChildren: true; <Tree>’s onToggle fires on expand, so the caller can fetch and merge the real children in then.

optional children?: FileEntry[]

Defined in: src/widgets/data/file-tree.ts:19

Loaded children (recurse); omit for an unloaded/lazy directory.


optional hasChildren?: boolean

Defined in: src/widgets/data/file-tree.ts:21

Force expandable even without loaded children (lazy directories).


isDirectory: boolean

Defined in: src/widgets/data/file-tree.ts:17

Whether this entry is a directory.


name: string

Defined in: src/widgets/data/file-tree.ts:15

Bare file/directory name, e.g. “package.json” or “src”.