That is an Empty Object Type
.
It describes an object that has no members on its own. TypeScript issues a compile-time error when you try to access arbitrary properties on such an object:
// Type {}
const obj = {};
// Error: Property 'prop' does not exist on type '{}'.
obj.prop = "value";
However, you can still use all properties and methods defined on the Object type, which are implicitly available via JavaScript's prototype chain:
// Type {}
const obj = {};
// "[object Object]"
obj.toString();
Relevant info is Basarat's Lazy Object Initialization entry that explains how Typescript will refuse this process and how to work with it.
Using that entry you would need to change your code in this manner:
interface Foo {
bar: string;
baz: number;
}
private getJsonBody(body: {} as Foo | FormData) {
return !(body instanceof FormData)
? JSON.stringify(body)
: body;
}