MCPcopy Create free account
hub / github.com/callstack/agent-device / parseTransformGestureParams

Function parseTransformGestureParams

src/core/dispatch-interactions.ts:972–993  ·  view source on GitHub ↗
(positionals: string[])

Source from the content-addressed store, hash-verified

970}
971
972function parseTransformGestureParams(positionals: string[]): TransformGestureParams {
973 const x = Number(positionals[0]);
974 const y = Number(positionals[1]);
975 const dx = Number(positionals[2]);
976 const dy = Number(positionals[3]);
977 const scale = Number(positionals[4]);
978 const degrees = Number(positionals[5]);
979 if (![x, y, dx, dy, scale, degrees].every(Number.isFinite)) {
980 throw new AppError(
981 'INVALID_ARGS',
982 'gesture transform requires x y dx dy scale degrees [durationMs]',
983 );
984 }
985 if (scale <= 0) {
986 throw new AppError('INVALID_ARGS', 'gesture transform scale must be > 0');
987 }
988 const durationMs =
989 positionals[6] === undefined
990 ? undefined
991 : requireIntInRange(Number(positionals[6]), 'durationMs', 16, 10_000);
992 return { x, y, dx, dy, scale, degrees, durationMs };
993}
994
995function parseOptionalGestureCenter(
996 xInput: string | undefined,

Callers 1

Calls 1

requireIntInRangeFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…