feat(server): Stricter types for `AnyRouter` etc
Essentially, I want a generic AnyRouter for a function that accepts a router, but inside the fn impl I want to be able to inspect router config. I want to be able to list procedures and their types.
Right now, if I pass as a generic, then all values of _def are any. I wish it was something like
Record<string, ProecedureConfig>or some such.
In the actual router implementation,
_def.proceduresis an object, rather than any.
To be clear, I understand that I cannot infer the actual router impl inside the fn with a generic type, but I wish there was just some resemblance of the procedure type, e.g. just having a generic
Record<string, Config>Also asked on Discord: https://discord.com/channels/867764511159091230/1088066576303005786
Originally posted by @moltar in https://github.com/trpc/trpc/discussions/4093
Source: trpc/trpc

