Skip to content

Commit a8b2756

Browse files
authored
Merge pull request #394 from jakearchibald/master
Adding touch event typings
2 parents dd0da9f + 82ecb2f commit a8b2756

File tree

3 files changed

+58
-21
lines changed

3 files changed

+58
-21
lines changed

baselines/dom.generated.d.ts

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3533,10 +3533,10 @@ interface DocumentEventMap extends GlobalEventHandlersEventMap {
35333533
"submit": Event;
35343534
"suspend": Event;
35353535
"timeupdate": Event;
3536-
"touchcancel": Event;
3537-
"touchend": Event;
3538-
"touchmove": Event;
3539-
"touchstart": Event;
3536+
"touchcancel": TouchEvent;
3537+
"touchend": TouchEvent;
3538+
"touchmove": TouchEvent;
3539+
"touchstart": TouchEvent;
35403540
"volumechange": Event;
35413541
"waiting": Event;
35423542
"webkitfullscreenchange": Event;
@@ -3950,10 +3950,10 @@ interface Document extends Node, GlobalEventHandlers, ParentNode, DocumentEvent
39503950
* @param ev The event.
39513951
*/
39523952
ontimeupdate: ((this: Document, ev: Event) => any) | null;
3953-
ontouchcancel: ((this: Document, ev: Event) => any) | null;
3954-
ontouchend: ((this: Document, ev: Event) => any) | null;
3955-
ontouchmove: ((this: Document, ev: Event) => any) | null;
3956-
ontouchstart: ((this: Document, ev: Event) => any) | null;
3953+
ontouchcancel: ((this: Document, ev: TouchEvent) => any) | null;
3954+
ontouchend: ((this: Document, ev: TouchEvent) => any) | null;
3955+
ontouchmove: ((this: Document, ev: TouchEvent) => any) | null;
3956+
ontouchstart: ((this: Document, ev: TouchEvent) => any) | null;
39573957
onvisibilitychange: (this: Document, ev: Event) => any;
39583958
/**
39593959
* Occurs when the volume is changed, or playback is muted or unmuted.
@@ -4313,6 +4313,7 @@ interface DocumentEvent {
43134313
createEvent(eventInterface: "SpeechSynthesisEvent"): SpeechSynthesisEvent;
43144314
createEvent(eventInterface: "StorageEvent"): StorageEvent;
43154315
createEvent(eventInterface: "TextEvent"): TextEvent;
4316+
createEvent(eventInterface: "TouchEvent"): TouchEvent;
43164317
createEvent(eventInterface: "TrackEvent"): TrackEvent;
43174318
createEvent(eventInterface: "TransitionEvent"): TransitionEvent;
43184319
createEvent(eventInterface: "UIEvent"): UIEvent;
@@ -4432,10 +4433,10 @@ interface ElementEventMap extends GlobalEventHandlersEventMap {
44324433
"MSPointerOut": Event;
44334434
"MSPointerOver": Event;
44344435
"MSPointerUp": Event;
4435-
"touchcancel": Event;
4436-
"touchend": Event;
4437-
"touchmove": Event;
4438-
"touchstart": Event;
4436+
"touchcancel": TouchEvent;
4437+
"touchend": TouchEvent;
4438+
"touchmove": TouchEvent;
4439+
"touchstart": TouchEvent;
44394440
"webkitfullscreenchange": Event;
44404441
"webkitfullscreenerror": Event;
44414442
}
@@ -4474,10 +4475,10 @@ interface Element extends Node, GlobalEventHandlers, ElementTraversal, ParentNod
44744475
onmspointerout: ((this: Element, ev: Event) => any) | null;
44754476
onmspointerover: ((this: Element, ev: Event) => any) | null;
44764477
onmspointerup: ((this: Element, ev: Event) => any) | null;
4477-
ontouchcancel: ((this: Element, ev: Event) => any) | null;
4478-
ontouchend: ((this: Element, ev: Event) => any) | null;
4479-
ontouchmove: ((this: Element, ev: Event) => any) | null;
4480-
ontouchstart: ((this: Element, ev: Event) => any) | null;
4478+
ontouchcancel: ((this: Element, ev: TouchEvent) => any) | null;
4479+
ontouchend: ((this: Element, ev: TouchEvent) => any) | null;
4480+
ontouchmove: ((this: Element, ev: TouchEvent) => any) | null;
4481+
ontouchstart: ((this: Element, ev: TouchEvent) => any) | null;
44814482
onwebkitfullscreenchange: ((this: Element, ev: Event) => any) | null;
44824483
onwebkitfullscreenerror: ((this: Element, ev: Event) => any) | null;
44834484
outerHTML: string;
@@ -14870,10 +14871,10 @@ interface WindowEventMap extends GlobalEventHandlersEventMap {
1487014871
"submit": Event;
1487114872
"suspend": Event;
1487214873
"timeupdate": Event;
14873-
"touchcancel": Event;
14874-
"touchend": Event;
14875-
"touchmove": Event;
14876-
"touchstart": Event;
14874+
"touchcancel": TouchEvent;
14875+
"touchend": TouchEvent;
14876+
"touchmove": TouchEvent;
14877+
"touchstart": TouchEvent;
1487714878
"unload": Event;
1487814879
"volumechange": Event;
1487914880
"vrdisplayactivate": Event;

inputfiles/addedTypes.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,42 @@
502502
"no-interface-object": "1"
503503
},
504504
"Element": {
505+
"events": {
506+
"event": [
507+
{
508+
"dispatch": "sync",
509+
"specs": "dom4",
510+
"name": "touchstart",
511+
"type": "TouchEvent",
512+
"cancelable": 1,
513+
"bubbles": 1
514+
},
515+
{
516+
"dispatch": "sync",
517+
"specs": "dom4",
518+
"name": "touchmove",
519+
"type": "TouchEvent",
520+
"cancelable": 1,
521+
"bubbles": 1
522+
},
523+
{
524+
"dispatch": "sync",
525+
"specs": "dom4",
526+
"name": "touchcancel",
527+
"type": "TouchEvent",
528+
"cancelable": 1,
529+
"bubbles": 1
530+
},
531+
{
532+
"dispatch": "sync",
533+
"specs": "dom4",
534+
"name": "touchend",
535+
"type": "TouchEvent",
536+
"cancelable": 1,
537+
"bubbles": 1
538+
}
539+
]
540+
},
505541
"name": "Element",
506542
"methods": {
507543
"method": {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"private": true,
44
"scripts": {
55
"build": "tsc --p ./tsconfig.json && node ./lib/index.js",
6-
"baseline-accept": "cpx generated\\* baselines\\",
6+
"baseline-accept": "cpx \"generated\\*\" baselines\\",
77
"test": "tsc --p ./tsconfig.json && node ./lib/index.js && node ./lib/test.js"
88
},
99
"dependencies": {

0 commit comments

Comments
 (0)