Skip to content

Commit 1b1ae65

Browse files
justjavacry
authored andcommitted
Make window compatible with ts 3.6 (#2984)
1 parent 5102eec commit 1b1ae65

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

cli/tests/types.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ declare interface Window {
1010
Deno: typeof Deno;
1111
}
1212

13-
declare const window: Window;
13+
declare const window: Window & typeof globalThis;
1414
[WILDCARD]

js/globals_test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ test(function windowWindowExists(): void {
1414
});
1515

1616
test(function globalThisEqualsWindow(): void {
17-
// @ts-ignore (TypeScript thinks globalThis and window don't match)
1817
assert(globalThis === window);
1918
});
2019

js/lib.deno_runtime.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,7 +1217,7 @@ declare namespace Deno {
12171217
// @url js/globals.ts
12181218

12191219
declare interface Window {
1220-
window: Window;
1220+
window: Window & typeof globalThis;
12211221
atob: typeof textEncoding.atob;
12221222
btoa: typeof textEncoding.btoa;
12231223
fetch: typeof fetchTypes.fetch;
@@ -1263,7 +1263,7 @@ declare interface Window {
12631263
Deno: typeof Deno;
12641264
}
12651265

1266-
declare const window: Window;
1266+
declare const window: Window & typeof globalThis;
12671267
declare const atob: typeof textEncoding.atob;
12681268
declare const btoa: typeof textEncoding.btoa;
12691269
declare const fetch: typeof fetchTypes.fetch;

0 commit comments

Comments
 (0)