@trpc/next 10.0.0-alpha.21 → 10.0.0-alpha.24
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/setupNext.d.ts +8 -8
- package/dist/withTRPC.d.ts.map +1 -1
- package/package.json +13 -13
- package/src/withTRPC.tsx +7 -2
package/dist/setupNext.d.ts
CHANGED
|
@@ -18,30 +18,30 @@ export declare function setupTRPC<TRouter extends AnyRouter, TSSRContext extends
|
|
|
18
18
|
input: import("@trpc/server").inferProcedureInput<TRouter["_def"]["queries"][TPath_1]>;
|
|
19
19
|
output: import("@trpc/server").ThenArg<ReturnType<TRouter["_def"]["queries"][TPath_1]["call"]>>;
|
|
20
20
|
}; }[TPath_3]["output"], import("@trpc/react").TRPCClientErrorLike<TRouter>>;
|
|
21
|
-
useMutation: <TPath_1 extends keyof TRouter["_def"]["mutations"] & string>(path: TPath_1 | [TPath_1], opts?: import("@trpc/react").UseTRPCMutationOptions<{ [TPath_2 in keyof TRouter["_def"]["mutations"]]: {
|
|
21
|
+
useMutation: <TPath_1 extends keyof TRouter["_def"]["mutations"] & string, TContext = unknown>(path: TPath_1 | [TPath_1], opts?: import("@trpc/react").UseTRPCMutationOptions<{ [TPath_2 in keyof TRouter["_def"]["mutations"]]: {
|
|
22
22
|
input: import("@trpc/server").inferProcedureInput<TRouter["_def"]["mutations"][TPath_2]>;
|
|
23
23
|
output: import("@trpc/server").ThenArg<ReturnType<TRouter["_def"]["mutations"][TPath_2]["call"]>>;
|
|
24
24
|
}; }[TPath_1]["input"], import("@trpc/react").TRPCClientErrorLike<TRouter>, { [TPath_2 in keyof TRouter["_def"]["mutations"]]: {
|
|
25
25
|
input: import("@trpc/server").inferProcedureInput<TRouter["_def"]["mutations"][TPath_2]>;
|
|
26
26
|
output: import("@trpc/server").ThenArg<ReturnType<TRouter["_def"]["mutations"][TPath_2]["call"]>>;
|
|
27
|
-
}; }[TPath_1]["output"]> | undefined) => import("react-query").UseMutationResult<{ [TPath_2 in keyof TRouter["_def"]["mutations"]]: {
|
|
27
|
+
}; }[TPath_1]["output"], TContext> | undefined) => import("react-query").UseMutationResult<{ [TPath_2 in keyof TRouter["_def"]["mutations"]]: {
|
|
28
28
|
input: import("@trpc/server").inferProcedureInput<TRouter["_def"]["mutations"][TPath_2]>;
|
|
29
29
|
output: import("@trpc/server").ThenArg<ReturnType<TRouter["_def"]["mutations"][TPath_2]["call"]>>;
|
|
30
30
|
}; }[TPath_1]["output"], import("@trpc/react").TRPCClientErrorLike<TRouter>, { [TPath_2 in keyof TRouter["_def"]["mutations"]]: {
|
|
31
31
|
input: import("@trpc/server").inferProcedureInput<TRouter["_def"]["mutations"][TPath_2]>;
|
|
32
32
|
output: import("@trpc/server").ThenArg<ReturnType<TRouter["_def"]["mutations"][TPath_2]["call"]>>;
|
|
33
|
-
}; }[TPath_1]["input"],
|
|
34
|
-
useQuery: <TPath_4 extends keyof TRouter["_def"]["queries"] & string
|
|
33
|
+
}; }[TPath_1]["input"], TContext>;
|
|
34
|
+
useQuery: <TPath_4 extends keyof TRouter["_def"]["queries"] & string, TQueryFnData = { [TPath_1 in keyof TRouter["_def"]["queries"]]: {
|
|
35
35
|
input: import("@trpc/server").inferProcedureInput<TRouter["_def"]["queries"][TPath_1]>;
|
|
36
36
|
output: import("@trpc/server").ThenArg<ReturnType<TRouter["_def"]["queries"][TPath_1]["call"]>>;
|
|
37
|
-
}; }[TPath_4]["
|
|
37
|
+
}; }[TPath_4]["output"], TData = { [TPath_1 in keyof TRouter["_def"]["queries"]]: {
|
|
38
38
|
input: import("@trpc/server").inferProcedureInput<TRouter["_def"]["queries"][TPath_1]>;
|
|
39
39
|
output: import("@trpc/server").ThenArg<ReturnType<TRouter["_def"]["queries"][TPath_1]["call"]>>;
|
|
40
|
-
}; }[TPath_4]["output"], import("@trpc/
|
|
40
|
+
}; }[TPath_4]["output"]>(pathAndInput: [path: TPath_4, ...args: import("@trpc/server").inferHandlerInput<TRouter["_def"]["queries"][TPath_4]>], opts?: import("@trpc/react").UseTRPCQueryOptions<TPath_4, { [TPath_1 in keyof TRouter["_def"]["queries"]]: {
|
|
41
41
|
input: import("@trpc/server").inferProcedureInput<TRouter["_def"]["queries"][TPath_1]>;
|
|
42
42
|
output: import("@trpc/server").ThenArg<ReturnType<TRouter["_def"]["queries"][TPath_1]["call"]>>;
|
|
43
|
-
}; }[TPath_4]["
|
|
44
|
-
useSubscription: <TPath_2 extends keyof TRouter["_def"]["subscriptions"] & string, TOutput extends
|
|
43
|
+
}; }[TPath_4]["input"], TQueryFnData, TData, import("@trpc/react").TRPCClientErrorLike<TRouter>> | undefined) => import("react-query").UseQueryResult<TData, import("@trpc/react").TRPCClientErrorLike<TRouter>>;
|
|
44
|
+
useSubscription: <TPath_2 extends keyof TRouter["_def"]["subscriptions"] & string, TOutput extends import("@trpc/server/observable").inferObservableValue<import("@trpc/server").ThenArg<ReturnType<TRouter["_def"]["subscriptions"][TPath_2]["call"]>>>>(pathAndInput: [path: TPath_2, ...args: import("@trpc/server").inferHandlerInput<TRouter["_def"]["subscriptions"][TPath_2]>], opts: {
|
|
45
45
|
enabled?: boolean | undefined;
|
|
46
46
|
error?: ((err: import("@trpc/react").TRPCClientErrorLike<TRouter>) => void) | undefined;
|
|
47
47
|
next: (data: TOutput) => void;
|
package/dist/withTRPC.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withTRPC.d.ts","sourceRoot":"","sources":["../src/withTRPC.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EACL,4BAA4B,EAE5B,eAAe,EAIhB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,SAAS,EAAe,YAAY,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,EAGL,iBAAiB,EACjB,eAAe,EAChB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,
|
|
1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AAO,SAAS,SAAS,EACzB,WAAW,SAAS,eAAe,GAAG,eAAe,EACrD,IAAI,EAAE,oBAAoB,CAAC,OAAO,CAAC,GAAG,kBAAkB,CAAC,OAAO,CAAC,eAU9C,kBAAkB,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,KAAG,iBAAiB,CAsKxE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trpc/next",
|
|
3
|
-
"version": "10.0.0-alpha.
|
|
3
|
+
"version": "10.0.0-alpha.24",
|
|
4
4
|
"description": "tRPC Next lib",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,32 +38,32 @@
|
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@trpc/client": "10.0.0-alpha.
|
|
42
|
-
"@trpc/react": "10.0.0-alpha.
|
|
43
|
-
"@trpc/server": "10.0.0-alpha.
|
|
41
|
+
"@trpc/client": "10.0.0-alpha.24",
|
|
42
|
+
"@trpc/react": "10.0.0-alpha.24",
|
|
43
|
+
"@trpc/server": "10.0.0-alpha.24",
|
|
44
44
|
"next": "*",
|
|
45
45
|
"react": ">=16.8.0",
|
|
46
46
|
"react-dom": ">=16.8.0",
|
|
47
|
-
"react-query": "^3.
|
|
47
|
+
"react-query": "^3.37.0 || ^4.0.0-alpha.4"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@babel/runtime": "^7.9.0",
|
|
51
51
|
"react-ssr-prepass": "^1.5.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@trpc/client": "10.0.0-alpha.
|
|
55
|
-
"@trpc/react": "10.0.0-alpha.
|
|
56
|
-
"@trpc/server": "10.0.0-alpha.
|
|
54
|
+
"@trpc/client": "10.0.0-alpha.24",
|
|
55
|
+
"@trpc/react": "10.0.0-alpha.24",
|
|
56
|
+
"@trpc/server": "10.0.0-alpha.24",
|
|
57
57
|
"@types/express": "^4.17.12",
|
|
58
58
|
"express": "^4.17.1",
|
|
59
|
-
"next": "^12.
|
|
60
|
-
"react": "^
|
|
61
|
-
"react-dom": "^
|
|
62
|
-
"react-query": "^3.
|
|
59
|
+
"next": "^12.1.6",
|
|
60
|
+
"react": "^18.1.0",
|
|
61
|
+
"react-dom": "^18.1.0",
|
|
62
|
+
"react-query": "^3.37.0",
|
|
63
63
|
"zod": "^3.0.0"
|
|
64
64
|
},
|
|
65
65
|
"publishConfig": {
|
|
66
66
|
"access": "public"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "a3ecf56d83dd9774aaf885e83e9ccfe363fbab48"
|
|
69
69
|
}
|
package/src/withTRPC.tsx
CHANGED
|
@@ -19,8 +19,13 @@ import {
|
|
|
19
19
|
NextPageContext,
|
|
20
20
|
} from 'next/dist/shared/lib/utils';
|
|
21
21
|
import React, { createElement, useState } from 'react';
|
|
22
|
-
import {
|
|
23
|
-
|
|
22
|
+
import {
|
|
23
|
+
DehydratedState,
|
|
24
|
+
Hydrate,
|
|
25
|
+
QueryClient,
|
|
26
|
+
QueryClientProvider,
|
|
27
|
+
dehydrate,
|
|
28
|
+
} from 'react-query';
|
|
24
29
|
import ssrPrepass from 'react-ssr-prepass';
|
|
25
30
|
|
|
26
31
|
type QueryClientConfig = ConstructorParameters<typeof QueryClient>[0];
|