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-public-latest';

Signature:

export interface ResultDom

Properties

Property Type Description
app App Reference to the obsidian#App instance.
changed Debouncer<[], unknown> Debounced callback triggered when results change.
childrenEl HTMLDivElement Container element for child result items.
collapseAll boolean Whether all result items are collapsed.
el HTMLDivElement Root element of the result DOM.
emptyStateEl HTMLDivElement Element displayed when there are no search results.
extraContext boolean Whether extra surrounding context is shown around matches.
focusedItem null Currently focused result item, or null if none.
infinityScroll InfinityScroll Virtual scrolling component for rendering visible results.
info TreeNodeInfo Layout information used by virtual scrolling.
pusherEl HTMLDivElement Spacer element used to maintain correct scroll height.
resultDomLookup Map<TFile, ResultDomItem> Lookup map from file to its corresponding result DOM item.
showingEmptyState boolean Whether the empty state placeholder is currently displayed.
sortOrder string Current sort order for search results.
vChildren TreeNodeVChildren<ResultDomItem, ResultDom> Virtual children manager for result items.
working boolean Whether a search operation is currently in progress.

Methods

Method Returns Description
addResult(file, result, content, shouldShowTitle?) ResultDomItem Add a search result for a file to the result DOM.
changeFocusedItem(arg1) unknown Change which result item has focus.
emptyResults() unknown Clear all search results from the DOM.
getFiles() unknown Get the list of files with search results.
getMatchCount() number Get the total number of matches across all results.
getResult(arg1) unknown Get the result DOM item for a specific file.
onChange() unknown Callback invoked when the result set changes.
onResize() unknown Handle resize events and recalculate layout.
removeResult(arg1) unknown Remove a search result from the DOM.
setCollapseAll(arg1) unknown Set whether all result items should be collapsed.
setExtraContext(arg1) unknown Set whether extra context is shown around matches.
setFocusedItem(arg1) unknown Set the focused result item.
startLoader() unknown Show a loading indicator while search is in progress.
stopLoader() unknown Hide the loading indicator when search completes.
toggle(arg1, arg2) Promise<unknown> Toggle the collapsed state of a result item.

Links to this page: