@empathyco/x-components
Version:
Empathy X Components
30 lines (21 loc) • 2.72 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [FacetsService](./x-components.facetsservice.md)
## FacetsService interface
Service to manipulate the filters.
**Signature:**
```typescript
export interface FacetsService
```
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [clearFilters](./x-components.facetsservice.clearfilters.md) | | (facetIds?: Array<Facet\['id'\]>, metadata?: [FiltersMetadata](./x-components.filtersmetadata.md)<!-- -->) => void | Deselects the selected filters. |
| [clearFiltersWithMetadata](./x-components.facetsservice.clearfilterswithmetadata.md) | | (payload?: { facetIds?: Array<Facet\['id'\]>; metadata?: [FiltersMetadata](./x-components.filtersmetadata.md)<!-- -->; }) => void | Deselects the selected filters. This is intended to be used from the wiring where currently we can only provide one argument. |
| [deselect](./x-components.facetsservice.deselect.md) | | (filter: Filter, metadata?: [FiltersMetadata](./x-components.filtersmetadata.md)<!-- -->) => void | Deselects filter, adding it to the store if it was not present. |
| [select](./x-components.facetsservice.select.md) | | (filter: Filter \| Filter\[\]) => void | Selects filter/filters, adding it/them to the store if it/they was not present. |
| [selectPreselectedFilters](./x-components.facetsservice.selectpreselectedfilters.md) | | () => void | Selects preselected filter/filters, adding it/them to the store if it/they are not present. |
| [setFacets](./x-components.facetsservice.setfacets.md) | | (facetsGroup: [FacetsGroup](./x-components.facetsgroup.md)<!-- -->) => void | Sets the facets of the group. This method just replaces the facets, and keeps the given facet's filters selected state as it is. |
| [setQuery](./x-components.facetsservice.setquery.md) | | (query: string) => void | Sets the query. |
| [toggle](./x-components.facetsservice.toggle.md) | | (filter: Filter) => void | Selects a deselected filter, and deselects a selected filter, adding them to the store in both cases. |
| [updateFacets](./x-components.facetsservice.updatefacets.md) | | (facetsGroup: [FacetsGroup](./x-components.facetsgroup.md)<!-- -->) => void | Replaces the facets of the group with the new ones. It ignores the provided filters selected state, replacing it with the previous selected filter. |
| [updatePreselectedFilters](./x-components.facetsservice.updatepreselectedfilters.md) | | (filters: Filter\[\]) => void | Replaces the preselected filters with the new ones. |