tRPCttRPC
Powered by
JokcyJ
tRPC•3y 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
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
typeof MyRouter
type infer? So that I can expose limited info to public.
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Question: Is there a way to have a base interface for Trpc router?
MayankMMayank / ❓-help
2y ago
Is there a type for "any useMutation"?
Answer OverflowAAnswer Overflow / ❓-help
3y ago
Hello, is there any way to create a base router with common procedures? like an interface
I am a DevII am a Dev / ❓-help
3y ago