/** * Created by steve on 3/28/2016. */ /** * Filter a provided list of (generic) items. * Uses a "multi-term" search approach. The search expression is parsed into query terms * (space delimited; quoted strings treated as one term). Items match if their searchable string contains * all of the terms. * * @param {Array} items The list of items to filter * @param {function} itemToSearchableString A function from item=>String. Returns the searchable string, given an item * @param {string} searchQueryString The query, in string form, with which to filter records * @return {Array} an Array of items that pass the filter */ export declare function filterItems(items: Array, itemToSearchableString: (item: T) => string, searchQueryString: string): T[]; /** * Split search query string on whitespace, unless wrapped in quotes * @param {string} searchQueryString A string representing the search query * @returns {Array} A set of query terms parsed from searchQueryString */ export declare function parseSearchQueryString(searchQueryString: string): string[]; /** * Return a boolean indicating if all the queryTerms are found in the searchableString * @param queryTerms An array of queryTerms to search with * @param searchableString The string to search. * @returns boolean */ export declare function areTermsInString(queryTerms: Array, searchableString: string): boolean; /** * Return a regex string which can be used to determine if all queryTerms * are found in the searchableString * @param queryTerms An array of queryTerms to search with * @param searchableString The string to search. * @returns boolean */ export declare function areTermsInStringRegexString(queryTerms: Array): string; /** * Returns help text which describes the search provided by areTermsInString * @param itemDescription A description of the items that are being filtered * Note that html is allowed in this help text as safeHtml is introduced */ export declare function makeSearchHelpText(itemDescription: string): string; /** * Return a boolean indicating if the query term is found in the searchableString * @param {string} queryTerm * @param {string} searchableString * @returns {boolean} true if a match */ export declare function isTermInString(queryTerm: string, searchableString?: string): boolean; //# sourceMappingURL=SearchUtils.d.ts.map