brr
brr
Explore posts from servers
TtRPC
Created by brr on 7/6/2024 in #❓-help
Trying to get the return type of a procedure.
Using TRPC v11. I am failing to return the type. I get the error Type alias 'ProtectedProcedureType' circularly references itself. Any ideas? This is my code
type ProtectedProcedureType = inferProcedureBuilderResolverOptions<
typeof protectedProcedure
>;

export type ProtectedProcedureContext = ProtectedProcedureType["ctx"];
type ProtectedProcedureType = inferProcedureBuilderResolverOptions<
typeof protectedProcedure
>;

export type ProtectedProcedureContext = ProtectedProcedureType["ctx"];
I need the type to be reusable in other files. I also tried this
type ProtectedProcedure = typeof protectedProcedure
type ProtectedProcedureOptions = Parameters<Parameters<ProtectedProcedure['query']>[0]>[0]
export type ProtectedProcedureContext = ProtectedProcedureOptions['ctx']
type ProtectedProcedure = typeof protectedProcedure
type ProtectedProcedureOptions = Parameters<Parameters<ProtectedProcedure['query']>[0]>[0]
export type ProtectedProcedureContext = ProtectedProcedureOptions['ctx']
still when I slap on the export I get the circularly references itself error...
2 replies