Name of property where child nodes are stored (default value is children
)
Name of unique identifier property in nodes (default value is id
)
Name of parent identifier property in nodes (default value is parentId
)
Method to add new node to tree (mutable operation!)
tree structure for node adding
identifier of parent node, null if new node should be on root level
data of new node
Method to delete node in tree by given id (mutable operation!)
tree structure for node deleting
identifier of node to delete
Method to update node by id with given data in tree (mutable operation!)
tree structure for node editing
identifier of node to be updated
new data of node (you should also pass children if you want to keep it)
Method to find all children nodes of given node in tree structure
tree structure to search in
identifier of node
all found children nodes
Method to find all parents of given node in tree structure
tree structure to search in
identifier of node
all found parent nodes
Method to find all nodes in tree structure by given callback function
tree structure to search in
callback function to find all nodes
all found nodes
Method to find parent of given node in tree structure
tree structure to search in
identifier of node
parent node, if we found something (for recursion only)
found parent node
Method to find node in tree structure by given callback function
tree structure to search in
callback function to find node
found node
Method to find node in tree structure by given id
tree structure to search in
identifier of node
found node
Helper method to recursively get all children nodes of given node in tree structure
we want to get all of its children
all found children nodes
Convert list to tree like structure
list of objects, objects need to have id (as you configured, or 'id' by default) and parentId property (as you configured, or 'parentId' by default)
id of parent node
Convert tree like structure to list
tree of objects, objects need to have children (as you configured, or 'children' by default) and parentId property (as you configured, or 'parentId' by default)
Helper method to deep clone object
object to be cloned
deep cloned object
Generated using TypeDoc
Class to transform and manipulate tree like structures