Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding touch event typings #394

Merged
merged 3 commits into from
Mar 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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