From c23af214a375ee2df6f04872a1e52f265abbc624 Mon Sep 17 00:00:00 2001 From: Robert Soriano Date: Fri, 20 May 2022 11:26:43 -0700 Subject: [PATCH] remove helpers --- src/module.ts | 6 ---- src/runtime/helpers.d.ts | 71 ---------------------------------------- 2 files changed, 77 deletions(-) delete mode 100644 src/runtime/helpers.d.ts diff --git a/src/module.ts b/src/module.ts index cba0f04..85f9923 100644 --- a/src/module.ts +++ b/src/module.ts @@ -78,12 +78,6 @@ export default defineNuxtModule({ ` }, }) - - addTemplate({ - filename: 'trpc-helpers.ts', - write: true, - src: join(runtimeDir, 'helpers.d.ts'), - }) }, }) diff --git a/src/runtime/helpers.d.ts b/src/runtime/helpers.d.ts deleted file mode 100644 index f405d26..0000000 --- a/src/runtime/helpers.d.ts +++ /dev/null @@ -1,71 +0,0 @@ -import type { inferProcedureInput, inferProcedureOutput, inferSubscriptionOutput } from '@trpc/server' -// @ts-expect-error: Resolved by Nuxt -import type { router } from '~/server/trpc' - -type AppRouter = typeof router - -/** - * Enum containing all api query paths - */ -export type TQuery = keyof AppRouter['_def']['queries'] - -/** - * Enum containing all api mutation paths - */ -export type TMutation = keyof AppRouter['_def']['mutations'] - -/** - * Enum containing all api subscription paths - */ -export type TSubscription = keyof AppRouter['_def']['subscriptions'] - -/** - * This is a helper method to infer the output of a query resolver - * @example type HelloOutput = InferQueryOutput<'hello'> - */ -export type InferQueryOutput = inferProcedureOutput< - AppRouter['_def']['queries'][TRouteKey] -> - -/** - * This is a helper method to infer the input of a query resolver - * @example type HelloInput = InferQueryInput<'hello'> - */ -export type InferQueryInput = inferProcedureInput< - AppRouter['_def']['queries'][TRouteKey] -> - -/** - * This is a helper method to infer the output of a mutation resolver - * @example type HelloOutput = InferMutationOutput<'hello'> - */ -export type InferMutationOutput = - inferProcedureOutput - -/** - * This is a helper method to infer the input of a mutation resolver - * @example type HelloInput = InferMutationInput<'hello'> - */ -export type InferMutationInput = - inferProcedureInput - -/** - * This is a helper method to infer the output of a subscription resolver - * @example type HelloOutput = InferSubscriptionOutput<'hello'> - */ -export type InferSubscriptionOutput = - inferProcedureOutput - -/** - * This is a helper method to infer the asynchronous output of a subscription resolver - * @example type HelloAsyncOutput = InferAsyncSubscriptionOutput<'hello'> - */ -export type InferAsyncSubscriptionOutput = - inferSubscriptionOutput - -/** - * This is a helper method to infer the input of a subscription resolver - * @example type HelloInput = InferSubscriptionInput<'hello'> - */ -export type InferSubscriptionInput = - inferProcedureInput