Skip to content

OutgoingLinkComponent

Unofficial

Main UI component that renders outgoing links and unlinked mentions for a file.

Import:

import type { OutgoingLinkComponent } from '@obsidian-typings/obsidian-public-latest';

Signature:

export interface OutgoingLinkComponent extends Component

Extends: Component

Constructor

new OutgoingLinkComponent()

Constructor.

To extract the constructor type, use ExtractConstructor<Component>.

Properties

PropertyTypeDescription
_childrenComponent[]Child Components attached to current component, will be unloaded on unloading parent component.
(Inherited from Component)
_eventsEventRef[]Events that are attached to the current component, will be detached on unloading parent component.
(Inherited from Component)
_loadedbooleanWhether the component and its children are loaded.
(Inherited from Component)
appAppReference to the app.
filenull | TFileThe file whose outgoing links are being shown.
linksCollapsedbooleanWhether the outgoing links section is collapsed.
linksCountElHTMLSpanElementElement displaying the count of outgoing links.
linksHeaderElHTMLDivElementHeader element for the outgoing links section.
outgoingFilenull | TFileFile for which outgoing links are currently displayed.
outgoingLinkInfinityScrollerInfinityScrollVirtual scroller rendering the outgoing links list.
showSearchbooleanWhether the search filter is shown.
tooltipPlacementstringPlacement direction for tooltips.
unlinkedCollapsedbooleanWhether the unlinked mentions section is collapsed.
unlinkedCountElHTMLSpanElementElement displaying the count of unlinked mentions.
unlinkedDomResultDomDOM tree rendering unlinked mention search results.
unlinkedFilenull | TFileFile for which unlinked mentions are currently displayed.
unlinkedHeaderElHTMLDivElementHeader element for the unlinked mentions section.

Methods

MethodReturnsDescription
addChild(component)TAdds a child component, loading it if this component is loaded.
(Inherited from Component)
load()voidLoad this component and its children.
(Inherited from Component)
onFileDeleted()voidHandle a file deletion event.
onFileResolved(file)voidHandle a metadata cache resolve event.
onload()voidLifecycle hook called when the component is loaded.
onResize()voidHandle the component being resized.
onunload()voidOverride this to unload your component
(Inherited from Component)
recomputeLinks()voidRecompute the outgoing links of the current file.
recomputeUnlinked()Promise<void>Recompute the unlinked mentions of the current file.
register(cb)voidRegisters a callback to be called when unloading.
(Inherited from Component)
registerDomEvent(el, type, callback, options?)voidRegisters a DOM event to be detached when unloading.
(Inherited from Component)
registerDomEvent(el, type, callback, options?)voidRegisters a DOM event to be detached when unloading.
(Inherited from Component)
registerDomEvent(el, type, callback, options?)voidRegisters a DOM event to be detached when unloading.
(Inherited from Component)
registerEvent(eventRef)voidRegisters an event to be detached when unloading.
(Inherited from Component)
registerInterval(id)numberRegisters an interval (from setInterval) to be cancelled when unloading. Use window.setInterval instead of setInterval to avoid TypeScript confusing between NodeJS vs Browser API
(Inherited from Component)
registerScopeEvent(keymapEventHandler)voidRegister a scope keymap event handler to be removed on unload.
(Inherited from Component)
removeChild(component)TRemoves a child component, unloading it.
(Inherited from Component)
requestUpdate()voidRequest a debounced OutgoingLinkComponent.update.
setLinksCollapsed(linksCollapsed, shouldAnimate)Promise<void>Set whether the outgoing links section is collapsed.
setSectionCollapsed(headerEl, dom, collapsed, shouldAnimate)Promise<void>Set the collapsed state of a specific section.
setUnlinkedCollapsed(unlinkedCollapsed, shouldAnimate)Promise<void>Set whether the unlinked mentions section is collapsed.
toggleLinksCollapsed()voidToggle the collapsed state of the outgoing links section.
toggleUnlinkedCollapsed()voidToggle the collapsed state of the unlinked mentions section.
unload()voidOverride this to unload your component.
(Inherited from Component)
update()voidRecompute whichever sections are stale for the current file.
updateHeaderTooltip(headerEl, collapsed)voidUpdate the tooltip text of a section header.

Links to this page: