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

Function handleTransformGestureCommand

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

Source from the content-addressed store, hash-verified

920}
921
922export async function handleTransformGestureCommand(
923 device: DeviceInfo,
924 interactor: Interactor,
925 positionals: string[],
926): Promise<Record<string, unknown>> {
927 // Cross-platform TV-target gate (also rejects Android TV) — see handlePinchCommand.
928 if (device.target === 'tv') {
929 throw new AppError('UNSUPPORTED_OPERATION', 'gesture transform is not supported on tvOS');
930 }
931 const supportedIosSimulator = isIosFamily(device) && device.kind === 'simulator';
932 if (device.platform !== 'android' && !supportedIosSimulator) {
933 throw new AppError(
934 'UNSUPPORTED_OPERATION',
935 'gesture transform is currently supported on Android and iOS simulators',
936 );
937 }
938
939 const params = parseTransformGestureParams(positionals);
940 const interactionResult = await interactor.transformGesture(params);
941 return {
942 ...params,
943 ...interactionResult,
944 ...successText(
945 `Requested transform gesture by (${params.dx}, ${params.dy}), scale ${params.scale}, rotate ${params.degrees} degrees`,
946 ),
947 };
948}
949
950type RotateGestureParams = {
951 degrees: number;

Callers 2

dispatch.tsFile · 0.90

Calls 4

isIosFamilyFunction · 0.90
successTextFunction · 0.90
transformGestureMethod · 0.80

Tested by

no test coverage detected