@orpc/svelte-query 0.0.0-next.f538070 → 0.0.0-next.f81b4a2
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/index.d.mts +33 -1
- package/dist/index.d.ts +33 -1
- package/package.json +5 -4
package/dist/index.d.mts
CHANGED
|
@@ -13,6 +13,11 @@ declare function buildKey<TType extends KeyType, TInput>(path: string[], options
|
|
|
13
13
|
* Utils at any level (procedure or router)
|
|
14
14
|
*/
|
|
15
15
|
interface GeneralUtils<TInput> {
|
|
16
|
+
/**
|
|
17
|
+
* Generate a query/mutation key for checking status, invalidate, set, get, etc.
|
|
18
|
+
*
|
|
19
|
+
* @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#query-mutation-key Tanstack Query/Mutation Key Docs}
|
|
20
|
+
*/
|
|
16
21
|
key<UType extends KeyType = undefined>(options?: BuildKeyOptions<UType, TInput>): QueryKey;
|
|
17
22
|
}
|
|
18
23
|
declare function createGeneralUtils<TInput>(path: string[]): GeneralUtils<TInput>;
|
|
@@ -51,9 +56,29 @@ type MutationOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TE
|
|
|
51
56
|
type MutationOptions<TInput, TOutput, TError, TMutationContext> = CreateMutationOptions<TOutput, TError, TInput, TMutationContext>;
|
|
52
57
|
|
|
53
58
|
interface ProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError> {
|
|
59
|
+
/**
|
|
60
|
+
* Calling corresponding procedure client
|
|
61
|
+
*
|
|
62
|
+
* @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#calling-procedure-clients Tanstack Calling Procedure Client Docs}
|
|
63
|
+
*/
|
|
54
64
|
call: Client<TClientContext, TInput, TOutput, TError>;
|
|
65
|
+
/**
|
|
66
|
+
* Generate options used for createQuery/prefetchQuery/...
|
|
67
|
+
*
|
|
68
|
+
* @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#query-options-utility Tanstack Query Options Utility Docs}
|
|
69
|
+
*/
|
|
55
70
|
queryOptions<U, USelectData = TOutput>(...rest: MaybeOptionalOptions<U & QueryOptionsIn<TClientContext, TInput, TOutput, TError, USelectData>>): NoInfer<U & Omit<QueryOptionsBase<TOutput, TError>, keyof U>>;
|
|
71
|
+
/**
|
|
72
|
+
* Generate options used for createInfiniteQuery/prefetchInfiniteQuery/...
|
|
73
|
+
*
|
|
74
|
+
* @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#infinite-query-options-utility Tanstack Infinite Query Options Utility Docs}
|
|
75
|
+
*/
|
|
56
76
|
infiniteOptions<U, UPageParam, USelectData = InfiniteData<TOutput, UPageParam>>(options: U & InfiniteOptionsIn<TClientContext, TInput, TOutput, TError, USelectData, UPageParam>): NoInfer<U & Omit<InfiniteOptionsBase<TOutput, TError, UPageParam>, keyof U>>;
|
|
77
|
+
/**
|
|
78
|
+
* Generate options used for createMutation/...
|
|
79
|
+
*
|
|
80
|
+
* @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#mutation-options Tanstack Mutation Options Docs}
|
|
81
|
+
*/
|
|
57
82
|
mutationOptions<UMutationContext>(...rest: MaybeOptionalOptions<MutationOptionsIn<TClientContext, TInput, TOutput, TError, UMutationContext>>): MutationOptions<TInput, TOutput, TError, UMutationContext>;
|
|
58
83
|
}
|
|
59
84
|
interface CreateProcedureUtilsOptions {
|
|
@@ -67,6 +92,13 @@ type RouterUtils<T extends NestedClient<any>> = T extends Client<infer UClientCo
|
|
|
67
92
|
interface CreateRouterUtilsOptions {
|
|
68
93
|
path?: string[];
|
|
69
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* Create a router utils from a client.
|
|
97
|
+
*
|
|
98
|
+
* @info Both client-side and server-side clients are supported.
|
|
99
|
+
* @see {@link https://orpc.unnoq.com/docs/tanstack-query/svelte Tanstack Query Svelte Docs}
|
|
100
|
+
*/
|
|
70
101
|
declare function createRouterUtils<T extends NestedClient<any>>(client: T, options?: CreateRouterUtilsOptions): RouterUtils<T>;
|
|
71
102
|
|
|
72
|
-
export {
|
|
103
|
+
export { buildKey, createGeneralUtils, createRouterUtils as createORPCSvelteQueryUtils, createProcedureUtils, createRouterUtils };
|
|
104
|
+
export type { BuildKeyOptions, CreateProcedureUtilsOptions, CreateRouterUtilsOptions, GeneralUtils, InfiniteOptionsBase, InfiniteOptionsIn, KeyType, MutationOptions, MutationOptionsIn, ProcedureUtils, QueryOptionsBase, QueryOptionsIn, RouterUtils };
|
package/dist/index.d.ts
CHANGED
|
@@ -13,6 +13,11 @@ declare function buildKey<TType extends KeyType, TInput>(path: string[], options
|
|
|
13
13
|
* Utils at any level (procedure or router)
|
|
14
14
|
*/
|
|
15
15
|
interface GeneralUtils<TInput> {
|
|
16
|
+
/**
|
|
17
|
+
* Generate a query/mutation key for checking status, invalidate, set, get, etc.
|
|
18
|
+
*
|
|
19
|
+
* @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#query-mutation-key Tanstack Query/Mutation Key Docs}
|
|
20
|
+
*/
|
|
16
21
|
key<UType extends KeyType = undefined>(options?: BuildKeyOptions<UType, TInput>): QueryKey;
|
|
17
22
|
}
|
|
18
23
|
declare function createGeneralUtils<TInput>(path: string[]): GeneralUtils<TInput>;
|
|
@@ -51,9 +56,29 @@ type MutationOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TE
|
|
|
51
56
|
type MutationOptions<TInput, TOutput, TError, TMutationContext> = CreateMutationOptions<TOutput, TError, TInput, TMutationContext>;
|
|
52
57
|
|
|
53
58
|
interface ProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError> {
|
|
59
|
+
/**
|
|
60
|
+
* Calling corresponding procedure client
|
|
61
|
+
*
|
|
62
|
+
* @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#calling-procedure-clients Tanstack Calling Procedure Client Docs}
|
|
63
|
+
*/
|
|
54
64
|
call: Client<TClientContext, TInput, TOutput, TError>;
|
|
65
|
+
/**
|
|
66
|
+
* Generate options used for createQuery/prefetchQuery/...
|
|
67
|
+
*
|
|
68
|
+
* @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#query-options-utility Tanstack Query Options Utility Docs}
|
|
69
|
+
*/
|
|
55
70
|
queryOptions<U, USelectData = TOutput>(...rest: MaybeOptionalOptions<U & QueryOptionsIn<TClientContext, TInput, TOutput, TError, USelectData>>): NoInfer<U & Omit<QueryOptionsBase<TOutput, TError>, keyof U>>;
|
|
71
|
+
/**
|
|
72
|
+
* Generate options used for createInfiniteQuery/prefetchInfiniteQuery/...
|
|
73
|
+
*
|
|
74
|
+
* @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#infinite-query-options-utility Tanstack Infinite Query Options Utility Docs}
|
|
75
|
+
*/
|
|
56
76
|
infiniteOptions<U, UPageParam, USelectData = InfiniteData<TOutput, UPageParam>>(options: U & InfiniteOptionsIn<TClientContext, TInput, TOutput, TError, USelectData, UPageParam>): NoInfer<U & Omit<InfiniteOptionsBase<TOutput, TError, UPageParam>, keyof U>>;
|
|
77
|
+
/**
|
|
78
|
+
* Generate options used for createMutation/...
|
|
79
|
+
*
|
|
80
|
+
* @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#mutation-options Tanstack Mutation Options Docs}
|
|
81
|
+
*/
|
|
57
82
|
mutationOptions<UMutationContext>(...rest: MaybeOptionalOptions<MutationOptionsIn<TClientContext, TInput, TOutput, TError, UMutationContext>>): MutationOptions<TInput, TOutput, TError, UMutationContext>;
|
|
58
83
|
}
|
|
59
84
|
interface CreateProcedureUtilsOptions {
|
|
@@ -67,6 +92,13 @@ type RouterUtils<T extends NestedClient<any>> = T extends Client<infer UClientCo
|
|
|
67
92
|
interface CreateRouterUtilsOptions {
|
|
68
93
|
path?: string[];
|
|
69
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* Create a router utils from a client.
|
|
97
|
+
*
|
|
98
|
+
* @info Both client-side and server-side clients are supported.
|
|
99
|
+
* @see {@link https://orpc.unnoq.com/docs/tanstack-query/svelte Tanstack Query Svelte Docs}
|
|
100
|
+
*/
|
|
70
101
|
declare function createRouterUtils<T extends NestedClient<any>>(client: T, options?: CreateRouterUtilsOptions): RouterUtils<T>;
|
|
71
102
|
|
|
72
|
-
export {
|
|
103
|
+
export { buildKey, createGeneralUtils, createRouterUtils as createORPCSvelteQueryUtils, createProcedureUtils, createRouterUtils };
|
|
104
|
+
export type { BuildKeyOptions, CreateProcedureUtilsOptions, CreateRouterUtilsOptions, GeneralUtils, InfiniteOptionsBase, InfiniteOptionsIn, KeyType, MutationOptions, MutationOptionsIn, ProcedureUtils, QueryOptionsBase, QueryOptionsIn, RouterUtils };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orpc/svelte-query",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.0-next.
|
|
4
|
+
"version": "0.0.0-next.f81b4a2",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://orpc.unnoq.com",
|
|
7
7
|
"repository": {
|
|
@@ -27,14 +27,15 @@
|
|
|
27
27
|
"dist"
|
|
28
28
|
],
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@tanstack/svelte-query": ">=5.
|
|
30
|
+
"@tanstack/svelte-query": ">=5.55.0",
|
|
31
31
|
"svelte": ">=4.2.0",
|
|
32
|
-
"@orpc/client": "0.0.0-next.
|
|
32
|
+
"@orpc/client": "0.0.0-next.f81b4a2"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@orpc/shared": "0.0.0-next.
|
|
35
|
+
"@orpc/shared": "0.0.0-next.f81b4a2"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
+
"@tanstack/vue-query": "^5.72.3",
|
|
38
39
|
"zod": "^3.24.2"
|
|
39
40
|
},
|
|
40
41
|
"scripts": {
|