Skip to content

ResultDomItemChild

Unofficial

Represents an individual match segment within a search result item.

Import:

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

Signature:

export interface ResultDomItemChild extends TreeNode

Extends: TreeNode

Properties

PropertyTypeDescription
cacheCachedMetadataCached metadata for the file containing this match.
contentstringText content of the matched region.
elHTMLElementThe element of the tree node.
(Inherited from TreeNode)
endnumberEnd offset of the match context within the document.
infoTreeNodeInfoLayout information used by virtual scrolling.
matchesContentPosition[]Array of match positions within the content.
mutateEStateunknownCallback to mutate the editor state when navigating to this match.
onMatchRenderunknownCallback for custom rendering of match highlights.
parentResultDomItemParent result item containing this match child.
parentDomResultDomItemReference to the parent result item.
showMoreAfterElHTMLElementElement for the "show more context after" button.
showMoreBeforeElHTMLElementElement for the "show more context before" button.
startnumberStart offset of the match context within the document.

Methods

MethodReturnsDescription
getNextPos(arg1)numberGet the position of the next match.
getPrevPos(arg1)numberGet the position of the previous match.
onFocusEnter(event?)voidHandle focus entering this match item.
onFocusExit(event?)voidHandle focus leaving this match item.
onResultClick(event)voidHandle click on this match to navigate to it.
render(hasTextBefore, hasTextAfter)voidRender this match with optional surrounding text indicators.
showMoreAfter()voidExpand the context to show more text after the match.
showMoreBefore()voidExpand the context to show more text before the match.
toggleShowMoreContextButtons()voidToggle visibility of the "show more context" buttons.

Links to this page: