diff --git a/src/orpc/client.ts b/src/orpc/client.ts index b1b8915..43b22fc 100644 --- a/src/orpc/client.ts +++ b/src/orpc/client.ts @@ -5,6 +5,7 @@ import { createTanstackQueryUtils } from '@orpc/tanstack-query' import { createIsomorphicFn } from '@tanstack/react-start' import { getRequestHeaders } from '@tanstack/react-start/server' import { router } from './router' +import type { APIClient } from './types' const getORPCClient = createIsomorphicFn() .server(() => @@ -18,9 +19,9 @@ const getORPCClient = createIsomorphicFn() const link = new RPCLink({ url: `${window.location.origin}/api/rpc`, }) - return createORPCClient>(link) + return createORPCClient(link) }) -const client = getORPCClient() +const client: APIClient = getORPCClient() export const orpc = createTanstackQueryUtils(client) diff --git a/src/orpc/types.ts b/src/orpc/types.ts new file mode 100644 index 0000000..988dcbb --- /dev/null +++ b/src/orpc/types.ts @@ -0,0 +1,4 @@ +import type { RouterClient } from '@orpc/server' +import type { router } from './router' + +export type APIClient = RouterClient