Skip to content

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.

readonly anchor: NavigationNode | undefined

The node the query was anchored at, when it is part of the response.


readonly localeSlot: string


readonly nodes: readonly NavigationNode[]


readonly roots: readonly NavigationNode[]

Nodes with no parent in this response — the site root for a full tree, the shallowest returned nodes for a partial one.


readonly site: object

name: string

rootNodeId: string

ancestors(idOrPath): NavigationNode[]

Root-first, self excluded.

string

NavigationNode[]


children(idOrPath): NavigationNode[]

string

NavigationNode[]


find(idOrPath): NavigationNode | undefined

By node id or by path — the two spellings from itself accepts.

string

NavigationNode | undefined


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.

string

boolean

NavigationNode[]