import { HistoryQuery } from '@empathyco/x-types' ; import { XActionContext , XStoreModule } from '../../../store' ; import { UrlParams } from '../../../types/url-params' ; import { HistoryQueriesConfig } from '../config.types' ; public export interface HistoryQueriesState { /**
     * Configuration for the `HistoryQueries` module.
     */ config : HistoryQueriesConfig ; /**
     * Timestamp that indicates when the current search session has started.
     */ sessionTimeStampInMs : number ; /**
     * The full list of queries made by the user. This list is persisted along different
     * search sessions.
     */ historyQueries : HistoryQuery [ ] ; /**
     * The current query for searching into the  HistoryQueriesState . historyQueries .
      query : string ; } public export interface HistoryQueriesGetters { /**
     * A sub-set of the  HistoryQueriesState . historyQueries . If the
     *  HistoryQueriesState . query property is not empty, this list will only contain
     * suggestions whose query matches with it.
      historyQueries : HistoryQuery [ ] ; /** The normalized module's query. */ normalizedQuery : string ; /**
     * A list of the queries that have been made in the last period of time specified by
     *  HistoryQueriesConfig . sessionTTLInMs .
      sessionHistoryQueries : HistoryQuery [ ] ; /**
     * The key for saving the  HistoryQueriesState . historyQueries in the browser storage.
      storageKey : string ; } public export interface HistoryQueriesMutations { /**
     * Sets the  HistoryQueriesState . historyQueries property.
     *
     *  param historyQueries - The new  HistoryQueriesState . historyQueries .
      setHistoryQueries ( historyQueries ) : void ; /**
     * Sets the  HistoryQueriesState . sessionTimeStampInMs property.
     *
     *  param timeStamp - The new  HistoryQueriesState . sessionTimeStampInMs .
      setSessionTimeStamp ( timeStamp ) : void ; /**
     * Sets the  HistoryQueriesState . query property.
     *
     *  param query - The new  HistoryQueriesState . query .
      setQuery ( query ) : void ; } public export interface HistoryQueriesActions { example example example param query addQueryToHistory ( query ) : void ; /**
     * Loads the  HistoryQueriesState . historyQueries property from the browser
     * storage.
      loadHistoryQueriesFromBrowserStorage ( ) : void ; /**
     * Refreshes the current search session, updating its TTL.
     */ refreshSession ( ) : void ; param historyQuery removeFromHistory ( historyQuery ) : void ; /**
     * Sets the history queries, synchronizing them with the browser storage. It also removes the
     * oldest query if the history queries length is bigger than the
     *  HistoryQueriesConfig . maxItemsToStore .
     *
     *  param historyQueries setHistoryQueries ( historyQueries ) : void ; param urlParams setUrlParams ( urlParams ) : void ; } public export type HistoryQueriesXStoreModule = XStoreModule < HistoryQueriesState , HistoryQueriesGetters , HistoryQueriesMutations , HistoryQueriesActions > ; /**
 * Alias type for actions context of the  HistoryQueriesXStoreModule .
 *
 *  public export type HistoryQueriesActionContext = XActionContext < HistoryQueriesState , HistoryQueriesGetters , HistoryQueriesMutations , HistoryQueriesActions > ;