diff --git a/types/window-or-global/index.d.ts b/types/window-or-global/index.d.ts index 18f6f9550f..b395b7e9be 100644 --- a/types/window-or-global/index.d.ts +++ b/types/window-or-global/index.d.ts @@ -7,5 +7,5 @@ /// -declare const _: typeof self | typeof global; +declare const _: typeof globalThis & (typeof self | typeof global); export = _; diff --git a/types/window-or-global/package.json b/types/window-or-global/package.json index 29b70d48f4..b942445af8 100644 --- a/types/window-or-global/package.json +++ b/types/window-or-global/package.json @@ -2,9 +2,9 @@ "private": true, "types": "index", "typesVersions": { - ">=3.4.0-0": { + "<=3.3": { "*": [ - "ts3.4/*" + "ts3.3/*" ] } } diff --git a/types/window-or-global/ts3.3/index.d.ts b/types/window-or-global/ts3.3/index.d.ts new file mode 100644 index 0000000000..56b546377a --- /dev/null +++ b/types/window-or-global/ts3.3/index.d.ts @@ -0,0 +1,4 @@ +/// + +declare const _: typeof self | typeof global; +export = _; diff --git a/types/window-or-global/ts3.4/tsconfig.json b/types/window-or-global/ts3.3/tsconfig.json similarity index 100% rename from types/window-or-global/ts3.4/tsconfig.json rename to types/window-or-global/ts3.3/tsconfig.json diff --git a/types/window-or-global/ts3.4/tslint.json b/types/window-or-global/ts3.3/tslint.json similarity index 100% rename from types/window-or-global/ts3.4/tslint.json rename to types/window-or-global/ts3.3/tslint.json diff --git a/types/window-or-global/ts3.3/window-or-global-tests.ts b/types/window-or-global/ts3.3/window-or-global-tests.ts new file mode 100644 index 0000000000..f3d55a805a --- /dev/null +++ b/types/window-or-global/ts3.3/window-or-global-tests.ts @@ -0,0 +1,8 @@ +import * as root from "window-or-global"; + +if ('location' in root) { + const location: Location = root.location; + root.addEventListener("click", () => console.log("Hi!")); +} else { + const process: NodeJS.Process = root.process; +} diff --git a/types/window-or-global/ts3.4/index.d.ts b/types/window-or-global/ts3.4/index.d.ts deleted file mode 100644 index 8989d00ddf..0000000000 --- a/types/window-or-global/ts3.4/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -/// - -declare const _: typeof globalThis & (typeof self | typeof global); -export = _; diff --git a/types/window-or-global/ts3.4/window-or-global-tests.ts b/types/window-or-global/ts3.4/window-or-global-tests.ts deleted file mode 100644 index f1809c1b96..0000000000 --- a/types/window-or-global/ts3.4/window-or-global-tests.ts +++ /dev/null @@ -1,9 +0,0 @@ -import * as root from "window-or-global"; - -if (Reflect.has(root, "location")) { - // $ExpectType Location - root.location; -} else if (Reflect.has(root, "process")) { - // $ExpectType Process - root.process; -} diff --git a/types/window-or-global/window-or-global-tests.ts b/types/window-or-global/window-or-global-tests.ts index f3d55a805a..f1809c1b96 100644 --- a/types/window-or-global/window-or-global-tests.ts +++ b/types/window-or-global/window-or-global-tests.ts @@ -1,8 +1,9 @@ import * as root from "window-or-global"; -if ('location' in root) { - const location: Location = root.location; - root.addEventListener("click", () => console.log("Hi!")); -} else { - const process: NodeJS.Process = root.process; +if (Reflect.has(root, "location")) { + // $ExpectType Location + root.location; +} else if (Reflect.has(root, "process")) { + // $ExpectType Process + root.process; }