@trpc/react-query 10.28.0 → 10.28.1
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.
- package/dist/{context-1da55110.js → context-4557b3d3.js} +31 -31
- package/dist/{createHooksInternal-bd7db1e7.js → createHooksInternal-15c02f18.js} +472 -472
- package/dist/createTRPCReact.d.ts +75 -75
- package/dist/createTRPCReact.d.ts.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/internals/context.d.ts +127 -127
- package/dist/internals/context.d.ts.map +1 -1
- package/dist/internals/getArrayQueryKey.d.ts +24 -24
- package/dist/internals/getArrayQueryKey.d.ts.map +1 -1
- package/dist/internals/getClientArgs.d.ts +1 -1
- package/dist/internals/getQueryKey.d.ts +30 -30
- package/dist/internals/getQueryKey.d.ts.map +1 -1
- package/dist/internals/useHookResult.d.ts +9 -9
- package/dist/internals/useQueries.d.ts +27 -27
- package/dist/internals/useQueries.d.ts.map +1 -1
- package/dist/interop.d.ts +10 -10
- package/dist/{queryClient-77734cc3.js → queryClient-1c8d7d8a.js} +3 -3
- package/dist/server/index.d.ts +3 -3
- package/dist/server/ssgProxy.d.ts +36 -36
- package/dist/server/ssgProxy.d.ts.map +1 -1
- package/dist/server/types.d.ts +9 -9
- package/dist/server/types.d.ts.map +1 -1
- package/dist/shared/hooks/createHooksInternal.d.ts +27 -27
- package/dist/shared/hooks/createRootHooks.d.ts +6 -6
- package/dist/shared/hooks/deprecated/createHooksInternal.d.ts +60 -60
- package/dist/shared/hooks/deprecated/createHooksInternal.d.ts.map +1 -1
- package/dist/shared/hooks/types.d.ts +81 -81
- package/dist/shared/hooks/types.d.ts.map +1 -1
- package/dist/shared/index.d.ts +21 -21
- package/dist/shared/polymorphism/index.d.ts +4 -4
- package/dist/shared/polymorphism/mutationLike.d.ts +17 -17
- package/dist/shared/polymorphism/mutationLike.d.ts.map +1 -1
- package/dist/shared/polymorphism/queryLike.d.ts +17 -17
- package/dist/shared/polymorphism/queryLike.d.ts.map +1 -1
- package/dist/shared/polymorphism/routerLike.d.ts +9 -9
- package/dist/shared/polymorphism/routerLike.d.ts.map +1 -1
- package/dist/shared/polymorphism/utilsLike.d.ts +6 -6
- package/dist/shared/polymorphism/utilsLike.d.ts.map +1 -1
- package/dist/shared/proxy/decorationProxy.d.ts +7 -7
- package/dist/shared/proxy/useQueriesProxy.d.ts +17 -17
- package/dist/shared/proxy/useQueriesProxy.d.ts.map +1 -1
- package/dist/shared/proxy/utilsProxy.d.ts +93 -93
- package/dist/shared/proxy/utilsProxy.d.ts.map +1 -1
- package/dist/shared/queryClient.d.ts +15 -15
- package/dist/shared/queryClient.d.ts.map +1 -1
- package/dist/shared/types.d.ts +52 -52
- package/dist/ssg/index.d.ts +14 -14
- package/dist/ssg/ssg.d.ts +15 -15
- package/dist/ssg/ssg.d.ts.map +1 -1
- package/dist/utils/inferReactQueryProcedure.d.ts +23 -23
- package/dist/utils/inferReactQueryProcedure.d.ts.map +1 -1
- package/package.json +7 -7
|
@@ -1,94 +1,94 @@
|
|
|
1
|
-
import { CancelOptions, InfiniteData, InvalidateOptions, InvalidateQueryFilters, Query, RefetchOptions, RefetchQueryFilters, ResetOptions, SetDataOptions, Updater } from '@tanstack/react-query';
|
|
2
|
-
import { TRPCClientError } from '@trpc/client';
|
|
3
|
-
import { AnyQueryProcedure, AnyRouter, DeepPartial, Filter, ProtectedIntersection, inferProcedureInput } from '@trpc/server';
|
|
4
|
-
import { inferTransformedProcedureOutput } from '@trpc/server/shared';
|
|
5
|
-
import { DecoratedProxyTRPCContextProps, TRPCFetchInfiniteQueryOptions, TRPCFetchQueryOptions } from '../../internals/context';
|
|
6
|
-
import { TRPCContextState } from '../../internals/context';
|
|
7
|
-
import { QueryKeyKnown } from '../../internals/getArrayQueryKey';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientfetchquery
|
|
11
|
-
*/
|
|
12
|
-
fetch(input: inferProcedureInput<TProcedure>, opts?: TRPCFetchQueryOptions<inferProcedureInput<TProcedure>, TRPCClientError<TProcedure>, inferTransformedProcedureOutput<TProcedure>>): Promise<inferTransformedProcedureOutput<TProcedure>>;
|
|
13
|
-
/**
|
|
14
|
-
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientfetchinfinitequery
|
|
15
|
-
*/
|
|
16
|
-
fetchInfinite(input: inferProcedureInput<TProcedure>, opts?: TRPCFetchInfiniteQueryOptions<inferProcedureInput<TProcedure>, TRPCClientError<TProcedure>, inferTransformedProcedureOutput<TProcedure>>): Promise<InfiniteData<inferTransformedProcedureOutput<TProcedure>>>;
|
|
17
|
-
/**
|
|
18
|
-
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientprefetchquery
|
|
19
|
-
*/
|
|
20
|
-
prefetch(input: inferProcedureInput<TProcedure>, opts?: TRPCFetchQueryOptions<inferProcedureInput<TProcedure>, TRPCClientError<TProcedure>, inferTransformedProcedureOutput<TProcedure>>): Promise<void>;
|
|
21
|
-
/**
|
|
22
|
-
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientprefetchinfinitequery
|
|
23
|
-
*/
|
|
24
|
-
prefetchInfinite(input: inferProcedureInput<TProcedure>, opts?: TRPCFetchInfiniteQueryOptions<inferProcedureInput<TProcedure>, TRPCClientError<TProcedure>, inferTransformedProcedureOutput<TProcedure>>): Promise<void>;
|
|
25
|
-
/**
|
|
26
|
-
* @link https://tanstack.com/query/v4/docs/react/reference/QueryClient#queryclientensurequerydata
|
|
27
|
-
*/
|
|
28
|
-
ensureData(input: inferProcedureInput<TProcedure>, opts?: TRPCFetchQueryOptions<inferProcedureInput<TProcedure>, TRPCClientError<TProcedure>, inferTransformedProcedureOutput<TProcedure>>): Promise<inferTransformedProcedureOutput<TProcedure>>;
|
|
29
|
-
/**
|
|
30
|
-
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientinvalidatequeries
|
|
31
|
-
*/
|
|
32
|
-
invalidate(input?: DeepPartial<inferProcedureInput<TProcedure>>, filters?: Omit<InvalidateQueryFilters, 'predicate'> & {
|
|
33
|
-
predicate?: (query: Query<inferProcedureInput<TProcedure>, TRPCClientError<TProcedure>, inferProcedureInput<TProcedure>, QueryKeyKnown<inferProcedureInput<TProcedure>, inferProcedureInput<TProcedure> extends {
|
|
34
|
-
cursor?: any;
|
|
35
|
-
} | void ? 'infinite' : 'query'>>) => boolean;
|
|
36
|
-
}, options?: InvalidateOptions): Promise<void>;
|
|
37
|
-
/**
|
|
38
|
-
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientrefetchqueries
|
|
39
|
-
*/
|
|
40
|
-
refetch(input?: inferProcedureInput<TProcedure>, filters?: RefetchQueryFilters, options?: RefetchOptions): Promise<void>;
|
|
41
|
-
/**
|
|
42
|
-
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientcancelqueries
|
|
43
|
-
*/
|
|
44
|
-
cancel(input?: inferProcedureInput<TProcedure>, options?: CancelOptions): Promise<void>;
|
|
45
|
-
/**
|
|
46
|
-
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientresetqueries
|
|
47
|
-
*/
|
|
48
|
-
reset(input?: inferProcedureInput<TProcedure>, options?: ResetOptions): Promise<void>;
|
|
49
|
-
/**
|
|
50
|
-
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientsetquerydata
|
|
51
|
-
*/
|
|
52
|
-
setData(
|
|
53
|
-
/**
|
|
54
|
-
* The input of the procedure
|
|
55
|
-
*/
|
|
56
|
-
input: inferProcedureInput<TProcedure>, updater: Updater<inferTransformedProcedureOutput<TProcedure> | undefined, inferTransformedProcedureOutput<TProcedure> | undefined>, options?: SetDataOptions): void;
|
|
57
|
-
/**
|
|
58
|
-
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientsetquerydata
|
|
59
|
-
*/
|
|
60
|
-
setInfiniteData(input: inferProcedureInput<TProcedure>, updater: Updater<InfiniteData<inferTransformedProcedureOutput<TProcedure>> | undefined, InfiniteData<inferTransformedProcedureOutput<TProcedure>> | undefined>, options?: SetDataOptions): void;
|
|
61
|
-
/**
|
|
62
|
-
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientgetquerydata
|
|
63
|
-
*/
|
|
64
|
-
getData(input?: inferProcedureInput<TProcedure>): inferTransformedProcedureOutput<TProcedure> | undefined;
|
|
65
|
-
/**
|
|
66
|
-
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientgetquerydata
|
|
67
|
-
*/
|
|
68
|
-
getInfiniteData(input?: inferProcedureInput<TProcedure>): InfiniteData<inferTransformedProcedureOutput<TProcedure>> | undefined;
|
|
69
|
-
};
|
|
70
|
-
/**
|
|
71
|
-
* this is the type that is used to add in procedures that can be used on
|
|
72
|
-
* an entire router
|
|
73
|
-
*/
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Invalidate the full router
|
|
77
|
-
* @link https://trpc.io/docs/v10/useContext#query-invalidation
|
|
78
|
-
* @link https://tanstack.com/query/v4/docs/react/guides/query-invalidation
|
|
79
|
-
*/
|
|
80
|
-
invalidate(input?: undefined, filters?: InvalidateQueryFilters, options?: InvalidateOptions): Promise<void>;
|
|
81
|
-
};
|
|
82
|
-
/**
|
|
83
|
-
* @internal
|
|
84
|
-
*/
|
|
85
|
-
export
|
|
86
|
-
[TKey in keyof Filter<TRouter['_def']['record'], AnyRouter | AnyQueryProcedure>]: TRouter['_def']['record'][TKey] extends AnyRouter ? DecoratedProcedureUtilsRecord<TRouter['_def']['record'][TKey]> & DecorateRouter : DecorateProcedure<TRouter['_def']['record'][TKey]>;
|
|
87
|
-
} & DecorateRouter;
|
|
88
|
-
export
|
|
89
|
-
/**
|
|
90
|
-
* @internal
|
|
91
|
-
*/
|
|
92
|
-
export declare function createReactQueryUtilsProxy<TRouter extends AnyRouter, TSSRContext>(context: TRPCContextState<AnyRouter, unknown>): ProtectedIntersection<DecoratedProxyTRPCContextProps<TRouter, TSSRContext>, DecoratedProcedureUtilsRecord<TRouter>>;
|
|
93
|
-
export {};
|
|
1
|
+
import { CancelOptions, InfiniteData, InvalidateOptions, InvalidateQueryFilters, Query, RefetchOptions, RefetchQueryFilters, ResetOptions, SetDataOptions, Updater } from '@tanstack/react-query';
|
|
2
|
+
import { TRPCClientError } from '@trpc/client';
|
|
3
|
+
import { AnyQueryProcedure, AnyRouter, DeepPartial, Filter, ProtectedIntersection, inferProcedureInput } from '@trpc/server';
|
|
4
|
+
import { inferTransformedProcedureOutput } from '@trpc/server/shared';
|
|
5
|
+
import { DecoratedProxyTRPCContextProps, TRPCFetchInfiniteQueryOptions, TRPCFetchQueryOptions } from '../../internals/context';
|
|
6
|
+
import { TRPCContextState } from '../../internals/context';
|
|
7
|
+
import { QueryKeyKnown } from '../../internals/getArrayQueryKey';
|
|
8
|
+
type DecorateProcedure<TProcedure extends AnyQueryProcedure> = {
|
|
9
|
+
/**
|
|
10
|
+
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientfetchquery
|
|
11
|
+
*/
|
|
12
|
+
fetch(input: inferProcedureInput<TProcedure>, opts?: TRPCFetchQueryOptions<inferProcedureInput<TProcedure>, TRPCClientError<TProcedure>, inferTransformedProcedureOutput<TProcedure>>): Promise<inferTransformedProcedureOutput<TProcedure>>;
|
|
13
|
+
/**
|
|
14
|
+
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientfetchinfinitequery
|
|
15
|
+
*/
|
|
16
|
+
fetchInfinite(input: inferProcedureInput<TProcedure>, opts?: TRPCFetchInfiniteQueryOptions<inferProcedureInput<TProcedure>, TRPCClientError<TProcedure>, inferTransformedProcedureOutput<TProcedure>>): Promise<InfiniteData<inferTransformedProcedureOutput<TProcedure>>>;
|
|
17
|
+
/**
|
|
18
|
+
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientprefetchquery
|
|
19
|
+
*/
|
|
20
|
+
prefetch(input: inferProcedureInput<TProcedure>, opts?: TRPCFetchQueryOptions<inferProcedureInput<TProcedure>, TRPCClientError<TProcedure>, inferTransformedProcedureOutput<TProcedure>>): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientprefetchinfinitequery
|
|
23
|
+
*/
|
|
24
|
+
prefetchInfinite(input: inferProcedureInput<TProcedure>, opts?: TRPCFetchInfiniteQueryOptions<inferProcedureInput<TProcedure>, TRPCClientError<TProcedure>, inferTransformedProcedureOutput<TProcedure>>): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* @link https://tanstack.com/query/v4/docs/react/reference/QueryClient#queryclientensurequerydata
|
|
27
|
+
*/
|
|
28
|
+
ensureData(input: inferProcedureInput<TProcedure>, opts?: TRPCFetchQueryOptions<inferProcedureInput<TProcedure>, TRPCClientError<TProcedure>, inferTransformedProcedureOutput<TProcedure>>): Promise<inferTransformedProcedureOutput<TProcedure>>;
|
|
29
|
+
/**
|
|
30
|
+
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientinvalidatequeries
|
|
31
|
+
*/
|
|
32
|
+
invalidate(input?: DeepPartial<inferProcedureInput<TProcedure>>, filters?: Omit<InvalidateQueryFilters, 'predicate'> & {
|
|
33
|
+
predicate?: (query: Query<inferProcedureInput<TProcedure>, TRPCClientError<TProcedure>, inferProcedureInput<TProcedure>, QueryKeyKnown<inferProcedureInput<TProcedure>, inferProcedureInput<TProcedure> extends {
|
|
34
|
+
cursor?: any;
|
|
35
|
+
} | void ? 'infinite' : 'query'>>) => boolean;
|
|
36
|
+
}, options?: InvalidateOptions): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientrefetchqueries
|
|
39
|
+
*/
|
|
40
|
+
refetch(input?: inferProcedureInput<TProcedure>, filters?: RefetchQueryFilters, options?: RefetchOptions): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientcancelqueries
|
|
43
|
+
*/
|
|
44
|
+
cancel(input?: inferProcedureInput<TProcedure>, options?: CancelOptions): Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientresetqueries
|
|
47
|
+
*/
|
|
48
|
+
reset(input?: inferProcedureInput<TProcedure>, options?: ResetOptions): Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientsetquerydata
|
|
51
|
+
*/
|
|
52
|
+
setData(
|
|
53
|
+
/**
|
|
54
|
+
* The input of the procedure
|
|
55
|
+
*/
|
|
56
|
+
input: inferProcedureInput<TProcedure>, updater: Updater<inferTransformedProcedureOutput<TProcedure> | undefined, inferTransformedProcedureOutput<TProcedure> | undefined>, options?: SetDataOptions): void;
|
|
57
|
+
/**
|
|
58
|
+
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientsetquerydata
|
|
59
|
+
*/
|
|
60
|
+
setInfiniteData(input: inferProcedureInput<TProcedure>, updater: Updater<InfiniteData<inferTransformedProcedureOutput<TProcedure>> | undefined, InfiniteData<inferTransformedProcedureOutput<TProcedure>> | undefined>, options?: SetDataOptions): void;
|
|
61
|
+
/**
|
|
62
|
+
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientgetquerydata
|
|
63
|
+
*/
|
|
64
|
+
getData(input?: inferProcedureInput<TProcedure>): inferTransformedProcedureOutput<TProcedure> | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientgetquerydata
|
|
67
|
+
*/
|
|
68
|
+
getInfiniteData(input?: inferProcedureInput<TProcedure>): InfiniteData<inferTransformedProcedureOutput<TProcedure>> | undefined;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* this is the type that is used to add in procedures that can be used on
|
|
72
|
+
* an entire router
|
|
73
|
+
*/
|
|
74
|
+
type DecorateRouter = {
|
|
75
|
+
/**
|
|
76
|
+
* Invalidate the full router
|
|
77
|
+
* @link https://trpc.io/docs/v10/useContext#query-invalidation
|
|
78
|
+
* @link https://tanstack.com/query/v4/docs/react/guides/query-invalidation
|
|
79
|
+
*/
|
|
80
|
+
invalidate(input?: undefined, filters?: InvalidateQueryFilters, options?: InvalidateOptions): Promise<void>;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* @internal
|
|
84
|
+
*/
|
|
85
|
+
export type DecoratedProcedureUtilsRecord<TRouter extends AnyRouter> = {
|
|
86
|
+
[TKey in keyof Filter<TRouter['_def']['record'], AnyRouter | AnyQueryProcedure>]: TRouter['_def']['record'][TKey] extends AnyRouter ? DecoratedProcedureUtilsRecord<TRouter['_def']['record'][TKey]> & DecorateRouter : DecorateProcedure<TRouter['_def']['record'][TKey]>;
|
|
87
|
+
} & DecorateRouter;
|
|
88
|
+
export type CreateReactUtilsProxy<TRouter extends AnyRouter, TSSRContext> = ProtectedIntersection<DecoratedProxyTRPCContextProps<TRouter, TSSRContext>, DecoratedProcedureUtilsRecord<TRouter>>;
|
|
89
|
+
/**
|
|
90
|
+
* @internal
|
|
91
|
+
*/
|
|
92
|
+
export declare function createReactQueryUtilsProxy<TRouter extends AnyRouter, TSSRContext>(context: TRPCContextState<AnyRouter, unknown>): ProtectedIntersection<DecoratedProxyTRPCContextProps<TRouter, TSSRContext>, DecoratedProcedureUtilsRecord<TRouter>>;
|
|
93
|
+
export {};
|
|
94
94
|
//# sourceMappingURL=utilsProxy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilsProxy.d.ts","sourceRoot":"","sources":["../../../src/shared/proxy/utilsProxy.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,sBAAsB,EACtB,KAAK,EACL,cAAc,EACd,mBAAmB,EACnB,YAAY,EACZ,cAAc,EACd,OAAO,EACR,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,eAAe,E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S,SAAS,EACzB,WAAW,IACT,qBAAqB,CACvB,8BAA8B,CAAC,OAAO,EAAE,WAAW,CAAC,EACpD,6BAA6B,CAAC,OAAO,CAAC,CACvC,CAAC;AAEF;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,SAAS,SAAS,EACzB,WAAW,EACX,OAAO,EAAE,gBAAgB,CAAC,SAAS,EAAE,OAAO,CAAC,uHAmE9C"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { QueryClient, QueryClientConfig } from '@tanstack/react-query';
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
*/
|
|
5
|
-
export
|
|
6
|
-
queryClient?: QueryClient;
|
|
7
|
-
queryClientConfig?: never;
|
|
8
|
-
} | {
|
|
9
|
-
queryClientConfig?: QueryClientConfig;
|
|
10
|
-
queryClient?: never;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* @internal
|
|
14
|
-
*/
|
|
15
|
-
export declare const getQueryClient: (config: CreateTRPCReactQueryClientConfig) => QueryClient;
|
|
1
|
+
import { QueryClient, QueryClientConfig } from '@tanstack/react-query';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export type CreateTRPCReactQueryClientConfig = {
|
|
6
|
+
queryClient?: QueryClient;
|
|
7
|
+
queryClientConfig?: never;
|
|
8
|
+
} | {
|
|
9
|
+
queryClientConfig?: QueryClientConfig;
|
|
10
|
+
queryClient?: never;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export declare const getQueryClient: (config: CreateTRPCReactQueryClientConfig) => QueryClient;
|
|
16
16
|
//# sourceMappingURL=queryClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryClient.d.ts","sourceRoot":"","sources":["../../src/shared/queryClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAEvE;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"queryClient.d.ts","sourceRoot":"","sources":["../../src/shared/queryClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAEvE;;GAEG;AACH,MAAM,MAAM,gCAAgC,GACxC;IACE,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,iBAAiB,CAAC,EAAE,KAAK,CAAC;CAC3B,GACD;IACE,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,WAAW,CAAC,EAAE,KAAK,CAAC;CACrB,CAAC;AAEN;;GAEG;AACH,eAAO,MAAM,cAAc,WAAY,gCAAgC,gBACN,CAAC"}
|
package/dist/shared/types.d.ts
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { QueryClient } from '@tanstack/react-query';
|
|
3
|
-
import { AnyRouter, MaybePromise } from '@trpc/server';
|
|
4
|
-
/**
|
|
5
|
-
* @internal
|
|
6
|
-
*/
|
|
7
|
-
export interface UseMutationOverride {
|
|
8
|
-
onSuccess: (opts: {
|
|
9
|
-
/**
|
|
10
|
-
* Calls the original function that was defined in the query's `onSuccess` option
|
|
11
|
-
*/
|
|
12
|
-
originalFn: () => MaybePromise<unknown>;
|
|
13
|
-
queryClient: QueryClient;
|
|
14
|
-
/**
|
|
15
|
-
* Meta data passed in from the `useMutation()` hook
|
|
16
|
-
*/
|
|
17
|
-
meta: Record<string, unknown>;
|
|
18
|
-
}) => MaybePromise<unknown>;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* @internal
|
|
22
|
-
*/
|
|
23
|
-
export interface CreateTRPCReactOptions<_TRouter extends AnyRouter> {
|
|
24
|
-
/**
|
|
25
|
-
* Override behaviors of the built-in hooks
|
|
26
|
-
* @deprecated use `overrides` instead
|
|
27
|
-
*/
|
|
28
|
-
unstable_overrides?: {
|
|
29
|
-
useMutation?: Partial<UseMutationOverride>;
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* Override behaviors of the built-in hooks
|
|
33
|
-
*/
|
|
34
|
-
overrides?: {
|
|
35
|
-
useMutation?: Partial<UseMutationOverride>;
|
|
36
|
-
};
|
|
37
|
-
/**
|
|
38
|
-
* Abort all queries when unmounting
|
|
39
|
-
* @default false
|
|
40
|
-
*/
|
|
41
|
-
abortOnUnmount?: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* Override the default context provider
|
|
44
|
-
* @default undefined
|
|
45
|
-
*/
|
|
46
|
-
context?: React.Context<any>;
|
|
47
|
-
/**
|
|
48
|
-
* Override the default React Query context
|
|
49
|
-
* @default undefined
|
|
50
|
-
*/
|
|
51
|
-
reactQueryContext?: React.Context<QueryClient | undefined>;
|
|
52
|
-
}
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
3
|
+
import { AnyRouter, MaybePromise } from '@trpc/server';
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export interface UseMutationOverride {
|
|
8
|
+
onSuccess: (opts: {
|
|
9
|
+
/**
|
|
10
|
+
* Calls the original function that was defined in the query's `onSuccess` option
|
|
11
|
+
*/
|
|
12
|
+
originalFn: () => MaybePromise<unknown>;
|
|
13
|
+
queryClient: QueryClient;
|
|
14
|
+
/**
|
|
15
|
+
* Meta data passed in from the `useMutation()` hook
|
|
16
|
+
*/
|
|
17
|
+
meta: Record<string, unknown>;
|
|
18
|
+
}) => MaybePromise<unknown>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
export interface CreateTRPCReactOptions<_TRouter extends AnyRouter> {
|
|
24
|
+
/**
|
|
25
|
+
* Override behaviors of the built-in hooks
|
|
26
|
+
* @deprecated use `overrides` instead
|
|
27
|
+
*/
|
|
28
|
+
unstable_overrides?: {
|
|
29
|
+
useMutation?: Partial<UseMutationOverride>;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Override behaviors of the built-in hooks
|
|
33
|
+
*/
|
|
34
|
+
overrides?: {
|
|
35
|
+
useMutation?: Partial<UseMutationOverride>;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Abort all queries when unmounting
|
|
39
|
+
* @default false
|
|
40
|
+
*/
|
|
41
|
+
abortOnUnmount?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Override the default context provider
|
|
44
|
+
* @default undefined
|
|
45
|
+
*/
|
|
46
|
+
context?: React.Context<any>;
|
|
47
|
+
/**
|
|
48
|
+
* Override the default React Query context
|
|
49
|
+
* @default undefined
|
|
50
|
+
*/
|
|
51
|
+
reactQueryContext?: React.Context<QueryClient | undefined>;
|
|
52
|
+
}
|
|
53
53
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/ssg/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export {
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated use `@trpc/react-query/server` instead
|
|
4
|
-
*/
|
|
5
|
-
type CreateSSGHelpersOptions,
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated use `@trpc/react-query/server` instead
|
|
8
|
-
*/
|
|
9
|
-
type DecoratedProcedureSSGRecord,
|
|
10
|
-
/**
|
|
11
|
-
* @deprecated use `import { createServerSideHelpers } from "@trpc/react-query/server"`
|
|
12
|
-
*/
|
|
13
|
-
createServerSideHelpers as createProxySSGHelpers, } from '../server';
|
|
14
|
-
export { createSSGHelpers } from './ssg';
|
|
1
|
+
export {
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated use `@trpc/react-query/server` instead
|
|
4
|
+
*/
|
|
5
|
+
type CreateSSGHelpersOptions,
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated use `@trpc/react-query/server` instead
|
|
8
|
+
*/
|
|
9
|
+
type DecoratedProcedureSSGRecord,
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated use `import { createServerSideHelpers } from "@trpc/react-query/server"`
|
|
12
|
+
*/
|
|
13
|
+
createServerSideHelpers as createProxySSGHelpers, } from '../server';
|
|
14
|
+
export { createSSGHelpers } from './ssg';
|
|
15
15
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/ssg/ssg.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { DehydrateOptions, DehydratedState, InfiniteData } from '@tanstack/react-query';
|
|
2
|
-
import { AnyRouter, inferProcedureOutput } from '@trpc/server';
|
|
3
|
-
import { CreateSSGHelpersOptions } from '../server/types';
|
|
4
|
-
/**
|
|
5
|
-
* Create functions you can use for server-side rendering / static generation
|
|
6
|
-
* @deprecated use `createServerSideHelpers` instead
|
|
7
|
-
*/
|
|
8
|
-
export declare function createSSGHelpers<TRouter extends AnyRouter>(opts: CreateSSGHelpersOptions<TRouter>): {
|
|
9
|
-
prefetchQuery: <TPath extends keyof TRouter["_def"]["queries"] & string, TProcedure extends TRouter["_def"]["queries"][TPath]>(path: TPath, ...args:
|
|
10
|
-
prefetchInfiniteQuery: <TPath_1 extends keyof TRouter["_def"]["queries"] & string, TProcedure_1 extends TRouter["_def"]["queries"][TPath_1]>(path: TPath_1, ...args:
|
|
11
|
-
fetchQuery: <TPath_2 extends keyof TRouter["_def"]["queries"] & string, TProcedure_2 extends TRouter["_def"]["queries"][TPath_2], TOutput extends inferProcedureOutput<TProcedure_2>>(path: TPath_2, ...args:
|
|
12
|
-
fetchInfiniteQuery: <TPath_3 extends keyof TRouter["_def"]["queries"] & string, TProcedure_3 extends TRouter["_def"]["queries"][TPath_3], TOutput_1 extends inferProcedureOutput<TProcedure_3>>(path: TPath_3, ...args:
|
|
13
|
-
dehydrate: (opts?: DehydrateOptions) => DehydratedState;
|
|
14
|
-
queryClient: import("@tanstack/react-query").QueryClient;
|
|
15
|
-
};
|
|
1
|
+
import { DehydrateOptions, DehydratedState, InfiniteData } from '@tanstack/react-query';
|
|
2
|
+
import { AnyRouter, inferHandlerInput, inferProcedureOutput } from '@trpc/server';
|
|
3
|
+
import { CreateSSGHelpersOptions } from '../server/types';
|
|
4
|
+
/**
|
|
5
|
+
* Create functions you can use for server-side rendering / static generation
|
|
6
|
+
* @deprecated use `createServerSideHelpers` instead
|
|
7
|
+
*/
|
|
8
|
+
export declare function createSSGHelpers<TRouter extends AnyRouter>(opts: CreateSSGHelpersOptions<TRouter>): {
|
|
9
|
+
prefetchQuery: <TPath extends keyof TRouter["_def"]["queries"] & string, TProcedure extends TRouter["_def"]["queries"][TPath]>(path: TPath, ...args: inferHandlerInput<TProcedure>) => Promise<void>;
|
|
10
|
+
prefetchInfiniteQuery: <TPath_1 extends keyof TRouter["_def"]["queries"] & string, TProcedure_1 extends TRouter["_def"]["queries"][TPath_1]>(path: TPath_1, ...args: inferHandlerInput<TProcedure_1>) => Promise<void>;
|
|
11
|
+
fetchQuery: <TPath_2 extends keyof TRouter["_def"]["queries"] & string, TProcedure_2 extends TRouter["_def"]["queries"][TPath_2], TOutput extends inferProcedureOutput<TProcedure_2>>(path: TPath_2, ...args: inferHandlerInput<TProcedure_2>) => Promise<TOutput>;
|
|
12
|
+
fetchInfiniteQuery: <TPath_3 extends keyof TRouter["_def"]["queries"] & string, TProcedure_3 extends TRouter["_def"]["queries"][TPath_3], TOutput_1 extends inferProcedureOutput<TProcedure_3>>(path: TPath_3, ...args: inferHandlerInput<TProcedure_3>) => Promise<InfiniteData<TOutput_1>>;
|
|
13
|
+
dehydrate: (opts?: DehydrateOptions) => DehydratedState;
|
|
14
|
+
queryClient: import("@tanstack/react-query").QueryClient;
|
|
15
|
+
};
|
|
16
16
|
//# sourceMappingURL=ssg.d.ts.map
|
package/dist/ssg/ssg.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssg.d.ts","sourceRoot":"","sources":["../../src/ssg/ssg.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,YAAY,EAEb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,SAAS,
|
|
1
|
+
{"version":3,"file":"ssg.d.ts","sourceRoot":"","sources":["../../src/ssg/ssg.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,YAAY,EAEb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,SAAS,EAET,iBAAiB,EACjB,oBAAoB,EACrB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAG1D;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,SAAS,SAAS,EACxD,IAAI,EAAE,uBAAuB,CAAC,OAAO,CAAC;;;;;uBA6F9B,gBAAgB,KAMrB,eAAe;;EAcnB"}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { TRPCClientErrorLike } from '@trpc/client';
|
|
2
|
-
import { AnyMutationProcedure, AnyProcedure, AnyQueryProcedure, AnyRouter, inferProcedureInput } from '@trpc/server';
|
|
3
|
-
import { inferTransformedProcedureOutput } from '@trpc/server/shared';
|
|
4
|
-
import { UseTRPCMutationOptions, UseTRPCMutationResult, UseTRPCQueryOptions, UseTRPCQueryResult } from '../shared';
|
|
5
|
-
/**
|
|
6
|
-
* @internal
|
|
7
|
-
*/
|
|
8
|
-
export
|
|
9
|
-
/**
|
|
10
|
-
* @internal
|
|
11
|
-
*/
|
|
12
|
-
export
|
|
13
|
-
/**
|
|
14
|
-
* @internal
|
|
15
|
-
*/
|
|
16
|
-
export
|
|
17
|
-
/**
|
|
18
|
-
* @internal
|
|
19
|
-
*/
|
|
20
|
-
export
|
|
21
|
-
export
|
|
22
|
-
[TKey in keyof TRouter['_def']['record']]: TRouter['_def']['record'][TKey] extends infer TRouterOrProcedure ? TRouterOrProcedure extends AnyRouter ? inferReactQueryProcedureOptions<TRouterOrProcedure, `${TPath}${TKey & string}.`> : TRouterOrProcedure extends AnyMutationProcedure ? InferMutationOptions<TRouterOrProcedure> : TRouterOrProcedure extends AnyQueryProcedure ? InferQueryOptions<TRouterOrProcedure, `${TPath}${TKey & string}`> : never : never;
|
|
23
|
-
};
|
|
1
|
+
import { TRPCClientErrorLike } from '@trpc/client';
|
|
2
|
+
import { AnyMutationProcedure, AnyProcedure, AnyQueryProcedure, AnyRouter, inferProcedureInput } from '@trpc/server';
|
|
3
|
+
import { inferTransformedProcedureOutput } from '@trpc/server/shared';
|
|
4
|
+
import { UseTRPCMutationOptions, UseTRPCMutationResult, UseTRPCQueryOptions, UseTRPCQueryResult } from '../shared';
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export type InferQueryOptions<TProcedure extends AnyProcedure, TPath extends string> = Omit<UseTRPCQueryOptions<TPath, inferProcedureInput<TProcedure>, inferTransformedProcedureOutput<TProcedure>, inferTransformedProcedureOutput<TProcedure>, TRPCClientErrorLike<TProcedure>>, 'select'>;
|
|
9
|
+
/**
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export type InferMutationOptions<TProcedure extends AnyProcedure> = UseTRPCMutationOptions<inferProcedureInput<TProcedure>, TRPCClientErrorLike<TProcedure>, inferTransformedProcedureOutput<TProcedure>>;
|
|
13
|
+
/**
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export type InferQueryResult<TProcedure extends AnyProcedure> = UseTRPCQueryResult<inferTransformedProcedureOutput<TProcedure>, TRPCClientErrorLike<TProcedure>>;
|
|
17
|
+
/**
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
export type InferMutationResult<TProcedure extends AnyProcedure, TContext = unknown> = UseTRPCMutationResult<inferTransformedProcedureOutput<TProcedure>, TRPCClientErrorLike<TProcedure>, inferProcedureInput<TProcedure>, TContext>;
|
|
21
|
+
export type inferReactQueryProcedureOptions<TRouter extends AnyRouter, TPath extends string = ''> = {
|
|
22
|
+
[TKey in keyof TRouter['_def']['record']]: TRouter['_def']['record'][TKey] extends infer TRouterOrProcedure ? TRouterOrProcedure extends AnyRouter ? inferReactQueryProcedureOptions<TRouterOrProcedure, `${TPath}${TKey & string}.`> : TRouterOrProcedure extends AnyMutationProcedure ? InferMutationOptions<TRouterOrProcedure> : TRouterOrProcedure extends AnyQueryProcedure ? InferQueryOptions<TRouterOrProcedure, `${TPath}${TKey & string}`> : never : never;
|
|
23
|
+
};
|
|
24
24
|
//# sourceMappingURL=inferReactQueryProcedure.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inferReactQueryProcedure.d.ts","sourceRoot":"","sources":["../../src/utils/inferReactQueryProcedure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EACL,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACT,mBAAmB,EACpB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,WAAW,CAAC;AAEnB;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"inferReactQueryProcedure.d.ts","sourceRoot":"","sources":["../../src/utils/inferReactQueryProcedure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EACL,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACT,mBAAmB,EACpB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,WAAW,CAAC;AAEnB;;GAEG;AACH,MAAM,MAAM,iBAAiB,CAC3B,UAAU,SAAS,YAAY,EAC/B,KAAK,SAAS,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iB,GAC5C,iBAAiB,CAAC,kBAAkB,EAAE,GAAG,KAAK,GAAG,IAAI,GAAG,MAAM,EAAE,CAAC,GACjE,KAAK,GACP,KAAK;CACV,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trpc/react-query",
|
|
3
|
-
"version": "10.28.
|
|
3
|
+
"version": "10.28.1",
|
|
4
4
|
"description": "The tRPC React library",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -64,17 +64,17 @@
|
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"@tanstack/react-query": "^4.18.0",
|
|
67
|
-
"@trpc/client": "10.28.
|
|
68
|
-
"@trpc/server": "10.28.
|
|
67
|
+
"@trpc/client": "10.28.1",
|
|
68
|
+
"@trpc/server": "10.28.1",
|
|
69
69
|
"react": ">=16.8.0",
|
|
70
70
|
"react-dom": ">=16.8.0"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@tanstack/react-query": "^4.18.0",
|
|
74
|
-
"@trpc/client": "10.28.
|
|
75
|
-
"@trpc/server": "10.28.
|
|
74
|
+
"@trpc/client": "10.28.1",
|
|
75
|
+
"@trpc/server": "10.28.1",
|
|
76
76
|
"@types/express": "^4.17.17",
|
|
77
|
-
"@types/node": "^18.
|
|
77
|
+
"@types/node": "^18.16.16",
|
|
78
78
|
"@types/react": "^18.2.6",
|
|
79
79
|
"eslint": "^8.40.0",
|
|
80
80
|
"express": "^4.17.1",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
"funding": [
|
|
92
92
|
"https://trpc.io/sponsor"
|
|
93
93
|
],
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "ea70b1c33899b66f964a7d11f5a8710148f03f8e"
|
|
95
95
|
}
|