diff --git a/cli/tests/types.out b/cli/tests/types.out index 2d5a39e64d..6c17b0f909 100644 --- a/cli/tests/types.out +++ b/cli/tests/types.out @@ -10,5 +10,5 @@ declare interface Window { Deno: typeof Deno; } -declare const window: Window; +declare const window: Window & typeof globalThis; [WILDCARD] diff --git a/js/globals_test.ts b/js/globals_test.ts index 42a055087a..d7c50c5b1d 100644 --- a/js/globals_test.ts +++ b/js/globals_test.ts @@ -14,7 +14,6 @@ test(function windowWindowExists(): void { }); test(function globalThisEqualsWindow(): void { - // @ts-ignore (TypeScript thinks globalThis and window don't match) assert(globalThis === window); }); diff --git a/js/lib.deno_runtime.d.ts b/js/lib.deno_runtime.d.ts index fe60d710b5..ed335216cf 100644 --- a/js/lib.deno_runtime.d.ts +++ b/js/lib.deno_runtime.d.ts @@ -1217,7 +1217,7 @@ declare namespace Deno { // @url js/globals.ts declare interface Window { - window: Window; + window: Window & typeof globalThis; atob: typeof textEncoding.atob; btoa: typeof textEncoding.btoa; fetch: typeof fetchTypes.fetch; @@ -1263,7 +1263,7 @@ declare interface Window { Deno: typeof Deno; } -declare const window: Window; +declare const window: Window & typeof globalThis; declare const atob: typeof textEncoding.atob; declare const btoa: typeof textEncoding.btoa; declare const fetch: typeof fetchTypes.fetch;