brr
brr2w ago

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...
0 Replies
No replies yetBe the first to reply to this messageJoin