import { SearchIndex } from "algoliasearch" ; see performAlgoliaTextSearch category export type FirestoreTextSearchController = ( props : { path : string ; searchString : string ; } ) => Promise < readonly string [ ] > | undefined ; param index param query category export function performAlgoliaTextSearch ( index , query ) { console . log ( "Performing Algolia query" , index , query ) ; return index . search ( query ) . then ( ( { hits } ) => { return hits . map ( ( hit ) => hit . objectID as string ) ; } ) . catch ( ( err ) => { console . log ( err ) ; return [ ] ; } ) ; }