fix: flexsearch types

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2023-07-02 17:27:51 +02:00
parent f4b54ca5a4
commit c94db0c1ff
2 changed files with 5 additions and 5 deletions

View file

@ -12,7 +12,7 @@ import { UiIcon } from '../../../common/icons/ui-icon'
import type { CheatsheetSingleEntry, CheatsheetExtension } from '../../cheatsheet/cheatsheet-extension'
import { hasCheatsheetTopics } from '../../cheatsheet/cheatsheet-extension'
import styles from './cheatsheet.module.scss'
import type { IndexOptionsForDocumentSearch } from 'flexsearch-ts'
import type { IndexOptionsForDocumentSearch, StoreOption } from 'flexsearch-ts'
import React, { useCallback, useEffect, useMemo, useState } from 'react'
import { FormControl, InputGroup } from 'react-bootstrap'
import { X } from 'react-bootstrap-icons'
@ -24,7 +24,7 @@ interface CheatsheetSearchIndexEntry extends SearchIndexEntry {
example: string
}
const searchOptions: IndexOptionsForDocumentSearch<CheatsheetSearchIndexEntry> = {
const searchOptions: IndexOptionsForDocumentSearch<CheatsheetSearchIndexEntry, StoreOption> = {
document: {
id: 'id',
field: ['title', 'description', 'example']