import { FilterConstraint, FilterMap } from './search-params'; /** * A utility class for building filter maps */ export declare class FilterMapBuilder { private filterMap; /** * Adds a filter to the FilterMap under construction. * If existing constraint(s) already exist for this field and value, then the old and new constraints * will be joined into a single array. * @param field The field to filter on (e.g., 'subject', 'year', ...) * @param value The value of the field to filter on (e.g., 'Cicero', '1920', ...) * @param constraint The constraint to apply to the `field`, with respect to the given `value`. * Allowed values are the enum members of `FilterConstraint`. */ addFilter(field: string, value: string, constraint: FilterConstraint): this; /** * Removes a single filter currently associated with the given field, value, and constraint type. * @param field The field to remove a filter for * @param value The value to remove the filter for * @param constraint The constraint type to remove for this field and value */ removeSingleFilter(field: string, value: string, constraint: FilterConstraint): this; /** * Removes any filters currently associated with the given field and value. * @param field The field to remove a filter for * @param value The value to remove the filter for */ removeFilters(field: string, value: string): this; /** If there are no remaining filters for this field, deletes the whole field object. */ private deleteFieldIfEmpty; /** * Initializes the filter map under construction to have filters exactly equal to the given one. * This will overwrite *all* existing filters already added to the builder. * @param map The FilterMap to set this builder's state to. */ setFilterMap(map: FilterMap): this; /** * Adds all filters from an existing filter map to the one being built. * Filters from the provided map may overwrite existing filters already added to the builder. * @param map The FilterMap to merge into the one being built. */ mergeFilterMap(map: FilterMap): this; /** * Produces a `FilterMap` including all the filters that have been applied to * this builder. */ build(): FilterMap; }