import { SuggestionsRequest } from '@empathyco/x-adapter' ; import { HistoryQuery , Suggestion } from '@empathyco/x-types' ; import { XActionContext , XStoreModule } from '../../../store' ; import { StatusMutations , StatusState } from '../../../store/utils/status-store.utils' ; import { PopularSearchesConfig } from '../config.types' ; import { Dictionary } from '../../../utils/types' ; public export interface PopularSearchesState extends StatusState { /** The suggestions list. These suggestions represent the most searched queries. */ popularSearches : Suggestion [ ] ; /** The popular searches module configuration. */ config : PopularSearchesConfig ; /** The list of the searched queries, related to the `query` property of the state. */ searchedQueries : HistoryQuery [ ] ; /** The extra params property of the state. */ params : Dictionary < unknown > ; } public export interface PopularSearchesGetters { /** The request object to retrieve popular searches. */ request : SuggestionsRequest ; /** List of the Popular Searches. */ popularSearches : Suggestion [ ] ; } public export interface PopularSearchesMutations extends StatusMutations { param suggestions setSuggestions ( suggestions ) : void ; param searchedQueries setSearchedQueries ( searchedQueries ) : void ; param params setParams ( params ) : void ; } public export interface PopularSearchesActions { /**
     * Cancels / interrupt  PopularSearchesActions . fetchAndSaveSuggestions synchronous promise.
      cancelFetchAndSaveSuggestions ( ) : void ; returns fetchSuggestions ( request ) : Suggestion [ ] ; /**
     * Fetches a new set of suggestions and stores them in the module state.
     */ fetchAndSaveSuggestions ( request ) : void ; } public export type PopularSearchesXStoreModule = XStoreModule < PopularSearchesState , PopularSearchesGetters , PopularSearchesMutations , PopularSearchesActions > ; /**
 * Alias type for actions context of the  PopularSearchesXStoreModule .
 *
 *  public export type PopularSearchesActionContext = XActionContext < PopularSearchesState , PopularSearchesGetters , PopularSearchesMutations , PopularSearchesActions > ;