// global.d.tsdeclareglobal {
interfaceBody {
json(): Promise<unknown>
}
}
export {} // Needed to augment global scope// index.tsfetch(URL)
.then(res => res.json())
.then((user: User) => ...)
// ✅ Does not compile:// Type 'unknown' is not assignable to type 'User'// ✅ You have to parse it.