Procedure passed as argument to function loses type safety. - tRPC