▲ | kentonv 4 days ago | |||||||
No. Zod gives you TypeScript types corresponding to the schema. So you would only need to write the schema in Zod. (I do wish it could be the other way, though: Write only TypeScript, get runtime checks automatically.) | ||||||||
▲ | sebws 4 days ago | parent | next [-] | |||||||
There are ways if you're ok with a build step, e.g. https://typia.io/ or https://github.com/GoogleFeud/ts-runtime-checks Although perhaps that's not what you mean. I found these through this https://github.com/moltar/typescript-runtime-type-benchmarks | ||||||||
▲ | ngrilly 4 days ago | parent | prev [-] | |||||||
I'm familiar with zod.infer but I'm not sure how to use it to produce an interface that would be compatible with RpcStub and RpcTarget, like MyApi in the example in your post:
| ||||||||
|