Inferring Types
It is often useful to wrap functionality of your @trpc/client or @trpc/react api within other functions. For this purpose, it's necessary to be able to infer input types, output types, and api paths generated by your @trpc/server router.
Inference Helpers
@trpc/server exports the following helper types to assist with inferring these types from the AppRouter exported by your @trpc/server router:
- inferProcedureOutput<TProcedure>
- inferProcedureInput<TProcedure>
- inferSubscriptionOutput<TRouter, TPath>
Example Code
utils/trpc.tstsx
utils/trpc.tstsx