#102 - Added url scheme + small refactor for public api

This commit is contained in:
Simon Cambier
2022-11-09 22:48:50 +01:00
parent 6be174eeb9
commit c91a958782
7 changed files with 76 additions and 287 deletions

View File

@@ -1,4 +1,4 @@
import type { ResultNote, SearchMatch } from '../globals'
import type { ResultNote } from '../globals'
import { Query } from '../search/query'
import { SearchEngine } from '../search/search-engine'
@@ -7,7 +7,12 @@ type ResultNoteApi = {
path: string
basename: string
foundWords: string[]
matches: SearchMatch[]
matches: SearchMatchApi[]
}
export type SearchMatchApi = {
match: string
offset: number
}
function mapResults(results: ResultNote[]): ResultNoteApi[] {