Core datasource contract for tree-view.
Implementations provide the root nodes and child resolution, following the same philosophy as IDatasource<T> for flat data but adapted for hierarchical data.
IDatasource<T>
The data payload type.
Returns the children of the given node.
The default implementation reads node.children. Override this method to support lazy-loading children from a remote source.
node.children
The parent node whose children are requested.
Returns the root-level nodes of the tree.
May return synchronously or as a Promise for lazy-loaded trees.
Promise
Returns true if the node has children (or might have children that can be lazy-loaded).
true
The default implementation checks node.children?.length > 0.
node.children?.length > 0
Core datasource contract for tree-view.
Implementations provide the root nodes and child resolution, following the same philosophy as
IDatasource<T>for flat data but adapted for hierarchical data.