(ev: any, detail: GestureDetail)
| 256 | }; |
| 257 | |
| 258 | const updateDetail = (ev: any, detail: GestureDetail) => { |
| 259 | // get X coordinates for either a mouse click |
| 260 | // or a touch depending on the given event |
| 261 | let x = 0; |
| 262 | let y = 0; |
| 263 | if (ev) { |
| 264 | const changedTouches = ev.changedTouches; |
| 265 | if (changedTouches && changedTouches.length > 0) { |
| 266 | const touch = changedTouches[0]; |
| 267 | x = touch.clientX; |
| 268 | y = touch.clientY; |
| 269 | } else if (ev.pageX !== undefined) { |
| 270 | x = ev.pageX; |
| 271 | y = ev.pageY; |
| 272 | } |
| 273 | } |
| 274 | detail.currentX = x; |
| 275 | detail.currentY = y; |
| 276 | }; |
| 277 | |
| 278 | const now = (ev: UIEvent) => { |
| 279 | return ev.timeStamp || Date.now(); |
no outgoing calls
no test coverage detected