ui/client/features/pages-editor/hooks/useReferenceTrail
Cockpit client (features), v0.8. Source: ui/client/features/pages-editor/hooks/useReferenceTrail.tsx.
Type Aliases#
RootLoader#
RootLoader = (
feature,file) =>Promise<NavView>
Defined in: ui/client/features/pages-editor/hooks/useReferenceTrail.tsx:16
Reads the first view of a trail: a page of the editor (the default), or a file the Flow view drew.
Parameters#
feature
string
file
string
Returns#
Promise<NavView>
Functions#
useReferenceTrail()#
useReferenceTrail(
feature,file,contentHash,loadRoot?):object
Defined in: ui/client/features/pages-editor/hooks/useReferenceTrail.tsx:54
Click-to-navigate for the Pages editor: the open page is the first step of a trail; following a resolved reference opens its file as the next step; Alt+Left / Alt+Right walk the trail. References are resolved by the server once per file render, so every reference this hands out either has a target or is never offered as a link.
Parameters#
feature
string
file
string
contentHash
string
loadRoot?
RootLoader = getNavPage
Returns#
object
back
back: () =>
void
Returns
void
current
current:
TrailStep|null=step
error
error:
string|null=state.error
follow
follow: (
ref) =>void
Parameters
ref
Returns
void
forward
forward: () =>
void
Returns
void
hopError
hopError:
string|null=state.hopError
index
index:
number=trail.index
items
items:
TrailItem[]
loading
loading:
boolean=state.loading
select
select: (
index) =>void
Parameters
index
number
Returns
void
steps
steps:
TrailStep[] =trail.steps
unlinked
unlinked:
object[]