Skip to content

SearchPropertyMatcher

Unofficial

The matcher of the [key] and [key: value] property operators.

Import:

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

Signature:

export interface SearchPropertyMatcher extends SearchMatcher

Extends: SearchMatcher

Constructor

new SearchPropertyMatcher(key: SearchMatcher, value: SearchMatcher | null)

Constructor.

Properties

PropertyTypeDescription
keySearchMatcherThe matcher the property name is matched with.
matchedTokensunknown[]The query tokens this matcher consumed while the query was parsed.
(Inherited from SearchMatcher)
valuenull | SearchMatcherThe matcher each property value is matched with, or null for a bare [key] query.

Methods

MethodReturnsDescription
eatToken(state)voidConsumes the parser's current token, recording it in SearchMatcher.matchedTokens.
(Inherited from SearchMatcher)
getContext(offset)null | SearchMatcherTokenContextFinds the matcher that owns the query token at a cursor offset.
(Inherited from SearchMatcher)
getInfo()stringDescribes this matcher, as shown by the search view's "Explain search term".
(Inherited from SearchMatcher)
match(context)null | SearchMatchResult | undefinedMatches the context's top-level frontmatter properties.

Every property whose name SearchPropertyMatcher.key matches is reported. With a SearchPropertyMatcher.value, each scalar value, or each item of an array value, is matched against it through SearchMatchContext.cloneForPropertyContent.
requiredInputs()SearchRequiredInputsThe inputs this matcher needs to evaluate a file.
(Inherited from SearchMatcher)