@empathyco/x-components
Version:
Empathy X Components
55 lines • 2.31 kB
TypeScript
import type { Facet, FacetFilter, Filter, HierarchicalFilter } from '@empathyco/x-types';
import { BaseFilterEntityModifier } from './types';
/**
* Allows only to select only one filter from the same facet at the same time.
*
* @internal
*/
export declare class SingleSelectModifier extends BaseFilterEntityModifier {
/**
* Selects the passed filter, and then deselects any other filter of the same facet.
*
* @param filter - The filter to select.
*/
select(filter: FacetFilter): void;
/**
* Retrieves the rest of selected filters of the same facet than the one given.
*
* @param filter - The filter to find its relatives.
* @returns A list of selected filters that belong to the same facet than the filter passed.
* @remarks It takes into account if the passed filter is an
* {@link @empathyco/x-types#HierarchicalFilter | HierarchicalFilter} to exclude the ancestors and
* descendants.
*
* @internal
*/
protected getOtherFilters(filter: FacetFilter): FacetFilter[];
/**
* Returns the ancestors Filters Ids of the passed filter.
*
* @param filter - The {@link @empathyco/x-types#Filter | Filter} which obtain the ancestors from.
* @param ids - (Optional) an Array with the Ids used to execute the method recursively.
* @returns An Array with the ancestors ids.
* @internal
*/
protected getAncestorsIds(filter: HierarchicalFilter, ids?: Array<Filter['id']>): Array<Filter['id']>;
/**
* Returns the descendants Filters Ids of the passed filter.
*
* @param filter - The {@link @empathyco/x-types#Filter | Filter} which obtain the descendants
* from.
* @param ids - (Optional) an Array with the Ids used to execute the method recursively.
* @returns An Array with the descendants ids.
* @internal
*/
protected getDescendantsIds(filter: HierarchicalFilter, ids?: Array<Filter['id']>): Array<Filter['id']>;
/**
* Retrieves All the filters from the given facet.
*
* @param facetId - The facet id to retrieve its filters.
* @returns The filters from the given facet.
* @internal
*/
protected getFacetFilters(facetId: Facet['id']): FacetFilter[];
}
//# sourceMappingURL=single-select.modifier.d.ts.map