@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,18 +1,18 @@
|
|
|
1
|
-
import { AnyProcedure, inferProcedureInput } from '@trpc/server';
|
|
2
|
-
import { inferTransformedProcedureOutput } from '@trpc/server/shared';
|
|
3
|
-
import { InferMutationOptions, InferMutationResult } from '../../utils/inferReactQueryProcedure';
|
|
4
|
-
/**
|
|
5
|
-
* Use to describe a mutation route which matches a given mutation procedure's interface
|
|
6
|
-
*/
|
|
7
|
-
export
|
|
8
|
-
useMutation: (opts?: InferMutationOptions<TProcedure>) => InferMutationResult<TProcedure>;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Use to unwrap a MutationLike's input
|
|
12
|
-
*/
|
|
13
|
-
export
|
|
14
|
-
/**
|
|
15
|
-
* Use to unwrap a MutationLike's data output
|
|
16
|
-
*/
|
|
17
|
-
export
|
|
1
|
+
import { AnyProcedure, inferProcedureInput } from '@trpc/server';
|
|
2
|
+
import { inferTransformedProcedureOutput } from '@trpc/server/shared';
|
|
3
|
+
import { InferMutationOptions, InferMutationResult } from '../../utils/inferReactQueryProcedure';
|
|
4
|
+
/**
|
|
5
|
+
* Use to describe a mutation route which matches a given mutation procedure's interface
|
|
6
|
+
*/
|
|
7
|
+
export type MutationLike<TProcedure extends AnyProcedure = AnyProcedure> = {
|
|
8
|
+
useMutation: (opts?: InferMutationOptions<TProcedure>) => InferMutationResult<TProcedure>;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Use to unwrap a MutationLike's input
|
|
12
|
+
*/
|
|
13
|
+
export type InferMutationLikeInput<TMutationLike extends MutationLike> = TMutationLike extends MutationLike<infer TProcedure> ? inferProcedureInput<TProcedure> : never;
|
|
14
|
+
/**
|
|
15
|
+
* Use to unwrap a MutationLike's data output
|
|
16
|
+
*/
|
|
17
|
+
export type InferMutationLikeData<TMutationLike extends MutationLike> = TMutationLike extends MutationLike<infer TProcedure> ? inferTransformedProcedureOutput<TProcedure> : never;
|
|
18
18
|
//# sourceMappingURL=mutationLike.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutationLike.d.ts","sourceRoot":"","sources":["../../../src/shared/polymorphism/mutationLike.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,sCAAsC,CAAC;AAE9C;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"mutationLike.d.ts","sourceRoot":"","sources":["../../../src/shared/polymorphism/mutationLike.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,sCAAsC,CAAC;AAE9C;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,UAAU,SAAS,YAAY,GAAG,YAAY,IAAI;IACzE,WAAW,EAAE,CACX,IAAI,CAAC,EAAE,oBAAoB,CAAC,UAAU,CAAC,KACpC,mBAAmB,CAAC,UAAU,CAAC,CAAC;CACtC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,sBAAsB,CAAC,aAAa,SAAS,YAAY,IACnE,aAAa,SAAS,YAAY,CAAC,MAAM,UAAU,CAAC,GAChD,mBAAmB,CAAC,UAAU,CAAC,GAC/B,KAAK,CAAC;AAEZ;;GAEG;AACH,MAAM,MAAM,qBAAqB,CAAC,aAAa,SAAS,YAAY,IAClE,aAAa,SAAS,YAAY,CAAC,MAAM,UAAU,CAAC,GAChD,+BAA+B,CAAC,UAAU,CAAC,GAC3C,KAAK,CAAC"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { AnyProcedure, inferProcedureInput } from '@trpc/server';
|
|
2
|
-
import { inferTransformedProcedureOutput } from '@trpc/server/shared';
|
|
3
|
-
import { InferQueryOptions, InferQueryResult } from '../../utils/inferReactQueryProcedure';
|
|
4
|
-
/**
|
|
5
|
-
* Use to request a query route which matches a given query procedure's interface
|
|
6
|
-
*/
|
|
7
|
-
export
|
|
8
|
-
useQuery: (variables: inferProcedureInput<TProcedure>, opts?: InferQueryOptions<TProcedure, any>) => InferQueryResult<TProcedure>;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Use to unwrap a QueryLike's input
|
|
12
|
-
*/
|
|
13
|
-
export
|
|
14
|
-
/**
|
|
15
|
-
* Use to unwrap a QueryLike's data output
|
|
16
|
-
*/
|
|
17
|
-
export
|
|
1
|
+
import { AnyProcedure, inferProcedureInput } from '@trpc/server';
|
|
2
|
+
import { inferTransformedProcedureOutput } from '@trpc/server/shared';
|
|
3
|
+
import { InferQueryOptions, InferQueryResult } from '../../utils/inferReactQueryProcedure';
|
|
4
|
+
/**
|
|
5
|
+
* Use to request a query route which matches a given query procedure's interface
|
|
6
|
+
*/
|
|
7
|
+
export type QueryLike<TProcedure extends AnyProcedure = AnyProcedure> = {
|
|
8
|
+
useQuery: (variables: inferProcedureInput<TProcedure>, opts?: InferQueryOptions<TProcedure, any>) => InferQueryResult<TProcedure>;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Use to unwrap a QueryLike's input
|
|
12
|
+
*/
|
|
13
|
+
export type InferQueryLikeInput<TQueryLike extends QueryLike> = TQueryLike extends QueryLike<infer TProcedure> ? inferProcedureInput<TProcedure> : never;
|
|
14
|
+
/**
|
|
15
|
+
* Use to unwrap a QueryLike's data output
|
|
16
|
+
*/
|
|
17
|
+
export type InferQueryLikeData<TQueryLike extends QueryLike> = TQueryLike extends QueryLike<infer TProcedure> ? inferTransformedProcedureOutput<TProcedure> : never;
|
|
18
18
|
//# sourceMappingURL=queryLike.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryLike.d.ts","sourceRoot":"","sources":["../../../src/shared/polymorphism/queryLike.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,sCAAsC,CAAC;AAE9C;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"queryLike.d.ts","sourceRoot":"","sources":["../../../src/shared/polymorphism/queryLike.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,sCAAsC,CAAC;AAE9C;;GAEG;AACH,MAAM,MAAM,SAAS,CAAC,UAAU,SAAS,YAAY,GAAG,YAAY,IAAI;IACtE,QAAQ,EAAE,CACR,SAAS,EAAE,mBAAmB,CAAC,UAAU,CAAC,EAC1C,IAAI,CAAC,EAAE,iBAAiB,CAAC,UAAU,EAAE,GAAG,CAAC,KACtC,gBAAgB,CAAC,UAAU,CAAC,CAAC;CACnC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,mBAAmB,CAAC,UAAU,SAAS,SAAS,IAC1D,UAAU,SAAS,SAAS,CAAC,MAAM,UAAU,CAAC,GAC1C,mBAAmB,CAAC,UAAU,CAAC,GAC/B,KAAK,CAAC;AAEZ;;GAEG;AACH,MAAM,MAAM,kBAAkB,CAAC,UAAU,SAAS,SAAS,IACzD,UAAU,SAAS,SAAS,CAAC,MAAM,UAAU,CAAC,GAC1C,+BAA+B,CAAC,UAAU,CAAC,GAC3C,KAAK,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { AnyMutationProcedure, AnyQueryProcedure, AnyRouter } from '@trpc/server';
|
|
2
|
-
import { MutationLike } from './mutationLike';
|
|
3
|
-
import { QueryLike } from './queryLike';
|
|
4
|
-
/**
|
|
5
|
-
* Use to describe a route path which matches a given route's interface
|
|
6
|
-
*/
|
|
7
|
-
export
|
|
8
|
-
[key in keyof TRecord]: TRecord[key] extends AnyRouter ? RouterLike<TRecord[key]> : TRecord[key] extends AnyQueryProcedure ? QueryLike<TRecord[key]> : TRecord[key] extends AnyMutationProcedure ? MutationLike<TRecord[key]> : never;
|
|
9
|
-
};
|
|
1
|
+
import { AnyMutationProcedure, AnyQueryProcedure, AnyRouter } from '@trpc/server';
|
|
2
|
+
import { MutationLike } from './mutationLike';
|
|
3
|
+
import { QueryLike } from './queryLike';
|
|
4
|
+
/**
|
|
5
|
+
* Use to describe a route path which matches a given route's interface
|
|
6
|
+
*/
|
|
7
|
+
export type RouterLike<TRouter extends AnyRouter, TRecord extends TRouter['_def']['record'] = TRouter['_def']['record']> = {
|
|
8
|
+
[key in keyof TRecord]: TRecord[key] extends AnyRouter ? RouterLike<TRecord[key]> : TRecord[key] extends AnyQueryProcedure ? QueryLike<TRecord[key]> : TRecord[key] extends AnyMutationProcedure ? MutationLike<TRecord[key]> : never;
|
|
9
|
+
};
|
|
10
10
|
//# sourceMappingURL=routerLike.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routerLike.d.ts","sourceRoot":"","sources":["../../../src/shared/polymorphism/routerLike.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,SAAS,EACV,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"routerLike.d.ts","sourceRoot":"","sources":["../../../src/shared/polymorphism/routerLike.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,SAAS,EACV,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;GAEG;AACH,MAAM,MAAM,UAAU,CACpB,OAAO,SAAS,SAAS,EACzB,OAAO,SAAS,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,IACnE;KACD,GAAG,IAAI,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,SAAS,GAClD,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GACxB,OAAO,CAAC,GAAG,CAAC,SAAS,iBAAiB,GACtC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GACvB,OAAO,CAAC,GAAG,CAAC,SAAS,oBAAoB,GACzC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAC1B,KAAK;CACV,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AnyRouter } from '@trpc/server';
|
|
2
|
-
import { DecoratedProcedureUtilsRecord } from '../proxy/utilsProxy';
|
|
3
|
-
/**
|
|
4
|
-
* Use to describe a Utils/Context path which matches the given route's interface
|
|
5
|
-
*/
|
|
6
|
-
export
|
|
1
|
+
import { AnyRouter } from '@trpc/server';
|
|
2
|
+
import { DecoratedProcedureUtilsRecord } from '../proxy/utilsProxy';
|
|
3
|
+
/**
|
|
4
|
+
* Use to describe a Utils/Context path which matches the given route's interface
|
|
5
|
+
*/
|
|
6
|
+
export type UtilsLike<TRouter extends AnyRouter> = DecoratedProcedureUtilsRecord<TRouter>;
|
|
7
7
|
//# sourceMappingURL=utilsLike.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilsLike.d.ts","sourceRoot":"","sources":["../../../src/shared/polymorphism/utilsLike.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,6BAA6B,EAAE,MAAM,qBAAqB,CAAC;AAEpE;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"utilsLike.d.ts","sourceRoot":"","sources":["../../../src/shared/polymorphism/utilsLike.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,6BAA6B,EAAE,MAAM,qBAAqB,CAAC;AAEpE;;GAEG;AACH,MAAM,MAAM,SAAS,CAAC,OAAO,SAAS,SAAS,IAC7C,6BAA6B,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AnyRouter } from '@trpc/server';
|
|
2
|
-
import { CreateReactQueryHooks } from '../hooks/createRootHooks';
|
|
3
|
-
/**
|
|
4
|
-
* Create proxy for decorating procedures
|
|
5
|
-
* @internal
|
|
6
|
-
*/
|
|
7
|
-
export declare function createReactProxyDecoration<TRouter extends AnyRouter, TSSRContext = unknown>(name: string, hooks: CreateReactQueryHooks<TRouter, TSSRContext>): unknown;
|
|
1
|
+
import { AnyRouter } from '@trpc/server';
|
|
2
|
+
import { CreateReactQueryHooks } from '../hooks/createRootHooks';
|
|
3
|
+
/**
|
|
4
|
+
* Create proxy for decorating procedures
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare function createReactProxyDecoration<TRouter extends AnyRouter, TSSRContext = unknown>(name: string, hooks: CreateReactQueryHooks<TRouter, TSSRContext>): unknown;
|
|
8
8
|
//# sourceMappingURL=decorationProxy.d.ts.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { TRPCClient, TRPCClientError } from '@trpc/client';
|
|
2
|
-
import { AnyProcedure, AnyQueryProcedure, AnyRouter, Filter, inferProcedureInput } from '@trpc/server';
|
|
3
|
-
import { inferTransformedProcedureOutput } from '@trpc/server/shared';
|
|
4
|
-
import { TrpcQueryOptionsForUseQueries } from '../../internals/useQueries';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export
|
|
10
|
-
[TKey in keyof Filter<TRouter['_def']['record'], AnyRouter | AnyQueryProcedure>]: TRouter['_def']['record'][TKey] extends AnyRouter ? UseQueriesProcedureRecord<TRouter['_def']['record'][TKey], `${TPath}${TKey & string}.`> : GetQueryOptions<TRouter['_def']['record'][TKey], `${TPath}${TKey & string}`>;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Create proxy for `useQueries` options
|
|
14
|
-
* @internal
|
|
15
|
-
*/
|
|
16
|
-
export declare function createUseQueriesProxy<TRouter extends AnyRouter>(client: TRPCClient<TRouter>): UseQueriesProcedureRecord<TRouter, "">;
|
|
17
|
-
export {};
|
|
1
|
+
import { TRPCClient, TRPCClientError } from '@trpc/client';
|
|
2
|
+
import { AnyProcedure, AnyQueryProcedure, AnyRouter, Filter, inferProcedureInput } from '@trpc/server';
|
|
3
|
+
import { inferTransformedProcedureOutput } from '@trpc/server/shared';
|
|
4
|
+
import { TrpcQueryOptionsForUseQueries } from '../../internals/useQueries';
|
|
5
|
+
type GetQueryOptions<TProcedure extends AnyProcedure, TPath extends string> = <TData = inferTransformedProcedureOutput<TProcedure>>(input: inferProcedureInput<TProcedure>, opts?: TrpcQueryOptionsForUseQueries<TPath, inferProcedureInput<TProcedure>, inferTransformedProcedureOutput<TProcedure>, TData, TRPCClientError<TProcedure>>) => TrpcQueryOptionsForUseQueries<TPath, inferProcedureInput<TProcedure>, inferTransformedProcedureOutput<TProcedure>, TData, TRPCClientError<TProcedure>>;
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export type UseQueriesProcedureRecord<TRouter extends AnyRouter, TPath extends string = ''> = {
|
|
10
|
+
[TKey in keyof Filter<TRouter['_def']['record'], AnyRouter | AnyQueryProcedure>]: TRouter['_def']['record'][TKey] extends AnyRouter ? UseQueriesProcedureRecord<TRouter['_def']['record'][TKey], `${TPath}${TKey & string}.`> : GetQueryOptions<TRouter['_def']['record'][TKey], `${TPath}${TKey & string}`>;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Create proxy for `useQueries` options
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export declare function createUseQueriesProxy<TRouter extends AnyRouter>(client: TRPCClient<TRouter>): UseQueriesProcedureRecord<TRouter, "">;
|
|
17
|
+
export {};
|
|
18
18
|
//# sourceMappingURL=useQueriesProxy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useQueriesProxy.d.ts","sourceRoot":"","sources":["../../../src/shared/proxy/useQueriesProxy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACT,MAAM,EACN,mBAAmB,EACpB,MAAM,cAAc,CAAC;AACtB,OAAO,EAEL,+BAA+B,EAChC,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAE3E,
|
|
1
|
+
{"version":3,"file":"useQueriesProxy.d.ts","sourceRoot":"","sources":["../../../src/shared/proxy/useQueriesProxy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACT,MAAM,EACN,mBAAmB,EACpB,MAAM,cAAc,CAAC;AACtB,OAAO,EAEL,+BAA+B,EAChC,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAE3E,KAAK,eAAe,CAAC,UAAU,SAAS,YAAY,EAAE,KAAK,SAAS,MAAM,IAAI,CAC5E,KAAK,GAAG,+BAA+B,CAAC,UAAU,CAAC,EAEnD,KAAK,EAAE,mBAAmB,CAAC,UAAU,CAAC,EACtC,IAAI,CAAC,EAAE,6BAA6B,CAClC,KAAK,EACL,mBAAmB,CAAC,UAAU,CAAC,EAC/B,+BAA+B,CAAC,UAAU,CAAC,EAC3C,KAAK,EACL,eAAe,CAAC,UAAU,CAAC,CAC5B,KACE,6BAA6B,CAChC,KAAK,EACL,mBAAmB,CAAC,UAAU,CAAC,EAC/B,+BAA+B,CAAC,UAAU,CAAC,EAC3C,KAAK,EACL,eAAe,CAAC,UAAU,CAAC,CAC5B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,yBAAyB,CACnC,OAAO,SAAS,SAAS,EACzB,KAAK,SAAS,MAAM,GAAG,EAAE,IACvB;KACD,IAAI,IAAI,MAAM,MAAM,CACnB,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,EACzB,SAAS,GAAG,iBAAiB,CAC9B,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GACjD,yBAAyB,CACvB,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,EAC/B,GAAG,KAAK,GAAG,IAAI,GAAG,MAAM,GAAG,CAC5B,GACD,eAAe,CACb,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,EAC/B,GAAG,KAAK,GAAG,IAAI,GAAG,MAAM,EAAE,CAC3B;CACN,CAAC;AAEF;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,SAAS,SAAS,EAC7D,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,0CAkB5B"}
|
|
@@ -1,94 +1,93 @@
|
|
|
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,
|
|
4
|
-
import { inferTransformedProcedureOutput } from '@trpc/server/shared';
|
|
5
|
-
import { DecoratedProxyTRPCContextProps, TRPCFetchInfiniteQueryOptions, TRPCFetchQueryOptions } from '../../internals/context';
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
* @link https://
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
export
|
|
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, inferProcedureInput, ProtectedIntersection } from '@trpc/server';
|
|
4
|
+
import { inferTransformedProcedureOutput } from '@trpc/server/shared';
|
|
5
|
+
import { DecoratedProxyTRPCContextProps, TRPCContextState, TRPCFetchInfiniteQueryOptions, TRPCFetchQueryOptions } from '../../internals/context';
|
|
6
|
+
import { QueryKeyKnown } from '../../internals/getArrayQueryKey';
|
|
7
|
+
type DecorateProcedure<TProcedure extends AnyQueryProcedure> = {
|
|
8
|
+
/**
|
|
9
|
+
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientfetchquery
|
|
10
|
+
*/
|
|
11
|
+
fetch(input: inferProcedureInput<TProcedure>, opts?: TRPCFetchQueryOptions<inferProcedureInput<TProcedure>, TRPCClientError<TProcedure>, inferTransformedProcedureOutput<TProcedure>>): Promise<inferTransformedProcedureOutput<TProcedure>>;
|
|
12
|
+
/**
|
|
13
|
+
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientfetchinfinitequery
|
|
14
|
+
*/
|
|
15
|
+
fetchInfinite(input: inferProcedureInput<TProcedure>, opts?: TRPCFetchInfiniteQueryOptions<inferProcedureInput<TProcedure>, TRPCClientError<TProcedure>, inferTransformedProcedureOutput<TProcedure>>): Promise<InfiniteData<inferTransformedProcedureOutput<TProcedure>>>;
|
|
16
|
+
/**
|
|
17
|
+
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientprefetchquery
|
|
18
|
+
*/
|
|
19
|
+
prefetch(input: inferProcedureInput<TProcedure>, opts?: TRPCFetchQueryOptions<inferProcedureInput<TProcedure>, TRPCClientError<TProcedure>, inferTransformedProcedureOutput<TProcedure>>): Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientprefetchinfinitequery
|
|
22
|
+
*/
|
|
23
|
+
prefetchInfinite(input: inferProcedureInput<TProcedure>, opts?: TRPCFetchInfiniteQueryOptions<inferProcedureInput<TProcedure>, TRPCClientError<TProcedure>, inferTransformedProcedureOutput<TProcedure>>): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* @link https://tanstack.com/query/v4/docs/react/reference/QueryClient#queryclientensurequerydata
|
|
26
|
+
*/
|
|
27
|
+
ensureData(input: inferProcedureInput<TProcedure>, opts?: TRPCFetchQueryOptions<inferProcedureInput<TProcedure>, TRPCClientError<TProcedure>, inferTransformedProcedureOutput<TProcedure>>): Promise<inferTransformedProcedureOutput<TProcedure>>;
|
|
28
|
+
/**
|
|
29
|
+
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientinvalidatequeries
|
|
30
|
+
*/
|
|
31
|
+
invalidate(input?: DeepPartial<inferProcedureInput<TProcedure>>, filters?: Omit<InvalidateQueryFilters, 'predicate'> & {
|
|
32
|
+
predicate?: (query: Query<inferProcedureInput<TProcedure>, TRPCClientError<TProcedure>, inferProcedureInput<TProcedure>, QueryKeyKnown<inferProcedureInput<TProcedure>, inferProcedureInput<TProcedure> extends {
|
|
33
|
+
cursor?: any;
|
|
34
|
+
} | void ? 'infinite' : 'query'>>) => boolean;
|
|
35
|
+
}, options?: InvalidateOptions): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientrefetchqueries
|
|
38
|
+
*/
|
|
39
|
+
refetch(input?: inferProcedureInput<TProcedure>, filters?: RefetchQueryFilters, options?: RefetchOptions): Promise<void>;
|
|
40
|
+
/**
|
|
41
|
+
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientcancelqueries
|
|
42
|
+
*/
|
|
43
|
+
cancel(input?: inferProcedureInput<TProcedure>, options?: CancelOptions): Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientresetqueries
|
|
46
|
+
*/
|
|
47
|
+
reset(input?: inferProcedureInput<TProcedure>, options?: ResetOptions): Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientsetquerydata
|
|
50
|
+
*/
|
|
51
|
+
setData(
|
|
52
|
+
/**
|
|
53
|
+
* The input of the procedure
|
|
54
|
+
*/
|
|
55
|
+
input: inferProcedureInput<TProcedure>, updater: Updater<inferTransformedProcedureOutput<TProcedure> | undefined, inferTransformedProcedureOutput<TProcedure> | undefined>, options?: SetDataOptions): void;
|
|
56
|
+
/**
|
|
57
|
+
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientsetquerydata
|
|
58
|
+
*/
|
|
59
|
+
setInfiniteData(input: inferProcedureInput<TProcedure>, updater: Updater<InfiniteData<inferTransformedProcedureOutput<TProcedure>> | undefined, InfiniteData<inferTransformedProcedureOutput<TProcedure>> | undefined>, options?: SetDataOptions): void;
|
|
60
|
+
/**
|
|
61
|
+
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientgetquerydata
|
|
62
|
+
*/
|
|
63
|
+
getData(input?: inferProcedureInput<TProcedure>): inferTransformedProcedureOutput<TProcedure> | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientgetquerydata
|
|
66
|
+
*/
|
|
67
|
+
getInfiniteData(input?: inferProcedureInput<TProcedure>): InfiniteData<inferTransformedProcedureOutput<TProcedure>> | undefined;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* this is the type that is used to add in procedures that can be used on
|
|
71
|
+
* an entire router
|
|
72
|
+
*/
|
|
73
|
+
type DecorateRouter = {
|
|
74
|
+
/**
|
|
75
|
+
* Invalidate the full router
|
|
76
|
+
* @link https://trpc.io/docs/v10/useContext#query-invalidation
|
|
77
|
+
* @link https://tanstack.com/query/v4/docs/react/guides/query-invalidation
|
|
78
|
+
*/
|
|
79
|
+
invalidate(input?: undefined, filters?: InvalidateQueryFilters, options?: InvalidateOptions): Promise<void>;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* @internal
|
|
83
|
+
*/
|
|
84
|
+
export type DecoratedProcedureUtilsRecord<TRouter extends AnyRouter> = {
|
|
85
|
+
[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]>;
|
|
86
|
+
} & DecorateRouter;
|
|
87
|
+
export type CreateReactUtilsProxy<TRouter extends AnyRouter, TSSRContext> = ProtectedIntersection<DecoratedProxyTRPCContextProps<TRouter, TSSRContext>, DecoratedProcedureUtilsRecord<TRouter>>;
|
|
88
|
+
/**
|
|
89
|
+
* @internal
|
|
90
|
+
*/
|
|
91
|
+
export declare function createReactQueryUtilsProxy<TRouter extends AnyRouter, TSSRContext>(context: TRPCContextState<AnyRouter, unknown>): ProtectedIntersection<DecoratedProxyTRPCContextProps<TRouter, TSSRContext>, DecoratedProcedureUtilsRecord<TRouter>>;
|
|
92
|
+
export {};
|
|
94
93
|
//# 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,
|
|
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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AAS,EACjB,OAAO,CAAC,EAAE,sBAAsB,EAChC,OAAO,CAAC,EAAE,iBAAiB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAAC;CAClB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,6BAA6B,CAAC,OAAO,SAAS,SAAS,IAAI;KACpE,IAAI,IAAI,MAAM,MAAM,CACnB,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,EACzB,SAAS,GAAG,iBAAiB,CAC9B,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GACjD,6BAA6B,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,GAC5D,cAAc,GAEhB,iBAAiB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC;CACvD,GAAG,cAAc,CAAC;AAInB,MAAM,MAAM,qBAAqB,CAC/B,OAAO,SAAS,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
|