interface SearchFn { (subString: string): Promise<boolean>; } // or as a type declaration: type SearchFn = (subString: string) => Promise<boolean>;