@helpwave/hightide
Version:
helpwave's component and theming library
51 lines (49 loc) • 2.15 kB
text/typescript
/**
* Finds all values matching the search values by first mapping the values to a string array and then checking each entry for matches.
* Returns the list of all matches.
*
* @param search The list of search strings e.g. `[name, type]`
*
* @param objects The list of objects to be searched in
*
* @param mapping The mapping of objects to the string properties they fulfil
*
* @return The list of objects that match all search strings
*/
declare const MultiSubjectSearchWithMapping: <T>(search: string[], objects: T[], mapping: (value: T) => (string[] | undefined)) => T[];
/**
* Finds all values matching the search value by first mapping the values to a string array and then checking each entry for matches.
* Returns the list of all matches.
*
* @param search The search string e.g `name`
*
* @param objects The list of objects to be searched in
*
* @param mapping The mapping of objects to the string properties they fulfil, if undefined it is always fulfilled
*
* @return The list of objects that match the search string
*/
declare const MultiSearchWithMapping: <T>(search: string, objects: T[], mapping: (value: T) => (string[] | undefined)) => T[];
/**
* Finds all values matching the search value by first mapping the values to a string and returns the list of all matches.
*
* @param search The search string e.g `name`
*
* @param objects The list of objects to be searched in
*
* @param mapping The mapping of objects to a string that is compared to the search
*
* @return The list of objects that match the search string
*/
declare const SimpleSearchWithMapping: <T>(search: string, objects: T[], mapping: (value: T) => string) => T[];
/**
* Finds all values matching the search value and returns the list of all matches.
*
* @param search The search string e.g `name`
*
* @param objects The list of objects to be searched in
*
* @return The list of objects that match the search string
*/
declare const SimpleSearch: (search: string, objects: string[]) => string[];
export { MultiSearchWithMapping, MultiSubjectSearchWithMapping, SimpleSearch, SimpleSearchWithMapping };