Skip to content

Commit

Permalink
Merge pull request #394 from jakearchibald/master
Browse files Browse the repository at this point in the history
Adding touch event typings
  • Loading branch information
mhegazy authored Mar 27, 2018
2 parents dd0da9f + 82ecb2f commit a8b2756
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 21 deletions.
41 changes: 21 additions & 20 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3533,10 +3533,10 @@ interface DocumentEventMap extends GlobalEventHandlersEventMap {
"submit": Event;
"suspend": Event;
"timeupdate": Event;
"touchcancel": Event;
"touchend": Event;
"touchmove": Event;
"touchstart": Event;
"touchcancel": TouchEvent;
"touchend": TouchEvent;
"touchmove": TouchEvent;
"touchstart": TouchEvent;
"volumechange": Event;
"waiting": Event;
"webkitfullscreenchange": Event;
Expand Down Expand Up @@ -3950,10 +3950,10 @@ interface Document extends Node, GlobalEventHandlers, ParentNode, DocumentEvent
* @param ev The event.
*/
ontimeupdate: ((this: Document, ev: Event) => any) | null;
ontouchcancel: ((this: Document, ev: Event) => any) | null;
ontouchend: ((this: Document, ev: Event) => any) | null;
ontouchmove: ((this: Document, ev: Event) => any) | null;
ontouchstart: ((this: Document, ev: Event) => any) | null;
ontouchcancel: ((this: Document, ev: TouchEvent) => any) | null;
ontouchend: ((this: Document, ev: TouchEvent) => any) | null;
ontouchmove: ((this: Document, ev: TouchEvent) => any) | null;
ontouchstart: ((this: Document, ev: TouchEvent) => any) | null;
onvisibilitychange: (this: Document, ev: Event) => any;
/**
* Occurs when the volume is changed, or playback is muted or unmuted.
Expand Down Expand Up @@ -4313,6 +4313,7 @@ interface DocumentEvent {
createEvent(eventInterface: "SpeechSynthesisEvent"): SpeechSynthesisEvent;
createEvent(eventInterface: "StorageEvent"): StorageEvent;
createEvent(eventInterface: "TextEvent"): TextEvent;
createEvent(eventInterface: "TouchEvent"): TouchEvent;
createEvent(eventInterface: "TrackEvent"): TrackEvent;
createEvent(eventInterface: "TransitionEvent"): TransitionEvent;
createEvent(eventInterface: "UIEvent"): UIEvent;
Expand Down Expand Up @@ -4432,10 +4433,10 @@ interface ElementEventMap extends GlobalEventHandlersEventMap {
"MSPointerOut": Event;
"MSPointerOver": Event;
"MSPointerUp": Event;
"touchcancel": Event;
"touchend": Event;
"touchmove": Event;
"touchstart": Event;
"touchcancel": TouchEvent;
"touchend": TouchEvent;
"touchmove": TouchEvent;
"touchstart": TouchEvent;
"webkitfullscreenchange": Event;
"webkitfullscreenerror": Event;
}
Expand Down Expand Up @@ -4474,10 +4475,10 @@ interface Element extends Node, GlobalEventHandlers, ElementTraversal, ParentNod
onmspointerout: ((this: Element, ev: Event) => any) | null;
onmspointerover: ((this: Element, ev: Event) => any) | null;
onmspointerup: ((this: Element, ev: Event) => any) | null;
ontouchcancel: ((this: Element, ev: Event) => any) | null;
ontouchend: ((this: Element, ev: Event) => any) | null;
ontouchmove: ((this: Element, ev: Event) => any) | null;
ontouchstart: ((this: Element, ev: Event) => any) | null;
ontouchcancel: ((this: Element, ev: TouchEvent) => any) | null;
ontouchend: ((this: Element, ev: TouchEvent) => any) | null;
ontouchmove: ((this: Element, ev: TouchEvent) => any) | null;
ontouchstart: ((this: Element, ev: TouchEvent) => any) | null;
onwebkitfullscreenchange: ((this: Element, ev: Event) => any) | null;
onwebkitfullscreenerror: ((this: Element, ev: Event) => any) | null;
outerHTML: string;
Expand Down Expand Up @@ -14870,10 +14871,10 @@ interface WindowEventMap extends GlobalEventHandlersEventMap {
"submit": Event;
"suspend": Event;
"timeupdate": Event;
"touchcancel": Event;
"touchend": Event;
"touchmove": Event;
"touchstart": Event;
"touchcancel": TouchEvent;
"touchend": TouchEvent;
"touchmove": TouchEvent;
"touchstart": TouchEvent;
"unload": Event;
"volumechange": Event;
"vrdisplayactivate": Event;
Expand Down
36 changes: 36 additions & 0 deletions inputfiles/addedTypes.json
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,42 @@
"no-interface-object": "1"
},
"Element": {
"events": {
"event": [
{
"dispatch": "sync",
"specs": "dom4",
"name": "touchstart",
"type": "TouchEvent",
"cancelable": 1,
"bubbles": 1
},
{
"dispatch": "sync",
"specs": "dom4",
"name": "touchmove",
"type": "TouchEvent",
"cancelable": 1,
"bubbles": 1
},
{
"dispatch": "sync",
"specs": "dom4",
"name": "touchcancel",
"type": "TouchEvent",
"cancelable": 1,
"bubbles": 1
},
{
"dispatch": "sync",
"specs": "dom4",
"name": "touchend",
"type": "TouchEvent",
"cancelable": 1,
"bubbles": 1
}
]
},
"name": "Element",
"methods": {
"method": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"private": true,
"scripts": {
"build": "tsc --p ./tsconfig.json && node ./lib/index.js",
"baseline-accept": "cpx generated\\* baselines\\",
"baseline-accept": "cpx \"generated\\*\" baselines\\",
"test": "tsc --p ./tsconfig.json && node ./lib/index.js && node ./lib/test.js"
},
"dependencies": {
Expand Down

0 comments on commit a8b2756

Please sign in to comment.