tRPCttRPC
Powered by
MikeyBM
tRPC•8mo ago•
1 reply
MikeyB

export full declaration of AppRouter for use in another project

So I have my API server and my web app. They're separate projects and initially I can import AppRouter type with relative paths but it feels messy, but it's ok. Now I have implemented some app specific typescrpt resolve/alias for imports, all my types break as the web project can't resolve those aliases that are present in the api project without sharing the same aliases.

I wonder if there is some way to codegen
export type AppRouter
export type AppRouter
in to a full declaration that is standalone? Then I can just import that one file without it needing to understand the layout of the other project?

Any help appreciated ❤️
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

AppRouter Type Declaration Method
ThreeCrownTThreeCrown / ❓-help
8mo ago
if I export 'appRouter' instead of 'router' I get error
NazCodelandNNazCodeland / ❓-help
3y ago
Getting type error for AppRouter
EmilEEmil / ❓-help
15mo ago