import { ExtraParameters, Filter } from "../models/index"; import { SIEVE_CONSTANTS } from "../models/sieveConstants"; import { FilterService } from "./filterService"; /** * FilterService to transform filters for http calls using SIEVE * * Example sieve: * ?sorts= LikeCount,CommentCount,-created // sort by likes, then comments, then descending by date created * &filters= LikeCount>10, Title@=awesome title, // filter to posts with more than 10 likes, and a title that contains the phrase "awesome title" * &page= 1 // get the first page... * &pageSize= 10 // ...which contains 10 posts */ export declare class SieveFilterService extends FilterService { private sieveConstants; constructor(sieveConstants?: typeof SIEVE_CONSTANTS); /** * Returns a fully formatted sieve filter string * * @param filter filter to generate string from * @param extraParameters extra key/value pairs to add onto the return value */ getFilterValue(filter: Filter, extraParameters?: ExtraParameters): string; /** @inheritdoc */ getFilter(url: string): Filter; /** * Function to parse the "&Filters=" part of an URI * * @param filters part of the URI to filter * @returns Array of filterItems constructed from the URI */ private parseFilters; /** * Function to parse the "&sorts=" part of an URI * * @param sort part of the URI to filter * @returns Array of SortItems constructed from the URI */ private parseSorts; /** * Create a sieve &Sorts= string based on the sortItems * * @param sortItems */ private addSorts; /** * Create a sieve &Filters= string based on the filterItems * * @param filterItems */ private addFilters; /** * Add filter as group of filter keys * @param filterString * @param feFilter * @returns */ private addFilterStringGroup; /** * Add values to filter * @param feFilter * @param filterString * @returns */ private addFilterValues; /** * Creates a part of the filterstring based on pageIndex and pagesize. * In the process it replaces pageIndex (0-based) with page (1-based) * * @param {number | undefined} pageIndex index (0 based) of the page you want to get * @param {number | undefined} pageSize size of the page you want to get * @return {string} filter segment for page and pagesize */ getPageAndPageSizeFilter(pageIndex?: number, pageSize?: number): string; }