Skip to content

Commit

Permalink
fix: stopped using internal types of trpc and nuxt
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexXanderGrib committed Feb 6, 2024
1 parent 61c0241 commit 3e31581
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/client/types.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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, K extends Array<string>> = T extends Array<any> ? T : T extends Record<string, any> ? keyof T extends K[number] ? T : K[number] extends never ? T : Pick<T, K[number]> : T;
type KeysOf<T> = Array<T extends T ? keyof T extends string ? keyof T : never : never>;

type TRPCSubscriptionObserver<TValue, TError> = {
onStarted: () => void;
onData: (value: TValue) => void;
onError: (err: TError) => void;
onStopped: () => void;
onComplete: () => void;
}

interface TRPCRequestOptions extends _TRPCRequestOptions {
abortOnUnmount?: boolean
}
Expand Down

0 comments on commit 3e31581

Please sign in to comment.