@empathyco/x-components
Version:
Empathy X Components
28 lines (19 loc) • 2.53 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [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) => void | Saves a query to the history, synchronizing it with the browser storage. There are 3 possible cases. |
| [loadHistoryQueriesFromBrowserStorage](./x-components.historyqueriesactions.loadhistoryqueriesfrombrowserstorage.md) | | () => void | Loads the [historyQueries](./x-components.historyqueriesstate.historyqueries.md) property from the browser storage. |
| [refreshSession](./x-components.historyqueriesactions.refreshsession.md) | | () => void | Refreshes the current search session, updating its TTL. |
| [removeFromHistory](./x-components.historyqueriesactions.removefromhistory.md) | | (historyQuery: HistoryQuery) => void | Removes a single query from the history, synchronizing it with the browser storage. |
| [setHistoryQueries](./x-components.historyqueriesactions.sethistoryqueries.md) | | (historyQueries: 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](./x-components.historyqueriesconfig.maxitemstostore.md)<!-- -->. |
| [setUrlParams](./x-components.historyqueriesactions.seturlparams.md) | | (urlParams: [UrlParams](./x-components.urlparams.md)<!-- -->) => 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) => 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)<!-- -->) => void | Updates the history queries with the relevant info included in a search response. |