Maybe? An alternative API might look something this:
route("path", "to", IntParam("myArg"))
TypeScript doesn't support properly typing variadic functions yet though.[1] So you can't type this properly for an arbitrary number of parameters. You could try overloading the function definition for a fixed number of parameters, but that could get messy really fast.
An alternate approach might involve regex-validated types[2], if/when those get implemented, though I'm not sure how that'd work exactly.