From 7efe08983e2c443abec4145c818ebeca99e68db4 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Tue, 1 Sep 2020 13:29:23 -0700 Subject: [PATCH] Make ts3.3 default for w3c screen orientation (#46960) * Make ts3.1 the default * Actually delete ts3.1 --- types/w3c-screen-orientation/index.d.ts | 1 - types/w3c-screen-orientation/package.json | 7 +--- types/w3c-screen-orientation/ts3.1/index.d.ts | 13 ------- .../ts3.1/tsconfig.json | 24 ------------- .../w3c-screen-orientation/ts3.1/tslint.json | 1 - .../ts3.1/w3c-screen-orientation-tests.ts | 36 ------------------- .../ts3.2/tsconfig.json | 2 +- 7 files changed, 2 insertions(+), 82 deletions(-) delete mode 100644 types/w3c-screen-orientation/ts3.1/index.d.ts delete mode 100644 types/w3c-screen-orientation/ts3.1/tsconfig.json delete mode 100644 types/w3c-screen-orientation/ts3.1/tslint.json delete mode 100644 types/w3c-screen-orientation/ts3.1/w3c-screen-orientation-tests.ts diff --git a/types/w3c-screen-orientation/index.d.ts b/types/w3c-screen-orientation/index.d.ts index b8b4226aee..2ed57b7550 100644 --- a/types/w3c-screen-orientation/index.d.ts +++ b/types/w3c-screen-orientation/index.d.ts @@ -3,7 +3,6 @@ // Definitions by: Kenneth Rohde Christiansen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -type OrientationType = "portrait-primary" | "portrait-secondary" | "landscape-primary" | "landscape-secondary"; type ScreenOrientationLockType = "any" | "natural" | "landscape" | "portrait" | "portrait-primary" | "portrait-secondary" | "landscape-primary" | "landscape-secondary"; interface ScreenOrientation extends EventTarget { diff --git a/types/w3c-screen-orientation/package.json b/types/w3c-screen-orientation/package.json index 25d6e24514..943fd97279 100644 --- a/types/w3c-screen-orientation/package.json +++ b/types/w3c-screen-orientation/package.json @@ -2,12 +2,7 @@ "private": true, "types": "index", "typesVersions": { - ">=3.1.0-0": { - "*": [ - "ts3.1/*" - ] - }, - ">=3.2.0-0": { + "<=3.2": { "*": [ "ts3.2/*" ] diff --git a/types/w3c-screen-orientation/ts3.1/index.d.ts b/types/w3c-screen-orientation/ts3.1/index.d.ts deleted file mode 100644 index 6d88f98715..0000000000 --- a/types/w3c-screen-orientation/ts3.1/index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -type ScreenOrientationLockType = "any" | "natural" | "landscape" | "portrait" | "portrait-primary" | "portrait-secondary" | "landscape-primary" | "landscape-secondary"; - -interface ScreenOrientation extends EventTarget { - lock(orientation: ScreenOrientationLockType): Promise; - unlock(): void; - readonly type: OrientationType; - readonly angle: number; - addEventListener(type: "change", listener: (this: this, ev: Event) => any, useCapture?: boolean): void; -} - -interface Screen { - readonly orientation: ScreenOrientation; -} diff --git a/types/w3c-screen-orientation/ts3.1/tsconfig.json b/types/w3c-screen-orientation/ts3.1/tsconfig.json deleted file mode 100644 index 2786c93736..0000000000 --- a/types/w3c-screen-orientation/ts3.1/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": true, - "baseUrl": "../../", - "typeRoots": [ - "../../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "w3c-screen-orientation-tests.ts" - ] -} diff --git a/types/w3c-screen-orientation/ts3.1/tslint.json b/types/w3c-screen-orientation/ts3.1/tslint.json deleted file mode 100644 index 3db14f85ea..0000000000 --- a/types/w3c-screen-orientation/ts3.1/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" } diff --git a/types/w3c-screen-orientation/ts3.1/w3c-screen-orientation-tests.ts b/types/w3c-screen-orientation/ts3.1/w3c-screen-orientation-tests.ts deleted file mode 100644 index 63963da5ac..0000000000 --- a/types/w3c-screen-orientation/ts3.1/w3c-screen-orientation-tests.ts +++ /dev/null @@ -1,36 +0,0 @@ -// Example 1 (from the spec): -const show = () => { - console.log("Orientation type is " + screen.orientation.type); - console.log("Orientation angle is " + screen.orientation.angle); -}; - -screen.orientation.addEventListener("change", show); -window.onload = show; - -// Example 2 (from the spec): -const start = () => { - document.onfullscreenchange = () => { - screen.orientation.lock('natural').then(startInternal); - }; - document.documentElement.requestFullscreen(); -}; - -// Example 3 (from the spec): -const startInternal = () => {}; - -const start2 = () => { - screen.orientation.lock('landscape-primary').then(startInternal, () => { - alert('To start, rotate your screen to landscape.'); - - const orientationChangeHandler = () => { - if (!screen.orientation.type.startsWith('landscape')) { - return; - } - screen.orientation.removeEventListener('change', orientationChangeHandler); - startInternal(); - }; - - screen.orientation.addEventListener('change', orientationChangeHandler); - }); -}; -window.onload = start2; diff --git a/types/w3c-screen-orientation/ts3.2/tsconfig.json b/types/w3c-screen-orientation/ts3.2/tsconfig.json index a273e63cf3..2786c93736 100644 --- a/types/w3c-screen-orientation/ts3.2/tsconfig.json +++ b/types/w3c-screen-orientation/ts3.2/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": true, + "strictNullChecks": false, "strictFunctionTypes": true, "baseUrl": "../../", "typeRoots": [