It's not overloaded, it a function that also has a property named promise. You can use Object.assign to create such an object:
let fn: SearchResultSetEachFunction = Object.assign(function (callback: (result: Result) => boolean): void {
}, {
promise(callback: (result: Result) => boolean): Promise<boolean> {
return Promise.resolve(false)
}
})
Playground Link
Or in newer versions of typescript you can use a function declaration and directly assign the promise member in the same scope as the declaration to have ts recogize it as a new memeber:
function mockSearchResultSetEachFunction(callback: (result: Result) => boolean): void {
}
mockSearchResultSetEachFunction.promise = function (callback: (result: Result) => boolean): Promise<boolean> {
return Promise.resolve(false)
}
let fn: SearchResultSetEachFunction = mockSearchResultSetEachFunction
Playground Link