diff --git a/src/client/types.ts b/src/client/types.ts index 91d8dfe..e07a53e 100644 --- a/src/client/types.ts +++ b/src/client/types.ts @@ -1,5 +1,4 @@ import type { TRPCClientErrorLike, TRPCRequestOptions as _TRPCRequestOptions } from '@trpc/client' -import { type TRPCSubscriptionObserver } from '@trpc/client/dist/internals/TRPCUntypedClient' import type { AnyMutationProcedure, AnyProcedure, @@ -13,10 +12,20 @@ import type { } from '@trpc/server' import { type inferObservableValue, type Unsubscribable } from '@trpc/server/observable' import { inferTransformedProcedureOutput } from '@trpc/server/shared' -import type { KeysOf, PickFrom } from 'nuxt/dist/app/composables/asyncData' import type { AsyncData, AsyncDataOptions } from 'nuxt/app' import type { Ref, UnwrapRef } from 'vue' +type PickFrom> = T extends Array ? T : T extends Record ? keyof T extends K[number] ? T : K[number] extends never ? T : Pick : T; +type KeysOf = Array; + +type TRPCSubscriptionObserver = { + onStarted: () => void; + onData: (value: TValue) => void; + onError: (err: TError) => void; + onStopped: () => void; + onComplete: () => void; +} + interface TRPCRequestOptions extends _TRPCRequestOptions { abortOnUnmount?: boolean }