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

Function handleRotateGestureCommand

src/core/dispatch-interactions.ts:894–920  ·  view source on GitHub ↗
(
  device: DeviceInfo,
  interactor: Interactor,
  positionals: string[],
)

Source from the content-addressed store, hash-verified

892}
893
894export async function handleRotateGestureCommand(
895 device: DeviceInfo,
896 interactor: Interactor,
897 positionals: string[],
898): Promise<Record<string, unknown>> {
899 // Cross-platform TV-target gate (also rejects Android TV) — see handlePinchCommand.
900 if (device.target === 'tv') {
901 throw new AppError('UNSUPPORTED_OPERATION', 'gesture rotate is not supported on tvOS');
902 }
903 if (isMacOs(device)) {
904 throw new AppError(
905 'UNSUPPORTED_OPERATION',
906 'gesture rotate is not supported on macOS; XCTest rotation gestures are available only for iOS app sessions.',
907 );
908 }
909
910 const { degrees, x, y, velocity } = parseRotateGestureParams(positionals);
911
912 const interactionResult = await interactor.rotateGesture(degrees, x, y, velocity);
913 return {
914 degrees,
915 ...(x !== undefined && y !== undefined ? { x, y } : {}),
916 velocity,
917 ...interactionResult,
918 ...successText(`Rotated gesture ${degrees} degrees`),
919 };
920}
921
922export async function handleTransformGestureCommand(
923 device: DeviceInfo,

Callers 2

dispatch.tsFile · 0.90

Calls 4

isMacOsFunction · 0.90
successTextFunction · 0.90
parseRotateGestureParamsFunction · 0.85
rotateGestureMethod · 0.80

Tested by

no test coverage detected