UNPKG

@empathyco/x-components

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