Skip to content

Commit 947ab2c

Browse files
committed
Makes the ontouch* events on window optional.
Browsers without touch support (e.g., Firefox/Chrome on desktop) will not have `ontouch*` events defined on `window`, so the current type definition is not correct. package-lock was out of date and auto-updated on `npm install`. I can roll that back if desired.
1 parent d4a6453 commit 947ab2c

File tree

3 files changed

+23
-11
lines changed

3 files changed

+23
-11
lines changed

baselines/dom.generated.d.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6061,10 +6061,10 @@ interface GlobalEventHandlers {
60616061
*/
60626062
ontimeupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null;
60636063
ontoggle: ((this: GlobalEventHandlers, ev: Event) => any) | null;
6064-
ontouchcancel: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null;
6065-
ontouchend: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null;
6066-
ontouchmove: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null;
6067-
ontouchstart: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null;
6064+
ontouchcancel: ((this: Window, ev: TouchEvent) => any) | null | undefined;
6065+
ontouchend: ((this: Window, ev: TouchEvent) => any) | null | undefined;
6066+
ontouchmove: ((this: Window, ev: TouchEvent) => any) | null | undefined;
6067+
ontouchstart: ((this: Window, ev: TouchEvent) => any) | null | undefined;
60686068
ontransitioncancel: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
60696069
ontransitionend: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
60706070
ontransitionrun: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
@@ -19845,10 +19845,10 @@ declare var onsuspend: ((this: Window, ev: Event) => any) | null;
1984519845
*/
1984619846
declare var ontimeupdate: ((this: Window, ev: Event) => any) | null;
1984719847
declare var ontoggle: ((this: Window, ev: Event) => any) | null;
19848-
declare var ontouchcancel: ((this: Window, ev: TouchEvent) => any) | null;
19849-
declare var ontouchend: ((this: Window, ev: TouchEvent) => any) | null;
19850-
declare var ontouchmove: ((this: Window, ev: TouchEvent) => any) | null;
19851-
declare var ontouchstart: ((this: Window, ev: TouchEvent) => any) | null;
19848+
declare var ontouchcancel: ((this: Window, ev: TouchEvent) => any) | null | undefined;
19849+
declare var ontouchend: ((this: Window, ev: TouchEvent) => any) | null | undefined;
19850+
declare var ontouchmove: ((this: Window, ev: TouchEvent) => any) | null | undefined;
19851+
declare var ontouchstart: ((this: Window, ev: TouchEvent) => any) | null | undefined;
1985219852
declare var ontransitioncancel: ((this: Window, ev: TransitionEvent) => any) | null;
1985319853
declare var ontransitionend: ((this: Window, ev: TransitionEvent) => any) | null;
1985419854
declare var ontransitionrun: ((this: Window, ev: TransitionEvent) => any) | null;

inputfiles/overridingTypes.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,18 @@
129129
"property": {
130130
"onerror": {
131131
"override-type": "OnErrorEventHandler"
132+
},
133+
"ontouchcancel": {
134+
"override-type": "((this: Window, ev: TouchEvent) => any) | null | undefined"
135+
},
136+
"ontouchend": {
137+
"override-type": "((this: Window, ev: TouchEvent) => any) | null | undefined"
138+
},
139+
"ontouchmove": {
140+
"override-type": "((this: Window, ev: TouchEvent) => any) | null | undefined"
141+
},
142+
"ontouchstart": {
143+
"override-type": "((this: Window, ev: TouchEvent) => any) | null | undefined"
132144
}
133145
}
134146
}

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)