How to Type a Middleware factory? - tRPC