How to get documentsHierarchy?
import documentsHierarchy from 'fontoxml-documents/src/documentsHierarchy.js'
The DocumentsHierarchy represents the relationships between the documents loaded in the DocumentsManager. It is a tree of DocumentsHierarchyNodes, each of which optionally references a document which can be loaded. The DocumentsHierarchy itself is the root of the tree and can not reference a document.
The top-level hierarchy nodes referencing the documents directly loaded in the editor
Notifier to use for signalling hierarchy changes. Note that this is not called by the hierarchy itself, but should be used by components that mutate the hierarchy. This way, mutations can be batched.
This notifier is debounced internally.
Append a child to this hierarchy node
Remove all children of the hierarchy
Traverses the documents hierarchy in depth-first order looking for a hierarchy node for which the given callback returns true.
Find all hierarchy nodes (in hierarchy order) for which the given callback returns true.
All Visible Hierarchy Nodes
Find all visible hierarchy nodes, in hierarchy order.
Next Visible Hierarchy Node
Find the visible hierarchy node following (or preceding) the given hierarchy node in hierarchy order.
Get the current DocumentsHierarchyNode with the given ID, or null if there is no node with that ID in the current hierarchy.
First Visible Hierarchy Node
Find the first visible hierarchy node.
Last Visible Hierarchy Node
Find the last visible hierarchy node.
Remove a child from this hierarchy node