MCPcopy
hub / github.com/palantir/plottable / getInteractionTypeString

Function getInteractionTypeString

test/testMethods.ts:300–327  ·  view source on GitHub ↗
(mode: InteractionMode, type: InteractionType)

Source from the content-addressed store, hash-verified

298
299/* tslint:disable:no-switch-case-fall-through */
300function 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
330export function triggerFakeKeyboardEvent(type: string, target: SimpleSelection<void>, keyCode: number, options?: {[key: string]: any}) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected