@tanstack/vue-query 5.103.2 → 5.104.0
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/build/legacy/devtools/devtools.d.cts +2 -3
- package/build/legacy/devtools/devtools.d.cts.map +1 -1
- package/build/legacy/devtools/devtools.d.ts +2 -3
- package/build/legacy/devtools/devtools.d.ts.map +1 -1
- package/build/legacy/devtools/utils.d.cts +5 -6
- package/build/legacy/devtools/utils.d.cts.map +1 -1
- package/build/legacy/devtools/utils.d.ts +5 -6
- package/build/legacy/devtools/utils.d.ts.map +1 -1
- package/build/legacy/index.d.cts +3 -3
- package/build/legacy/index.d.ts +3 -3
- package/build/legacy/{infiniteQueryOptions-qN6sOJM-.d.cts → infiniteQueryOptions-CnTRbIP5.d.cts} +16 -6
- package/build/legacy/infiniteQueryOptions-CnTRbIP5.d.cts.map +1 -0
- package/build/legacy/{infiniteQueryOptions-CEDiLwh5.d.ts → infiniteQueryOptions-NucMX_M_.d.ts} +16 -6
- package/build/legacy/infiniteQueryOptions-NucMX_M_.d.ts.map +1 -0
- package/build/legacy/infiniteQueryOptions.cjs.map +1 -1
- package/build/legacy/infiniteQueryOptions.d.cts +1 -1
- package/build/legacy/infiniteQueryOptions.d.ts +1 -1
- package/build/legacy/infiniteQueryOptions.js.map +1 -1
- package/build/legacy/mutationCache.d.cts +1 -2
- package/build/legacy/mutationCache.d.cts.map +1 -1
- package/build/legacy/mutationCache.d.ts +1 -2
- package/build/legacy/mutationCache.d.ts.map +1 -1
- package/build/legacy/mutationOptions.cjs.map +1 -1
- package/build/legacy/mutationOptions.d.cts +8 -5
- package/build/legacy/mutationOptions.d.cts.map +1 -1
- package/build/legacy/mutationOptions.d.ts +8 -5
- package/build/legacy/mutationOptions.d.ts.map +1 -1
- package/build/legacy/mutationOptions.js.map +1 -1
- package/build/legacy/queryCache.d.cts +1 -2
- package/build/legacy/queryCache.d.cts.map +1 -1
- package/build/legacy/queryCache.d.ts +1 -2
- package/build/legacy/queryCache.d.ts.map +1 -1
- package/build/legacy/{queryClient-Cv73nzNT.d.ts → queryClient-B6mLtXOj.d.ts} +9 -2
- package/build/legacy/queryClient-B6mLtXOj.d.ts.map +1 -0
- package/build/{modern/queryClient-CZeNAt68.d.cts → legacy/queryClient-Bn2Ql_Lu.d.cts} +9 -2
- package/build/legacy/queryClient-Bn2Ql_Lu.d.cts.map +1 -0
- package/build/legacy/queryClient.cjs +7 -0
- package/build/legacy/queryClient.cjs.map +1 -1
- package/build/legacy/queryClient.d.cts +1 -1
- package/build/legacy/queryClient.d.ts +1 -1
- package/build/legacy/queryClient.js +7 -0
- package/build/legacy/queryClient.js.map +1 -1
- package/build/{modern/queryOptions-DPDwdVBu.d.ts → legacy/queryOptions-CsM5TXD2.d.ts} +4 -3
- package/build/legacy/queryOptions-CsM5TXD2.d.ts.map +1 -0
- package/build/{modern/queryOptions-rkZ3sk6g.d.cts → legacy/queryOptions-CwqQgQmQ.d.cts} +4 -3
- package/build/legacy/queryOptions-CwqQgQmQ.d.cts.map +1 -0
- package/build/legacy/queryOptions.cjs.map +1 -1
- package/build/legacy/queryOptions.d.cts +1 -1
- package/build/legacy/queryOptions.d.ts +1 -1
- package/build/legacy/queryOptions.js.map +1 -1
- package/build/legacy/types-JpJB72CS.d.cts.map +1 -1
- package/build/legacy/types-JpJB72CS.d.ts.map +1 -1
- package/build/legacy/useBaseQuery.cjs.map +1 -1
- package/build/legacy/useBaseQuery.d.cts +1 -1
- package/build/legacy/useBaseQuery.d.ts +1 -1
- package/build/legacy/useBaseQuery.js.map +1 -1
- package/build/legacy/useInfiniteQuery.cjs.map +1 -1
- package/build/legacy/useInfiniteQuery.d.cts +1 -1
- package/build/legacy/useInfiniteQuery.d.ts +1 -1
- package/build/legacy/useInfiniteQuery.js.map +1 -1
- package/build/legacy/useIsFetching.cjs.map +1 -1
- package/build/legacy/useIsFetching.d.cts +3 -4
- package/build/legacy/useIsFetching.d.cts.map +1 -1
- package/build/legacy/useIsFetching.d.ts +3 -4
- package/build/legacy/useIsFetching.d.ts.map +1 -1
- package/build/legacy/useIsFetching.js.map +1 -1
- package/build/legacy/useMutation.d.cts +4 -5
- package/build/legacy/useMutation.d.cts.map +1 -1
- package/build/legacy/useMutation.d.ts +4 -5
- package/build/legacy/useMutation.d.ts.map +1 -1
- package/build/legacy/useMutationState.cjs.map +1 -1
- package/build/legacy/useMutationState.d.cts +5 -6
- package/build/legacy/useMutationState.d.cts.map +1 -1
- package/build/legacy/useMutationState.d.ts +5 -6
- package/build/legacy/useMutationState.d.ts.map +1 -1
- package/build/legacy/useMutationState.js.map +1 -1
- package/build/legacy/usePrefetchInfiniteQuery.d.cts +3 -4
- package/build/legacy/usePrefetchInfiniteQuery.d.cts.map +1 -1
- package/build/legacy/usePrefetchInfiniteQuery.d.ts +3 -4
- package/build/legacy/usePrefetchInfiniteQuery.d.ts.map +1 -1
- package/build/legacy/usePrefetchQuery.d.cts +3 -4
- package/build/legacy/usePrefetchQuery.d.cts.map +1 -1
- package/build/legacy/usePrefetchQuery.d.ts +3 -4
- package/build/legacy/usePrefetchQuery.d.ts.map +1 -1
- package/build/legacy/useQueries.d.cts +5 -6
- package/build/legacy/useQueries.d.cts.map +1 -1
- package/build/legacy/useQueries.d.ts +5 -6
- package/build/legacy/useQueries.d.ts.map +1 -1
- package/build/legacy/useQuery.cjs.map +1 -1
- package/build/legacy/useQuery.d.cts +18 -13
- package/build/legacy/useQuery.d.cts.map +1 -1
- package/build/legacy/useQuery.d.ts +18 -13
- package/build/legacy/useQuery.d.ts.map +1 -1
- package/build/legacy/useQuery.js.map +1 -1
- package/build/legacy/useQueryClient.d.cts +2 -3
- package/build/legacy/useQueryClient.d.cts.map +1 -1
- package/build/legacy/useQueryClient.d.ts +2 -3
- package/build/legacy/useQueryClient.d.ts.map +1 -1
- package/build/legacy/utils.d.cts +6 -7
- package/build/legacy/utils.d.cts.map +1 -1
- package/build/legacy/utils.d.ts +6 -7
- package/build/legacy/utils.d.ts.map +1 -1
- package/build/legacy/vueQueryPlugin.d.cts +3 -4
- package/build/legacy/vueQueryPlugin.d.cts.map +1 -1
- package/build/legacy/vueQueryPlugin.d.ts +3 -4
- package/build/legacy/vueQueryPlugin.d.ts.map +1 -1
- package/build/modern/devtools/devtools.d.cts +2 -3
- package/build/modern/devtools/devtools.d.cts.map +1 -1
- package/build/modern/devtools/devtools.d.ts +2 -3
- package/build/modern/devtools/devtools.d.ts.map +1 -1
- package/build/modern/devtools/utils.d.cts +5 -6
- package/build/modern/devtools/utils.d.cts.map +1 -1
- package/build/modern/devtools/utils.d.ts +5 -6
- package/build/modern/devtools/utils.d.ts.map +1 -1
- package/build/modern/index.d.cts +3 -3
- package/build/modern/index.d.ts +3 -3
- package/build/modern/{infiniteQueryOptions-qN6sOJM-.d.cts → infiniteQueryOptions-CnTRbIP5.d.cts} +16 -6
- package/build/modern/infiniteQueryOptions-CnTRbIP5.d.cts.map +1 -0
- package/build/modern/{infiniteQueryOptions-CEDiLwh5.d.ts → infiniteQueryOptions-NucMX_M_.d.ts} +16 -6
- package/build/modern/infiniteQueryOptions-NucMX_M_.d.ts.map +1 -0
- package/build/modern/infiniteQueryOptions.cjs.map +1 -1
- package/build/modern/infiniteQueryOptions.d.cts +1 -1
- package/build/modern/infiniteQueryOptions.d.ts +1 -1
- package/build/modern/infiniteQueryOptions.js.map +1 -1
- package/build/modern/mutationCache.d.cts +1 -2
- package/build/modern/mutationCache.d.cts.map +1 -1
- package/build/modern/mutationCache.d.ts +1 -2
- package/build/modern/mutationCache.d.ts.map +1 -1
- package/build/modern/mutationOptions.cjs.map +1 -1
- package/build/modern/mutationOptions.d.cts +8 -5
- package/build/modern/mutationOptions.d.cts.map +1 -1
- package/build/modern/mutationOptions.d.ts +8 -5
- package/build/modern/mutationOptions.d.ts.map +1 -1
- package/build/modern/mutationOptions.js.map +1 -1
- package/build/modern/queryCache.d.cts +1 -2
- package/build/modern/queryCache.d.cts.map +1 -1
- package/build/modern/queryCache.d.ts +1 -2
- package/build/modern/queryCache.d.ts.map +1 -1
- package/build/modern/{queryClient-Cv73nzNT.d.ts → queryClient-B6mLtXOj.d.ts} +9 -2
- package/build/modern/queryClient-B6mLtXOj.d.ts.map +1 -0
- package/build/{legacy/queryClient-CZeNAt68.d.cts → modern/queryClient-Bn2Ql_Lu.d.cts} +9 -2
- package/build/modern/queryClient-Bn2Ql_Lu.d.cts.map +1 -0
- package/build/modern/queryClient.cjs +7 -0
- package/build/modern/queryClient.cjs.map +1 -1
- package/build/modern/queryClient.d.cts +1 -1
- package/build/modern/queryClient.d.ts +1 -1
- package/build/modern/queryClient.js +7 -0
- package/build/modern/queryClient.js.map +1 -1
- package/build/{legacy/queryOptions-DPDwdVBu.d.ts → modern/queryOptions-CsM5TXD2.d.ts} +4 -3
- package/build/modern/queryOptions-CsM5TXD2.d.ts.map +1 -0
- package/build/{legacy/queryOptions-rkZ3sk6g.d.cts → modern/queryOptions-CwqQgQmQ.d.cts} +4 -3
- package/build/modern/queryOptions-CwqQgQmQ.d.cts.map +1 -0
- package/build/modern/queryOptions.cjs.map +1 -1
- package/build/modern/queryOptions.d.cts +1 -1
- package/build/modern/queryOptions.d.ts +1 -1
- package/build/modern/queryOptions.js.map +1 -1
- package/build/modern/types-JpJB72CS.d.cts.map +1 -1
- package/build/modern/types-JpJB72CS.d.ts.map +1 -1
- package/build/modern/useBaseQuery.cjs.map +1 -1
- package/build/modern/useBaseQuery.d.cts +1 -1
- package/build/modern/useBaseQuery.d.ts +1 -1
- package/build/modern/useBaseQuery.js.map +1 -1
- package/build/modern/useInfiniteQuery.cjs.map +1 -1
- package/build/modern/useInfiniteQuery.d.cts +1 -1
- package/build/modern/useInfiniteQuery.d.ts +1 -1
- package/build/modern/useInfiniteQuery.js.map +1 -1
- package/build/modern/useIsFetching.cjs.map +1 -1
- package/build/modern/useIsFetching.d.cts +3 -4
- package/build/modern/useIsFetching.d.cts.map +1 -1
- package/build/modern/useIsFetching.d.ts +3 -4
- package/build/modern/useIsFetching.d.ts.map +1 -1
- package/build/modern/useIsFetching.js.map +1 -1
- package/build/modern/useMutation.d.cts +4 -5
- package/build/modern/useMutation.d.cts.map +1 -1
- package/build/modern/useMutation.d.ts +4 -5
- package/build/modern/useMutation.d.ts.map +1 -1
- package/build/modern/useMutationState.cjs.map +1 -1
- package/build/modern/useMutationState.d.cts +5 -6
- package/build/modern/useMutationState.d.cts.map +1 -1
- package/build/modern/useMutationState.d.ts +5 -6
- package/build/modern/useMutationState.d.ts.map +1 -1
- package/build/modern/useMutationState.js.map +1 -1
- package/build/modern/usePrefetchInfiniteQuery.d.cts +3 -4
- package/build/modern/usePrefetchInfiniteQuery.d.cts.map +1 -1
- package/build/modern/usePrefetchInfiniteQuery.d.ts +3 -4
- package/build/modern/usePrefetchInfiniteQuery.d.ts.map +1 -1
- package/build/modern/usePrefetchQuery.d.cts +3 -4
- package/build/modern/usePrefetchQuery.d.cts.map +1 -1
- package/build/modern/usePrefetchQuery.d.ts +3 -4
- package/build/modern/usePrefetchQuery.d.ts.map +1 -1
- package/build/modern/useQueries.d.cts +5 -6
- package/build/modern/useQueries.d.cts.map +1 -1
- package/build/modern/useQueries.d.ts +5 -6
- package/build/modern/useQueries.d.ts.map +1 -1
- package/build/modern/useQuery.cjs.map +1 -1
- package/build/modern/useQuery.d.cts +18 -13
- package/build/modern/useQuery.d.cts.map +1 -1
- package/build/modern/useQuery.d.ts +18 -13
- package/build/modern/useQuery.d.ts.map +1 -1
- package/build/modern/useQuery.js.map +1 -1
- package/build/modern/useQueryClient.d.cts +2 -3
- package/build/modern/useQueryClient.d.cts.map +1 -1
- package/build/modern/useQueryClient.d.ts +2 -3
- package/build/modern/useQueryClient.d.ts.map +1 -1
- package/build/modern/utils.d.cts +6 -7
- package/build/modern/utils.d.cts.map +1 -1
- package/build/modern/utils.d.ts +6 -7
- package/build/modern/utils.d.ts.map +1 -1
- package/build/modern/vueQueryPlugin.d.cts +3 -4
- package/build/modern/vueQueryPlugin.d.cts.map +1 -1
- package/build/modern/vueQueryPlugin.d.ts +3 -4
- package/build/modern/vueQueryPlugin.d.ts.map +1 -1
- package/package.json +9 -9
- package/src/infiniteQueryOptions.ts +3 -2
- package/src/mutationOptions.ts +4 -0
- package/src/queryClient.ts +7 -0
- package/src/queryOptions.ts +29 -26
- package/src/useBaseQuery.ts +9 -3
- package/src/useInfiniteQuery.ts +11 -8
- package/src/useIsFetching.ts +1 -2
- package/src/useMutationState.ts +1 -2
- package/src/useQuery.ts +11 -6
- package/build/legacy/infiniteQueryOptions-CEDiLwh5.d.ts.map +0 -1
- package/build/legacy/infiniteQueryOptions-qN6sOJM-.d.cts.map +0 -1
- package/build/legacy/queryClient-CZeNAt68.d.cts.map +0 -1
- package/build/legacy/queryClient-Cv73nzNT.d.ts.map +0 -1
- package/build/legacy/queryOptions-DPDwdVBu.d.ts.map +0 -1
- package/build/legacy/queryOptions-rkZ3sk6g.d.cts.map +0 -1
- package/build/modern/infiniteQueryOptions-CEDiLwh5.d.ts.map +0 -1
- package/build/modern/infiniteQueryOptions-qN6sOJM-.d.cts.map +0 -1
- package/build/modern/queryClient-CZeNAt68.d.cts.map +0 -1
- package/build/modern/queryClient-Cv73nzNT.d.ts.map +0 -1
- package/build/modern/queryOptions-DPDwdVBu.d.ts.map +0 -1
- package/build/modern/queryOptions-rkZ3sk6g.d.cts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as QueryClient } from "./queryClient-
|
|
1
|
+
import { t as QueryClient } from "./queryClient-B6mLtXOj.js";
|
|
2
2
|
//#region src/useQueryClient.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* Retrieves the `QueryClient` installed by `VueQueryPlugin`, via Vue's `inject`. Must be called inside
|
|
@@ -21,7 +21,6 @@ import { t as QueryClient } from "./queryClient-Cv73nzNT.js";
|
|
|
21
21
|
* </script>
|
|
22
22
|
* ```
|
|
23
23
|
*/
|
|
24
|
-
declare function useQueryClient(id?: string): QueryClient;
|
|
24
|
+
export declare function useQueryClient(id?: string): QueryClient;
|
|
25
25
|
//#endregion
|
|
26
|
-
export { useQueryClient };
|
|
27
26
|
//# sourceMappingURL=useQueryClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useQueryClient.d.ts","names":[],"sources":["../../src/useQueryClient.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useQueryClient.d.ts","names":[],"sources":["../../src/useQueryClient.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;wBA0BgB,eAAe,cAAU"}
|
package/build/legacy/utils.d.cts
CHANGED
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
import { o as MaybeRefDeep } from "./types-JpJB72CS.cjs";
|
|
2
2
|
//#region src/utils.d.ts
|
|
3
3
|
/** @internal Base Vue injection key `VueQueryPlugin` provides the `QueryClient` under. */
|
|
4
|
-
declare const VUE_QUERY_CLIENT = "VUE_QUERY_CLIENT";
|
|
4
|
+
export declare const VUE_QUERY_CLIENT = "VUE_QUERY_CLIENT";
|
|
5
5
|
/** @internal Builds the injection key `useQueryClient`/`VueQueryPlugin` use for a given `queryClientKey`. */
|
|
6
|
-
declare function getClientKey(key?: string): string;
|
|
6
|
+
export declare function getClientKey(key?: string): string;
|
|
7
7
|
/** @internal Copies each property from `update` onto `state`, in place, for every key already on `state`. */
|
|
8
|
-
declare function updateState(state: Record<string, any>, update: Record<string, any>): void;
|
|
8
|
+
export declare function updateState(state: Record<string, any>, update: Record<string, any>): void;
|
|
9
9
|
/**
|
|
10
10
|
* @internal Deep-clones `value`, recursing into arrays and plain objects. `customize`, if provided, can
|
|
11
11
|
* intercept any node (by key and nesting level) and substitute its own return value instead of recursing
|
|
12
12
|
* further.
|
|
13
13
|
*/
|
|
14
|
-
declare function cloneDeep<T>(value: MaybeRefDeep<T>, customize?: (val: MaybeRefDeep<T>, key: string, level: number) => T | undefined): T;
|
|
14
|
+
export declare function cloneDeep<T>(value: MaybeRefDeep<T>, customize?: (val: MaybeRefDeep<T>, key: string, level: number) => T | undefined): T;
|
|
15
15
|
/**
|
|
16
16
|
* @internal Deep-clones `value` like {@link cloneDeep}, additionally unwrapping any `ref`s it encounters (and,
|
|
17
17
|
* if `unrefGetters` is `true`, calling any functions it encounters and unwrapping their result too). Always
|
|
18
18
|
* resolves `queryKey` this way, regardless of `unrefGetters` — this is what lets a `queryKey` containing `ref`s
|
|
19
19
|
* be passed straight through to `@tanstack/query-core`.
|
|
20
20
|
*/
|
|
21
|
-
declare function cloneDeepUnref<T>(obj: MaybeRefDeep<T>, unrefGetters?: boolean): T;
|
|
21
|
+
export declare function cloneDeepUnref<T>(obj: MaybeRefDeep<T>, unrefGetters?: boolean): T;
|
|
22
22
|
/** @internal Resolves `source` to a plain value — calls it if it's a function, otherwise deep-unwraps it. */
|
|
23
|
-
declare function toValueDeep<T>(source: (() => T) | MaybeRefDeep<T>): T;
|
|
23
|
+
export declare function toValueDeep<T>(source: (() => T) | MaybeRefDeep<T>): T;
|
|
24
24
|
//#endregion
|
|
25
|
-
export { VUE_QUERY_CLIENT, cloneDeep, cloneDeepUnref, getClientKey, toValueDeep, updateState };
|
|
26
25
|
//# sourceMappingURL=utils.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.cts","names":[],"sources":["../../src/utils.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"utils.d.cts","names":[],"sources":["../../src/utils.ts"],"mappings":";;;qBAIa;;wBAGG,aAAa;;wBAMb,YACd,OAAO,qBACP,QAAQ;;;;;;wBAmDM,UAAU,GACxB,OAAO,aAAa,IACpB,aACE,KAAK,aAAa,IAClB,aACA,kBACG,gBACJ;;;;;;;wBAUa,eAAe,GAC7B,KAAK,aAAa,IAClB,yBACC;;wBAyCa,YAAY,GAAG,eAAe,KAAK,aAAa,KAAK"}
|
package/build/legacy/utils.d.ts
CHANGED
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
import { o as MaybeRefDeep } from "./types-JpJB72CS.js";
|
|
2
2
|
//#region src/utils.d.ts
|
|
3
3
|
/** @internal Base Vue injection key `VueQueryPlugin` provides the `QueryClient` under. */
|
|
4
|
-
declare const VUE_QUERY_CLIENT = "VUE_QUERY_CLIENT";
|
|
4
|
+
export declare const VUE_QUERY_CLIENT = "VUE_QUERY_CLIENT";
|
|
5
5
|
/** @internal Builds the injection key `useQueryClient`/`VueQueryPlugin` use for a given `queryClientKey`. */
|
|
6
|
-
declare function getClientKey(key?: string): string;
|
|
6
|
+
export declare function getClientKey(key?: string): string;
|
|
7
7
|
/** @internal Copies each property from `update` onto `state`, in place, for every key already on `state`. */
|
|
8
|
-
declare function updateState(state: Record<string, any>, update: Record<string, any>): void;
|
|
8
|
+
export declare function updateState(state: Record<string, any>, update: Record<string, any>): void;
|
|
9
9
|
/**
|
|
10
10
|
* @internal Deep-clones `value`, recursing into arrays and plain objects. `customize`, if provided, can
|
|
11
11
|
* intercept any node (by key and nesting level) and substitute its own return value instead of recursing
|
|
12
12
|
* further.
|
|
13
13
|
*/
|
|
14
|
-
declare function cloneDeep<T>(value: MaybeRefDeep<T>, customize?: (val: MaybeRefDeep<T>, key: string, level: number) => T | undefined): T;
|
|
14
|
+
export declare function cloneDeep<T>(value: MaybeRefDeep<T>, customize?: (val: MaybeRefDeep<T>, key: string, level: number) => T | undefined): T;
|
|
15
15
|
/**
|
|
16
16
|
* @internal Deep-clones `value` like {@link cloneDeep}, additionally unwrapping any `ref`s it encounters (and,
|
|
17
17
|
* if `unrefGetters` is `true`, calling any functions it encounters and unwrapping their result too). Always
|
|
18
18
|
* resolves `queryKey` this way, regardless of `unrefGetters` — this is what lets a `queryKey` containing `ref`s
|
|
19
19
|
* be passed straight through to `@tanstack/query-core`.
|
|
20
20
|
*/
|
|
21
|
-
declare function cloneDeepUnref<T>(obj: MaybeRefDeep<T>, unrefGetters?: boolean): T;
|
|
21
|
+
export declare function cloneDeepUnref<T>(obj: MaybeRefDeep<T>, unrefGetters?: boolean): T;
|
|
22
22
|
/** @internal Resolves `source` to a plain value — calls it if it's a function, otherwise deep-unwraps it. */
|
|
23
|
-
declare function toValueDeep<T>(source: (() => T) | MaybeRefDeep<T>): T;
|
|
23
|
+
export declare function toValueDeep<T>(source: (() => T) | MaybeRefDeep<T>): T;
|
|
24
24
|
//#endregion
|
|
25
|
-
export { VUE_QUERY_CLIENT, cloneDeep, cloneDeepUnref, getClientKey, toValueDeep, updateState };
|
|
26
25
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","names":[],"sources":["../../src/utils.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","names":[],"sources":["../../src/utils.ts"],"mappings":";;;qBAIa;;wBAGG,aAAa;;wBAMb,YACd,OAAO,qBACP,QAAQ;;;;;;wBAmDM,UAAU,GACxB,OAAO,aAAa,IACpB,aACE,KAAK,aAAa,IAClB,aACA,kBACG,gBACJ;;;;;;;wBAUa,eAAe,GAC7B,KAAK,aAAa,IAClB,yBACC;;wBAyCa,YAAY,GAAG,eAAe,KAAK,aAAa,KAAK"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { u as QueryClientConfig } from "./types-JpJB72CS.cjs";
|
|
2
|
-
import { t as QueryClient } from "./queryClient-
|
|
2
|
+
import { t as QueryClient } from "./queryClient-Bn2Ql_Lu.cjs";
|
|
3
3
|
//#region src/vueQueryPlugin.d.ts
|
|
4
4
|
type ClientPersister = (client: QueryClient) => [() => void, Promise<void>];
|
|
5
5
|
interface CommonOptions {
|
|
@@ -26,7 +26,7 @@ interface ClientOptions extends CommonOptions {
|
|
|
26
26
|
/** Use your own `QueryClient` instance instead of having the plugin construct one from `queryClientConfig`. */
|
|
27
27
|
queryClient?: QueryClient;
|
|
28
28
|
}
|
|
29
|
-
type VueQueryPluginOptions = ConfigOptions | ClientOptions;
|
|
29
|
+
export type VueQueryPluginOptions = ConfigOptions | ClientOptions;
|
|
30
30
|
/**
|
|
31
31
|
* Installs a `QueryClient` on the Vue app, making it available to every descendant component through
|
|
32
32
|
* `useQueryClient` — the Vue equivalent of React's `QueryClientProvider`, but wired up as an app-level plugin
|
|
@@ -61,9 +61,8 @@ type VueQueryPluginOptions = ConfigOptions | ClientOptions;
|
|
|
61
61
|
* })
|
|
62
62
|
* ```
|
|
63
63
|
*/
|
|
64
|
-
declare const VueQueryPlugin: {
|
|
64
|
+
export declare const VueQueryPlugin: {
|
|
65
65
|
install: (app: any, options?: VueQueryPluginOptions) => void;
|
|
66
66
|
};
|
|
67
67
|
//#endregion
|
|
68
|
-
export { VueQueryPlugin, VueQueryPluginOptions };
|
|
69
68
|
//# sourceMappingURL=vueQueryPlugin.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vueQueryPlugin.d.cts","names":[],"sources":["../../src/vueQueryPlugin.ts"],"mappings":";;;KAQK,mBAAmB,QAAQ,6BAA6B;UAEnD;;EAER;;;;;EAKA;;;;;EAKA,kBAAkB;;EAElB,4BAA4B,QAAQ;;UAG5B,sBAAsB;;EAE9B,oBAAoB;;UAGZ,sBAAsB;;EAE9B,cAAc;;
|
|
1
|
+
{"version":3,"file":"vueQueryPlugin.d.cts","names":[],"sources":["../../src/vueQueryPlugin.ts"],"mappings":";;;KAQK,mBAAmB,QAAQ,6BAA6B;UAEnD;;EAER;;;;;EAKA;;;;;EAKA,kBAAkB;;EAElB,4BAA4B,QAAQ;;UAG5B,sBAAsB;;EAE9B,oBAAoB;;UAGZ,sBAAsB;;EAE9B,cAAc;;YAGJ,wBAAwB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAoCvC;EACI,UAAA,UAAG,UAAW"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { u as QueryClientConfig } from "./types-JpJB72CS.js";
|
|
2
|
-
import { t as QueryClient } from "./queryClient-
|
|
2
|
+
import { t as QueryClient } from "./queryClient-B6mLtXOj.js";
|
|
3
3
|
//#region src/vueQueryPlugin.d.ts
|
|
4
4
|
type ClientPersister = (client: QueryClient) => [() => void, Promise<void>];
|
|
5
5
|
interface CommonOptions {
|
|
@@ -26,7 +26,7 @@ interface ClientOptions extends CommonOptions {
|
|
|
26
26
|
/** Use your own `QueryClient` instance instead of having the plugin construct one from `queryClientConfig`. */
|
|
27
27
|
queryClient?: QueryClient;
|
|
28
28
|
}
|
|
29
|
-
type VueQueryPluginOptions = ConfigOptions | ClientOptions;
|
|
29
|
+
export type VueQueryPluginOptions = ConfigOptions | ClientOptions;
|
|
30
30
|
/**
|
|
31
31
|
* Installs a `QueryClient` on the Vue app, making it available to every descendant component through
|
|
32
32
|
* `useQueryClient` — the Vue equivalent of React's `QueryClientProvider`, but wired up as an app-level plugin
|
|
@@ -61,9 +61,8 @@ type VueQueryPluginOptions = ConfigOptions | ClientOptions;
|
|
|
61
61
|
* })
|
|
62
62
|
* ```
|
|
63
63
|
*/
|
|
64
|
-
declare const VueQueryPlugin: {
|
|
64
|
+
export declare const VueQueryPlugin: {
|
|
65
65
|
install: (app: any, options?: VueQueryPluginOptions) => void;
|
|
66
66
|
};
|
|
67
67
|
//#endregion
|
|
68
|
-
export { VueQueryPlugin, VueQueryPluginOptions };
|
|
69
68
|
//# sourceMappingURL=vueQueryPlugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vueQueryPlugin.d.ts","names":[],"sources":["../../src/vueQueryPlugin.ts"],"mappings":";;;KAQK,mBAAmB,QAAQ,6BAA6B;UAEnD;;EAER;;;;;EAKA;;;;;EAKA,kBAAkB;;EAElB,4BAA4B,QAAQ;;UAG5B,sBAAsB;;EAE9B,oBAAoB;;UAGZ,sBAAsB;;EAE9B,cAAc;;
|
|
1
|
+
{"version":3,"file":"vueQueryPlugin.d.ts","names":[],"sources":["../../src/vueQueryPlugin.ts"],"mappings":";;;KAQK,mBAAmB,QAAQ,6BAA6B;UAEnD;;EAER;;;;;EAKA;;;;;EAKA,kBAAkB;;EAElB,4BAA4B,QAAQ;;UAG5B,sBAAsB;;EAE9B,oBAAoB;;UAGZ,sBAAsB;;EAE9B,cAAc;;YAGJ,wBAAwB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAoCvC;EACI,UAAA,UAAG,UAAW"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { t as QueryClient } from "../queryClient-
|
|
1
|
+
import { t as QueryClient } from "../queryClient-Bn2Ql_Lu.cjs";
|
|
2
2
|
//#region src/devtools/devtools.d.ts
|
|
3
|
-
declare function setupDevtools(app: any, queryClient: QueryClient): void;
|
|
3
|
+
export declare function setupDevtools(app: any, queryClient: QueryClient): void;
|
|
4
4
|
//#endregion
|
|
5
|
-
export { setupDevtools };
|
|
6
5
|
//# sourceMappingURL=devtools.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devtools.d.cts","names":[],"sources":["../../../src/devtools/devtools.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"devtools.d.cts","names":[],"sources":["../../../src/devtools/devtools.ts"],"mappings":";;wBAgBgB,cAAc,UAAU,aAAa"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { t as QueryClient } from "../queryClient-
|
|
1
|
+
import { t as QueryClient } from "../queryClient-B6mLtXOj.js";
|
|
2
2
|
//#region src/devtools/devtools.d.ts
|
|
3
|
-
declare function setupDevtools(app: any, queryClient: QueryClient): void;
|
|
3
|
+
export declare function setupDevtools(app: any, queryClient: QueryClient): void;
|
|
4
4
|
//#endregion
|
|
5
|
-
export { setupDevtools };
|
|
6
5
|
//# sourceMappingURL=devtools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devtools.d.ts","names":[],"sources":["../../../src/devtools/devtools.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"devtools.d.ts","names":[],"sources":["../../../src/devtools/devtools.ts"],"mappings":";;wBAgBgB,cAAc,UAAU,aAAa"}
|
|
@@ -8,11 +8,10 @@ declare enum QueryState$1 {
|
|
|
8
8
|
Inactive = 3,
|
|
9
9
|
Paused = 4
|
|
10
10
|
}
|
|
11
|
-
declare function getQueryState(query: Query): QueryState$1;
|
|
12
|
-
declare function getQueryStateLabel(query: Query): string;
|
|
13
|
-
declare function getQueryStatusFg(query: Query): number;
|
|
14
|
-
declare function getQueryStatusBg(query: Query): number;
|
|
15
|
-
declare const sortFns: Record<string, SortFn>;
|
|
11
|
+
export declare function getQueryState(query: Query): QueryState$1;
|
|
12
|
+
export declare function getQueryStateLabel(query: Query): string;
|
|
13
|
+
export declare function getQueryStatusFg(query: Query): number;
|
|
14
|
+
export declare function getQueryStatusBg(query: Query): number;
|
|
15
|
+
export declare const sortFns: Record<string, SortFn>;
|
|
16
16
|
//#endregion
|
|
17
|
-
export { getQueryState, getQueryStateLabel, getQueryStatusBg, getQueryStatusFg, sortFns };
|
|
18
17
|
//# sourceMappingURL=utils.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.cts","names":[],"sources":["../../../src/devtools/utils.ts"],"mappings":";;KAEK,UAAU,GAAG,OAAO,GAAG;
|
|
1
|
+
{"version":3,"file":"utils.d.cts","names":["QueryState"],"sources":["../../../src/devtools/utils.ts"],"mappings":";;KAEK,UAAU,GAAG,OAAO,GAAG;aAEvBA;EACH;EACA;EACA;EACA;EACA;;wBAGc,cAAc,OAAO,QAAQA;wBAiB7B,mBAAmB,OAAO;wBAmB1B,iBAAiB,OAAO;wBAUxB,iBAAiB,OAAO;qBAgC3B,SAAS,eAAe"}
|
|
@@ -8,11 +8,10 @@ declare enum QueryState$1 {
|
|
|
8
8
|
Inactive = 3,
|
|
9
9
|
Paused = 4
|
|
10
10
|
}
|
|
11
|
-
declare function getQueryState(query: Query): QueryState$1;
|
|
12
|
-
declare function getQueryStateLabel(query: Query): string;
|
|
13
|
-
declare function getQueryStatusFg(query: Query): number;
|
|
14
|
-
declare function getQueryStatusBg(query: Query): number;
|
|
15
|
-
declare const sortFns: Record<string, SortFn>;
|
|
11
|
+
export declare function getQueryState(query: Query): QueryState$1;
|
|
12
|
+
export declare function getQueryStateLabel(query: Query): string;
|
|
13
|
+
export declare function getQueryStatusFg(query: Query): number;
|
|
14
|
+
export declare function getQueryStatusBg(query: Query): number;
|
|
15
|
+
export declare const sortFns: Record<string, SortFn>;
|
|
16
16
|
//#endregion
|
|
17
|
-
export { getQueryState, getQueryStateLabel, getQueryStatusBg, getQueryStatusFg, sortFns };
|
|
18
17
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","names":[],"sources":["../../../src/devtools/utils.ts"],"mappings":";;KAEK,UAAU,GAAG,OAAO,GAAG;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","names":["QueryState"],"sources":["../../../src/devtools/utils.ts"],"mappings":";;KAEK,UAAU,GAAG,OAAO,GAAG;aAEvBA;EACH;EACA;EACA;EACA;EACA;;wBAGc,cAAc,OAAO,QAAQA;wBAiB7B,mBAAmB,OAAO;wBAmB1B,iBAAiB,OAAO;wBAUxB,iBAAiB,OAAO;qBAgC3B,SAAS,eAAe"}
|
package/build/modern/index.d.cts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { c as MutationOptions } from "./types-JpJB72CS.cjs";
|
|
2
|
-
import { a as UndefinedInitialQueryOptionsWithDataTag, i as UndefinedInitialQueryOptions, n as DefinedInitialQueryOptionsWithDataTag, o as UseQueryOptions, r as QueryOptions, s as queryOptions, t as DefinedInitialQueryOptions } from "./queryOptions-
|
|
3
|
-
import { t as QueryClient } from "./queryClient-
|
|
2
|
+
import { a as UndefinedInitialQueryOptionsWithDataTag, i as UndefinedInitialQueryOptions, n as DefinedInitialQueryOptionsWithDataTag, o as UseQueryOptions, r as QueryOptions, s as queryOptions, t as DefinedInitialQueryOptions } from "./queryOptions-CwqQgQmQ.cjs";
|
|
3
|
+
import { t as QueryClient } from "./queryClient-Bn2Ql_Lu.cjs";
|
|
4
4
|
import { useQueryClient } from "./useQueryClient.cjs";
|
|
5
5
|
import { VueQueryPlugin, VueQueryPluginOptions } from "./vueQueryPlugin.cjs";
|
|
6
6
|
import { QueryCache } from "./queryCache.cjs";
|
|
7
|
-
import { a as UseInfiniteQueryReturnType, i as UseInfiniteQueryOptions, n as UndefinedInitialDataInfiniteOptions, o as useInfiniteQuery, r as infiniteQueryOptions, t as DefinedInitialDataInfiniteOptions } from "./infiniteQueryOptions-
|
|
7
|
+
import { a as UseInfiniteQueryReturnType, i as UseInfiniteQueryOptions, n as UndefinedInitialDataInfiniteOptions, o as useInfiniteQuery, r as infiniteQueryOptions, t as DefinedInitialDataInfiniteOptions } from "./infiniteQueryOptions-CnTRbIP5.cjs";
|
|
8
8
|
import { MutationCache } from "./mutationCache.cjs";
|
|
9
9
|
import { mutationOptions } from "./mutationOptions.cjs";
|
|
10
10
|
import { UseQueryDefinedReturnType, UseQueryReturnType, useQuery } from "./useQuery.cjs";
|
package/build/modern/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { c as MutationOptions } from "./types-JpJB72CS.js";
|
|
2
|
-
import { a as UndefinedInitialQueryOptionsWithDataTag, i as UndefinedInitialQueryOptions, n as DefinedInitialQueryOptionsWithDataTag, o as UseQueryOptions, r as QueryOptions, s as queryOptions, t as DefinedInitialQueryOptions } from "./queryOptions-
|
|
3
|
-
import { t as QueryClient } from "./queryClient-
|
|
2
|
+
import { a as UndefinedInitialQueryOptionsWithDataTag, i as UndefinedInitialQueryOptions, n as DefinedInitialQueryOptionsWithDataTag, o as UseQueryOptions, r as QueryOptions, s as queryOptions, t as DefinedInitialQueryOptions } from "./queryOptions-CsM5TXD2.js";
|
|
3
|
+
import { t as QueryClient } from "./queryClient-B6mLtXOj.js";
|
|
4
4
|
import { useQueryClient } from "./useQueryClient.js";
|
|
5
5
|
import { VueQueryPlugin, VueQueryPluginOptions } from "./vueQueryPlugin.js";
|
|
6
6
|
import { QueryCache } from "./queryCache.js";
|
|
7
|
-
import { a as UseInfiniteQueryReturnType, i as UseInfiniteQueryOptions, n as UndefinedInitialDataInfiniteOptions, o as useInfiniteQuery, r as infiniteQueryOptions, t as DefinedInitialDataInfiniteOptions } from "./infiniteQueryOptions-
|
|
7
|
+
import { a as UseInfiniteQueryReturnType, i as UseInfiniteQueryOptions, n as UndefinedInitialDataInfiniteOptions, o as useInfiniteQuery, r as infiniteQueryOptions, t as DefinedInitialDataInfiniteOptions } from "./infiniteQueryOptions-NucMX_M_.js";
|
|
8
8
|
import { MutationCache } from "./mutationCache.js";
|
|
9
9
|
import { mutationOptions } from "./mutationOptions.js";
|
|
10
10
|
import { UseQueryDefinedReturnType, UseQueryReturnType, useQuery } from "./useQuery.js";
|
package/build/modern/{infiniteQueryOptions-qN6sOJM-.d.cts → infiniteQueryOptions-CnTRbIP5.d.cts}
RENAMED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import { a as MaybeRef, d as ShallowOption, o as MaybeRefDeep, s as MaybeRefOrGetter, t as DeepUnwrapRef } from "./types-JpJB72CS.cjs";
|
|
2
|
-
import { o as UseQueryOptions } from "./queryOptions-
|
|
3
|
-
import { t as QueryClient$1 } from "./queryClient-
|
|
2
|
+
import { o as UseQueryOptions } from "./queryOptions-CwqQgQmQ.cjs";
|
|
3
|
+
import { t as QueryClient$1 } from "./queryClient-Bn2Ql_Lu.cjs";
|
|
4
4
|
import { DefaultError, InfiniteData, InfiniteQueryObserverOptions, InfiniteQueryObserverResult, NonUndefinedGuard, QueryKey, QueryKeyWithDataTag, QueryObserver, QueryObserverResult } from "@tanstack/query-core";
|
|
5
5
|
import { Ref } from "vue-demi";
|
|
6
6
|
//#region src/useBaseQuery.d.ts
|
|
7
7
|
type UseBaseQueryReturnType<TData, TError, TResult = QueryObserverResult<TData, TError>> = { [K in keyof TResult]: K extends 'fetchNextPage' | 'fetchPreviousPage' | 'refetch' ? TResult[K] : Ref<Readonly<TResult>[K]>; } & {
|
|
8
|
+
/**
|
|
9
|
+
* Returns a promise for use with Vue's `Suspense` or `onServerPrefetch`. It fetches the query if it has no
|
|
10
|
+
* data or its data is stale and resolves with the result once that fetch resolves (usually when the query
|
|
11
|
+
* function finishes, but earlier after the first chunk of a streamed query or when data is set during the
|
|
12
|
+
* fetch), or resolves immediately if the data is fresh. While the query is disabled, it waits until the query
|
|
13
|
+
* is enabled. If the fetch fails, it resolves with the error result, unless `throwOnError` is (or returns)
|
|
14
|
+
* `true`, in which case it rejects.
|
|
15
|
+
*/
|
|
8
16
|
suspense: () => Promise<TResult>;
|
|
9
17
|
};
|
|
10
18
|
type UseQueryOptionsGeneric<TQueryFnData, TError, TData, TQueryData, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = UseQueryOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey> | UseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>;
|
|
@@ -25,7 +33,8 @@ type UseInfiniteQueryReturnType<TData, TError> = UseBaseQueryReturnType<TData, T
|
|
|
25
33
|
* The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of
|
|
26
34
|
* `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`.
|
|
27
35
|
*
|
|
28
|
-
* This overload is selected when `initialData` is set, so the resulting `data` is never `undefined
|
|
36
|
+
* This overload is selected when `initialData` is set, so the resulting `data` is never `undefined` (unless
|
|
37
|
+
* a `select` changes `TData` to include `undefined`).
|
|
29
38
|
*
|
|
30
39
|
* `enabled` tracks reactive dependencies automatically as a `ref`, a plain value, or a reactive getter
|
|
31
40
|
* (`() => ...`). `queryKey` reacts through a `ref` for the array itself, or `ref`s and reactive getters as
|
|
@@ -282,7 +291,7 @@ type UndefinedInitialDataInfiniteOptions<TQueryFnData, TError = DefaultError, TD
|
|
|
282
291
|
};
|
|
283
292
|
/**
|
|
284
293
|
* The options accepted by the `infiniteQueryOptions` overload selected when `initialData` is set — `data` is
|
|
285
|
-
* never `undefined
|
|
294
|
+
* never `undefined` (unless a `select` changes `TData` to include `undefined`).
|
|
286
295
|
*
|
|
287
296
|
* @template TQueryFnData - The type of a single page, as your `queryFn` resolves it.
|
|
288
297
|
* @template TError - The type of errors your `queryFn` may throw.
|
|
@@ -333,7 +342,8 @@ declare function infiniteQueryOptions<TQueryFnData, TError = DefaultError, TData
|
|
|
333
342
|
* These options can be shared across hooks and imperative APIs such as `queryClient.infiniteQuery`.
|
|
334
343
|
* `options.queryKey` is required and is the query key to generate options for.
|
|
335
344
|
*
|
|
336
|
-
* This overload is selected when `initialData` is set, so the resulting `data` is never `undefined
|
|
345
|
+
* This overload is selected when `initialData` is set, so the resulting `data` is never `undefined` (unless
|
|
346
|
+
* a `select` changes `TData` to include `undefined`).
|
|
337
347
|
*
|
|
338
348
|
* @see {@link useInfiniteQuery} to run an infinite query with these options.
|
|
339
349
|
* @param options - The {@link DefinedInitialDataInfiniteOptions} to use — everything you can pass to
|
|
@@ -362,4 +372,4 @@ declare function infiniteQueryOptions<TQueryFnData, TError = DefaultError, TData
|
|
|
362
372
|
declare function infiniteQueryOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: DefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>): DefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam> & QueryKeyWithDataTag<TQueryKey, InfiniteData<TQueryFnData>, TError>;
|
|
363
373
|
//#endregion
|
|
364
374
|
export { UseInfiniteQueryReturnType as a, useBaseQuery as c, UseInfiniteQueryOptions as i, UndefinedInitialDataInfiniteOptions as n, useInfiniteQuery as o, infiniteQueryOptions as r, UseBaseQueryReturnType as s, DefinedInitialDataInfiniteOptions as t };
|
|
365
|
-
//# sourceMappingURL=infiniteQueryOptions-
|
|
375
|
+
//# sourceMappingURL=infiniteQueryOptions-CnTRbIP5.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"infiniteQueryOptions-CnTRbIP5.d.cts","names":["QueryClient","QueryClient"],"sources":["../../src/useBaseQuery.ts","../../src/useInfiniteQuery.ts","../../src/infiniteQueryOptions.ts"],"mappings":";;;;;;KA0BY,uBACV,OACA,QACA,UAAU,oBAAoB,OAAO,cAEpC,WAAW,UAAU,8DAElB,QAAQ,KACR,IAAI,SAAS,SAAS;;;;;;;;;EAU1B,gBAAgB,QAAQ;;KAGrB,uBACH,cACA,QACA,OACA,YACA,kBAAkB,WAAW,UAC7B,wBAEE,gBAAgB,cAAc,QAAQ,OAAO,YAAY,aACzD,wBAAwB,cAAc,QAAQ,OAAO,WAAW;;;;;;;;;iBAUpD,aACd,cACA,QACA,OACA,YACA,kBAAkB,UAClB,YAEA,iBAAiB,eACjB,SAAS,iBACP,uBACE,cACA,QACA,OACA,YACA,WACA,cAGJ,cAAcA,gBACb,uBAAuB,OAAO;;;KC5DrB,wBACV,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAC7B,wBACE,YAGE,kBAAkB,6BAChB,cACA,QACA,OACA,WACA,cAED,6BACC,iBACE,6BACE,cACA,QACA,OACA,cAAc,YACd,YACA,aAEJ,aACE,6BACE,cACA,QACA,OACA,cAAc,YACd,YACA,gBAEN;KAGM,2BAA2B,OAAO,UAAU,uBACtD,OACA,QACA,4BAA4B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAoDrB,iBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,iBACP,kCACE,cACA,QACA,OACA,WACA,cAGJ,cAAcC,gBACb,2BAA2B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqHrB,iBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,iBACP,oCACE,cACA,QACA,OACA,WACA,cAGJ,cAAcA,gBACb,2BAA2B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA+ErB,iBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,iBACP,wBAAwB,cAAc,QAAQ,OAAO,WAAW,cAElE,cAAcA,gBACb,2BAA2B,OAAO;;;;;;;;;;;;;;KCpVzB,oCACV,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,wBACE,wBACF,cACA,QACA,OACA,WACA;EAEA;;;;;;;;;;;;;KAcU,kCACV,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,wBACE,wBACF,cACA,QACA,OACA,WACA;;;;;;;;EASA,aACI,kBAAkB,aAAa,cAAc,sBACtC,kBAAkB,aAAa,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6B1C,qBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,oCACP,cACA,QACA,OACA,WACA,cAED,oCACD,cACA,QACA,OACA,WACA,cAEA,oBAAoB,WAAW,aAAa,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkC7C,qBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,kCACP,cACA,QACA,OACA,WACA,cAED,kCACD,cACA,QACA,OACA,WACA,cAEA,oBAAoB,WAAW,aAAa,eAAe"}
|
package/build/modern/{infiniteQueryOptions-CEDiLwh5.d.ts → infiniteQueryOptions-NucMX_M_.d.ts}
RENAMED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import { a as MaybeRef, d as ShallowOption, o as MaybeRefDeep, s as MaybeRefOrGetter, t as DeepUnwrapRef } from "./types-JpJB72CS.js";
|
|
2
|
-
import { o as UseQueryOptions } from "./queryOptions-
|
|
3
|
-
import { t as QueryClient$1 } from "./queryClient-
|
|
2
|
+
import { o as UseQueryOptions } from "./queryOptions-CsM5TXD2.js";
|
|
3
|
+
import { t as QueryClient$1 } from "./queryClient-B6mLtXOj.js";
|
|
4
4
|
import { DefaultError, InfiniteData, InfiniteQueryObserverOptions, InfiniteQueryObserverResult, NonUndefinedGuard, QueryKey, QueryKeyWithDataTag, QueryObserver, QueryObserverResult } from "@tanstack/query-core";
|
|
5
5
|
import { Ref } from "vue-demi";
|
|
6
6
|
//#region src/useBaseQuery.d.ts
|
|
7
7
|
type UseBaseQueryReturnType<TData, TError, TResult = QueryObserverResult<TData, TError>> = { [K in keyof TResult]: K extends 'fetchNextPage' | 'fetchPreviousPage' | 'refetch' ? TResult[K] : Ref<Readonly<TResult>[K]>; } & {
|
|
8
|
+
/**
|
|
9
|
+
* Returns a promise for use with Vue's `Suspense` or `onServerPrefetch`. It fetches the query if it has no
|
|
10
|
+
* data or its data is stale and resolves with the result once that fetch resolves (usually when the query
|
|
11
|
+
* function finishes, but earlier after the first chunk of a streamed query or when data is set during the
|
|
12
|
+
* fetch), or resolves immediately if the data is fresh. While the query is disabled, it waits until the query
|
|
13
|
+
* is enabled. If the fetch fails, it resolves with the error result, unless `throwOnError` is (or returns)
|
|
14
|
+
* `true`, in which case it rejects.
|
|
15
|
+
*/
|
|
8
16
|
suspense: () => Promise<TResult>;
|
|
9
17
|
};
|
|
10
18
|
type UseQueryOptionsGeneric<TQueryFnData, TError, TData, TQueryData, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = UseQueryOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey> | UseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>;
|
|
@@ -25,7 +33,8 @@ type UseInfiniteQueryReturnType<TData, TError> = UseBaseQueryReturnType<TData, T
|
|
|
25
33
|
* The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of
|
|
26
34
|
* `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`.
|
|
27
35
|
*
|
|
28
|
-
* This overload is selected when `initialData` is set, so the resulting `data` is never `undefined
|
|
36
|
+
* This overload is selected when `initialData` is set, so the resulting `data` is never `undefined` (unless
|
|
37
|
+
* a `select` changes `TData` to include `undefined`).
|
|
29
38
|
*
|
|
30
39
|
* `enabled` tracks reactive dependencies automatically as a `ref`, a plain value, or a reactive getter
|
|
31
40
|
* (`() => ...`). `queryKey` reacts through a `ref` for the array itself, or `ref`s and reactive getters as
|
|
@@ -282,7 +291,7 @@ type UndefinedInitialDataInfiniteOptions<TQueryFnData, TError = DefaultError, TD
|
|
|
282
291
|
};
|
|
283
292
|
/**
|
|
284
293
|
* The options accepted by the `infiniteQueryOptions` overload selected when `initialData` is set — `data` is
|
|
285
|
-
* never `undefined
|
|
294
|
+
* never `undefined` (unless a `select` changes `TData` to include `undefined`).
|
|
286
295
|
*
|
|
287
296
|
* @template TQueryFnData - The type of a single page, as your `queryFn` resolves it.
|
|
288
297
|
* @template TError - The type of errors your `queryFn` may throw.
|
|
@@ -333,7 +342,8 @@ declare function infiniteQueryOptions<TQueryFnData, TError = DefaultError, TData
|
|
|
333
342
|
* These options can be shared across hooks and imperative APIs such as `queryClient.infiniteQuery`.
|
|
334
343
|
* `options.queryKey` is required and is the query key to generate options for.
|
|
335
344
|
*
|
|
336
|
-
* This overload is selected when `initialData` is set, so the resulting `data` is never `undefined
|
|
345
|
+
* This overload is selected when `initialData` is set, so the resulting `data` is never `undefined` (unless
|
|
346
|
+
* a `select` changes `TData` to include `undefined`).
|
|
337
347
|
*
|
|
338
348
|
* @see {@link useInfiniteQuery} to run an infinite query with these options.
|
|
339
349
|
* @param options - The {@link DefinedInitialDataInfiniteOptions} to use — everything you can pass to
|
|
@@ -362,4 +372,4 @@ declare function infiniteQueryOptions<TQueryFnData, TError = DefaultError, TData
|
|
|
362
372
|
declare function infiniteQueryOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: DefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>): DefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam> & QueryKeyWithDataTag<TQueryKey, InfiniteData<TQueryFnData>, TError>;
|
|
363
373
|
//#endregion
|
|
364
374
|
export { UseInfiniteQueryReturnType as a, useBaseQuery as c, UseInfiniteQueryOptions as i, UndefinedInitialDataInfiniteOptions as n, useInfiniteQuery as o, infiniteQueryOptions as r, UseBaseQueryReturnType as s, DefinedInitialDataInfiniteOptions as t };
|
|
365
|
-
//# sourceMappingURL=infiniteQueryOptions-
|
|
375
|
+
//# sourceMappingURL=infiniteQueryOptions-NucMX_M_.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"infiniteQueryOptions-NucMX_M_.d.ts","names":["QueryClient","QueryClient"],"sources":["../../src/useBaseQuery.ts","../../src/useInfiniteQuery.ts","../../src/infiniteQueryOptions.ts"],"mappings":";;;;;;KA0BY,uBACV,OACA,QACA,UAAU,oBAAoB,OAAO,cAEpC,WAAW,UAAU,8DAElB,QAAQ,KACR,IAAI,SAAS,SAAS;;;;;;;;;EAU1B,gBAAgB,QAAQ;;KAGrB,uBACH,cACA,QACA,OACA,YACA,kBAAkB,WAAW,UAC7B,wBAEE,gBAAgB,cAAc,QAAQ,OAAO,YAAY,aACzD,wBAAwB,cAAc,QAAQ,OAAO,WAAW;;;;;;;;;iBAUpD,aACd,cACA,QACA,OACA,YACA,kBAAkB,UAClB,YAEA,iBAAiB,eACjB,SAAS,iBACP,uBACE,cACA,QACA,OACA,YACA,WACA,cAGJ,cAAcA,gBACb,uBAAuB,OAAO;;;KC5DrB,wBACV,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAC7B,wBACE,YAGE,kBAAkB,6BAChB,cACA,QACA,OACA,WACA,cAED,6BACC,iBACE,6BACE,cACA,QACA,OACA,cAAc,YACd,YACA,aAEJ,aACE,6BACE,cACA,QACA,OACA,cAAc,YACd,YACA,gBAEN;KAGM,2BAA2B,OAAO,UAAU,uBACtD,OACA,QACA,4BAA4B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAoDrB,iBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,iBACP,kCACE,cACA,QACA,OACA,WACA,cAGJ,cAAcC,gBACb,2BAA2B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqHrB,iBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,iBACP,oCACE,cACA,QACA,OACA,WACA,cAGJ,cAAcA,gBACb,2BAA2B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA+ErB,iBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,iBACP,wBAAwB,cAAc,QAAQ,OAAO,WAAW,cAElE,cAAcA,gBACb,2BAA2B,OAAO;;;;;;;;;;;;;;KCpVzB,oCACV,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,wBACE,wBACF,cACA,QACA,OACA,WACA;EAEA;;;;;;;;;;;;;KAcU,kCACV,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,wBACE,wBACF,cACA,QACA,OACA,WACA;;;;;;;;EASA,aACI,kBAAkB,aAAa,cAAc,sBACtC,kBAAkB,aAAa,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6B1C,qBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,oCACP,cACA,QACA,OACA,WACA,cAED,oCACD,cACA,QACA,OACA,WACA,cAEA,oBAAoB,WAAW,aAAa,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkC7C,qBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,kCACP,cACA,QACA,OACA,WACA,cAED,kCACD,cACA,QACA,OACA,WACA,cAEA,oBAAoB,WAAW,aAAa,eAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"infiniteQueryOptions.cjs","names":[],"sources":["../../src/infiniteQueryOptions.ts"],"sourcesContent":["import type {\n DefaultError,\n InfiniteData,\n NonUndefinedGuard,\n QueryKey,\n QueryKeyWithDataTag,\n} from '@tanstack/query-core'\nimport type { UseInfiniteQueryOptions } from './useInfiniteQuery'\n\n/**\n * The options accepted by the `infiniteQueryOptions` overload selected when no `initialData` is set — `data`\n * may be `undefined` while the query is `pending`.\n *\n * @template TQueryFnData - The type of a single page, as your `queryFn` resolves it.\n * @template TError - The type of errors your `queryFn` may throw.\n * @template TData - The type `data` ends up as after `select` runs — defaults to `InfiniteData<TQueryFnData>`,\n * the shape of all fetched pages plus their page params.\n * @template TQueryKey - The type of your `queryKey`.\n * @template TPageParam - The type of the parameter passed to `queryFn` to fetch a given page.\n */\nexport type UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n initialData?: undefined\n}\n\n/**\n * The options accepted by the `infiniteQueryOptions` overload selected when `initialData` is set — `data` is\n * never `undefined
|
|
1
|
+
{"version":3,"file":"infiniteQueryOptions.cjs","names":[],"sources":["../../src/infiniteQueryOptions.ts"],"sourcesContent":["import type {\n DefaultError,\n InfiniteData,\n NonUndefinedGuard,\n QueryKey,\n QueryKeyWithDataTag,\n} from '@tanstack/query-core'\nimport type { UseInfiniteQueryOptions } from './useInfiniteQuery'\n\n/**\n * The options accepted by the `infiniteQueryOptions` overload selected when no `initialData` is set — `data`\n * may be `undefined` while the query is `pending`.\n *\n * @template TQueryFnData - The type of a single page, as your `queryFn` resolves it.\n * @template TError - The type of errors your `queryFn` may throw.\n * @template TData - The type `data` ends up as after `select` runs — defaults to `InfiniteData<TQueryFnData>`,\n * the shape of all fetched pages plus their page params.\n * @template TQueryKey - The type of your `queryKey`.\n * @template TPageParam - The type of the parameter passed to `queryFn` to fetch a given page.\n */\nexport type UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n initialData?: undefined\n}\n\n/**\n * The options accepted by the `infiniteQueryOptions` overload selected when `initialData` is set — `data` is\n * never `undefined` (unless a `select` changes `TData` to include `undefined`).\n *\n * @template TQueryFnData - The type of a single page, as your `queryFn` resolves it.\n * @template TError - The type of errors your `queryFn` may throw.\n * @template TData - The type `data` ends up as after `select` runs — defaults to `InfiniteData<TQueryFnData>`,\n * the shape of all fetched pages plus their page params.\n * @template TQueryKey - The type of your `queryKey`.\n * @template TPageParam - The type of the parameter passed to `queryFn` to fetch a given page.\n */\nexport type DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n /**\n * If set, this value will be used as the initial data for the query cache (as long as the query hasn't been\n * created or cached yet). If set to a function, the function will be called **once** during the shared/root\n * query initialization, and be expected to synchronously return the initial data. Initial data is\n * considered stale by default unless a `staleTime` has been set. `initialData` **is persisted** to the\n * cache.\n */\n initialData:\n | NonUndefinedGuard<InfiniteData<TQueryFnData, TPageParam>>\n | (() => NonUndefinedGuard<InfiniteData<TQueryFnData, TPageParam>>)\n}\n\n/**\n * You can generally pass everything to `infiniteQueryOptions` that you can also pass to `useInfiniteQuery`.\n * These options can be shared across hooks and imperative APIs such as `queryClient.infiniteQuery`.\n * `options.queryKey` is required and is the query key to generate options for.\n *\n * @see {@link useInfiniteQuery} to run an infinite query with these options.\n * @param options - The {@link UndefinedInitialDataInfiniteOptions} to use — everything you can pass to\n * `useInfiniteQuery`.\n * @returns The same options object, typed so that `queryKey` carries the inferred data type.\n *\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { infiniteQueryOptions, useInfiniteQuery } from '@tanstack/vue-query'\n *\n * const projectsOptions = infiniteQueryOptions({\n * queryKey: ['projects'],\n * queryFn: ({ pageParam }) => fetchProjects(pageParam),\n * initialPageParam: 0,\n * getNextPageParam: (lastPage) => lastPage.nextId,\n * })\n *\n * const { data, isError, error, fetchNextPage } = useInfiniteQuery(projectsOptions)\n * </script>\n * ```\n */\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> &\n QueryKeyWithDataTag<TQueryKey, InfiniteData<TQueryFnData>, TError>\n\n/**\n * You can generally pass everything to `infiniteQueryOptions` that you can also pass to `useInfiniteQuery`.\n * These options can be shared across hooks and imperative APIs such as `queryClient.infiniteQuery`.\n * `options.queryKey` is required and is the query key to generate options for.\n *\n * This overload is selected when `initialData` is set, so the resulting `data` is never `undefined` (unless\n * a `select` changes `TData` to include `undefined`).\n *\n * @see {@link useInfiniteQuery} to run an infinite query with these options.\n * @param options - The {@link DefinedInitialDataInfiniteOptions} to use — everything you can pass to\n * `useInfiniteQuery`, with `initialData` set.\n * @returns The same options object, typed so that `queryKey` carries the inferred data type.\n *\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { infiniteQueryOptions, useInfiniteQuery } from '@tanstack/vue-query'\n *\n * const projectsOptions = infiniteQueryOptions({\n * queryKey: ['projects'],\n * queryFn: ({ pageParam }) => fetchProjects(pageParam),\n * initialPageParam: 0,\n * getNextPageParam: (lastPage) => lastPage.nextId,\n * initialData: { pages: [], pageParams: [] },\n * })\n *\n * // `data` is never `undefined`, thanks to `initialData` — even if a refetch fails, so the\n * // list stays visible alongside the error.\n * const { data, isError, error } = useInfiniteQuery(projectsOptions)\n * </script>\n * ```\n */\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> &\n QueryKeyWithDataTag<TQueryKey, InfiniteData<TQueryFnData>, TError>\n\nexport function infiniteQueryOptions(options: unknown) {\n return options\n}\n"],"mappings":";;AAgLA,SAAgB,qBAAqB,SAAkB;CACrD,OAAO;AACT"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as UndefinedInitialDataInfiniteOptions, r as infiniteQueryOptions, t as DefinedInitialDataInfiniteOptions } from "./infiniteQueryOptions-
|
|
1
|
+
import { n as UndefinedInitialDataInfiniteOptions, r as infiniteQueryOptions, t as DefinedInitialDataInfiniteOptions } from "./infiniteQueryOptions-CnTRbIP5.cjs";
|
|
2
2
|
export { DefinedInitialDataInfiniteOptions, UndefinedInitialDataInfiniteOptions, infiniteQueryOptions };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as UndefinedInitialDataInfiniteOptions, r as infiniteQueryOptions, t as DefinedInitialDataInfiniteOptions } from "./infiniteQueryOptions-
|
|
1
|
+
import { n as UndefinedInitialDataInfiniteOptions, r as infiniteQueryOptions, t as DefinedInitialDataInfiniteOptions } from "./infiniteQueryOptions-NucMX_M_.js";
|
|
2
2
|
export { DefinedInitialDataInfiniteOptions, UndefinedInitialDataInfiniteOptions, infiniteQueryOptions };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"infiniteQueryOptions.js","names":[],"sources":["../../src/infiniteQueryOptions.ts"],"sourcesContent":["import type {\n DefaultError,\n InfiniteData,\n NonUndefinedGuard,\n QueryKey,\n QueryKeyWithDataTag,\n} from '@tanstack/query-core'\nimport type { UseInfiniteQueryOptions } from './useInfiniteQuery'\n\n/**\n * The options accepted by the `infiniteQueryOptions` overload selected when no `initialData` is set — `data`\n * may be `undefined` while the query is `pending`.\n *\n * @template TQueryFnData - The type of a single page, as your `queryFn` resolves it.\n * @template TError - The type of errors your `queryFn` may throw.\n * @template TData - The type `data` ends up as after `select` runs — defaults to `InfiniteData<TQueryFnData>`,\n * the shape of all fetched pages plus their page params.\n * @template TQueryKey - The type of your `queryKey`.\n * @template TPageParam - The type of the parameter passed to `queryFn` to fetch a given page.\n */\nexport type UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n initialData?: undefined\n}\n\n/**\n * The options accepted by the `infiniteQueryOptions` overload selected when `initialData` is set — `data` is\n * never `undefined
|
|
1
|
+
{"version":3,"file":"infiniteQueryOptions.js","names":[],"sources":["../../src/infiniteQueryOptions.ts"],"sourcesContent":["import type {\n DefaultError,\n InfiniteData,\n NonUndefinedGuard,\n QueryKey,\n QueryKeyWithDataTag,\n} from '@tanstack/query-core'\nimport type { UseInfiniteQueryOptions } from './useInfiniteQuery'\n\n/**\n * The options accepted by the `infiniteQueryOptions` overload selected when no `initialData` is set — `data`\n * may be `undefined` while the query is `pending`.\n *\n * @template TQueryFnData - The type of a single page, as your `queryFn` resolves it.\n * @template TError - The type of errors your `queryFn` may throw.\n * @template TData - The type `data` ends up as after `select` runs — defaults to `InfiniteData<TQueryFnData>`,\n * the shape of all fetched pages plus their page params.\n * @template TQueryKey - The type of your `queryKey`.\n * @template TPageParam - The type of the parameter passed to `queryFn` to fetch a given page.\n */\nexport type UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n initialData?: undefined\n}\n\n/**\n * The options accepted by the `infiniteQueryOptions` overload selected when `initialData` is set — `data` is\n * never `undefined` (unless a `select` changes `TData` to include `undefined`).\n *\n * @template TQueryFnData - The type of a single page, as your `queryFn` resolves it.\n * @template TError - The type of errors your `queryFn` may throw.\n * @template TData - The type `data` ends up as after `select` runs — defaults to `InfiniteData<TQueryFnData>`,\n * the shape of all fetched pages plus their page params.\n * @template TQueryKey - The type of your `queryKey`.\n * @template TPageParam - The type of the parameter passed to `queryFn` to fetch a given page.\n */\nexport type DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n /**\n * If set, this value will be used as the initial data for the query cache (as long as the query hasn't been\n * created or cached yet). If set to a function, the function will be called **once** during the shared/root\n * query initialization, and be expected to synchronously return the initial data. Initial data is\n * considered stale by default unless a `staleTime` has been set. `initialData` **is persisted** to the\n * cache.\n */\n initialData:\n | NonUndefinedGuard<InfiniteData<TQueryFnData, TPageParam>>\n | (() => NonUndefinedGuard<InfiniteData<TQueryFnData, TPageParam>>)\n}\n\n/**\n * You can generally pass everything to `infiniteQueryOptions` that you can also pass to `useInfiniteQuery`.\n * These options can be shared across hooks and imperative APIs such as `queryClient.infiniteQuery`.\n * `options.queryKey` is required and is the query key to generate options for.\n *\n * @see {@link useInfiniteQuery} to run an infinite query with these options.\n * @param options - The {@link UndefinedInitialDataInfiniteOptions} to use — everything you can pass to\n * `useInfiniteQuery`.\n * @returns The same options object, typed so that `queryKey` carries the inferred data type.\n *\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { infiniteQueryOptions, useInfiniteQuery } from '@tanstack/vue-query'\n *\n * const projectsOptions = infiniteQueryOptions({\n * queryKey: ['projects'],\n * queryFn: ({ pageParam }) => fetchProjects(pageParam),\n * initialPageParam: 0,\n * getNextPageParam: (lastPage) => lastPage.nextId,\n * })\n *\n * const { data, isError, error, fetchNextPage } = useInfiniteQuery(projectsOptions)\n * </script>\n * ```\n */\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> &\n QueryKeyWithDataTag<TQueryKey, InfiniteData<TQueryFnData>, TError>\n\n/**\n * You can generally pass everything to `infiniteQueryOptions` that you can also pass to `useInfiniteQuery`.\n * These options can be shared across hooks and imperative APIs such as `queryClient.infiniteQuery`.\n * `options.queryKey` is required and is the query key to generate options for.\n *\n * This overload is selected when `initialData` is set, so the resulting `data` is never `undefined` (unless\n * a `select` changes `TData` to include `undefined`).\n *\n * @see {@link useInfiniteQuery} to run an infinite query with these options.\n * @param options - The {@link DefinedInitialDataInfiniteOptions} to use — everything you can pass to\n * `useInfiniteQuery`, with `initialData` set.\n * @returns The same options object, typed so that `queryKey` carries the inferred data type.\n *\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { infiniteQueryOptions, useInfiniteQuery } from '@tanstack/vue-query'\n *\n * const projectsOptions = infiniteQueryOptions({\n * queryKey: ['projects'],\n * queryFn: ({ pageParam }) => fetchProjects(pageParam),\n * initialPageParam: 0,\n * getNextPageParam: (lastPage) => lastPage.nextId,\n * initialData: { pages: [], pageParams: [] },\n * })\n *\n * // `data` is never `undefined`, thanks to `initialData` — even if a refetch fails, so the\n * // list stays visible alongside the error.\n * const { data, isError, error } = useInfiniteQuery(projectsOptions)\n * </script>\n * ```\n */\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> &\n QueryKeyWithDataTag<TQueryKey, InfiniteData<TQueryFnData>, TError>\n\nexport function infiniteQueryOptions(options: unknown) {\n return options\n}\n"],"mappings":";AAgLA,SAAgB,qBAAqB,SAAkB;CACrD,OAAO;AACT"}
|
|
@@ -6,10 +6,9 @@ import { DefaultError, Mutation, MutationCache as MutationCache$1, MutationFilte
|
|
|
6
6
|
* {@link MaybeRefDeep} filters object, so `ref`s can be passed directly without unwrapping. Access it via
|
|
7
7
|
* `queryClient.getMutationCache()` — `QueryClient` constructs one of these by default.
|
|
8
8
|
*/
|
|
9
|
-
declare class MutationCache extends MutationCache$1 {
|
|
9
|
+
export declare class MutationCache extends MutationCache$1 {
|
|
10
10
|
find<TData = unknown, TError = DefaultError, TVariables = any, TOnMutateResult = unknown>(filters: MaybeRefDeep<MutationFilters>): Mutation<TData, TError, TVariables, TOnMutateResult> | undefined;
|
|
11
11
|
findAll(filters?: MaybeRefDeep<MutationFilters>): Array<Mutation>;
|
|
12
12
|
}
|
|
13
13
|
//#endregion
|
|
14
|
-
export { MutationCache };
|
|
15
14
|
//# sourceMappingURL=mutationCache.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutationCache.d.cts","names":[],"sources":["../../src/mutationCache.ts"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"mutationCache.d.cts","names":["MC"],"sources":["../../src/mutationCache.ts"],"mappings":";;;;;;;;qBAca,sBAAsBA;EACjC,KACE,iBACA,SAAS,cACT,kBACA,2BAEA,SAAS,aAAa,mBACrB,SAAS,OAAO,QAAQ,YAAY;EAIvC,QAAQ,UAAS,aAAa,mBAAwB,MAAM"}
|
|
@@ -6,10 +6,9 @@ import { DefaultError, Mutation, MutationCache as MutationCache$1, MutationFilte
|
|
|
6
6
|
* {@link MaybeRefDeep} filters object, so `ref`s can be passed directly without unwrapping. Access it via
|
|
7
7
|
* `queryClient.getMutationCache()` — `QueryClient` constructs one of these by default.
|
|
8
8
|
*/
|
|
9
|
-
declare class MutationCache extends MutationCache$1 {
|
|
9
|
+
export declare class MutationCache extends MutationCache$1 {
|
|
10
10
|
find<TData = unknown, TError = DefaultError, TVariables = any, TOnMutateResult = unknown>(filters: MaybeRefDeep<MutationFilters>): Mutation<TData, TError, TVariables, TOnMutateResult> | undefined;
|
|
11
11
|
findAll(filters?: MaybeRefDeep<MutationFilters>): Array<Mutation>;
|
|
12
12
|
}
|
|
13
13
|
//#endregion
|
|
14
|
-
export { MutationCache };
|
|
15
14
|
//# sourceMappingURL=mutationCache.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutationCache.d.ts","names":[],"sources":["../../src/mutationCache.ts"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"mutationCache.d.ts","names":["MC"],"sources":["../../src/mutationCache.ts"],"mappings":";;;;;;;;qBAca,sBAAsBA;EACjC,KACE,iBACA,SAAS,cACT,kBACA,2BAEA,SAAS,aAAa,mBACrB,SAAS,OAAO,QAAQ,YAAY;EAIvC,QAAQ,UAAS,aAAa,mBAAwB,MAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutationOptions.cjs","names":[],"sources":["../../src/mutationOptions.ts"],"sourcesContent":["import type { DefaultError, WithRequired } from '@tanstack/query-core'\nimport type { MutationOptions } from './types'\n\n/**\n * You can generally pass everything to `mutationOptions` that you can also pass to `useMutation`. A\n * `mutationKey` is required on this overload so the mutation can be looked up later, e.g. with\n * `useMutationState`.\n *\n * @see {@link useMutation} to run the mutation these options describe.\n * @param options - The mutation options to use, identical to what you'd pass to `useMutation`, with a\n * required `mutationKey`.\n * @returns The same options object, unchanged.\n *\n * @example\n * Looking the mutation up elsewhere via its `mutationKey`, e.g. for a global \"saving…\" indicator:\n * ```vue\n * <script setup lang=\"ts\">\n * import { mutationOptions, useMutationState } from '@tanstack/vue-query'\n * import { computed } from 'vue'\n *\n * const createPostOptions = mutationOptions({\n * mutationKey: ['posts', 'create'],\n * mutationFn: createPost,\n * })\n *\n * // Call `useMutationState` once — it manages its own subscription — then derive from its result.\n * const creatingPosts = useMutationState({\n * filters: { mutationKey: createPostOptions.mutationKey, status: 'pending' },\n * })\n * const isCreatingPost = computed(() => creatingPosts.value.length > 0)\n * </script>\n * ```\n */\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: WithRequired<\n MutationOptions<TData, TError, TVariables, TOnMutateResult>,\n 'mutationKey'\n >,\n): WithRequired<\n MutationOptions<TData, TError, TVariables, TOnMutateResult>,\n 'mutationKey'\n>\n\n/**\n * Same as the plain-object overload with a required `mutationKey`, but for options that close over reactive\n * state (`ref`s read inside the function body). Wrap them in a getter so `useMutation` and the other consumers\n * always read the current values instead of the ones captured when the options were created.\n *\n * @see {@link useMutation} to run the mutation these options describe.\n * @param options - A function returning the mutation options to use, with a required `mutationKey`,\n * re-evaluated on demand.\n * @returns A function that returns the same options object, unchanged.\n *\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { mutationOptions, useMutation } from '@tanstack/vue-query'\n *\n * const props = defineProps<{ userId: number }>()\n *\n * const createPostOptions = mutationOptions(() => ({\n * mutationKey: ['posts', 'create'],\n * // Reacts to changes on `props.userId`, unlike the plain-object overload.\n * mutationFn: (title: string) => createPost({ title, userId: props.userId }),\n * }))\n *\n * const mutation = useMutation(createPostOptions)\n * </script>\n *\n * <template>\n * <button @click=\"mutation.mutate('Hello')\">Create</button>\n * </template>\n * ```\n */\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: () => WithRequired<\n MutationOptions<TData, TError, TVariables, TOnMutateResult>,\n 'mutationKey'\n >,\n): () => WithRequired<\n MutationOptions<TData, TError, TVariables, TOnMutateResult>,\n 'mutationKey'\n>\n\n/**\n * You can generally pass everything to `mutationOptions` that you can also pass to `useMutation`. No\n * `mutationKey` is required on this overload — use this when you don't need to target the mutation via a\n * `mutationKey` filter later (e.g. with `useMutationState`); it can still be observed through other filters,\n * such as `status`.\n *\n * @see {@link useMutation} to run the mutation these options describe.\n * @param options - The mutation options to use, identical to what you'd pass to `useMutation`, without a\n * `mutationKey`.\n * @returns The same options object, unchanged.\n * @remarks See the other overload's example for looking a mutation up via `useMutationState`.\n *\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { mutationOptions, useMutation } from '@tanstack/vue-query'\n *\n * const createPostOptions = mutationOptions({\n * mutationFn: createPost,\n * })\n *\n * const mutation = useMutation(createPostOptions)\n * </script>\n *\n * <template>\n * <button @click=\"mutation.mutate({ title: 'Hello' })\">Create</button>\n * </template>\n * ```\n */\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: Omit<\n MutationOptions<TData, TError, TVariables, TOnMutateResult>,\n 'mutationKey'\n >,\n): Omit<\n MutationOptions<TData, TError, TVariables, TOnMutateResult>,\n 'mutationKey'\n>\n\n/**\n * Same as the plain-object overload without a `mutationKey`, but for options that close over reactive state\n * (`ref`s read inside the function body). Wrap them in a getter so `useMutation` and the other consumers\n * always read the current values instead of the ones captured when the options were created.\n *\n * @see {@link useMutation} to run the mutation these options describe.\n * @param options - A function returning the mutation options to use, without a `mutationKey`, re-evaluated on\n * demand.\n * @returns A function that returns the same options object, unchanged.\n *\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { mutationOptions, useMutation } from '@tanstack/vue-query'\n *\n * const props = defineProps<{ userId: number }>()\n *\n * const createPostOptions = mutationOptions(() => ({\n * // Reacts to changes on `props.userId`, unlike the plain-object overload.\n * mutationFn: (title: string) => createPost({ title, userId: props.userId }),\n * }))\n *\n * const mutation = useMutation(createPostOptions)\n * </script>\n *\n * <template>\n * <button @click=\"mutation.mutate('Hello')\">Create</button>\n * </template>\n * ```\n */\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: () => Omit<\n MutationOptions<TData, TError, TVariables, TOnMutateResult>,\n 'mutationKey'\n >,\n): () => Omit<\n MutationOptions<TData, TError, TVariables, TOnMutateResult>,\n 'mutationKey'\n>\nexport function mutationOptions(options: unknown) {\n return options\n}\n"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"mutationOptions.cjs","names":[],"sources":["../../src/mutationOptions.ts"],"sourcesContent":["import type { DefaultError, WithRequired } from '@tanstack/query-core'\nimport type { MutationOptions } from './types'\n\n/**\n * You can generally pass everything to `mutationOptions` that you can also pass to `useMutation`. A\n * `mutationKey` is required on this overload so the mutation can be looked up later, e.g. with\n * `useMutationState`.\n *\n * Unlike a `queryKey` property on a query's options (e.g. `queryOptions({ queryKey: [...] })`), `mutationKey`\n * entries that are reactive getters (`() => id.value`) are never unwrapped — the getter function itself is\n * stored as the entry, rather than its current value. `ref` entries are still unwrapped normally.\n *\n * @see {@link useMutation} to run the mutation these options describe.\n * @param options - The mutation options to use, identical to what you'd pass to `useMutation`, with a\n * required `mutationKey`.\n * @returns The same options object, unchanged.\n *\n * @example\n * Looking the mutation up elsewhere via its `mutationKey`, e.g. for a global \"saving…\" indicator:\n * ```vue\n * <script setup lang=\"ts\">\n * import { mutationOptions, useMutationState } from '@tanstack/vue-query'\n * import { computed } from 'vue'\n *\n * const createPostOptions = mutationOptions({\n * mutationKey: ['posts', 'create'],\n * mutationFn: createPost,\n * })\n *\n * // Call `useMutationState` once — it manages its own subscription — then derive from its result.\n * const creatingPosts = useMutationState({\n * filters: { mutationKey: createPostOptions.mutationKey, status: 'pending' },\n * })\n * const isCreatingPost = computed(() => creatingPosts.value.length > 0)\n * </script>\n * ```\n */\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: WithRequired<\n MutationOptions<TData, TError, TVariables, TOnMutateResult>,\n 'mutationKey'\n >,\n): WithRequired<\n MutationOptions<TData, TError, TVariables, TOnMutateResult>,\n 'mutationKey'\n>\n\n/**\n * Same as the plain-object overload with a required `mutationKey`, but for options that close over reactive\n * state (`ref`s read inside the function body). Wrap them in a getter so `useMutation` and the other consumers\n * always read the current values instead of the ones captured when the options were created.\n *\n * @see {@link useMutation} to run the mutation these options describe.\n * @param options - A function returning the mutation options to use, with a required `mutationKey`,\n * re-evaluated on demand.\n * @returns A function that returns the same options object, unchanged.\n *\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { mutationOptions, useMutation } from '@tanstack/vue-query'\n *\n * const props = defineProps<{ userId: number }>()\n *\n * const createPostOptions = mutationOptions(() => ({\n * mutationKey: ['posts', 'create'],\n * // Reacts to changes on `props.userId`, unlike the plain-object overload.\n * mutationFn: (title: string) => createPost({ title, userId: props.userId }),\n * }))\n *\n * const mutation = useMutation(createPostOptions)\n * </script>\n *\n * <template>\n * <button @click=\"mutation.mutate('Hello')\">Create</button>\n * </template>\n * ```\n */\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: () => WithRequired<\n MutationOptions<TData, TError, TVariables, TOnMutateResult>,\n 'mutationKey'\n >,\n): () => WithRequired<\n MutationOptions<TData, TError, TVariables, TOnMutateResult>,\n 'mutationKey'\n>\n\n/**\n * You can generally pass everything to `mutationOptions` that you can also pass to `useMutation`. No\n * `mutationKey` is required on this overload — use this when you don't need to target the mutation via a\n * `mutationKey` filter later (e.g. with `useMutationState`); it can still be observed through other filters,\n * such as `status`.\n *\n * @see {@link useMutation} to run the mutation these options describe.\n * @param options - The mutation options to use, identical to what you'd pass to `useMutation`, without a\n * `mutationKey`.\n * @returns The same options object, unchanged.\n * @remarks See the other overload's example for looking a mutation up via `useMutationState`.\n *\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { mutationOptions, useMutation } from '@tanstack/vue-query'\n *\n * const createPostOptions = mutationOptions({\n * mutationFn: createPost,\n * })\n *\n * const mutation = useMutation(createPostOptions)\n * </script>\n *\n * <template>\n * <button @click=\"mutation.mutate({ title: 'Hello' })\">Create</button>\n * </template>\n * ```\n */\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: Omit<\n MutationOptions<TData, TError, TVariables, TOnMutateResult>,\n 'mutationKey'\n >,\n): Omit<\n MutationOptions<TData, TError, TVariables, TOnMutateResult>,\n 'mutationKey'\n>\n\n/**\n * Same as the plain-object overload without a `mutationKey`, but for options that close over reactive state\n * (`ref`s read inside the function body). Wrap them in a getter so `useMutation` and the other consumers\n * always read the current values instead of the ones captured when the options were created.\n *\n * @see {@link useMutation} to run the mutation these options describe.\n * @param options - A function returning the mutation options to use, without a `mutationKey`, re-evaluated on\n * demand.\n * @returns A function that returns the same options object, unchanged.\n *\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { mutationOptions, useMutation } from '@tanstack/vue-query'\n *\n * const props = defineProps<{ userId: number }>()\n *\n * const createPostOptions = mutationOptions(() => ({\n * // Reacts to changes on `props.userId`, unlike the plain-object overload.\n * mutationFn: (title: string) => createPost({ title, userId: props.userId }),\n * }))\n *\n * const mutation = useMutation(createPostOptions)\n * </script>\n *\n * <template>\n * <button @click=\"mutation.mutate('Hello')\">Create</button>\n * </template>\n * ```\n */\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: () => Omit<\n MutationOptions<TData, TError, TVariables, TOnMutateResult>,\n 'mutationKey'\n >,\n): () => Omit<\n MutationOptions<TData, TError, TVariables, TOnMutateResult>,\n 'mutationKey'\n>\nexport function mutationOptions(options: unknown) {\n return options\n}\n"],"mappings":";;AA0LA,SAAgB,gBAAgB,SAAkB;CAChD,OAAO;AACT"}
|