Code Snippet trouble with TypeScript in Astro 2.0

HI,
Hope you can help. I am a total typescript noob.
I copy-pasted the code snippet in to my main layout under the and came across the following problems:

1.- Property ‘SnipcartSettings’ does not exist on type ‘Window & typeof globalThis’.ts(2339).

Apparently I could fix this one editing the env.d.ts file with the following code:

export {};

declare global {
  interface Window {
    SnipcartSettings: any;
    LoadSnipcart: any;
  }
}

But there are a couple of errors that I can’t seem to figure out:
a variable “i” was declared to create an element and typescript is looking for the “src” and “async” types.

The same is happening with variable “n”, where typescript is looking for the “rel”, “type”, and “href” types with messages like the following:

2.- Property ‘rel’ does not exist on type ‘Element’.ts(2339)

I guess that i can edit the env.d.ts file but I can’t find how to do it…

Thank you for your help!
Dan.

I am trying this solution:

In the tsconfig.json I added this code:

{
  "extends": "astro/tsconfigs/base",

// new code
  "compilerOptions": {
    "strictNullChecks": true,
    "allowJs": true
  }
}

In the env.d.ts file:

export {};

declare global {
  interface Window {
    SnipcartSettings: any;
    LoadSnipcart: any;
  }
}

And finally in Snipcart’s code snippet I just ignored typscript with the “// @ts-ignore” comment like this:

<script>
	window.SnipcartSettings = {
           PublicApiKey: 'KEY',
           loadStrategy: 'on-user-interaction',
        };

        // @ts-ignore
       (()=>{... all the code})();			
</script>

For now there are no errors, I’ll keep testing to see if everything works fine.