It seems I have found the solution with the help of this answer:
type Foo = Record<string, any>;
type FuncGenericReturn<T> = () => T;
const untypedFunction = () => {
const test = {};
// ...
return test;
}
const funcReturnsFoo: FuncGenericReturn<Foo> = untypedFunction;
const myObject = funcReturnsFoo(); // myObject is typed as Foo