/** * @file * * Mock of Obsidian's `prepareSimpleSearch`. */ import type { SearchResult as SearchResultOriginal } from 'obsidian'; /** * Builds a simple search callback for a query, as Obsidian does. The query is lowercased and split on spaces; every * non-empty word must occur in the text, case-insensitively, or the search fails. Every occurrence of every word is * a match, and overlapping or touching matches are merged. * * @param query - The search query. * @returns A callback that searches a text, returning the merged match ranges, sorted by start, and a score that * prefers fewer, tighter and earlier matches in shorter texts, or `null` when a word is missing. */ export declare function prepareSimpleSearch(query: string): (text: string) => null | SearchResultOriginal;