The following article helped my to find a solution to this:
https://mariusschulz.com/blog/declaring-global-variables-in-typescript
AMBIENT.d.ts
interface Window {
adsbygoogle: {[key: string]: unknown}[]
}
From that article:
Augmenting the Window Interface
Lastly, you can use TypeScript’s interface declaration merging to let the compiler know that it can expect to find a property named INITIAL_DATA on the Window type and therefore the window object. To do that, you’ll need to define an interface named Window with a property named INITIAL_DATA:
TypeScript will merge this interface definition together with the Window interface defined in lib.dom.d.ts, resulting in a single Window type. Now, the following assignment will no longer produce a type error:
CLICK HERE to find out more related problems solutions.