(positionals: string[])
| 955 | }; |
| 956 | |
| 957 | function parseRotateGestureParams(positionals: string[]): RotateGestureParams { |
| 958 | const degrees = Number(positionals[0]); |
| 959 | if (!Number.isFinite(degrees)) { |
| 960 | throw new AppError('INVALID_ARGS', 'gesture rotate requires degrees [x] [y] [velocity]'); |
| 961 | } |
| 962 | |
| 963 | const center = parseOptionalGestureCenter(positionals[1], positionals[2]); |
| 964 | const velocity = Number(positionals[3] ?? (degrees >= 0 ? 1 : -1)); |
| 965 | if (!Number.isFinite(velocity) || velocity === 0) { |
| 966 | throw new AppError('INVALID_ARGS', 'gesture rotate velocity must be a non-zero number'); |
| 967 | } |
| 968 | |
| 969 | return { degrees, ...center, velocity: Math.abs(velocity) * (degrees >= 0 ? 1 : -1) }; |
| 970 | } |
| 971 | |
| 972 | function parseTransformGestureParams(positionals: string[]): TransformGestureParams { |
| 973 | const x = Number(positionals[0]); |
no test coverage detected