@orpc/react 0.18.0 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,7 +23,7 @@ export interface ProcedureUtils<TInput, TOutput> {
23
23
  setInfiniteQueryData: (input: SchemaInputForInfiniteQuery<TInput>, updater: Updater<InfiniteData<TOutput, InferCursor<TInput>> | undefined, InfiniteData<TOutput, InferCursor<TInput>> | undefined>, options?: SetDataOptions) => InfiniteData<TOutput, InferCursor<TInput>> | undefined;
24
24
  }
25
25
  export interface CreateProcedureUtilsOptions<TInput, TOutput> {
26
- client: ProcedureClient<TInput, TOutput>;
26
+ client: ProcedureClient<TInput, TOutput, any>;
27
27
  queryClient: QueryClient;
28
28
  /**
29
29
  * The path of procedure on sever
@@ -1,11 +1,11 @@
1
1
  import type { RouterClient } from '@orpc/server';
2
2
  import type { QueryClient } from '@tanstack/react-query';
3
3
  import { type Context } from 'react';
4
- export interface ORPCContextValue<T extends RouterClient<any>> {
4
+ export interface ORPCContextValue<T extends RouterClient<any, any>> {
5
5
  client: T;
6
6
  queryClient: QueryClient;
7
7
  }
8
- export type ORPCContext<T extends RouterClient<any>> = Context<ORPCContextValue<T> | undefined>;
9
- export declare function createORPCContext<T extends RouterClient<any>>(): ORPCContext<T>;
10
- export declare function useORPCContext<T extends RouterClient<any>>(context: ORPCContext<T>): ORPCContextValue<T>;
8
+ export type ORPCContext<T extends RouterClient<any, any>> = Context<ORPCContextValue<T> | undefined>;
9
+ export declare function createORPCContext<T extends RouterClient<any, any>>(): ORPCContext<T>;
10
+ export declare function useORPCContext<T extends RouterClient<any, any>>(context: ORPCContext<T>): ORPCContextValue<T>;
11
11
  //# sourceMappingURL=react-context.d.ts.map
@@ -2,10 +2,10 @@ import type { ProcedureClient, RouterClient } from '@orpc/server';
2
2
  import type { ORPCContext } from './react-context';
3
3
  import { type GeneralHooks } from './general-hooks';
4
4
  import { type ProcedureHooks } from './procedure-hooks';
5
- export type ORPCHooks<T extends RouterClient<any>> = T extends ProcedureClient<infer TInput, infer TOutput> ? ProcedureHooks<TInput, TOutput> & GeneralHooks<TInput, TOutput> : {
6
- [K in keyof T]: T[K] extends RouterClient<any> ? ORPCHooks<T[K]> : never;
5
+ export type ORPCHooks<T extends RouterClient<any, any>> = T extends ProcedureClient<infer TInput, infer TOutput, any> ? ProcedureHooks<TInput, TOutput> & GeneralHooks<TInput, TOutput> : {
6
+ [K in keyof T]: T[K] extends RouterClient<any, any> ? ORPCHooks<T[K]> : never;
7
7
  } & GeneralHooks<unknown, unknown>;
8
- export interface CreateORPCHooksOptions<T extends RouterClient<any>> {
8
+ export interface CreateORPCHooksOptions<T extends RouterClient<any, any>> {
9
9
  context: ORPCContext<T>;
10
10
  /**
11
11
  * The path of the router.
@@ -14,5 +14,5 @@ export interface CreateORPCHooksOptions<T extends RouterClient<any>> {
14
14
  */
15
15
  path?: string[];
16
16
  }
17
- export declare function createORPCHooks<T extends RouterClient<any>>(options: CreateORPCHooksOptions<T>): ORPCHooks<T>;
17
+ export declare function createORPCHooks<T extends RouterClient<any, any>>(options: CreateORPCHooksOptions<T>): ORPCHooks<T>;
18
18
  //# sourceMappingURL=react-hooks.d.ts.map
@@ -2,10 +2,10 @@ import type { ProcedureClient, RouterClient } from '@orpc/server';
2
2
  import type { ORPCContextValue } from './react-context';
3
3
  import { type GeneralUtils } from './general-utils';
4
4
  import { type ProcedureUtils } from './procedure-utils';
5
- export type ORPCUtils<T extends RouterClient<any>> = T extends ProcedureClient<infer TInput, infer TOutput> ? ProcedureUtils<TInput, TOutput> & GeneralUtils<TInput, TOutput> : {
6
- [K in keyof T]: T[K] extends RouterClient<any> ? ORPCUtils<T[K]> : never;
5
+ export type ORPCUtils<T extends RouterClient<any, any>> = T extends ProcedureClient<infer TInput, infer TOutput, any> ? ProcedureUtils<TInput, TOutput> & GeneralUtils<TInput, TOutput> : {
6
+ [K in keyof T]: T[K] extends RouterClient<any, any> ? ORPCUtils<T[K]> : never;
7
7
  } & GeneralUtils<unknown, unknown>;
8
- export interface CreateORPCUtilsOptions<T extends RouterClient<any>> {
8
+ export interface CreateORPCUtilsOptions<T extends RouterClient<any, any>> {
9
9
  contextValue: ORPCContextValue<T>;
10
10
  /**
11
11
  * The path of the router.
@@ -14,5 +14,5 @@ export interface CreateORPCUtilsOptions<T extends RouterClient<any>> {
14
14
  */
15
15
  path?: string[];
16
16
  }
17
- export declare function createORPCUtils<T extends RouterClient<any>>(options: CreateORPCUtilsOptions<T>): ORPCUtils<T>;
17
+ export declare function createORPCUtils<T extends RouterClient<any, any>>(options: CreateORPCUtilsOptions<T>): ORPCUtils<T>;
18
18
  //# sourceMappingURL=react-utils.d.ts.map
@@ -3,12 +3,12 @@ import type { ORPCContext, ORPCContextValue } from './react-context';
3
3
  import type { ORPCHooks } from './react-hooks';
4
4
  import type { ORPCUtils } from './react-utils';
5
5
  import type { UseQueries } from './use-queries/hook';
6
- export type ORPCReact<T extends RouterClient<any>> = ORPCHooks<T> & {
6
+ export type ORPCReact<T extends RouterClient<any, any>> = ORPCHooks<T> & {
7
7
  useContext: () => ORPCContextValue<T>;
8
8
  useUtils: () => ORPCUtils<T>;
9
9
  useQueries: UseQueries<T>;
10
10
  };
11
- export declare function createORPCReact<T extends RouterClient<any>>(): {
11
+ export declare function createORPCReact<T extends RouterClient<any, any>>(): {
12
12
  orpc: ORPCReact<T>;
13
13
  ORPCContext: ORPCContext<T>;
14
14
  };
@@ -8,7 +8,7 @@ export interface UseQueriesBuilder<TInput, TOutput> {
8
8
  (input: TInput, options?: SetOptional<UseQueryOptionsForUseQueries<TOutput>, 'queryFn' | 'queryKey'>): UseQueryOptionsForUseQueries<TOutput>;
9
9
  }
10
10
  export interface CreateUseQueriesBuilderOptions<TInput, TOutput> {
11
- client: ProcedureClient<TInput, TOutput>;
11
+ client: ProcedureClient<TInput, TOutput, any>;
12
12
  /**
13
13
  * The path of procedure on server
14
14
  */
@@ -1,14 +1,14 @@
1
1
  import type { ProcedureClient, RouterClient } from '@orpc/server';
2
2
  import { type UseQueriesBuilder } from './builder';
3
- export type UseQueriesBuilders<T extends RouterClient<any>> = T extends ProcedureClient<infer UInput, infer UOutput> ? UseQueriesBuilder<UInput, UOutput> : {
4
- [K in keyof T]: T[K] extends RouterClient<any> ? UseQueriesBuilders<T[K]> : never;
3
+ export type UseQueriesBuilders<T extends RouterClient<any, any>> = T extends ProcedureClient<infer UInput, infer UOutput, any> ? UseQueriesBuilder<UInput, UOutput> : {
4
+ [K in keyof T]: T[K] extends RouterClient<any, any> ? UseQueriesBuilders<T[K]> : never;
5
5
  };
6
- export interface CreateUseQueriesBuildersOptions<T extends RouterClient<any>> {
6
+ export interface CreateUseQueriesBuildersOptions<T extends RouterClient<any, any>> {
7
7
  client: T;
8
8
  /**
9
9
  * The path of router on server
10
10
  */
11
11
  path?: string[];
12
12
  }
13
- export declare function createUseQueriesBuilders<T extends RouterClient<any>>(options: CreateUseQueriesBuildersOptions<T>): UseQueriesBuilders<T>;
13
+ export declare function createUseQueriesBuilders<T extends RouterClient<any, any>>(options: CreateUseQueriesBuildersOptions<T>): UseQueriesBuilders<T>;
14
14
  //# sourceMappingURL=builders.d.ts.map
@@ -2,11 +2,11 @@ import type { RouterClient } from '@orpc/server';
2
2
  import type { QueriesOptions, QueriesResults } from '@tanstack/react-query';
3
3
  import type { ORPCContext } from '../react-context';
4
4
  import type { UseQueriesBuilders } from './builders';
5
- export interface UseQueries<T extends RouterClient<any>> {
5
+ export interface UseQueries<T extends RouterClient<any, any>> {
6
6
  <U extends Array<any> = [], UCombinedResult = QueriesResults<U>>(build: (builders: UseQueriesBuilders<T>) => [...QueriesOptions<U>], combine?: (result: QueriesResults<U>) => UCombinedResult): UCombinedResult;
7
7
  }
8
- export interface UseQueriesFactoryOptions<T extends RouterClient<any>> {
8
+ export interface UseQueriesFactoryOptions<T extends RouterClient<any, any>> {
9
9
  context: ORPCContext<T>;
10
10
  }
11
- export declare function useQueriesFactory<T extends RouterClient<any>>(options: UseQueriesFactoryOptions<T>): UseQueries<T>;
11
+ export declare function useQueriesFactory<T extends RouterClient<any, any>>(options: UseQueriesFactoryOptions<T>): UseQueries<T>;
12
12
  //# sourceMappingURL=hook.d.ts.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orpc/react",
3
3
  "type": "module",
4
- "version": "0.18.0",
4
+ "version": "0.20.0",
5
5
  "license": "MIT",
6
6
  "homepage": "https://orpc.unnoq.com",
7
7
  "repository": {
@@ -31,12 +31,12 @@
31
31
  "peerDependencies": {
32
32
  "@tanstack/react-query": ">=5.55.0",
33
33
  "react": ">=18.3.0",
34
- "@orpc/contract": "0.18.0",
35
- "@orpc/client": "0.18.0",
36
- "@orpc/server": "0.18.0"
34
+ "@orpc/contract": "0.20.0",
35
+ "@orpc/client": "0.20.0",
36
+ "@orpc/server": "0.20.0"
37
37
  },
38
38
  "dependencies": {
39
- "@orpc/shared": "0.18.0"
39
+ "@orpc/shared": "0.20.0"
40
40
  },
41
41
  "devDependencies": {
42
42
  "zod": "^3.24.1"