NavigationTree
The four navigation questions, answered locally over one listNodes response. Pure — no
network, no client — so a consumer can fetch the whole tree once and slice it, or fetch exactly
one selection and read that.
Helpers answer only from what the response actually contains, by design: ancestors() on an
include=children result is empty, not wrong. A tree is whatever was asked for, and inventing
nodes that weren’t returned would be worse than reporting none.
Properties
Section titled “Properties”anchor
Section titled “anchor”
readonlyanchor:NavigationNode|undefined
The node the query was anchored at, when it is part of the response.
localeSlot
Section titled “localeSlot”
readonlylocaleSlot:string
readonlynodes: readonlyNavigationNode[]
readonlyroots: readonlyNavigationNode[]
Nodes with no parent in this response — the site root for a full tree, the shallowest returned nodes for a partial one.
readonlysite:object
name:
string
rootNodeId
Section titled “rootNodeId”rootNodeId:
string
Methods
Section titled “Methods”ancestors()
Section titled “ancestors()”ancestors(
idOrPath):NavigationNode[]
Root-first, self excluded.
Parameters
Section titled “Parameters”idOrPath
Section titled “idOrPath”string
Returns
Section titled “Returns”children()
Section titled “children()”children(
idOrPath):NavigationNode[]
Parameters
Section titled “Parameters”idOrPath
Section titled “idOrPath”string
Returns
Section titled “Returns”find()
Section titled “find()”find(
idOrPath):NavigationNode|undefined
By node id or by path — the two spellings from itself accepts.
Parameters
Section titled “Parameters”idOrPath
Section titled “idOrPath”string
Returns
Section titled “Returns”NavigationNode | undefined
siblings()
Section titled “siblings()”siblings(
idOrPath,options?):NavigationNode[]
Every returned node sharing the same parent, in authored order, the node itself included.
With adjacent, exactly [previous, next] — either may be undefined at an edge.
Parameters
Section titled “Parameters”idOrPath
Section titled “idOrPath”string
options?
Section titled “options?”adjacent?
Section titled “adjacent?”boolean