MCPcopy Index your code
hub / github.com/callstack/agent-device / handleSwipeCommand

Function handleSwipeCommand

src/core/dispatch-interactions.ts:552–577  ·  view source on GitHub ↗
(
  device: DeviceInfo,
  interactor: Interactor,
  positionals: string[],
  context: DispatchContext | undefined,
)

Source from the content-addressed store, hash-verified

550}
551
552export async function handleSwipeCommand(
553 device: DeviceInfo,
554 interactor: Interactor,
555 positionals: string[],
556 context: DispatchContext | undefined,
557): Promise<Record<string, unknown>> {
558 const x1 = Number(positionals[0]);
559 const y1 = Number(positionals[1]);
560 const x2 = Number(positionals[2]);
561 const y2 = Number(positionals[3]);
562 if ([x1, y1, x2, y2].some(Number.isNaN)) {
563 throw new AppError('INVALID_ARGS', 'swipe requires x1 y1 x2 y2 [durationMs]');
564 }
565
566 const requestedDurationMs = positionals[4] ? Number(positionals[4]) : 250;
567 return await runSwipeCoordinates({
568 device,
569 interactor,
570 context,
571 x1,
572 y1,
573 x2,
574 y2,
575 requestedDurationMs,
576 });
577}
578
579export async function handleSwipePresetCommand(
580 device: DeviceInfo,

Callers 2

dispatch.tsFile · 0.90

Calls 1

runSwipeCoordinatesFunction · 0.85

Tested by

no test coverage detected