@trpc/react-query 10.28.0 → 10.28.2
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/README.md +1 -2
- package/dist/{context-1da55110.js → context-4557b3d3.js} +31 -31
- package/dist/{createHooksInternal-bd7db1e7.js → createHooksInternal-03506f75.js} +483 -472
- package/dist/{createHooksInternal-9f8a4b21.js → createHooksInternal-466f5861.js} +21 -7
- package/dist/{createHooksInternal-d15d0073.mjs → createHooksInternal-a6562110.mjs} +21 -7
- package/dist/createTRPCReact.d.ts +75 -75
- package/dist/createTRPCReact.d.ts.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +1 -1
- package/dist/index.mjs +2 -2
- package/dist/internals/context.d.ts +125 -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/interop.d.ts.map +1 -1
- 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/createHooksInternal.d.ts.map +1 -1
- 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/index.js +1 -1
- package/dist/shared/index.mjs +1 -1
- 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 +92 -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
- package/src/createTRPCReact.tsx +3 -3
- package/src/internals/context.tsx +3 -5
- package/src/internals/getQueryKey.ts +2 -2
- package/src/interop.ts +2 -2
- package/src/server/ssgProxy.ts +2 -2
- package/src/shared/hooks/createHooksInternal.tsx +38 -13
- package/src/shared/hooks/deprecated/createHooksInternal.tsx +10 -7
- package/src/shared/proxy/utilsProxy.ts +4 -4
- package/src/ssg/ssg.ts +2 -2
|
@@ -1,128 +1,126 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { FetchInfiniteQueryOptions, FetchQueryOptions, QueryClient } from '@tanstack/react-query';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export interface
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
*
|
|
27
|
-
* - `
|
|
28
|
-
* - `
|
|
29
|
-
*
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
* @
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}
|
|
126
|
-
export declare const TRPCContext: import("react").Context<any>;
|
|
127
|
-
export {};
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CancelOptions, FetchInfiniteQueryOptions, FetchQueryOptions, InfiniteData, InvalidateOptions, InvalidateQueryFilters, QueryClient, RefetchOptions, RefetchQueryFilters, ResetOptions, ResetQueryFilters, SetDataOptions, Updater } from '@tanstack/react-query';
|
|
3
|
+
import { CreateTRPCProxyClient, TRPCClient, TRPCClientError, TRPCRequestOptions } from '@trpc/client';
|
|
4
|
+
import type { AnyRouter } from '@trpc/server';
|
|
5
|
+
import { inferHandlerInput, inferProcedureInput } from '@trpc/server';
|
|
6
|
+
import { inferTransformedProcedureOutput } from '@trpc/server/shared';
|
|
7
|
+
export interface TRPCFetchQueryOptions<TInput, TError, TOutput> extends FetchQueryOptions<TInput, TError, TOutput>, TRPCRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
export interface TRPCFetchInfiniteQueryOptions<TInput, TError, TOutput> extends FetchInfiniteQueryOptions<TInput, TError, TOutput>, TRPCRequestOptions {
|
|
10
|
+
}
|
|
11
|
+
/** @internal */
|
|
12
|
+
export type SSRState = false | 'prepass' | 'mounting' | 'mounted';
|
|
13
|
+
export interface ProxyTRPCContextProps<TRouter extends AnyRouter, TSSRContext> {
|
|
14
|
+
/**
|
|
15
|
+
* The `TRPCClient`
|
|
16
|
+
*/
|
|
17
|
+
client: TRPCClient<TRouter>;
|
|
18
|
+
/**
|
|
19
|
+
* The SSR context when server-side rendering
|
|
20
|
+
* @default null
|
|
21
|
+
*/
|
|
22
|
+
ssrContext?: TSSRContext | null;
|
|
23
|
+
/**
|
|
24
|
+
* State of SSR hydration.
|
|
25
|
+
* - `false` if not using SSR.
|
|
26
|
+
* - `prepass` when doing a prepass to fetch queries' data
|
|
27
|
+
* - `mounting` before TRPCProvider has been rendered on the client
|
|
28
|
+
* - `mounted` when the TRPCProvider has been rendered on the client
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
ssrState?: SSRState;
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated pass abortOnUnmount to `createTRPCReact` instead
|
|
34
|
+
* Abort loading query calls when unmounting a component - usually when navigating to a new page
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
37
|
+
abortOnUnmount?: boolean;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* @internal
|
|
41
|
+
*/
|
|
42
|
+
export type DecoratedProxyTRPCContextProps<TRouter extends AnyRouter, TSSRContext> = ProxyTRPCContextProps<TRouter, TSSRContext> & {
|
|
43
|
+
client: CreateTRPCProxyClient<TRouter>;
|
|
44
|
+
};
|
|
45
|
+
export interface TRPCContextProps<TRouter extends AnyRouter, TSSRContext> extends ProxyTRPCContextProps<TRouter, TSSRContext> {
|
|
46
|
+
/**
|
|
47
|
+
* The react-query `QueryClient`
|
|
48
|
+
*/
|
|
49
|
+
queryClient: QueryClient;
|
|
50
|
+
}
|
|
51
|
+
export declare const contextProps: (keyof ProxyTRPCContextProps<any, any>)[];
|
|
52
|
+
/** @internal */
|
|
53
|
+
type TRPCContextResetQueries<TRouter extends AnyRouter> =
|
|
54
|
+
/**
|
|
55
|
+
* @link https://tanstack.com/query/v4/docs/react/reference/QueryClient#queryclientresetqueries
|
|
56
|
+
*/
|
|
57
|
+
(<TPath extends keyof TRouter['_def']['queries'] & string, TInput extends inferProcedureInput<TRouter['_def']['queries'][TPath]>>(pathAndInput?: [TPath, TInput?] | TPath, filters?: ResetQueryFilters, options?: ResetOptions) => Promise<void>) &
|
|
58
|
+
/**
|
|
59
|
+
* @link https://tanstack.com/query/v4/docs/react/reference/QueryClient#queryclientresetqueries
|
|
60
|
+
*/
|
|
61
|
+
((filters?: ResetQueryFilters, options?: ResetOptions) => Promise<void>);
|
|
62
|
+
/**
|
|
63
|
+
* @deprecated
|
|
64
|
+
* @internal
|
|
65
|
+
**/
|
|
66
|
+
export interface TRPCContextState<TRouter extends AnyRouter, TSSRContext = undefined> extends Required<TRPCContextProps<TRouter, TSSRContext>> {
|
|
67
|
+
/**
|
|
68
|
+
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientfetchquery
|
|
69
|
+
*/
|
|
70
|
+
fetchQuery: <TPath extends keyof TRouter['_def']['queries'] & string, TProcedure extends TRouter['_def']['queries'][TPath], TOutput extends inferTransformedProcedureOutput<TProcedure>, TInput extends inferProcedureInput<TProcedure>>(pathAndInput: [path: TPath, ...args: inferHandlerInput<TProcedure>], opts?: TRPCFetchQueryOptions<TInput, TRPCClientError<TProcedure>, TOutput>) => Promise<TOutput>;
|
|
71
|
+
/**
|
|
72
|
+
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientfetchinfinitequery
|
|
73
|
+
*/
|
|
74
|
+
fetchInfiniteQuery: <TPath extends keyof TRouter['_def']['queries'] & string, TProcedure extends TRouter['_def']['queries'][TPath], TOutput extends inferTransformedProcedureOutput<TProcedure>, TInput extends inferProcedureInput<TProcedure>>(pathAndInput: [path: TPath, ...args: inferHandlerInput<TProcedure>], opts?: TRPCFetchInfiniteQueryOptions<TInput, TRPCClientError<TProcedure>, TOutput>) => Promise<InfiniteData<TOutput>>;
|
|
75
|
+
/**
|
|
76
|
+
* @link https://tanstack.com/query/v4/docs/react/guides/prefetching
|
|
77
|
+
*/
|
|
78
|
+
prefetchQuery: <TPath extends keyof TRouter['_def']['queries'] & string, TProcedure extends TRouter['_def']['queries'][TPath], TOutput extends inferTransformedProcedureOutput<TProcedure>, TInput extends inferProcedureInput<TProcedure>>(pathAndInput: [path: TPath, ...args: inferHandlerInput<TProcedure>], opts?: TRPCFetchQueryOptions<TInput, TRPCClientError<TProcedure>, TOutput>) => Promise<void>;
|
|
79
|
+
/**
|
|
80
|
+
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientprefetchinfinitequery
|
|
81
|
+
*/
|
|
82
|
+
prefetchInfiniteQuery: <TPath extends keyof TRouter['_def']['queries'] & string, TProcedure extends TRouter['_def']['queries'][TPath], TOutput extends inferTransformedProcedureOutput<TProcedure>, TInput extends inferProcedureInput<TProcedure>>(pathAndInput: [path: TPath, ...args: inferHandlerInput<TProcedure>], opts?: TRPCFetchInfiniteQueryOptions<TInput, TRPCClientError<TProcedure>, TOutput>) => Promise<void>;
|
|
83
|
+
/**
|
|
84
|
+
* @link https://tanstack.com/query/v4/docs/react/reference/QueryClient#queryclientensurequerydata
|
|
85
|
+
*/
|
|
86
|
+
ensureQueryData: <TPath extends keyof TRouter['_def']['queries'] & string, TProcedure extends TRouter['_def']['queries'][TPath], TOutput extends inferTransformedProcedureOutput<TProcedure>, TInput extends inferProcedureInput<TProcedure>>(pathAndInput: [path: TPath, ...args: inferHandlerInput<TProcedure>], opts?: TRPCFetchQueryOptions<TInput, TRPCClientError<TProcedure>, TOutput>) => Promise<TOutput>;
|
|
87
|
+
/**
|
|
88
|
+
* @link https://tanstack.com/query/v4/docs/react/guides/query-invalidation
|
|
89
|
+
*/
|
|
90
|
+
invalidateQueries: <TPath extends keyof TRouter['_def']['queries'] & string, TInput extends inferProcedureInput<TRouter['_def']['queries'][TPath]>>(pathAndInput?: [TPath, TInput?] | TPath, filters?: InvalidateQueryFilters, options?: InvalidateOptions) => Promise<void>;
|
|
91
|
+
/**
|
|
92
|
+
* @link https://tanstack.com/query/v4/docs/react/reference/QueryClient#queryclientresetqueries
|
|
93
|
+
*/
|
|
94
|
+
resetQueries: TRPCContextResetQueries<TRouter>;
|
|
95
|
+
/**
|
|
96
|
+
* @link https://tanstack.com/query/v4/docs/react/reference/QueryClient#queryclientrefetchqueries
|
|
97
|
+
*/
|
|
98
|
+
refetchQueries<TPath extends keyof TRouter['_def']['queries'] & string, TInput extends inferProcedureInput<TRouter['_def']['queries'][TPath]>>(pathAndInput: [TPath, TInput?], filters?: RefetchQueryFilters, options?: RefetchOptions): Promise<void>;
|
|
99
|
+
/**
|
|
100
|
+
* @link https://tanstack.com/query/v4/docs/react/reference/QueryClient#queryclientrefetchqueries
|
|
101
|
+
*/
|
|
102
|
+
refetchQueries(filters?: RefetchQueryFilters, options?: RefetchOptions): Promise<void>;
|
|
103
|
+
/**
|
|
104
|
+
* @link https://tanstack.com/query/v4/docs/react/guides/query-cancellation
|
|
105
|
+
*/
|
|
106
|
+
cancelQuery: <TPath extends keyof TRouter['_def']['queries'] & string, TInput extends inferProcedureInput<TRouter['_def']['queries'][TPath]>>(pathAndInput: [TPath, TInput?], options?: CancelOptions) => Promise<void>;
|
|
107
|
+
/**
|
|
108
|
+
* @link https://tanstack.com/query/v4/docs/react/reference/QueryClient#queryclientsetquerydata
|
|
109
|
+
*/
|
|
110
|
+
setQueryData: <TPath extends keyof TRouter['_def']['queries'] & string, TInput extends inferProcedureInput<TRouter['_def']['queries'][TPath]>, TOutput extends inferTransformedProcedureOutput<TRouter['_def']['queries'][TPath]>>(pathAndInput: [TPath, TInput?], updater: Updater<TOutput | undefined, TOutput | undefined>, options?: SetDataOptions) => void;
|
|
111
|
+
/**
|
|
112
|
+
* @link https://tanstack.com/query/v4/docs/react/reference/QueryClient#queryclientgetquerydata
|
|
113
|
+
*/
|
|
114
|
+
getQueryData: <TPath extends keyof TRouter['_def']['queries'] & string, TInput extends inferProcedureInput<TRouter['_def']['queries'][TPath]>, TOutput extends inferTransformedProcedureOutput<TRouter['_def']['queries'][TPath]>>(pathAndInput: [TPath, TInput?]) => TOutput | undefined;
|
|
115
|
+
/**
|
|
116
|
+
* @link https://tanstack.com/query/v4/docs/react/reference/QueryClient#queryclientsetquerydata
|
|
117
|
+
*/
|
|
118
|
+
setInfiniteQueryData: <TPath extends keyof TRouter['_def']['queries'] & string, TInput extends inferProcedureInput<TRouter['_def']['queries'][TPath]>, TOutput extends inferTransformedProcedureOutput<TRouter['_def']['queries'][TPath]>>(pathAndInput: [TPath, TInput?], updater: Updater<InfiniteData<TOutput> | undefined, InfiniteData<TOutput> | undefined>, options?: SetDataOptions) => void;
|
|
119
|
+
/**
|
|
120
|
+
* @link https://tanstack.com/query/v4/docs/react/reference/QueryClient#queryclientgetquerydata
|
|
121
|
+
*/
|
|
122
|
+
getInfiniteQueryData: <TPath extends keyof TRouter['_def']['queries'] & string, TInput extends inferProcedureInput<TRouter['_def']['queries'][TPath]>, TOutput extends inferTransformedProcedureOutput<TRouter['_def']['queries'][TPath]>>(pathAndInput: [TPath, TInput?]) => InfiniteData<TOutput> | undefined;
|
|
123
|
+
}
|
|
124
|
+
export declare const TRPCContext: import("react").Context<any>;
|
|
125
|
+
export {};
|
|
128
126
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/internals/context.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/internals/context.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,aAAa,EACb,yBAAyB,EACzB,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,EACjB,sBAAsB,EACtB,WAAW,EACX,cAAc,EACd,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,OAAO,EACR,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,qBAAqB,EACrB,UAAU,EACV,eAAe,EACf,kBAAkB,EACnB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,E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OAAO,SAAS,+BAA+B,CAC7C,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,CAClC,EAED,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,KAC3B,YAAY,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC;CACxC;AAED,eAAO,MAAM,WAAW,8BAA6B,CAAC"}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { GetQueryProcedureInput } from './getQueryKey';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
string[],
|
|
5
|
-
{
|
|
6
|
-
input?: unknown;
|
|
7
|
-
type?: Exclude<QueryType, 'any'>;
|
|
8
|
-
}?
|
|
9
|
-
];
|
|
10
|
-
export
|
|
11
|
-
string[],
|
|
12
|
-
{
|
|
13
|
-
input?: GetQueryProcedureInput<TInput>;
|
|
14
|
-
type: TType;
|
|
15
|
-
}?
|
|
16
|
-
];
|
|
17
|
-
/**
|
|
18
|
-
* To allow easy interactions with groups of related queries, such as
|
|
19
|
-
* invalidating all queries of a router, we use an array as the path when
|
|
20
|
-
* storing in tanstack query. This function converts from the `.` separated
|
|
21
|
-
* path passed around internally by both the legacy and proxy implementation.
|
|
22
|
-
* https://github.com/trpc/trpc/issues/2611
|
|
23
|
-
**/
|
|
24
|
-
export declare function getArrayQueryKey(queryKey: string | [string] | [string, ...unknown[]] | unknown[], type: QueryType): QueryKey;
|
|
1
|
+
import { GetQueryProcedureInput } from './getQueryKey';
|
|
2
|
+
export type QueryType = 'query' | 'infinite' | 'any';
|
|
3
|
+
export type QueryKey = [
|
|
4
|
+
string[],
|
|
5
|
+
{
|
|
6
|
+
input?: unknown;
|
|
7
|
+
type?: Exclude<QueryType, 'any'>;
|
|
8
|
+
}?
|
|
9
|
+
];
|
|
10
|
+
export type QueryKeyKnown<TInput, TType extends Exclude<QueryType, 'any'>> = [
|
|
11
|
+
string[],
|
|
12
|
+
{
|
|
13
|
+
input?: GetQueryProcedureInput<TInput>;
|
|
14
|
+
type: TType;
|
|
15
|
+
}?
|
|
16
|
+
];
|
|
17
|
+
/**
|
|
18
|
+
* To allow easy interactions with groups of related queries, such as
|
|
19
|
+
* invalidating all queries of a router, we use an array as the path when
|
|
20
|
+
* storing in tanstack query. This function converts from the `.` separated
|
|
21
|
+
* path passed around internally by both the legacy and proxy implementation.
|
|
22
|
+
* https://github.com/trpc/trpc/issues/2611
|
|
23
|
+
**/
|
|
24
|
+
export declare function getArrayQueryKey(queryKey: string | [string] | [string, ...unknown[]] | unknown[], type: QueryType): QueryKey;
|
|
25
25
|
//# sourceMappingURL=getArrayQueryKey.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getArrayQueryKey.d.ts","sourceRoot":"","sources":["../../src/internals/getArrayQueryKey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAEvD,
|
|
1
|
+
{"version":3,"file":"getArrayQueryKey.d.ts","sourceRoot":"","sources":["../../src/internals/getArrayQueryKey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAEvD,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,KAAK,CAAC;AAErD,MAAM,MAAM,QAAQ,GAAG;IACrB,MAAM,EAAE;IACR;QAAE,KAAK,CAAC,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;KAAE,CAAC;CACvD,CAAC;AAEF,MAAM,MAAM,aAAa,CAAC,MAAM,EAAE,KAAK,SAAS,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,IAAI;IAC3E,MAAM,EAAE;IACR;QAAE,KAAK,CAAC,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;QAAC,IAAI,EAAE,KAAK,CAAA;KAAE,CAAC;CACzD,CAAC;AAEF;;;;;;IAMI;AACJ,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,OAAO,EAAE,CAAC,GAAG,OAAO,EAAE,EAChE,IAAI,EAAE,SAAS,GACd,QAAQ,CAqBV"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function getClientArgs<TPathAndInput extends unknown[], TOptions>(pathAndInput: TPathAndInput, opts: TOptions): readonly [unknown, unknown, any];
|
|
1
|
+
export declare function getClientArgs<TPathAndInput extends unknown[], TOptions>(pathAndInput: TPathAndInput, opts: TOptions): readonly [unknown, unknown, any];
|
|
2
2
|
//# sourceMappingURL=getClientArgs.d.ts.map
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { AnyMutationProcedure, AnyQueryProcedure, AnyRouter, DeepPartial, inferProcedureInput } from '@trpc/server';
|
|
2
|
-
import { QueryType } from '../internals/getArrayQueryKey';
|
|
3
|
-
import {
|
|
4
|
-
/**
|
|
5
|
-
* We treat `undefined` as an input the same as omitting an `input`
|
|
6
|
-
* https://github.com/trpc/trpc/issues/2290
|
|
7
|
-
*/
|
|
8
|
-
export declare function getQueryKeyInternal(path: string, input: unknown): [string] | [string, unknown];
|
|
9
|
-
|
|
10
|
-
/** @internal */
|
|
11
|
-
export
|
|
12
|
-
cursor?: any;
|
|
13
|
-
} ? GetInfiniteQueryInput<TProcedureInput> : DeepPartial<TProcedureInput> | undefined;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
procedureOrRouter: DecorateProcedure<TProcedureOrRouter, TFlags, TPath>,
|
|
17
|
-
..._params: GetQueryParams<TProcedureOrRouter>
|
|
18
|
-
] : TProcedureOrRouter extends AnyMutationProcedure ? [procedureOrRouter: DecorateProcedure<TProcedureOrRouter, TFlags, TPath>] : [
|
|
19
|
-
procedureOrRouter: DecoratedProcedureRecord<TProcedureOrRouter['_def']['record'], TFlags, any>
|
|
20
|
-
];
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Method to extract the query key for a procedure
|
|
24
|
-
* @param procedureOrRouter - procedure or AnyRouter
|
|
25
|
-
* @param input - input to procedureOrRouter
|
|
26
|
-
* @param type - defaults to `any`
|
|
27
|
-
* @link https://trpc.io/docs/getQueryKey
|
|
28
|
-
*/
|
|
29
|
-
export declare function getQueryKey<TProcedureOrRouter extends AnyQueryProcedure | AnyMutationProcedure | AnyRouter, TPath extends string, TFlags>(..._params: GetQueryKeyParams<TProcedureOrRouter, TPath, TFlags>): import("../internals/getArrayQueryKey").QueryKey;
|
|
30
|
-
export {};
|
|
1
|
+
import { AnyMutationProcedure, AnyQueryProcedure, AnyRouter, DeepPartial, inferProcedureInput } from '@trpc/server';
|
|
2
|
+
import { QueryType } from '../internals/getArrayQueryKey';
|
|
3
|
+
import { DecoratedProcedureRecord, DecorateProcedure } from '../shared';
|
|
4
|
+
/**
|
|
5
|
+
* We treat `undefined` as an input the same as omitting an `input`
|
|
6
|
+
* https://github.com/trpc/trpc/issues/2290
|
|
7
|
+
*/
|
|
8
|
+
export declare function getQueryKeyInternal(path: string, input: unknown): [string] | [string, unknown];
|
|
9
|
+
type GetInfiniteQueryInput<TProcedureInput, TInputWithoutCursor = Omit<TProcedureInput, 'cursor'>> = keyof TInputWithoutCursor extends never ? undefined : DeepPartial<TInputWithoutCursor> | undefined;
|
|
10
|
+
/** @internal */
|
|
11
|
+
export type GetQueryProcedureInput<TProcedureInput> = TProcedureInput extends {
|
|
12
|
+
cursor?: any;
|
|
13
|
+
} ? GetInfiniteQueryInput<TProcedureInput> : DeepPartial<TProcedureInput> | undefined;
|
|
14
|
+
type GetQueryParams<TProcedureOrRouter extends AnyQueryProcedure, TProcedureInput = inferProcedureInput<TProcedureOrRouter>> = TProcedureInput extends undefined ? [] : [input?: GetQueryProcedureInput<TProcedureInput>, type?: QueryType];
|
|
15
|
+
type GetParams<TProcedureOrRouter extends AnyQueryProcedure | AnyMutationProcedure | AnyRouter, TPath extends string, TFlags> = TProcedureOrRouter extends AnyQueryProcedure ? [
|
|
16
|
+
procedureOrRouter: DecorateProcedure<TProcedureOrRouter, TFlags, TPath>,
|
|
17
|
+
..._params: GetQueryParams<TProcedureOrRouter>
|
|
18
|
+
] : TProcedureOrRouter extends AnyMutationProcedure ? [procedureOrRouter: DecorateProcedure<TProcedureOrRouter, TFlags, TPath>] : [
|
|
19
|
+
procedureOrRouter: DecoratedProcedureRecord<TProcedureOrRouter['_def']['record'], TFlags, any>
|
|
20
|
+
];
|
|
21
|
+
type GetQueryKeyParams<TProcedureOrRouter extends AnyQueryProcedure | AnyMutationProcedure | AnyRouter, TPath extends string, TFlags> = GetParams<TProcedureOrRouter, TPath, TFlags>;
|
|
22
|
+
/**
|
|
23
|
+
* Method to extract the query key for a procedure
|
|
24
|
+
* @param procedureOrRouter - procedure or AnyRouter
|
|
25
|
+
* @param input - input to procedureOrRouter
|
|
26
|
+
* @param type - defaults to `any`
|
|
27
|
+
* @link https://trpc.io/docs/getQueryKey
|
|
28
|
+
*/
|
|
29
|
+
export declare function getQueryKey<TProcedureOrRouter extends AnyQueryProcedure | AnyMutationProcedure | AnyRouter, TPath extends string, TFlags>(..._params: GetQueryKeyParams<TProcedureOrRouter, TPath, TFlags>): import("../internals/getArrayQueryKey").QueryKey;
|
|
30
|
+
export {};
|
|
31
31
|
//# sourceMappingURL=getQueryKey.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getQueryKey.d.ts","sourceRoot":"","sources":["../../src/internals/getQueryKey.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,SAAS,EACT,WAAW,EACX,mBAAmB,EACpB,MAAM,cAAc,CAAC;AACtB,OAAO,
|
|
1
|
+
{"version":3,"file":"getQueryKey.d.ts","sourceRoot":"","sources":["../../src/internals/getQueryKey.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,SAAS,EACT,WAAW,EACX,mBAAmB,E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,CAAC,kBAAkB,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,GACzE;IACE,iBAAiB,EAAE,wBAAwB,CACzC,kBAAkB,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,EACpC,MAAM,EACN,GAAG,CACJ;CACF,CAAC;AAEN,KAAK,iBAAiB,CACpB,kBAAkB,SACd,iBAAiB,GACjB,oBAAoB,GACpB,SAAS,EACb,KAAK,SAAS,MAAM,EACpB,MAAM,IACJ,SAAS,CAAC,kBAAkB,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AAEjD;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,kBAAkB,SACd,iBAAiB,GACjB,oBAAoB,GACpB,SAAS,EACb,KAAK,SAAS,MAAM,EACpB,MAAM,EACN,GAAG,OAAO,EAAE,iBAAiB,CAAC,kBAAkB,EAAE,KAAK,EAAE,MAAM,CAAC,oDAUjE"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export interface TRPCHookResult {
|
|
2
|
-
trpc: {
|
|
3
|
-
path: string;
|
|
4
|
-
};
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Makes a stable reference of the `trpc` prop
|
|
8
|
-
*/
|
|
9
|
-
export declare function useHookResult(value: TRPCHookResult['trpc']): TRPCHookResult['trpc'];
|
|
1
|
+
export interface TRPCHookResult {
|
|
2
|
+
trpc: {
|
|
3
|
+
path: string;
|
|
4
|
+
};
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Makes a stable reference of the `trpc` prop
|
|
8
|
+
*/
|
|
9
|
+
export declare function useHookResult(value: TRPCHookResult['trpc']): TRPCHookResult['trpc'];
|
|
10
10
|
//# sourceMappingURL=useHookResult.d.ts.map
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { QueryKey, UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
-
import { AnyRouter } from '@trpc/server';
|
|
3
|
-
import { UseQueriesProcedureRecord, UseTRPCQueryOptions, UseTRPCQueryResult } from '../shared';
|
|
4
|
-
/**
|
|
5
|
-
* @internal
|
|
6
|
-
*/
|
|
7
|
-
export
|
|
8
|
-
/**
|
|
9
|
-
* @internal
|
|
10
|
-
*/
|
|
11
|
-
export
|
|
12
|
-
/**
|
|
13
|
-
* @internal
|
|
14
|
-
*/
|
|
15
|
-
export declare type QueriesResults<TQueriesOptions extends UseQueryOptionsForUseQueries<any, any, any, any>[]> = {
|
|
16
|
-
[TKey in keyof TQueriesOptions]: TQueriesOptions[TKey] extends UseQueryOptionsForUseQueries<infer TQueryFnData, infer TError, infer TData, any> ? UseTRPCQueryResult<unknown extends TData ? TQueryFnData : TData, TError> : never;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @internal
|
|
21
|
-
*/
|
|
22
|
-
export
|
|
23
|
-
/**
|
|
24
|
-
* @internal
|
|
25
|
-
*/
|
|
26
|
-
export
|
|
27
|
-
export {};
|
|
1
|
+
import { QueryKey, UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import { AnyRouter } from '@trpc/server';
|
|
3
|
+
import { UseQueriesProcedureRecord, UseTRPCQueryOptions, UseTRPCQueryResult } from '../shared';
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export type UseQueryOptionsForUseQueries<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = Omit<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, 'context'>;
|
|
8
|
+
/**
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export type TrpcQueryOptionsForUseQueries<TPath, TInput, TOutput, TData, TError> = Omit<UseTRPCQueryOptions<TPath, TInput, TOutput, TData, TError>, 'context'>;
|
|
12
|
+
/**
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export declare type QueriesResults<TQueriesOptions extends UseQueryOptionsForUseQueries<any, any, any, any>[]> = {
|
|
16
|
+
[TKey in keyof TQueriesOptions]: TQueriesOptions[TKey] extends UseQueryOptionsForUseQueries<infer TQueryFnData, infer TError, infer TData, any> ? UseTRPCQueryResult<unknown extends TData ? TQueryFnData : TData, TError> : never;
|
|
17
|
+
};
|
|
18
|
+
type GetOptions<TQueryOptions> = TQueryOptions extends UseQueryOptionsForUseQueries<any, any, any, any> ? TQueryOptions : never;
|
|
19
|
+
/**
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
export type QueriesOptions<TQueriesOptions extends any[], TResult extends any[] = []> = TQueriesOptions extends [] ? [] : TQueriesOptions extends [infer Head] ? [...TResult, GetOptions<Head>] : TQueriesOptions extends [infer Head, ...infer Tail] ? QueriesOptions<Tail, [...TResult, GetOptions<Head>]> : unknown[] extends TQueriesOptions ? TQueriesOptions : TQueriesOptions extends UseQueryOptionsForUseQueries<infer TQueryFnData, infer TError, infer TData, infer TQueryKey>[] ? UseQueryOptionsForUseQueries<TQueryFnData, TError, TData, TQueryKey>[] : UseQueryOptionsForUseQueries[];
|
|
23
|
+
/**
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
export type TRPCUseQueries<TRouter extends AnyRouter> = <TQueryOptions extends UseQueryOptionsForUseQueries<any, any, any, any>[]>(queriesCallback: (t: UseQueriesProcedureRecord<TRouter>) => readonly [...QueriesOptions<TQueryOptions>], context?: UseQueryOptions['context']) => QueriesResults<TQueryOptions>;
|
|
27
|
+
export {};
|
|
28
28
|
//# sourceMappingURL=useQueries.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useQueries.d.ts","sourceRoot":"","sources":["../../src/internals/useQueries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EACL,yBAAyB,EACzB,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,WAAW,C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G,EAAE,GAAG,EAAE,GAAG,CAAC,GAClE,aAAa,GACb,KAAK,CAAC;AAEZ;;GAEG;AACH,MAAM,MAAM,cAAc,CACxB,eAAe,SAAS,GAAG,EAAE,EAC7B,OAAO,SAAS,GAAG,EAAE,GAAG,EAAE,IACxB,eAAe,SAAS,EAAE,GAC1B,EAAE,GACF,eAAe,SAAS,CAAC,MAAM,IAAI,CAAC,GACpC,CAAC,GAAG,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,GAC9B,eAAe,SAAS,CAAC,MAAM,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,GACnD,cAAc,CAAC,IAAI,EAAE,CAAC,GAAG,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,GACpD,OAAO,EAAE,SAAS,eAAe,GACjC,eAAe,GACf,eAAe,SAAS,4BAA4B,CAClD,MAAM,YAAY,EAClB,MAAM,MAAM,EACZ,MAAM,KAAK,EACX,MAAM,SAAS,CAChB,EAAE,GACH,4BAA4B,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,GACtE,4BAA4B,EAAE,CAAC;AAEnC;;GAEG;AACH,MAAM,MAAM,cAAc,CAAC,OAAO,SAAS,SAAS,IAAI,CACtD,aAAa,SAAS,4BAA4B,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,EAExE,eAAe,EAAE,CACf,CAAC,EAAE,yBAAyB,CAAC,OAAO,CAAC,KAClC,SAAS,CAAC,GAAG,cAAc,CAAC,aAAa,CAAC,CAAC,EAChD,OAAO,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC,KACjC,cAAc,CAAC,aAAa,CAAC,CAAC"}
|
package/dist/interop.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { AnyRouter } from '@trpc/server';
|
|
2
|
-
import { CreateTRPCReact } from './createTRPCReact';
|
|
3
|
-
import { CreateTRPCReactOptions } from './shared';
|
|
4
|
-
import { CreateReactQueryHooks } from './shared/hooks/createRootHooks';
|
|
5
|
-
/**
|
|
6
|
-
* @deprecated use `createTRPCReact` instead
|
|
7
|
-
*/
|
|
8
|
-
export declare function createReactQueryHooks<TRouter extends AnyRouter, TSSRContext = unknown, TFlags = null>(opts?: CreateTRPCReactOptions<TRouter>): CreateReactQueryHooks<TRouter, TSSRContext> & {
|
|
9
|
-
proxy: CreateTRPCReact<TRouter, TSSRContext, TFlags>;
|
|
10
|
-
};
|
|
1
|
+
import { AnyRouter } from '@trpc/server';
|
|
2
|
+
import { CreateTRPCReact } from './createTRPCReact';
|
|
3
|
+
import { CreateTRPCReactOptions } from './shared';
|
|
4
|
+
import { CreateReactQueryHooks } from './shared/hooks/createRootHooks';
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated use `createTRPCReact` instead
|
|
7
|
+
*/
|
|
8
|
+
export declare function createReactQueryHooks<TRouter extends AnyRouter, TSSRContext = unknown, TFlags = null>(opts?: CreateTRPCReactOptions<TRouter>): CreateReactQueryHooks<TRouter, TSSRContext> & {
|
|
9
|
+
proxy: CreateTRPCReact<TRouter, TSSRContext, TFlags>;
|
|
10
|
+
};
|
|
11
11
|
//# sourceMappingURL=interop.d.ts.map
|
package/dist/interop.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interop.d.ts","sourceRoot":"","sources":["../src/interop.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,
|
|
1
|
+
{"version":3,"file":"interop.d.ts","sourceRoot":"","sources":["../src/interop.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAA4B,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAEL,qBAAqB,EACtB,MAAM,gCAAgC,CAAC;AAExC;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,SAAS,SAAS,EACzB,WAAW,GAAG,OAAO,EACrB,MAAM,GAAG,IAAI,EAEb,IAAI,CAAC,EAAE,sBAAsB,CAAC,OAAO,CAAC,GACrC,qBAAqB,CAAC,OAAO,EAAE,WAAW,CAAC,GAAG;IAC/C,KAAK,EAAE,eAAe,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;CACtD,CAQA"}
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { createServerSideHelpers } from './ssgProxy';
|
|
2
|
-
export type { CreateSSGHelpersOptions } from './types';
|
|
3
|
-
export type { DecoratedProcedureSSGRecord } from './ssgProxy';
|
|
1
|
+
export { createServerSideHelpers } from './ssgProxy';
|
|
2
|
+
export type { CreateSSGHelpersOptions } from './types';
|
|
3
|
+
export type { DecoratedProcedureSSGRecord } from './ssgProxy';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|