import MiniSearch, { Query, Options, SearchOptions, SearchResult, Suggestion } from 'minisearch'; import React, { PropsWithChildren } from 'react'; export interface UseMiniSearch { search: (query: Query, options?: SearchOptions) => void; searchResults: T[] | null; rawResults: SearchResult[] | null; autoSuggest: (query: string, options?: SearchOptions) => void; suggestions: Suggestion[] | null; add: (document: T) => void; addAll: (documents: readonly T[]) => void; addAllAsync: (documents: readonly T[], options?: { chunkSize?: number; }) => Promise; getById: (id: any) => T | null; remove: (document: T) => void; removeById: (id: any) => void; removeAll: (documents?: readonly T[]) => void; discard: (id: any) => void; discardAll: (ids: readonly any[]) => void; replace: (document: T) => void; isIndexing: boolean; clearSearch: () => void; clearSuggestions: () => void; miniSearch: MiniSearch; } export declare function useMiniSearch(documents: readonly T[], options: Options): UseMiniSearch; export declare function withMiniSearch(documents: T[], options: Options, Component: React.ComponentType>): React.FC; export interface WithMiniSearchProps { documents: T[]; options: Options; children: (props: UseMiniSearch) => JSX.Element | null; } export declare const WithMiniSearch: ({ documents, options, children }: React.PropsWithChildren>) => JSX.Element;