mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Make ts3.3 default for w3c screen orientation (#46960)
* Make ts3.1 the default * Actually delete ts3.1
This commit is contained in:
parent
78330f7401
commit
7efe08983e
1
types/w3c-screen-orientation/index.d.ts
vendored
1
types/w3c-screen-orientation/index.d.ts
vendored
@ -3,7 +3,6 @@
|
||||
// Definitions by: Kenneth Rohde Christiansen <https://github.com/kenchris>
|
||||
// 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 {
|
||||
|
||||
@ -2,12 +2,7 @@
|
||||
"private": true,
|
||||
"types": "index",
|
||||
"typesVersions": {
|
||||
">=3.1.0-0": {
|
||||
"*": [
|
||||
"ts3.1/*"
|
||||
]
|
||||
},
|
||||
">=3.2.0-0": {
|
||||
"<=3.2": {
|
||||
"*": [
|
||||
"ts3.2/*"
|
||||
]
|
||||
|
||||
13
types/w3c-screen-orientation/ts3.1/index.d.ts
vendored
13
types/w3c-screen-orientation/ts3.1/index.d.ts
vendored
@ -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<void>;
|
||||
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;
|
||||
}
|
||||
@ -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"
|
||||
]
|
||||
}
|
||||
@ -1 +0,0 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@ -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;
|
||||
@ -7,7 +7,7 @@
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictNullChecks": false,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../../",
|
||||
"typeRoots": [
|
||||
|
||||
Loading…
Reference in New Issue
Block a user