@mikezimm/fps-library-v2
Version:
Library of reusable typescript/javascript functions, interfaces and constants
48 lines (47 loc) • 2.37 kB
TypeScript
/**
* CodeAnalizerComment: Updated 1 imports on 2024-09-22 14:49:52
* Update:: import { IAnySourceItem } to '@mikezimm/fps-core-v7/lib/components/molecules/AnyContent/IAnyContent;'
*/
import { IAnySourceItem } from '@mikezimm/fps-core-v7/lib/components/molecules/AnyContent/IAnyContent';
/**
* ICustomRegexSearch expects an object like this with any Keys that have RegExp[] as a prop:
*
Customer1?: RegExp[];
Customer2?: RegExp[];
Customer?: RegExp[];
Facilities?: RegExp[];
*/
export interface ICustomRegexSearch {
[key: string]: RegExp[];
}
export type IXSearchArray = 'topSearch' | 'leftSearch' | 'rightSearch' | 'typeSearch';
/**
* applyRegExpXSearchObject is built to take
* @param items - array of IAnySourceItem
* @param keys - array of item.props you want to search for like ['Title', 'Description'] etc...
* @param Uncategorized
* @param searchKeyX - like 'topSearch' 'leftSearch' 'rightSearch'
* @param EasyRegexSearch
* @returns
*/
export declare function applyRegExpXSearchObject(items: IAnySourceItem[], keys: string[], Uncategorized: 'Uncategorized', searchKeyX: IXSearchArray, EasyRegexSearch?: ICustomRegexSearch): IAnySourceItem[];
/**
* addARegExTopSearchArray is built to be called by applyRegExpXSearchObject ^^^^^^^^^
* addARegExTopSearchArray does the work of adding TopSearch info based on a single array of reg exp.
* it adds a specific label to the Search and topSearch array if any of the regex in the array are found.
* @param items - array of IAnySourceItem
* @param keys - array of item.props you want to search for like ['Title', 'Description'] etc...
* @param ARegex - [key: string]: RegExp [];
* @param label - label value to apply if Regex match is found... typically the key of ICustomRegexSearch
* @returns
*/
export declare function addARegExXSearchArray(items: IAnySourceItem[], keys: string[], searchKeyX: IXSearchArray, ARegex: RegExp[], label: string): IAnySourceItem[];
/**
*
* @param item - array of IAnySourceItem
* @param ARegex - [key: string]: RegExp [];
* @param keys - array of item.props you want to search for like ['Title', 'Description'] etc...
* @returns
*/
export declare function isAnyRegexFoundOnKeys(item: IAnySourceItem, ARegex: RegExp[], keys: string[]): boolean;
//# sourceMappingURL=applyRegExpXSearchObject.d.ts.map