type SearchItem = string | object; type TextGetter = (obj: Item) => string; export type TextSearchProps = { items: Array; term: string; normalized?: boolean; } & (Item extends string ? { prop?: TextGetter; } : { prop: TextGetter | keyof Item; }); declare const textSearch: { (props: TextSearchProps): Item[]; normalize: (str: string | Array) => string; }; export default textSearch;