SearchMatcher
Unofficial
A node of a compiled search query’s matcher tree.
This is the abstract base every concrete matcher extends (text, regex, property, boolean, file:, tag: and the other operators, and the AND / OR / negation operators). SearchMatcher.getInfo, SearchMatcher.match and SearchMatcher.requiredInputs are implemented by every concrete matcher; the base class declares the token bookkeeping.
Import:
import type { SearchMatcher } from '@obsidian-typings/obsidian-catalyst-latest';Signature:
export interface SearchMatcherProperties
| Property | Type | Description | |
|---|---|---|---|
| matchedTokens | unknown[] | The query tokens this matcher consumed while the query was parsed. |
Methods
| Method | Returns | Description | |
|---|---|---|---|
| eatToken(state) | void | Consumes the parser's current token, recording it in SearchMatcher.matchedTokens. | |
| getContext(offset) | null | SearchMatcherTokenContext | Finds the matcher that owns the query token at a cursor offset. | |
| getInfo() | string | Describes this matcher, as shown by the search view's "Explain search term". | |
| match(context) | null | SearchMatchResult | undefined | Matches this node against a context. | |
| requiredInputs() | SearchRequiredInputs | The inputs this matcher needs to evaluate a file. |
Links to this page: