UNPKG

@empathyco/x-components

Version:
28 lines (19 loc) 2.53 kB
<!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [HistoryQueriesActions](./x-components.historyqueriesactions.md) ## HistoryQueriesActions interface HistoryQueries store actions. **Signature:** ```typescript export interface HistoryQueriesActions ``` ## Properties | Property | Modifiers | Type | Description | | --- | --- | --- | --- | | [addQueryToHistory](./x-components.historyqueriesactions.addquerytohistory.md) | | (query: string) =&gt; void | Saves a query to the history, synchronizing it with the browser storage. There are 3 possible cases. | | [loadHistoryQueriesFromBrowserStorage](./x-components.historyqueriesactions.loadhistoryqueriesfrombrowserstorage.md) | | () =&gt; void | Loads the [historyQueries](./x-components.historyqueriesstate.historyqueries.md) property from the browser storage. | | [refreshSession](./x-components.historyqueriesactions.refreshsession.md) | | () =&gt; void | Refreshes the current search session, updating its TTL. | | [removeFromHistory](./x-components.historyqueriesactions.removefromhistory.md) | | (historyQuery: HistoryQuery) =&gt; void | Removes a single query from the history, synchronizing it with the browser storage. | | [setHistoryQueries](./x-components.historyqueriesactions.sethistoryqueries.md) | | (historyQueries: HistoryQuery\[\]) =&gt; 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](./x-components.historyqueriesconfig.maxitemstostore.md)<!-- -->. | | [setUrlParams](./x-components.historyqueriesactions.seturlparams.md) | | (urlParams: [UrlParams](./x-components.urlparams.md)<!-- -->) =&gt; void | Checks if the url has a query on it and then updates the state with that value. | | [toggleHistoryQueries](./x-components.historyqueriesactions.togglehistoryqueries.md) | | (isEnabled: boolean) =&gt; void | Toggles the history queries and stores the state in the browser storage. It also cleans the history queries when disabling them. | | [updateHistoryQueriesWithSearchResponse](./x-components.historyqueriesactions.updatehistoryquerieswithsearchresponse.md) | | (searchResponse: [InternalSearchResponse](./x-components.internalsearchresponse.md)<!-- -->) =&gt; void | Updates the history queries with the relevant info included in a search response. |