@orpc/vue-query 0.32.0 → 0.34.0
Sign up to get free protection for your applications and to get access to all the features.
package/dist/src/types.d.ts
CHANGED
@@ -24,8 +24,8 @@ export type QueryOptionsExtra<TClientContext, TInput, TOutput, TError extends Er
|
|
24
24
|
};
|
25
25
|
export interface QueryOptionsBase<TOutput, TError extends Error> {
|
26
26
|
queryKey: ComputedRef<QueryKey>;
|
27
|
-
queryFn
|
28
|
-
retry
|
27
|
+
queryFn(ctx: QueryFunctionContext): Promise<TOutput>;
|
28
|
+
retry?(failureCount: number, error: TError): boolean;
|
29
29
|
}
|
30
30
|
export type InfiniteOptionsExtra<TClientContext, TInput, TOutput, TError extends Error, TSelectData> = (undefined extends TInput ? {
|
31
31
|
input?: MaybeDeepRef<Omit<TInput, 'cursor'>>;
|
@@ -38,9 +38,9 @@ export type InfiniteOptionsExtra<TClientContext, TInput, TOutput, TError extends
|
|
38
38
|
}) & SetOptional<UseInfiniteQueryOptions<TOutput, TError, TSelectData, TOutput, QueryKey, InferCursor<TInput>>, 'queryKey' | (undefined extends InferCursor<TInput> ? 'initialPageParam' : never)>;
|
39
39
|
export interface InfiniteOptionsBase<TInput, TOutput, TError extends Error> {
|
40
40
|
queryKey: ComputedRef<QueryKey>;
|
41
|
-
queryFn
|
41
|
+
queryFn(ctx: QueryFunctionContext<QueryKey, InferCursor<TInput>>): Promise<TOutput>;
|
42
42
|
initialPageParam: undefined;
|
43
|
-
retry
|
43
|
+
retry?(failureCount: number, error: TError): boolean;
|
44
44
|
}
|
45
45
|
export type MutationOptionsExtra<TClientContext, TInput, TOutput, TError extends Error> = (undefined extends TClientContext ? {
|
46
46
|
context?: MaybeDeepRef<TClientContext>;
|
@@ -53,7 +53,7 @@ export type MutationOptionsExtra<TClientContext, TInput, TOutput, TError extends
|
|
53
53
|
};
|
54
54
|
export interface MutationOptionsBase<TInput, TOutput, TError extends Error> {
|
55
55
|
mutationKey: QueryKey;
|
56
|
-
mutationFn
|
57
|
-
retry
|
56
|
+
mutationFn(input: TInput): Promise<TOutput>;
|
57
|
+
retry?(failureCount: number, error: TError): boolean;
|
58
58
|
}
|
59
59
|
//# sourceMappingURL=types.d.ts.map
|
@@ -5,7 +5,7 @@ import type { MaybeDeepRef } from './types';
|
|
5
5
|
* Utils at any level (procedure or router)
|
6
6
|
*/
|
7
7
|
export interface GeneralUtils<TInput> {
|
8
|
-
key
|
8
|
+
key<UType extends KeyType = undefined>(options?: MaybeDeepRef<BuildKeyOptions<UType, TInput>>): QueryKey;
|
9
9
|
}
|
10
10
|
export declare function createGeneralUtils<TInput>(path: string[]): GeneralUtils<TInput>;
|
11
11
|
//# sourceMappingURL=utils-general.d.ts.map
|
@@ -5,9 +5,9 @@ import type { InfiniteOptionsBase, InfiniteOptionsExtra, MutationOptionsBase, Mu
|
|
5
5
|
* Utils at procedure level
|
6
6
|
*/
|
7
7
|
export interface ProcedureUtils<TClientContext, TInput, TOutput, TError extends Error> {
|
8
|
-
queryOptions
|
9
|
-
infiniteOptions
|
10
|
-
mutationOptions
|
8
|
+
queryOptions<U extends QueryOptionsExtra<TClientContext, TInput, TOutput, TError, any>>(...opt: [options: U] | (undefined extends TInput & TClientContext ? [] : never)): IsEqual<U, QueryOptionsExtra<TClientContext, TInput, TOutput, TError, any>> extends true ? QueryOptionsBase<TOutput, TError> : Omit<QueryOptionsBase<TOutput, TError>, keyof U> & U;
|
9
|
+
infiniteOptions<U extends InfiniteOptionsExtra<TClientContext, TInput, TOutput, TError, any>>(options: U): Omit<InfiniteOptionsBase<TInput, TOutput, TError>, keyof U> & U;
|
10
|
+
mutationOptions<U extends MutationOptionsExtra<TClientContext, TInput, TOutput, TError>>(...opt: [options: U] | (undefined extends TClientContext ? [] : never)): IsEqual<U, MutationOptionsExtra<TClientContext, TInput, TOutput, TError>> extends true ? MutationOptionsBase<TInput, TOutput, TError> : Omit<MutationOptionsBase<TInput, TOutput, TError>, keyof U> & U;
|
11
11
|
}
|
12
12
|
export declare function createProcedureUtils<TClientContext, TInput, TOutput, TError extends Error>(client: Client<TClientContext, TInput, TOutput, TError>, path: string[]): ProcedureUtils<TClientContext, TInput, TOutput, TError>;
|
13
13
|
//# sourceMappingURL=utils-procedure.d.ts.map
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@orpc/vue-query",
|
3
3
|
"type": "module",
|
4
|
-
"version": "0.
|
4
|
+
"version": "0.34.0",
|
5
5
|
"license": "MIT",
|
6
6
|
"homepage": "https://orpc.unnoq.com",
|
7
7
|
"repository": {
|
@@ -34,8 +34,8 @@
|
|
34
34
|
"peerDependencies": {
|
35
35
|
"@tanstack/vue-query": ">=5.50.0",
|
36
36
|
"vue": ">=3.3.0",
|
37
|
-
"@orpc/client": "0.
|
38
|
-
"@orpc/contract": "0.
|
37
|
+
"@orpc/client": "0.34.0",
|
38
|
+
"@orpc/contract": "0.34.0"
|
39
39
|
},
|
40
40
|
"scripts": {
|
41
41
|
"build": "tsup --clean --sourcemap --entry.index=src/index.ts --format=esm --onSuccess='tsc -b --noCheck'",
|