Skip to content

ResultDom

Unofficial

Container for search result DOM elements, managing the display of file search results.

Import:

import type { ResultDom } from '@obsidian-typings/obsidian-catalyst-latest';

Signature:

export interface ResultDom

Properties

PropertyTypeDescription
appAppReference to the obsidian#App instance.
changedDebouncer<[], unknown>Debounced callback triggered when results change.
childrenElHTMLDivElementContainer element for child result items.
collapseAllbooleanWhether all result items are collapsed.
elHTMLDivElementRoot element of the result DOM.
emptyStateElHTMLDivElementElement displayed when there are no search results.
extraContextbooleanWhether extra surrounding context is shown around matches.
focusedItemnullCurrently focused result item, or null if none.
infinityScrollInfinityScrollVirtual scrolling component for rendering visible results.
infoTreeNodeInfoLayout information used by virtual scrolling.
pusherElHTMLDivElementSpacer element used to maintain correct scroll height.
resultDomLookupMap<TFile, ResultDomItem>Lookup map from file to its corresponding result DOM item.
showingEmptyStatebooleanWhether the empty state placeholder is currently displayed.
sortOrderstringCurrent sort order for search results.
vChildrenTreeNodeVChildren<ResultDomItem, ResultDom>Virtual children manager for result items.
workingbooleanWhether a search operation is currently in progress.

Methods

MethodReturnsDescription
addResult(file, result, content, shouldShowTitle?)ResultDomItemAdd a search result for a file to the result DOM.
changeFocusedItem(arg1)unknownChange which result item has focus.
emptyResults()unknownClear all search results from the DOM.
getFiles()unknownGet the list of files with search results.
getMatchCount()numberGet the total number of matches across all results.
getResult(arg1)unknownGet the result DOM item for a specific file.
onChange()unknownCallback invoked when the result set changes.
onResize()unknownHandle resize events and recalculate layout.
removeResult(arg1)unknownRemove a search result from the DOM.
setCollapseAll(arg1)unknownSet whether all result items should be collapsed.
setExtraContext(arg1)unknownSet whether extra context is shown around matches.
setFocusedItem(arg1)unknownSet the focused result item.
startLoader()unknownShow a loading indicator while search is in progress.
stopLoader()unknownHide the loading indicator when search completes.
toggle(arg1, arg2)Promise<unknown>Toggle the collapsed state of a result item.

Links to this page: