JokcyJ
tRPC3y ago
2 replies
Jokcy

Is there any easy way to create a Type for a trpc router

I want to publish a set of trpc api client to npm, which will be used by my customer directly. But if I use typeof MyRouter to infer the Router type, my bundler (which is tsup) will bundle db schema types into the d.ts file. If I want my customer to gain the typesafe ability I have to make my db schema info public. Is there any way to define a Router type without typeof MyRouter type infer? So that I can expose limited info to public.
Was this page helpful?