( device: DeviceInfo, interactor: Interactor, positionals: string[], )
| 920 | } |
| 921 | |
| 922 | export 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 | |
| 950 | type RotateGestureParams = { |
| 951 | degrees: number; |
no test coverage detected