Is `inferSubscriptionOutput` missing in 10.x?

I'm working on a vue 3 app with reactive state and need to infer the output of a subscription. It looks like 9.x had inferSubscriptionOutput but that appears to be deprecated / not applicable in 10.x and I am not sure what the best alternative is. There is a inferObservableValue but I am not sure how that works / if it is what I am looking for. Here is some todo app code to help explain the problem:
import { ref } from 'vue'
import { trpc } from './trpc' // the TRPC proxy client

const todos = ref<Type>()

trpc.todos.subscribe(undefined, {
onData(data) {
todos.value = data;
},
});
import { ref } from 'vue'
import { trpc } from './trpc' // the TRPC proxy client

const todos = ref<Type>()

trpc.todos.subscribe(undefined, {
onData(data) {
todos.value = data;
},
});
I need to infer the type (Type) of onData's data before the subscription is called so I can type the reactive ref that will receive the todos. I have created the following inferSubscriptionObservable type that extracts the observable from the client:
type inferSubscriptionOutput<T extends (...args: any) => any> = Parameters<
NonNullable<Parameters<T>[1]["onData"]>
>[0];

const todos = ref<inferSubscriptionOutput<typeof trpc.todos.subscribe>>()
type inferSubscriptionOutput<T extends (...args: any) => any> = Parameters<
NonNullable<Parameters<T>[1]["onData"]>
>[0];

const todos = ref<inferSubscriptionOutput<typeof trpc.todos.subscribe>>()
It's working for me but I suspect there is a better way of doing this using the AppRouter type. Something similar to inferSubscriptionOutput from 9.x? so I could do
const todos = ref<inferSubscriptionOutput<AppRouter["todos"]>>();
const todos = ref<inferSubscriptionOutput<AppRouter["todos"]>>();
Do you agree that this is missing from 10.x? I am not sure that I have enough familiarity with typescript and trpc to work this out myself but happy to file a feature request and help out, etc.
MM
Michael McAndrew165d ago
I see someone asked a similar question here: https://github.com/trpc/trpc/issues/3996. They have marked it as resolved but did not provide a working example so I'm not sure how to use it (and the issue is now closed)
GitHub
Issues · trpc/trpc
🧙‍♀️ Move Fast and Break Nothing. End-to-end typesafe APIs made easy. - Issues · trpc/trpc