@tanstack/vue-query 5.104.5 → 5.105.1
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.cjs +1 -2
- package/build/legacy/devtools/devtools.d.cts +1 -3
- package/build/legacy/devtools/devtools.d.cts.map +1 -1
- package/build/legacy/devtools/devtools.d.ts +1 -3
- package/build/legacy/devtools/devtools.d.ts.map +1 -1
- package/build/legacy/devtools/devtools.js +1 -2
- package/build/legacy/devtools/utils.cjs +1 -2
- package/build/legacy/devtools/utils.d.cts +0 -2
- package/build/legacy/devtools/utils.d.cts.map +1 -1
- package/build/legacy/devtools/utils.d.ts +0 -2
- package/build/legacy/devtools/utils.d.ts.map +1 -1
- package/build/legacy/devtools/utils.js +1 -2
- package/build/legacy/index.d.cts +4 -4
- package/build/legacy/index.d.ts +4 -4
- package/build/legacy/{infiniteQueryOptions-BaoKhSzb.d.ts → infiniteQueryOptions-BLGtkUwV.d.ts} +28 -33
- package/build/legacy/infiniteQueryOptions-BLGtkUwV.d.ts.map +1 -0
- package/build/legacy/{infiniteQueryOptions-ClNe2-FB.d.cts → infiniteQueryOptions-oStzZOCq.d.cts} +28 -33
- package/build/legacy/infiniteQueryOptions-oStzZOCq.d.cts.map +1 -0
- package/build/legacy/infiniteQueryOptions.cjs +1 -2
- 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 +1 -2
- package/build/legacy/infiniteQueryOptions.js.map +1 -1
- package/build/legacy/mutationCache.cjs +1 -2
- package/build/legacy/mutationCache.d.cts +1 -3
- package/build/legacy/mutationCache.d.cts.map +1 -1
- package/build/legacy/mutationCache.d.ts +1 -3
- package/build/legacy/mutationCache.d.ts.map +1 -1
- package/build/legacy/mutationCache.js +1 -2
- package/build/legacy/mutationOptions.cjs +1 -2
- package/build/legacy/mutationOptions.d.cts +1 -3
- package/build/legacy/mutationOptions.d.cts.map +1 -1
- package/build/legacy/mutationOptions.d.ts +1 -3
- package/build/legacy/mutationOptions.d.ts.map +1 -1
- package/build/legacy/mutationOptions.js +1 -2
- package/build/legacy/queryCache.cjs +1 -2
- package/build/legacy/queryCache.d.cts +1 -3
- package/build/legacy/queryCache.d.cts.map +1 -1
- package/build/legacy/queryCache.d.ts +1 -3
- package/build/legacy/queryCache.d.ts.map +1 -1
- package/build/legacy/queryCache.js +1 -2
- package/build/{modern/queryClient-BoBzDWAZ.d.ts → legacy/queryClient-CVne8UYf.d.ts} +57 -7
- package/build/legacy/queryClient-CVne8UYf.d.ts.map +1 -0
- package/build/{modern/queryClient-BK9W57Qu.d.cts → legacy/queryClient-DdZQqhoA.d.cts} +57 -7
- package/build/legacy/queryClient-DdZQqhoA.d.cts.map +1 -0
- package/build/legacy/queryClient.cjs +1 -2
- 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 +1 -2
- package/build/legacy/queryClient.js.map +1 -1
- package/build/{modern/queryOptions-gpn5D4rf.d.ts → legacy/queryOptions-BuZEBLtg.d.cts} +16 -16
- package/build/legacy/queryOptions-BuZEBLtg.d.cts.map +1 -0
- package/build/{modern/queryOptions-BvmZtmiU.d.cts → legacy/queryOptions-dXiBZnGk.d.ts} +16 -16
- package/build/legacy/queryOptions-dXiBZnGk.d.ts.map +1 -0
- package/build/legacy/queryOptions.cjs +1 -2
- 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 +1 -2
- package/build/legacy/queryOptions.js.map +1 -1
- package/build/legacy/{types-sdZdiLgo.d.ts → types-u_Tu5Ybs.d.cts} +1 -3
- package/build/legacy/{types-sdZdiLgo.d.ts.map → types-u_Tu5Ybs.d.cts.map} +1 -1
- package/build/{modern/types-sdZdiLgo.d.ts → legacy/types-u_Tu5Ybs.d.ts} +1 -3
- package/build/legacy/types-u_Tu5Ybs.d.ts.map +1 -0
- package/build/legacy/types.d.cts +1 -1
- package/build/legacy/types.d.ts +1 -1
- package/build/legacy/useBaseQuery.cjs +1 -2
- package/build/legacy/useBaseQuery.d.cts +1 -1
- package/build/legacy/useBaseQuery.d.ts +1 -1
- package/build/legacy/useBaseQuery.js +1 -2
- package/build/legacy/useInfiniteQuery.cjs +1 -2
- 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 +1 -2
- package/build/legacy/useInfiniteQuery.js.map +1 -1
- package/build/legacy/useIsFetching.cjs +1 -2
- package/build/legacy/useIsFetching.cjs.map +1 -1
- package/build/legacy/useIsFetching.d.cts +3 -5
- package/build/legacy/useIsFetching.d.cts.map +1 -1
- package/build/legacy/useIsFetching.d.ts +3 -5
- package/build/legacy/useIsFetching.d.ts.map +1 -1
- package/build/legacy/useIsFetching.js +1 -2
- package/build/legacy/useIsFetching.js.map +1 -1
- package/build/legacy/useMutation.cjs +1 -2
- package/build/legacy/useMutation.d.cts +2 -4
- package/build/legacy/useMutation.d.cts.map +1 -1
- package/build/legacy/useMutation.d.ts +2 -4
- package/build/legacy/useMutation.d.ts.map +1 -1
- package/build/legacy/useMutation.js +1 -2
- package/build/legacy/useMutationState.cjs +1 -2
- package/build/legacy/useMutationState.d.cts +2 -4
- package/build/legacy/useMutationState.d.cts.map +1 -1
- package/build/legacy/useMutationState.d.ts +2 -4
- package/build/legacy/useMutationState.d.ts.map +1 -1
- package/build/legacy/useMutationState.js +1 -2
- package/build/legacy/usePrefetchInfiniteQuery.cjs +1 -2
- package/build/legacy/usePrefetchInfiniteQuery.d.cts +2 -4
- package/build/legacy/usePrefetchInfiniteQuery.d.cts.map +1 -1
- package/build/legacy/usePrefetchInfiniteQuery.d.ts +2 -4
- package/build/legacy/usePrefetchInfiniteQuery.d.ts.map +1 -1
- package/build/legacy/usePrefetchInfiniteQuery.js +1 -2
- package/build/legacy/usePrefetchQuery.cjs +1 -2
- package/build/legacy/usePrefetchQuery.d.cts +2 -4
- package/build/legacy/usePrefetchQuery.d.cts.map +1 -1
- package/build/legacy/usePrefetchQuery.d.ts +2 -4
- package/build/legacy/usePrefetchQuery.d.ts.map +1 -1
- package/build/legacy/usePrefetchQuery.js +1 -2
- package/build/legacy/useQueries.cjs +1 -2
- package/build/legacy/useQueries.d.cts +3 -5
- package/build/legacy/useQueries.d.cts.map +1 -1
- package/build/legacy/useQueries.d.ts +3 -5
- package/build/legacy/useQueries.d.ts.map +1 -1
- package/build/legacy/useQueries.js +1 -2
- package/build/legacy/useQuery.cjs +1 -2
- package/build/legacy/useQuery.cjs.map +1 -1
- package/build/legacy/useQuery.d.cts +11 -12
- package/build/legacy/useQuery.d.cts.map +1 -1
- package/build/legacy/useQuery.d.ts +11 -12
- package/build/legacy/useQuery.d.ts.map +1 -1
- package/build/legacy/useQuery.js +1 -2
- package/build/legacy/useQuery.js.map +1 -1
- package/build/legacy/useQueryClient.cjs +1 -2
- package/build/legacy/useQueryClient.d.cts +1 -3
- package/build/legacy/useQueryClient.d.cts.map +1 -1
- package/build/legacy/useQueryClient.d.ts +1 -3
- package/build/legacy/useQueryClient.d.ts.map +1 -1
- package/build/legacy/useQueryClient.js +1 -2
- package/build/legacy/utils.cjs +1 -2
- package/build/legacy/utils.cjs.map +1 -1
- package/build/legacy/utils.d.cts +1 -3
- package/build/legacy/utils.d.cts.map +1 -1
- package/build/legacy/utils.d.ts +1 -3
- package/build/legacy/utils.d.ts.map +1 -1
- package/build/legacy/utils.js +1 -2
- package/build/legacy/utils.js.map +1 -1
- package/build/legacy/vueQueryPlugin.cjs +1 -2
- package/build/legacy/vueQueryPlugin.d.cts +2 -4
- package/build/legacy/vueQueryPlugin.d.cts.map +1 -1
- package/build/legacy/vueQueryPlugin.d.ts +2 -4
- package/build/legacy/vueQueryPlugin.d.ts.map +1 -1
- package/build/legacy/vueQueryPlugin.js +1 -2
- package/build/modern/devtools/devtools.cjs +1 -2
- package/build/modern/devtools/devtools.d.cts +1 -3
- package/build/modern/devtools/devtools.d.cts.map +1 -1
- package/build/modern/devtools/devtools.d.ts +1 -3
- package/build/modern/devtools/devtools.d.ts.map +1 -1
- package/build/modern/devtools/devtools.js +1 -2
- package/build/modern/devtools/utils.cjs +1 -2
- package/build/modern/devtools/utils.d.cts +0 -2
- package/build/modern/devtools/utils.d.cts.map +1 -1
- package/build/modern/devtools/utils.d.ts +0 -2
- package/build/modern/devtools/utils.d.ts.map +1 -1
- package/build/modern/devtools/utils.js +1 -2
- package/build/modern/index.d.cts +4 -4
- package/build/modern/index.d.ts +4 -4
- package/build/modern/{infiniteQueryOptions-BaoKhSzb.d.ts → infiniteQueryOptions-BLGtkUwV.d.ts} +28 -33
- package/build/modern/infiniteQueryOptions-BLGtkUwV.d.ts.map +1 -0
- package/build/modern/{infiniteQueryOptions-ClNe2-FB.d.cts → infiniteQueryOptions-oStzZOCq.d.cts} +28 -33
- package/build/modern/infiniteQueryOptions-oStzZOCq.d.cts.map +1 -0
- package/build/modern/infiniteQueryOptions.cjs +1 -2
- 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 +1 -2
- package/build/modern/infiniteQueryOptions.js.map +1 -1
- package/build/modern/mutationCache.cjs +1 -2
- package/build/modern/mutationCache.d.cts +1 -3
- package/build/modern/mutationCache.d.cts.map +1 -1
- package/build/modern/mutationCache.d.ts +1 -3
- package/build/modern/mutationCache.d.ts.map +1 -1
- package/build/modern/mutationCache.js +1 -2
- package/build/modern/mutationOptions.cjs +1 -2
- package/build/modern/mutationOptions.d.cts +1 -3
- package/build/modern/mutationOptions.d.cts.map +1 -1
- package/build/modern/mutationOptions.d.ts +1 -3
- package/build/modern/mutationOptions.d.ts.map +1 -1
- package/build/modern/mutationOptions.js +1 -2
- package/build/modern/queryCache.cjs +1 -2
- package/build/modern/queryCache.d.cts +1 -3
- package/build/modern/queryCache.d.cts.map +1 -1
- package/build/modern/queryCache.d.ts +1 -3
- package/build/modern/queryCache.d.ts.map +1 -1
- package/build/modern/queryCache.js +1 -2
- package/build/{legacy/queryClient-BoBzDWAZ.d.ts → modern/queryClient-CVne8UYf.d.ts} +57 -7
- package/build/modern/queryClient-CVne8UYf.d.ts.map +1 -0
- package/build/{legacy/queryClient-BK9W57Qu.d.cts → modern/queryClient-DdZQqhoA.d.cts} +57 -7
- package/build/modern/queryClient-DdZQqhoA.d.cts.map +1 -0
- package/build/modern/queryClient.cjs +1 -2
- 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 +1 -2
- package/build/modern/queryClient.js.map +1 -1
- package/build/{legacy/queryOptions-gpn5D4rf.d.ts → modern/queryOptions-BuZEBLtg.d.cts} +16 -16
- package/build/modern/queryOptions-BuZEBLtg.d.cts.map +1 -0
- package/build/{legacy/queryOptions-BvmZtmiU.d.cts → modern/queryOptions-dXiBZnGk.d.ts} +16 -16
- package/build/modern/queryOptions-dXiBZnGk.d.ts.map +1 -0
- package/build/modern/queryOptions.cjs +1 -2
- 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 +1 -2
- package/build/modern/queryOptions.js.map +1 -1
- package/build/{legacy/types-sdZdiLgo.d.cts → modern/types-u_Tu5Ybs.d.cts} +1 -3
- package/build/modern/{types-sdZdiLgo.d.ts.map → types-u_Tu5Ybs.d.cts.map} +1 -1
- package/build/modern/{types-sdZdiLgo.d.cts → types-u_Tu5Ybs.d.ts} +1 -3
- package/build/modern/types-u_Tu5Ybs.d.ts.map +1 -0
- package/build/modern/types.d.cts +1 -1
- package/build/modern/types.d.ts +1 -1
- package/build/modern/useBaseQuery.cjs +1 -2
- package/build/modern/useBaseQuery.d.cts +1 -1
- package/build/modern/useBaseQuery.d.ts +1 -1
- package/build/modern/useBaseQuery.js +1 -2
- package/build/modern/useInfiniteQuery.cjs +1 -2
- 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 +1 -2
- package/build/modern/useInfiniteQuery.js.map +1 -1
- package/build/modern/useIsFetching.cjs +1 -2
- package/build/modern/useIsFetching.cjs.map +1 -1
- package/build/modern/useIsFetching.d.cts +3 -5
- package/build/modern/useIsFetching.d.cts.map +1 -1
- package/build/modern/useIsFetching.d.ts +3 -5
- package/build/modern/useIsFetching.d.ts.map +1 -1
- package/build/modern/useIsFetching.js +1 -2
- package/build/modern/useIsFetching.js.map +1 -1
- package/build/modern/useMutation.cjs +1 -2
- package/build/modern/useMutation.d.cts +2 -4
- package/build/modern/useMutation.d.cts.map +1 -1
- package/build/modern/useMutation.d.ts +2 -4
- package/build/modern/useMutation.d.ts.map +1 -1
- package/build/modern/useMutation.js +1 -2
- package/build/modern/useMutationState.cjs +1 -2
- package/build/modern/useMutationState.d.cts +2 -4
- package/build/modern/useMutationState.d.cts.map +1 -1
- package/build/modern/useMutationState.d.ts +2 -4
- package/build/modern/useMutationState.d.ts.map +1 -1
- package/build/modern/useMutationState.js +1 -2
- package/build/modern/usePrefetchInfiniteQuery.cjs +1 -2
- package/build/modern/usePrefetchInfiniteQuery.d.cts +2 -4
- package/build/modern/usePrefetchInfiniteQuery.d.cts.map +1 -1
- package/build/modern/usePrefetchInfiniteQuery.d.ts +2 -4
- package/build/modern/usePrefetchInfiniteQuery.d.ts.map +1 -1
- package/build/modern/usePrefetchInfiniteQuery.js +1 -2
- package/build/modern/usePrefetchQuery.cjs +1 -2
- package/build/modern/usePrefetchQuery.d.cts +2 -4
- package/build/modern/usePrefetchQuery.d.cts.map +1 -1
- package/build/modern/usePrefetchQuery.d.ts +2 -4
- package/build/modern/usePrefetchQuery.d.ts.map +1 -1
- package/build/modern/usePrefetchQuery.js +1 -2
- package/build/modern/useQueries.cjs +1 -2
- package/build/modern/useQueries.d.cts +3 -5
- package/build/modern/useQueries.d.cts.map +1 -1
- package/build/modern/useQueries.d.ts +3 -5
- package/build/modern/useQueries.d.ts.map +1 -1
- package/build/modern/useQueries.js +1 -2
- package/build/modern/useQuery.cjs +1 -2
- package/build/modern/useQuery.cjs.map +1 -1
- package/build/modern/useQuery.d.cts +11 -12
- package/build/modern/useQuery.d.cts.map +1 -1
- package/build/modern/useQuery.d.ts +11 -12
- package/build/modern/useQuery.d.ts.map +1 -1
- package/build/modern/useQuery.js +1 -2
- package/build/modern/useQuery.js.map +1 -1
- package/build/modern/useQueryClient.cjs +1 -2
- package/build/modern/useQueryClient.d.cts +1 -3
- package/build/modern/useQueryClient.d.cts.map +1 -1
- package/build/modern/useQueryClient.d.ts +1 -3
- package/build/modern/useQueryClient.d.ts.map +1 -1
- package/build/modern/useQueryClient.js +1 -2
- package/build/modern/utils.cjs +1 -2
- package/build/modern/utils.cjs.map +1 -1
- package/build/modern/utils.d.cts +1 -3
- package/build/modern/utils.d.cts.map +1 -1
- package/build/modern/utils.d.ts +1 -3
- package/build/modern/utils.d.ts.map +1 -1
- package/build/modern/utils.js +1 -2
- package/build/modern/utils.js.map +1 -1
- package/build/modern/vueQueryPlugin.cjs +1 -2
- package/build/modern/vueQueryPlugin.d.cts +2 -4
- package/build/modern/vueQueryPlugin.d.cts.map +1 -1
- package/build/modern/vueQueryPlugin.d.ts +2 -4
- package/build/modern/vueQueryPlugin.d.ts.map +1 -1
- package/build/modern/vueQueryPlugin.js +1 -2
- package/package.json +2 -2
- package/src/infiniteQueryOptions.ts +28 -21
- package/src/queryClient.ts +68 -2
- package/src/queryOptions.ts +14 -12
- package/src/useInfiniteQuery.ts +3 -3
- package/src/useIsFetching.ts +2 -2
- package/src/useQuery.ts +7 -6
- package/src/utils.ts +4 -6
- package/build/legacy/infiniteQueryOptions-BaoKhSzb.d.ts.map +0 -1
- package/build/legacy/infiniteQueryOptions-ClNe2-FB.d.cts.map +0 -1
- package/build/legacy/queryClient-BK9W57Qu.d.cts.map +0 -1
- package/build/legacy/queryClient-BoBzDWAZ.d.ts.map +0 -1
- package/build/legacy/queryOptions-BvmZtmiU.d.cts.map +0 -1
- package/build/legacy/queryOptions-gpn5D4rf.d.ts.map +0 -1
- package/build/legacy/types-sdZdiLgo.d.cts.map +0 -1
- package/build/modern/infiniteQueryOptions-BaoKhSzb.d.ts.map +0 -1
- package/build/modern/infiniteQueryOptions-ClNe2-FB.d.cts.map +0 -1
- package/build/modern/queryClient-BK9W57Qu.d.cts.map +0 -1
- package/build/modern/queryClient-BoBzDWAZ.d.ts.map +0 -1
- package/build/modern/queryOptions-BvmZtmiU.d.cts.map +0 -1
- package/build/modern/queryOptions-gpn5D4rf.d.ts.map +0 -1
- package/build/modern/types-sdZdiLgo.d.cts.map +0 -1
|
@@ -3,7 +3,7 @@ const require_devtools_utils = require("./utils.cjs");
|
|
|
3
3
|
let _tanstack_query_core = require("@tanstack/query-core");
|
|
4
4
|
let _vue_devtools_api = require("@vue/devtools-api");
|
|
5
5
|
let _tanstack_match_sorter_utils = require("@tanstack/match-sorter-utils");
|
|
6
|
-
|
|
6
|
+
// src/devtools/devtools.ts
|
|
7
7
|
const pluginId = "vue-query";
|
|
8
8
|
const pluginName = "Vue Query";
|
|
9
9
|
/**
|
|
@@ -206,7 +206,6 @@ function setupDevtools(app, queryClient) {
|
|
|
206
206
|
});
|
|
207
207
|
});
|
|
208
208
|
}
|
|
209
|
-
//#endregion
|
|
210
209
|
exports.setupDevtools = setupDevtools;
|
|
211
210
|
|
|
212
211
|
//# sourceMappingURL=devtools.cjs.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { t as QueryClient } from "../queryClient-
|
|
2
|
-
//#region src/devtools/devtools.d.ts
|
|
1
|
+
import { t as QueryClient } from "../queryClient-DdZQqhoA.cjs";
|
|
3
2
|
/**
|
|
4
3
|
* Registers the Vue Query plugin with the Vue devtools, adding a query inspector and a timeline
|
|
5
4
|
* layer for query cache events.
|
|
@@ -7,5 +6,4 @@ import { t as QueryClient } from "../queryClient-BK9W57Qu.cjs";
|
|
|
7
6
|
* @param queryClient - The client whose query cache is shown in the devtools.
|
|
8
7
|
*/
|
|
9
8
|
export declare function setupDevtools(app: any, queryClient: QueryClient): void;
|
|
10
|
-
//#endregion
|
|
11
9
|
//# 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":";;;;;;;wBAsBgB,cAAc,UAAU,aAAa"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { t as QueryClient } from "../queryClient-
|
|
2
|
-
//#region src/devtools/devtools.d.ts
|
|
1
|
+
import { t as QueryClient } from "../queryClient-CVne8UYf.js";
|
|
3
2
|
/**
|
|
4
3
|
* Registers the Vue Query plugin with the Vue devtools, adding a query inspector and a timeline
|
|
5
4
|
* layer for query cache events.
|
|
@@ -7,5 +6,4 @@ import { t as QueryClient } from "../queryClient-BoBzDWAZ.js";
|
|
|
7
6
|
* @param queryClient - The client whose query cache is shown in the devtools.
|
|
8
7
|
*/
|
|
9
8
|
export declare function setupDevtools(app: any, queryClient: QueryClient): void;
|
|
10
|
-
//#endregion
|
|
11
9
|
//# 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":";;;;;;;wBAsBgB,cAAc,UAAU,aAAa"}
|
|
@@ -2,7 +2,7 @@ import { getQueryStateLabel, getQueryStatusBg, getQueryStatusFg, sortFns } from
|
|
|
2
2
|
import { onlineManager } from "@tanstack/query-core";
|
|
3
3
|
import { setupDevtoolsPlugin } from "@vue/devtools-api";
|
|
4
4
|
import { rankItem } from "@tanstack/match-sorter-utils";
|
|
5
|
-
|
|
5
|
+
// src/devtools/devtools.ts
|
|
6
6
|
const pluginId = "vue-query";
|
|
7
7
|
const pluginName = "Vue Query";
|
|
8
8
|
/**
|
|
@@ -205,7 +205,6 @@ function setupDevtools(app, queryClient) {
|
|
|
205
205
|
});
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
|
-
//#endregion
|
|
209
208
|
export { setupDevtools };
|
|
210
209
|
|
|
211
210
|
//# sourceMappingURL=devtools.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// src/devtools/utils.ts
|
|
3
3
|
/**
|
|
4
4
|
* Returns the devtools state of a query: fetching, paused, inactive (no observers), stale, or fresh,
|
|
5
5
|
* checked in that order.
|
|
@@ -59,7 +59,6 @@ const sortFns = {
|
|
|
59
59
|
"Query Hash": queryHashSort,
|
|
60
60
|
"Last Updated": dateSort
|
|
61
61
|
};
|
|
62
|
-
//#endregion
|
|
63
62
|
exports.getQueryState = getQueryState;
|
|
64
63
|
exports.getQueryStateLabel = getQueryStateLabel;
|
|
65
64
|
exports.getQueryStatusBg = getQueryStatusBg;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Query } from "@tanstack/query-core";
|
|
2
|
-
//#region src/devtools/utils.d.ts
|
|
3
2
|
type SortFn = (a: Query, b: Query) => number;
|
|
4
3
|
declare enum QueryState$1 {
|
|
5
4
|
Fetching = 0,
|
|
@@ -34,5 +33,4 @@ export declare function getQueryStatusFg(query: Query): number;
|
|
|
34
33
|
*/
|
|
35
34
|
export declare function getQueryStatusBg(query: Query): number;
|
|
36
35
|
export declare const sortFns: Record<string, SortFn>;
|
|
37
|
-
//#endregion
|
|
38
36
|
//# sourceMappingURL=utils.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.cts","names":["QueryState"],"sources":["../../../src/devtools/utils.ts"],"mappings":"
|
|
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;;;;;;;;wBASc,cAAc,OAAO,QAAQA;;;;;;wBAsB7B,mBAAmB,OAAO;;;;;;wBAwB1B,iBAAiB,OAAO;;;;;;wBAexB,iBAAiB,OAAO;qBAgC3B,SAAS,eAAe"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Query } from "@tanstack/query-core";
|
|
2
|
-
//#region src/devtools/utils.d.ts
|
|
3
2
|
type SortFn = (a: Query, b: Query) => number;
|
|
4
3
|
declare enum QueryState$1 {
|
|
5
4
|
Fetching = 0,
|
|
@@ -34,5 +33,4 @@ export declare function getQueryStatusFg(query: Query): number;
|
|
|
34
33
|
*/
|
|
35
34
|
export declare function getQueryStatusBg(query: Query): number;
|
|
36
35
|
export declare const sortFns: Record<string, SortFn>;
|
|
37
|
-
//#endregion
|
|
38
36
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","names":["QueryState"],"sources":["../../../src/devtools/utils.ts"],"mappings":"
|
|
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;;;;;;;;wBASc,cAAc,OAAO,QAAQA;;;;;;wBAsB7B,mBAAmB,OAAO;;;;;;wBAwB1B,iBAAiB,OAAO;;;;;;wBAexB,iBAAiB,OAAO;qBAgC3B,SAAS,eAAe"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/devtools/utils.ts
|
|
2
2
|
/**
|
|
3
3
|
* Returns the devtools state of a query: fetching, paused, inactive (no observers), stale, or fresh,
|
|
4
4
|
* checked in that order.
|
|
@@ -58,7 +58,6 @@ const sortFns = {
|
|
|
58
58
|
"Query Hash": queryHashSort,
|
|
59
59
|
"Last Updated": dateSort
|
|
60
60
|
};
|
|
61
|
-
//#endregion
|
|
62
61
|
export { getQueryState, getQueryStateLabel, getQueryStatusBg, getQueryStatusFg, sortFns };
|
|
63
62
|
|
|
64
63
|
//# sourceMappingURL=utils.js.map
|
package/build/legacy/index.d.cts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { c as MutationOptions } from "./types-
|
|
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-
|
|
1
|
+
import { c as MutationOptions } from "./types-u_Tu5Ybs.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-BuZEBLtg.cjs";
|
|
3
|
+
import { t as QueryClient } from "./queryClient-DdZQqhoA.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-oStzZOCq.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/legacy/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { c as MutationOptions } from "./types-
|
|
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-
|
|
1
|
+
import { c as MutationOptions } from "./types-u_Tu5Ybs.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-dXiBZnGk.js";
|
|
3
|
+
import { t as QueryClient } from "./queryClient-CVne8UYf.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-BLGtkUwV.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/legacy/{infiniteQueryOptions-BaoKhSzb.d.ts → infiniteQueryOptions-BLGtkUwV.d.ts}
RENAMED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { a as MaybeRef, d as ShallowOption, o as MaybeRefDeep, s as MaybeRefOrGetter, t as DeepUnwrapRef } from "./types-
|
|
2
|
-
import { o as UseQueryOptions } from "./queryOptions-
|
|
3
|
-
import { t as QueryClient$1 } from "./queryClient-
|
|
4
|
-
import { DefaultError, InfiniteData, InfiniteQueryObserverOptions, InfiniteQueryObserverResult, NonUndefinedGuard, QueryKey, QueryKeyWithDataTag, QueryObserver, QueryObserverResult } from "@tanstack/query-core";
|
|
1
|
+
import { a as MaybeRef, d as ShallowOption, o as MaybeRefDeep, s as MaybeRefOrGetter, t as DeepUnwrapRef } from "./types-u_Tu5Ybs.js";
|
|
2
|
+
import { o as UseQueryOptions } from "./queryOptions-dXiBZnGk.js";
|
|
3
|
+
import { t as QueryClient$1 } from "./queryClient-CVne8UYf.js";
|
|
4
|
+
import { DefaultError, InfiniteData, InfiniteQueryObserverOptions, InfiniteQueryObserverResult, InitialDataFunction, NonUndefinedGuard, QueryKey, QueryKeyWithDataTag, QueryObserver, QueryObserverResult } from "@tanstack/query-core";
|
|
5
5
|
import { Ref } from "vue-demi";
|
|
6
|
-
//#region src/useBaseQuery.d.ts
|
|
7
6
|
/**
|
|
8
7
|
* The result of the query composables: every property of the observer result wrapped in a `Ref`, except
|
|
9
8
|
* the `refetch`, `fetchNextPage`, and `fetchPreviousPage` functions, plus `suspense`.
|
|
@@ -29,8 +28,6 @@ type UseQueryOptionsGeneric<TQueryFnData, TError, TData, TQueryData, TQueryKey e
|
|
|
29
28
|
* @returns The query result as `ref`s, plus the `suspense` function.
|
|
30
29
|
*/
|
|
31
30
|
declare function useBaseQuery<TQueryFnData, TError, TData, TQueryData, TQueryKey extends QueryKey, TPageParam>(Observer: typeof QueryObserver, options: MaybeRefOrGetter<UseQueryOptionsGeneric<TQueryFnData, TError, TData, TQueryData, TQueryKey, TPageParam>>, queryClient?: QueryClient$1): UseBaseQueryReturnType<TData, TError>;
|
|
32
|
-
//#endregion
|
|
33
|
-
//#region src/useInfiniteQuery.d.ts
|
|
34
31
|
/**
|
|
35
32
|
* The options accepted by `useInfiniteQuery`. Same as {@link InfiniteQueryObserverOptions} from
|
|
36
33
|
* `@tanstack/query-core`, plus the `shallow` option. Each option except `shallow` can also be a `ref` (and
|
|
@@ -46,14 +43,14 @@ type UseInfiniteQueryReturnType<TData, TError> = UseBaseQueryReturnType<TData, T
|
|
|
46
43
|
* The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of
|
|
47
44
|
* `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`.
|
|
48
45
|
*
|
|
49
|
-
* This overload is selected when `initialData` is
|
|
50
|
-
* a `select` changes `TData` to include `undefined`).
|
|
46
|
+
* This overload is selected when `initialData` is known to be defined, so the resulting `data` is never
|
|
47
|
+
* `undefined` (unless a `select` changes `TData` to include `undefined`).
|
|
51
48
|
*
|
|
52
49
|
* `enabled` tracks reactive dependencies automatically as a `ref`, a plain value, or a reactive getter
|
|
53
50
|
* (`() => ...`). `queryKey` reacts through a `ref` for the array itself, or `ref`s and reactive getters as
|
|
54
51
|
* individual entries — the array itself can't be a bare getter.
|
|
55
52
|
* @param options - The {@link DefinedInitialDataInfiniteOptions} to use — everything you can pass to
|
|
56
|
-
* `useInfiniteQuery`, with `initialData`
|
|
53
|
+
* `useInfiniteQuery`, with `initialData` known to be defined.
|
|
57
54
|
* @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one provided by `VueQueryPlugin`
|
|
58
55
|
* will be used.
|
|
59
56
|
* @returns The same properties as `useQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,
|
|
@@ -278,11 +275,10 @@ declare function useInfiniteQuery<TQueryFnData, TError = DefaultError, TData = I
|
|
|
278
275
|
* ```
|
|
279
276
|
*/
|
|
280
277
|
declare function useInfiniteQuery<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: MaybeRefOrGetter<UseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>>, queryClient?: QueryClient$1): UseInfiniteQueryReturnType<TData, TError>;
|
|
281
|
-
//#endregion
|
|
282
|
-
//#region src/infiniteQueryOptions.d.ts
|
|
283
278
|
/**
|
|
284
|
-
* The options accepted by the `infiniteQueryOptions` overload selected when
|
|
285
|
-
* may be `undefined` while the query is
|
|
279
|
+
* The options accepted by the `infiniteQueryOptions` overload selected when `initialData` is omitted, may be
|
|
280
|
+
* `undefined`, or is a function that may return `undefined` — `data` may be `undefined` while the query is
|
|
281
|
+
* `pending`.
|
|
286
282
|
* @template TQueryFnData - The type of a single page, as your `queryFn` resolves it.
|
|
287
283
|
* @template TError - The type of errors your `queryFn` may throw.
|
|
288
284
|
* @template TData - The type `data` ends up as after `select` runs — defaults to `InfiniteData<TQueryFnData>`,
|
|
@@ -291,11 +287,11 @@ declare function useInfiniteQuery<TQueryFnData, TError = DefaultError, TData = I
|
|
|
291
287
|
* @template TPageParam - The type of the parameter passed to `queryFn` to fetch a given page.
|
|
292
288
|
*/
|
|
293
289
|
type UndefinedInitialDataInfiniteOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = UseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam> & {
|
|
294
|
-
initialData?: undefined
|
|
290
|
+
initialData?: undefined | NonUndefinedGuard<InfiniteData<TQueryFnData, TPageParam>> | InitialDataFunction<NonUndefinedGuard<InfiniteData<TQueryFnData, TPageParam>>>;
|
|
295
291
|
};
|
|
296
292
|
/**
|
|
297
|
-
* The options accepted by the `infiniteQueryOptions` overload selected when `initialData` is
|
|
298
|
-
* never `undefined` (unless a `select` changes `TData` to include `undefined`).
|
|
293
|
+
* The options accepted by the `infiniteQueryOptions` overload selected when `initialData` is known to be
|
|
294
|
+
* defined — `data` is never `undefined` (unless a `select` changes `TData` to include `undefined`).
|
|
299
295
|
* @template TQueryFnData - The type of a single page, as your `queryFn` resolves it.
|
|
300
296
|
* @template TError - The type of errors your `queryFn` may throw.
|
|
301
297
|
* @template TData - The type `data` ends up as after `select` runs — defaults to `InfiniteData<TQueryFnData>`,
|
|
@@ -317,8 +313,11 @@ type DefinedInitialDataInfiniteOptions<TQueryFnData, TError = DefaultError, TDat
|
|
|
317
313
|
* You can generally pass everything to `infiniteQueryOptions` that you can also pass to `useInfiniteQuery`.
|
|
318
314
|
* These options can be shared across hooks and imperative APIs such as `queryClient.infiniteQuery`.
|
|
319
315
|
* `options.queryKey` is required and is the query key to generate options for.
|
|
320
|
-
*
|
|
321
|
-
* `
|
|
316
|
+
*
|
|
317
|
+
* This overload is selected when `initialData` is known to be defined, so the resulting `data` is never
|
|
318
|
+
* `undefined` (unless a `select` changes `TData` to include `undefined`).
|
|
319
|
+
* @param options - The {@link DefinedInitialDataInfiniteOptions} to use — everything you can pass to
|
|
320
|
+
* `useInfiniteQuery`, with `initialData` known to be defined.
|
|
322
321
|
* @returns The same options object, typed so that `queryKey` carries the inferred data type.
|
|
323
322
|
* @see {@link useInfiniteQuery} to run an infinite query with these options.
|
|
324
323
|
* @example
|
|
@@ -331,22 +330,22 @@ type DefinedInitialDataInfiniteOptions<TQueryFnData, TError = DefaultError, TDat
|
|
|
331
330
|
* queryFn: ({ pageParam }) => fetchProjects(pageParam),
|
|
332
331
|
* initialPageParam: 0,
|
|
333
332
|
* getNextPageParam: (lastPage) => lastPage.nextId,
|
|
333
|
+
* initialData: { pages: [], pageParams: [] },
|
|
334
334
|
* })
|
|
335
335
|
*
|
|
336
|
-
*
|
|
336
|
+
* // `data` is never `undefined`, thanks to `initialData` — even if a refetch fails, so the
|
|
337
|
+
* // list stays visible alongside the error.
|
|
338
|
+
* const { data, isError, error } = useInfiniteQuery(projectsOptions)
|
|
337
339
|
* </script>
|
|
338
340
|
* ```
|
|
339
341
|
*/
|
|
340
|
-
declare function infiniteQueryOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options:
|
|
342
|
+
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>;
|
|
341
343
|
/**
|
|
342
344
|
* You can generally pass everything to `infiniteQueryOptions` that you can also pass to `useInfiniteQuery`.
|
|
343
345
|
* These options can be shared across hooks and imperative APIs such as `queryClient.infiniteQuery`.
|
|
344
346
|
* `options.queryKey` is required and is the query key to generate options for.
|
|
345
|
-
*
|
|
346
|
-
*
|
|
347
|
-
* a `select` changes `TData` to include `undefined`).
|
|
348
|
-
* @param options - The {@link DefinedInitialDataInfiniteOptions} to use — everything you can pass to
|
|
349
|
-
* `useInfiniteQuery`, with `initialData` set.
|
|
347
|
+
* @param options - The {@link UndefinedInitialDataInfiniteOptions} to use — everything you can pass to
|
|
348
|
+
* `useInfiniteQuery`.
|
|
350
349
|
* @returns The same options object, typed so that `queryKey` carries the inferred data type.
|
|
351
350
|
* @see {@link useInfiniteQuery} to run an infinite query with these options.
|
|
352
351
|
* @example
|
|
@@ -359,16 +358,12 @@ declare function infiniteQueryOptions<TQueryFnData, TError = DefaultError, TData
|
|
|
359
358
|
* queryFn: ({ pageParam }) => fetchProjects(pageParam),
|
|
360
359
|
* initialPageParam: 0,
|
|
361
360
|
* getNextPageParam: (lastPage) => lastPage.nextId,
|
|
362
|
-
* initialData: { pages: [], pageParams: [] },
|
|
363
361
|
* })
|
|
364
362
|
*
|
|
365
|
-
*
|
|
366
|
-
* // list stays visible alongside the error.
|
|
367
|
-
* const { data, isError, error } = useInfiniteQuery(projectsOptions)
|
|
363
|
+
* const { data, isError, error, fetchNextPage } = useInfiniteQuery(projectsOptions)
|
|
368
364
|
* </script>
|
|
369
365
|
* ```
|
|
370
366
|
*/
|
|
371
|
-
declare function infiniteQueryOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options:
|
|
372
|
-
//#endregion
|
|
367
|
+
declare function infiniteQueryOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UndefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>): UndefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam> & QueryKeyWithDataTag<TQueryKey, InfiniteData<TQueryFnData>, TError>;
|
|
373
368
|
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 };
|
|
374
|
-
//# sourceMappingURL=infiniteQueryOptions-
|
|
369
|
+
//# sourceMappingURL=infiniteQueryOptions-BLGtkUwV.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"infiniteQueryOptions-BLGtkUwV.d.ts","names":["QueryClient","QueryClient"],"sources":["../../src/useBaseQuery.ts","../../src/useInfiniteQuery.ts","../../src/infiniteQueryOptions.ts"],"mappings":";;;;;;;;;KA8BY,uBACV,OACA,QACA,UAAU,oBAAoB,OAAO,cAEpC,WAAW,UAAU,8DAIlB,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;;;;;;KC7DrB,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;;;;;KAOM,2BAA2B,OAAO,UAAU,uBACtD,OACA,QACA,4BAA4B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkDrB,iBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,iBACP,kCACE,cACA,QACA,OACA,WACA,cAGJ,cAAcC,gBACb,2BAA2B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkHrB,iBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,iBACP,oCACE,cACA,QACA,OACA,WACA,cAGJ,cAAcA,gBACb,2BAA2B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA4ErB,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,0BAEI,kBAAkB,aAAa,cAAc,eAC7C,oBACE,kBAAkB,aAAa,cAAc;;;;;;;;;;;;KAczC,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiC1C,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;;;;;;;;;;;;;;;;;;;;;;;;;iBA0B7C,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"}
|
package/build/legacy/{infiniteQueryOptions-ClNe2-FB.d.cts → infiniteQueryOptions-oStzZOCq.d.cts}
RENAMED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { a as MaybeRef, d as ShallowOption, o as MaybeRefDeep, s as MaybeRefOrGetter, t as DeepUnwrapRef } from "./types-
|
|
2
|
-
import { o as UseQueryOptions } from "./queryOptions-
|
|
3
|
-
import { t as QueryClient$1 } from "./queryClient-
|
|
4
|
-
import { DefaultError, InfiniteData, InfiniteQueryObserverOptions, InfiniteQueryObserverResult, NonUndefinedGuard, QueryKey, QueryKeyWithDataTag, QueryObserver, QueryObserverResult } from "@tanstack/query-core";
|
|
1
|
+
import { a as MaybeRef, d as ShallowOption, o as MaybeRefDeep, s as MaybeRefOrGetter, t as DeepUnwrapRef } from "./types-u_Tu5Ybs.cjs";
|
|
2
|
+
import { o as UseQueryOptions } from "./queryOptions-BuZEBLtg.cjs";
|
|
3
|
+
import { t as QueryClient$1 } from "./queryClient-DdZQqhoA.cjs";
|
|
4
|
+
import { DefaultError, InfiniteData, InfiniteQueryObserverOptions, InfiniteQueryObserverResult, InitialDataFunction, NonUndefinedGuard, QueryKey, QueryKeyWithDataTag, QueryObserver, QueryObserverResult } from "@tanstack/query-core";
|
|
5
5
|
import { Ref } from "vue-demi";
|
|
6
|
-
//#region src/useBaseQuery.d.ts
|
|
7
6
|
/**
|
|
8
7
|
* The result of the query composables: every property of the observer result wrapped in a `Ref`, except
|
|
9
8
|
* the `refetch`, `fetchNextPage`, and `fetchPreviousPage` functions, plus `suspense`.
|
|
@@ -29,8 +28,6 @@ type UseQueryOptionsGeneric<TQueryFnData, TError, TData, TQueryData, TQueryKey e
|
|
|
29
28
|
* @returns The query result as `ref`s, plus the `suspense` function.
|
|
30
29
|
*/
|
|
31
30
|
declare function useBaseQuery<TQueryFnData, TError, TData, TQueryData, TQueryKey extends QueryKey, TPageParam>(Observer: typeof QueryObserver, options: MaybeRefOrGetter<UseQueryOptionsGeneric<TQueryFnData, TError, TData, TQueryData, TQueryKey, TPageParam>>, queryClient?: QueryClient$1): UseBaseQueryReturnType<TData, TError>;
|
|
32
|
-
//#endregion
|
|
33
|
-
//#region src/useInfiniteQuery.d.ts
|
|
34
31
|
/**
|
|
35
32
|
* The options accepted by `useInfiniteQuery`. Same as {@link InfiniteQueryObserverOptions} from
|
|
36
33
|
* `@tanstack/query-core`, plus the `shallow` option. Each option except `shallow` can also be a `ref` (and
|
|
@@ -46,14 +43,14 @@ type UseInfiniteQueryReturnType<TData, TError> = UseBaseQueryReturnType<TData, T
|
|
|
46
43
|
* The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of
|
|
47
44
|
* `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`.
|
|
48
45
|
*
|
|
49
|
-
* This overload is selected when `initialData` is
|
|
50
|
-
* a `select` changes `TData` to include `undefined`).
|
|
46
|
+
* This overload is selected when `initialData` is known to be defined, so the resulting `data` is never
|
|
47
|
+
* `undefined` (unless a `select` changes `TData` to include `undefined`).
|
|
51
48
|
*
|
|
52
49
|
* `enabled` tracks reactive dependencies automatically as a `ref`, a plain value, or a reactive getter
|
|
53
50
|
* (`() => ...`). `queryKey` reacts through a `ref` for the array itself, or `ref`s and reactive getters as
|
|
54
51
|
* individual entries — the array itself can't be a bare getter.
|
|
55
52
|
* @param options - The {@link DefinedInitialDataInfiniteOptions} to use — everything you can pass to
|
|
56
|
-
* `useInfiniteQuery`, with `initialData`
|
|
53
|
+
* `useInfiniteQuery`, with `initialData` known to be defined.
|
|
57
54
|
* @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one provided by `VueQueryPlugin`
|
|
58
55
|
* will be used.
|
|
59
56
|
* @returns The same properties as `useQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,
|
|
@@ -278,11 +275,10 @@ declare function useInfiniteQuery<TQueryFnData, TError = DefaultError, TData = I
|
|
|
278
275
|
* ```
|
|
279
276
|
*/
|
|
280
277
|
declare function useInfiniteQuery<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: MaybeRefOrGetter<UseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>>, queryClient?: QueryClient$1): UseInfiniteQueryReturnType<TData, TError>;
|
|
281
|
-
//#endregion
|
|
282
|
-
//#region src/infiniteQueryOptions.d.ts
|
|
283
278
|
/**
|
|
284
|
-
* The options accepted by the `infiniteQueryOptions` overload selected when
|
|
285
|
-
* may be `undefined` while the query is
|
|
279
|
+
* The options accepted by the `infiniteQueryOptions` overload selected when `initialData` is omitted, may be
|
|
280
|
+
* `undefined`, or is a function that may return `undefined` — `data` may be `undefined` while the query is
|
|
281
|
+
* `pending`.
|
|
286
282
|
* @template TQueryFnData - The type of a single page, as your `queryFn` resolves it.
|
|
287
283
|
* @template TError - The type of errors your `queryFn` may throw.
|
|
288
284
|
* @template TData - The type `data` ends up as after `select` runs — defaults to `InfiniteData<TQueryFnData>`,
|
|
@@ -291,11 +287,11 @@ declare function useInfiniteQuery<TQueryFnData, TError = DefaultError, TData = I
|
|
|
291
287
|
* @template TPageParam - The type of the parameter passed to `queryFn` to fetch a given page.
|
|
292
288
|
*/
|
|
293
289
|
type UndefinedInitialDataInfiniteOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = UseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam> & {
|
|
294
|
-
initialData?: undefined
|
|
290
|
+
initialData?: undefined | NonUndefinedGuard<InfiniteData<TQueryFnData, TPageParam>> | InitialDataFunction<NonUndefinedGuard<InfiniteData<TQueryFnData, TPageParam>>>;
|
|
295
291
|
};
|
|
296
292
|
/**
|
|
297
|
-
* The options accepted by the `infiniteQueryOptions` overload selected when `initialData` is
|
|
298
|
-
* never `undefined` (unless a `select` changes `TData` to include `undefined`).
|
|
293
|
+
* The options accepted by the `infiniteQueryOptions` overload selected when `initialData` is known to be
|
|
294
|
+
* defined — `data` is never `undefined` (unless a `select` changes `TData` to include `undefined`).
|
|
299
295
|
* @template TQueryFnData - The type of a single page, as your `queryFn` resolves it.
|
|
300
296
|
* @template TError - The type of errors your `queryFn` may throw.
|
|
301
297
|
* @template TData - The type `data` ends up as after `select` runs — defaults to `InfiniteData<TQueryFnData>`,
|
|
@@ -317,8 +313,11 @@ type DefinedInitialDataInfiniteOptions<TQueryFnData, TError = DefaultError, TDat
|
|
|
317
313
|
* You can generally pass everything to `infiniteQueryOptions` that you can also pass to `useInfiniteQuery`.
|
|
318
314
|
* These options can be shared across hooks and imperative APIs such as `queryClient.infiniteQuery`.
|
|
319
315
|
* `options.queryKey` is required and is the query key to generate options for.
|
|
320
|
-
*
|
|
321
|
-
* `
|
|
316
|
+
*
|
|
317
|
+
* This overload is selected when `initialData` is known to be defined, so the resulting `data` is never
|
|
318
|
+
* `undefined` (unless a `select` changes `TData` to include `undefined`).
|
|
319
|
+
* @param options - The {@link DefinedInitialDataInfiniteOptions} to use — everything you can pass to
|
|
320
|
+
* `useInfiniteQuery`, with `initialData` known to be defined.
|
|
322
321
|
* @returns The same options object, typed so that `queryKey` carries the inferred data type.
|
|
323
322
|
* @see {@link useInfiniteQuery} to run an infinite query with these options.
|
|
324
323
|
* @example
|
|
@@ -331,22 +330,22 @@ type DefinedInitialDataInfiniteOptions<TQueryFnData, TError = DefaultError, TDat
|
|
|
331
330
|
* queryFn: ({ pageParam }) => fetchProjects(pageParam),
|
|
332
331
|
* initialPageParam: 0,
|
|
333
332
|
* getNextPageParam: (lastPage) => lastPage.nextId,
|
|
333
|
+
* initialData: { pages: [], pageParams: [] },
|
|
334
334
|
* })
|
|
335
335
|
*
|
|
336
|
-
*
|
|
336
|
+
* // `data` is never `undefined`, thanks to `initialData` — even if a refetch fails, so the
|
|
337
|
+
* // list stays visible alongside the error.
|
|
338
|
+
* const { data, isError, error } = useInfiniteQuery(projectsOptions)
|
|
337
339
|
* </script>
|
|
338
340
|
* ```
|
|
339
341
|
*/
|
|
340
|
-
declare function infiniteQueryOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options:
|
|
342
|
+
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>;
|
|
341
343
|
/**
|
|
342
344
|
* You can generally pass everything to `infiniteQueryOptions` that you can also pass to `useInfiniteQuery`.
|
|
343
345
|
* These options can be shared across hooks and imperative APIs such as `queryClient.infiniteQuery`.
|
|
344
346
|
* `options.queryKey` is required and is the query key to generate options for.
|
|
345
|
-
*
|
|
346
|
-
*
|
|
347
|
-
* a `select` changes `TData` to include `undefined`).
|
|
348
|
-
* @param options - The {@link DefinedInitialDataInfiniteOptions} to use — everything you can pass to
|
|
349
|
-
* `useInfiniteQuery`, with `initialData` set.
|
|
347
|
+
* @param options - The {@link UndefinedInitialDataInfiniteOptions} to use — everything you can pass to
|
|
348
|
+
* `useInfiniteQuery`.
|
|
350
349
|
* @returns The same options object, typed so that `queryKey` carries the inferred data type.
|
|
351
350
|
* @see {@link useInfiniteQuery} to run an infinite query with these options.
|
|
352
351
|
* @example
|
|
@@ -359,16 +358,12 @@ declare function infiniteQueryOptions<TQueryFnData, TError = DefaultError, TData
|
|
|
359
358
|
* queryFn: ({ pageParam }) => fetchProjects(pageParam),
|
|
360
359
|
* initialPageParam: 0,
|
|
361
360
|
* getNextPageParam: (lastPage) => lastPage.nextId,
|
|
362
|
-
* initialData: { pages: [], pageParams: [] },
|
|
363
361
|
* })
|
|
364
362
|
*
|
|
365
|
-
*
|
|
366
|
-
* // list stays visible alongside the error.
|
|
367
|
-
* const { data, isError, error } = useInfiniteQuery(projectsOptions)
|
|
363
|
+
* const { data, isError, error, fetchNextPage } = useInfiniteQuery(projectsOptions)
|
|
368
364
|
* </script>
|
|
369
365
|
* ```
|
|
370
366
|
*/
|
|
371
|
-
declare function infiniteQueryOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options:
|
|
372
|
-
//#endregion
|
|
367
|
+
declare function infiniteQueryOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UndefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>): UndefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam> & QueryKeyWithDataTag<TQueryKey, InfiniteData<TQueryFnData>, TError>;
|
|
373
368
|
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 };
|
|
374
|
-
//# sourceMappingURL=infiniteQueryOptions-
|
|
369
|
+
//# sourceMappingURL=infiniteQueryOptions-oStzZOCq.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"infiniteQueryOptions-oStzZOCq.d.cts","names":["QueryClient","QueryClient"],"sources":["../../src/useBaseQuery.ts","../../src/useInfiniteQuery.ts","../../src/infiniteQueryOptions.ts"],"mappings":";;;;;;;;;KA8BY,uBACV,OACA,QACA,UAAU,oBAAoB,OAAO,cAEpC,WAAW,UAAU,8DAIlB,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;;;;;;KC7DrB,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;;;;;KAOM,2BAA2B,OAAO,UAAU,uBACtD,OACA,QACA,4BAA4B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkDrB,iBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,iBACP,kCACE,cACA,QACA,OACA,WACA,cAGJ,cAAcC,gBACb,2BAA2B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkHrB,iBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,iBACP,oCACE,cACA,QACA,OACA,WACA,cAGJ,cAAcA,gBACb,2BAA2B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA4ErB,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,0BAEI,kBAAkB,aAAa,cAAc,eAC7C,oBACE,kBAAkB,aAAa,cAAc;;;;;;;;;;;;KAczC,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiC1C,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;;;;;;;;;;;;;;;;;;;;;;;;;iBA0B7C,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"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// src/infiniteQueryOptions.ts
|
|
3
3
|
function infiniteQueryOptions(options) {
|
|
4
4
|
return options;
|
|
5
5
|
}
|
|
6
|
-
//#endregion
|
|
7
6
|
exports.infiniteQueryOptions = infiniteQueryOptions;
|
|
8
7
|
|
|
9
8
|
//# sourceMappingURL=infiniteQueryOptions.cjs.map
|
|
@@ -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
|
|
1
|
+
{"version":3,"file":"infiniteQueryOptions.cjs","names":[],"sources":["../../src/infiniteQueryOptions.ts"],"sourcesContent":["import type {\n DefaultError,\n InfiniteData,\n InitialDataFunction,\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 `initialData` is omitted, may be\n * `undefined`, or is a function that may return `undefined` — `data` may be `undefined` while the query is\n * `pending`.\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?:\n | undefined\n | NonUndefinedGuard<InfiniteData<TQueryFnData, TPageParam>>\n | InitialDataFunction<\n NonUndefinedGuard<InfiniteData<TQueryFnData, TPageParam>>\n >\n}\n\n/**\n * The options accepted by the `infiniteQueryOptions` overload selected when `initialData` is known to be\n * defined — `data` is never `undefined` (unless a `select` changes `TData` to include `undefined`).\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 * This overload is selected when `initialData` is known to be defined, so the resulting `data` is never\n * `undefined` (unless a `select` changes `TData` to include `undefined`).\n * @param options - The {@link DefinedInitialDataInfiniteOptions} to use — everything you can pass to\n * `useInfiniteQuery`, with `initialData` known to be defined.\n * @returns The same options object, typed so that `queryKey` carries the inferred data type.\n * @see {@link useInfiniteQuery} to run an infinite query with these options.\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\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 * @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 * @see {@link useInfiniteQuery} to run an infinite query with these options.\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\nexport function infiniteQueryOptions(options: unknown) {\n return options\n}\n"],"mappings":";;AAiLA,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-oStzZOCq.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-BLGtkUwV.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
|
|
1
|
+
{"version":3,"file":"infiniteQueryOptions.js","names":[],"sources":["../../src/infiniteQueryOptions.ts"],"sourcesContent":["import type {\n DefaultError,\n InfiniteData,\n InitialDataFunction,\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 `initialData` is omitted, may be\n * `undefined`, or is a function that may return `undefined` — `data` may be `undefined` while the query is\n * `pending`.\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?:\n | undefined\n | NonUndefinedGuard<InfiniteData<TQueryFnData, TPageParam>>\n | InitialDataFunction<\n NonUndefinedGuard<InfiniteData<TQueryFnData, TPageParam>>\n >\n}\n\n/**\n * The options accepted by the `infiniteQueryOptions` overload selected when `initialData` is known to be\n * defined — `data` is never `undefined` (unless a `select` changes `TData` to include `undefined`).\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 * This overload is selected when `initialData` is known to be defined, so the resulting `data` is never\n * `undefined` (unless a `select` changes `TData` to include `undefined`).\n * @param options - The {@link DefinedInitialDataInfiniteOptions} to use — everything you can pass to\n * `useInfiniteQuery`, with `initialData` known to be defined.\n * @returns The same options object, typed so that `queryKey` carries the inferred data type.\n * @see {@link useInfiniteQuery} to run an infinite query with these options.\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\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 * @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 * @see {@link useInfiniteQuery} to run an infinite query with these options.\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\nexport function infiniteQueryOptions(options: unknown) {\n return options\n}\n"],"mappings":";AAiLA,SAAgB,qBAAqB,SAAkB;CACrD,OAAO;AACT"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_utils = require("./utils.cjs");
|
|
3
3
|
let _tanstack_query_core = require("@tanstack/query-core");
|
|
4
|
-
|
|
4
|
+
// src/mutationCache.ts
|
|
5
5
|
/**
|
|
6
6
|
* Vue-aware subclass of `@tanstack/query-core`'s `MutationCache`. `find`/`findAll` also accept a
|
|
7
7
|
* {@link MaybeRefDeep} filters object, so `ref`s can be passed directly without unwrapping. Access it via
|
|
@@ -15,7 +15,6 @@ var MutationCache = class extends _tanstack_query_core.MutationCache {
|
|
|
15
15
|
return super.findAll(require_utils.cloneDeepUnref(filters));
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
|
-
//#endregion
|
|
19
18
|
exports.MutationCache = MutationCache;
|
|
20
19
|
|
|
21
20
|
//# sourceMappingURL=mutationCache.cjs.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { o as MaybeRefDeep } from "./types-
|
|
1
|
+
import { o as MaybeRefDeep } from "./types-u_Tu5Ybs.cjs";
|
|
2
2
|
import { DefaultError, Mutation, MutationCache as MutationCache$1, MutationFilters } from "@tanstack/query-core";
|
|
3
|
-
//#region src/mutationCache.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Vue-aware subclass of `@tanstack/query-core`'s `MutationCache`. `find`/`findAll` also accept a
|
|
6
5
|
* {@link MaybeRefDeep} filters object, so `ref`s can be passed directly without unwrapping. Access it via
|
|
@@ -10,5 +9,4 @@ export declare class MutationCache extends MutationCache$1 {
|
|
|
10
9
|
find<TData = unknown, TError = DefaultError, TVariables = any, TOnMutateResult = unknown>(filters: MaybeRefDeep<MutationFilters>): Mutation<TData, TError, TVariables, TOnMutateResult> | undefined;
|
|
11
10
|
findAll(filters?: MaybeRefDeep<MutationFilters>): Array<Mutation>;
|
|
12
11
|
}
|
|
13
|
-
//#endregion
|
|
14
12
|
//# sourceMappingURL=mutationCache.d.cts.map
|