Skip to content

ResultDomItem

Unofficial

Represents a single file’s search result in the result DOM tree.

Import:

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

Signature:

export interface ResultDomItem extends TreeNode

Extends: TreeNode

Properties

PropertyTypeDescription
appAppReference to the obsidian#App instance.
childrenElHTMLDivElementContainer element for child match items.
collapsedbooleanWhether this result item is currently collapsed.
collapseElHTMLDivElementElement for the collapse/expand toggle.
collapsiblebooleanWhether this result item can be collapsed.
containerElHTMLDivElementOuter container element for this result item.
contentstringText content of the file associated with this result.
elHTMLElementThe element of the tree node.
(Inherited from TreeNode)
extraContextbooleanWhether extra surrounding context is shown around matches.
fileTFileThe file associated with this search result.
infoTreeNodeInfoLayout information used by virtual scrolling.
onMatchRendernullCallback for custom match rendering, or null if not set.
parentResultDomParent result DOM container.
parentDomResultDomReference to the parent result DOM container.
pusherElHTMLDivElementSpacer element used to maintain correct scroll height.
resultResultDomResultSearch result data containing match positions.
separateMatchesbooleanWhether matches are displayed as separate items.
showTitlebooleanWhether the file title is shown above matches.
vChildrenTreeNodeVChildren<ResultDomItem, ResultDomItemChild>Virtual children manager for match child items.

Methods

MethodReturnsDescription
getMatchExtraPositions(arg1, arg2, arg3)unknownGet additional context positions surrounding a match.
invalidate()unknownMark this result item as needing re-render.
onCollapseClick(arg1)unknownHandle click on the collapse toggle.
onResultClick(arg1)unknownHandle click on a search result to navigate to it.
onResultContextMenu(arg1)unknownHandle right-click context menu on a search result.
onResultMouseover(arg1, arg2, arg3)unknownHandle mouseover on a search result for preview.
renderContentMatches()voidRender the content matches for this result item.
setCollapse(arg1, arg2)Promise<unknown>Set the collapsed state of this result item.
setCollapsible(arg1)unknownSet whether this result item can be collapsed.
setExtraContext(arg1)unknownSet whether extra context is shown around matches.

Links to this page: