(mode: InteractionMode, type: InteractionType)
| 298 | |
| 299 | /* tslint:disable:no-switch-case-fall-through */ |
| 300 | function getInteractionTypeString(mode: InteractionMode, type: InteractionType) { |
| 301 | switch (mode) { |
| 302 | case InteractionMode.Mouse: |
| 303 | switch (type) { |
| 304 | case InteractionType.Start: |
| 305 | return "mousedown"; |
| 306 | case InteractionType.Move: |
| 307 | return "mousemove"; |
| 308 | case InteractionType.End: |
| 309 | return "mouseup"; |
| 310 | default: |
| 311 | throw new Error("Unrecognized enum value: " + type); |
| 312 | } |
| 313 | case InteractionMode.Touch: |
| 314 | switch (type) { |
| 315 | case InteractionType.Start: |
| 316 | return "touchstart"; |
| 317 | case InteractionType.Move: |
| 318 | return "touchmove"; |
| 319 | case InteractionType.End: |
| 320 | return "touchend"; |
| 321 | default: |
| 322 | throw new Error("Unrecognized enum value: " + type); |
| 323 | } |
| 324 | default: |
| 325 | throw new Error("Unrecognized enum value: " + mode); |
| 326 | } |
| 327 | } |
| 328 | /* tslint:enable:no-switch-case-fall-through */ |
| 329 | |
| 330 | export function triggerFakeKeyboardEvent(type: string, target: SimpleSelection<void>, keyCode: number, options?: {[key: string]: any}) { |
no outgoing calls
no test coverage detected