@tanstack/vue-query 5.101.4 → 5.102.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/README.md +17 -0
- package/build/legacy/devtools/devtools.cjs +203 -258
- package/build/legacy/devtools/devtools.cjs.map +1 -1
- package/build/legacy/devtools/devtools.d.cts +6 -1
- package/build/legacy/devtools/devtools.d.cts.map +1 -0
- package/build/legacy/devtools/devtools.d.ts +6 -1
- package/build/legacy/devtools/devtools.d.ts.map +1 -0
- package/build/legacy/devtools/devtools.js +200 -236
- package/build/legacy/devtools/devtools.js.map +1 -1
- package/build/legacy/devtools/utils.cjs +37 -94
- package/build/legacy/devtools/utils.cjs.map +1 -1
- package/build/legacy/devtools/utils.d.cts +18 -5
- package/build/legacy/devtools/utils.d.cts.map +1 -0
- package/build/legacy/devtools/utils.d.ts +18 -5
- package/build/legacy/devtools/utils.d.ts.map +1 -0
- package/build/legacy/devtools/utils.js +32 -65
- package/build/legacy/devtools/utils.js.map +1 -1
- package/build/legacy/index.cjs +44 -83
- package/build/legacy/index.d.cts +17 -173
- package/build/legacy/index.d.ts +17 -173
- package/build/legacy/index.js +6 -27
- package/build/legacy/infiniteQueryOptions.cjs +6 -30
- package/build/legacy/infiniteQueryOptions.cjs.map +1 -1
- package/build/legacy/infiniteQueryOptions.d.cts +2 -3
- package/build/legacy/infiniteQueryOptions.d.ts +2 -3
- package/build/legacy/infiniteQueryOptions.js +5 -5
- package/build/legacy/infiniteQueryOptions.js.map +1 -1
- package/build/legacy/mutationCache.cjs +13 -37
- package/build/legacy/mutationCache.cjs.map +1 -1
- package/build/legacy/mutationCache.d.cts +10 -1
- package/build/legacy/mutationCache.d.cts.map +1 -0
- package/build/legacy/mutationCache.d.ts +10 -1
- package/build/legacy/mutationCache.d.ts.map +1 -0
- package/build/legacy/mutationCache.js +12 -12
- package/build/legacy/mutationCache.js.map +1 -1
- package/build/legacy/mutationOptions.cjs +6 -30
- package/build/legacy/mutationOptions.cjs.map +1 -1
- package/build/legacy/mutationOptions.d.cts +10 -1
- package/build/legacy/mutationOptions.d.cts.map +1 -0
- package/build/legacy/mutationOptions.d.ts +10 -1
- package/build/legacy/mutationOptions.d.ts.map +1 -0
- package/build/legacy/mutationOptions.js +5 -5
- package/build/legacy/mutationOptions.js.map +1 -1
- package/build/legacy/queryCache.cjs +13 -37
- package/build/legacy/queryCache.cjs.map +1 -1
- package/build/legacy/queryCache.d.cts +10 -1
- package/build/legacy/queryCache.d.cts.map +1 -0
- package/build/legacy/queryCache.d.ts +10 -1
- package/build/legacy/queryCache.d.ts.map +1 -0
- package/build/legacy/queryCache.js +12 -12
- package/build/legacy/queryCache.js.map +1 -1
- package/build/legacy/queryClient-C07d0chJ.d.cts +97 -0
- package/build/legacy/queryClient-C07d0chJ.d.cts.map +1 -0
- package/build/legacy/queryClient-hf6i_vCa.d.ts +97 -0
- package/build/legacy/queryClient-hf6i_vCa.d.ts.map +1 -0
- package/build/legacy/queryClient.cjs +104 -142
- package/build/legacy/queryClient.cjs.map +1 -1
- package/build/legacy/queryClient.d.cts +2 -1
- package/build/legacy/queryClient.d.ts +2 -1
- package/build/legacy/queryClient.js +103 -117
- package/build/legacy/queryClient.js.map +1 -1
- package/build/legacy/queryOptions.cjs +6 -30
- package/build/legacy/queryOptions.cjs.map +1 -1
- package/build/legacy/queryOptions.d.cts +19 -4
- package/build/legacy/queryOptions.d.cts.map +1 -0
- package/build/legacy/queryOptions.d.ts +19 -4
- package/build/legacy/queryOptions.d.ts.map +1 -0
- package/build/legacy/queryOptions.js +5 -5
- package/build/legacy/queryOptions.js.map +1 -1
- package/build/legacy/types-BzZi3_rS.d.cts +33 -0
- package/build/legacy/types-BzZi3_rS.d.cts.map +1 -0
- package/build/legacy/types-BzZi3_rS.d.ts +33 -0
- package/build/legacy/types-BzZi3_rS.d.ts.map +1 -0
- package/build/legacy/types.cjs +0 -19
- package/build/legacy/types.d.cts +2 -11
- package/build/legacy/types.d.ts +2 -11
- package/build/legacy/types.js +1 -1
- package/build/legacy/useBaseQuery.cjs +78 -140
- package/build/legacy/useBaseQuery.cjs.map +1 -1
- package/build/legacy/useBaseQuery.d.cts +2 -2
- package/build/legacy/useBaseQuery.d.ts +2 -2
- package/build/legacy/useBaseQuery.js +76 -124
- package/build/legacy/useBaseQuery.js.map +1 -1
- package/build/legacy/useInfiniteQuery.cjs +8 -36
- package/build/legacy/useInfiniteQuery.cjs.map +1 -1
- package/build/legacy/useInfiniteQuery.d.cts +2 -3
- package/build/legacy/useInfiniteQuery.d.ts +2 -3
- package/build/legacy/useInfiniteQuery.js +6 -10
- package/build/legacy/useInfiniteQuery.js.map +1 -1
- package/build/legacy/useIsFetching.cjs +23 -51
- package/build/legacy/useIsFetching.cjs.map +1 -1
- package/build/legacy/useIsFetching.d.cts +10 -2
- package/build/legacy/useIsFetching.d.cts.map +1 -0
- package/build/legacy/useIsFetching.d.ts +10 -2
- package/build/legacy/useIsFetching.d.ts.map +1 -0
- package/build/legacy/useIsFetching.js +21 -25
- package/build/legacy/useIsFetching.js.map +1 -1
- package/build/legacy/useMutation.cjs +42 -76
- package/build/legacy/useMutation.cjs.map +1 -1
- package/build/legacy/useMutation.d.cts +17 -3
- package/build/legacy/useMutation.d.cts.map +1 -0
- package/build/legacy/useMutation.d.ts +17 -3
- package/build/legacy/useMutation.d.ts.map +1 -0
- package/build/legacy/useMutation.js +39 -59
- package/build/legacy/useMutation.js.map +1 -1
- package/build/legacy/useMutationState.cjs +38 -75
- package/build/legacy/useMutationState.cjs.map +1 -1
- package/build/legacy/useMutationState.d.cts +16 -4
- package/build/legacy/useMutationState.d.cts.map +1 -0
- package/build/legacy/useMutationState.d.ts +16 -4
- package/build/legacy/useMutationState.d.ts.map +1 -0
- package/build/legacy/useMutationState.js +35 -55
- package/build/legacy/useMutationState.js.map +1 -1
- package/build/legacy/usePrefetchInfiniteQuery.cjs +19 -50
- package/build/legacy/usePrefetchInfiniteQuery.cjs.map +1 -1
- package/build/legacy/usePrefetchInfiniteQuery.d.cts +11 -2
- package/build/legacy/usePrefetchInfiniteQuery.d.cts.map +1 -0
- package/build/legacy/usePrefetchInfiniteQuery.d.ts +11 -2
- package/build/legacy/usePrefetchInfiniteQuery.d.ts.map +1 -0
- package/build/legacy/usePrefetchInfiniteQuery.js +17 -24
- package/build/legacy/usePrefetchInfiniteQuery.js.map +1 -1
- package/build/legacy/usePrefetchQuery.cjs +19 -48
- package/build/legacy/usePrefetchQuery.cjs.map +1 -1
- package/build/legacy/usePrefetchQuery.d.cts +11 -2
- package/build/legacy/usePrefetchQuery.d.cts.map +1 -0
- package/build/legacy/usePrefetchQuery.d.ts +11 -2
- package/build/legacy/usePrefetchQuery.d.ts.map +1 -0
- package/build/legacy/usePrefetchQuery.js +17 -22
- package/build/legacy/usePrefetchQuery.js.map +1 -1
- package/build/legacy/useQueries.cjs +57 -113
- package/build/legacy/useQueries.cjs.map +1 -1
- package/build/legacy/useQueries.d.cts +63 -3
- package/build/legacy/useQueries.d.cts.map +1 -0
- package/build/legacy/useQueries.d.ts +63 -3
- package/build/legacy/useQueries.d.ts.map +1 -0
- package/build/legacy/useQueries.js +55 -96
- package/build/legacy/useQueries.js.map +1 -1
- package/build/legacy/useQuery.cjs +8 -32
- package/build/legacy/useQuery.cjs.map +1 -1
- package/build/legacy/useQuery.d.cts +2 -6
- package/build/legacy/useQuery.d.ts +2 -6
- package/build/legacy/useQuery.js +6 -6
- package/build/legacy/useQuery.js.map +1 -1
- package/build/legacy/useQueryClient.cjs +12 -44
- package/build/legacy/useQueryClient.cjs.map +1 -1
- package/build/legacy/useQueryClient.d.cts +6 -1
- package/build/legacy/useQueryClient.d.cts.map +1 -0
- package/build/legacy/useQueryClient.d.ts +6 -1
- package/build/legacy/useQueryClient.d.ts.map +1 -0
- package/build/legacy/useQueryClient.js +10 -18
- package/build/legacy/useQueryClient.js.map +1 -1
- package/build/legacy/utils.cjs +40 -89
- package/build/legacy/utils.cjs.map +1 -1
- package/build/legacy/utils.d.cts +11 -6
- package/build/legacy/utils.d.cts.map +1 -0
- package/build/legacy/utils.d.ts +11 -6
- package/build/legacy/utils.d.ts.map +1 -0
- package/build/legacy/utils.js +32 -57
- package/build/legacy/utils.js.map +1 -1
- package/build/legacy/vueQueryPlugin.cjs +61 -103
- package/build/legacy/vueQueryPlugin.cjs.map +1 -1
- package/build/legacy/vueQueryPlugin.d.cts +23 -2
- package/build/legacy/vueQueryPlugin.d.cts.map +1 -0
- package/build/legacy/vueQueryPlugin.d.ts +23 -2
- package/build/legacy/vueQueryPlugin.d.ts.map +1 -0
- package/build/legacy/vueQueryPlugin.js +59 -77
- package/build/legacy/vueQueryPlugin.js.map +1 -1
- package/build/modern/devtools/devtools.cjs +201 -256
- package/build/modern/devtools/devtools.cjs.map +1 -1
- package/build/modern/devtools/devtools.d.cts +6 -1
- package/build/modern/devtools/devtools.d.cts.map +1 -0
- package/build/modern/devtools/devtools.d.ts +6 -1
- package/build/modern/devtools/devtools.d.ts.map +1 -0
- package/build/modern/devtools/devtools.js +198 -234
- package/build/modern/devtools/devtools.js.map +1 -1
- package/build/modern/devtools/utils.cjs +37 -94
- package/build/modern/devtools/utils.cjs.map +1 -1
- package/build/modern/devtools/utils.d.cts +18 -5
- package/build/modern/devtools/utils.d.cts.map +1 -0
- package/build/modern/devtools/utils.d.ts +18 -5
- package/build/modern/devtools/utils.d.ts.map +1 -0
- package/build/modern/devtools/utils.js +32 -65
- package/build/modern/devtools/utils.js.map +1 -1
- package/build/modern/index.cjs +44 -83
- package/build/modern/index.d.cts +17 -173
- package/build/modern/index.d.ts +17 -173
- package/build/modern/index.js +6 -27
- package/build/modern/infiniteQueryOptions.cjs +6 -30
- package/build/modern/infiniteQueryOptions.cjs.map +1 -1
- package/build/modern/infiniteQueryOptions.d.cts +2 -3
- package/build/modern/infiniteQueryOptions.d.ts +2 -3
- package/build/modern/infiniteQueryOptions.js +5 -5
- package/build/modern/infiniteQueryOptions.js.map +1 -1
- package/build/modern/mutationCache.cjs +13 -37
- package/build/modern/mutationCache.cjs.map +1 -1
- package/build/modern/mutationCache.d.cts +10 -1
- package/build/modern/mutationCache.d.cts.map +1 -0
- package/build/modern/mutationCache.d.ts +10 -1
- package/build/modern/mutationCache.d.ts.map +1 -0
- package/build/modern/mutationCache.js +12 -12
- package/build/modern/mutationCache.js.map +1 -1
- package/build/modern/mutationOptions.cjs +6 -30
- package/build/modern/mutationOptions.cjs.map +1 -1
- package/build/modern/mutationOptions.d.cts +10 -1
- package/build/modern/mutationOptions.d.cts.map +1 -0
- package/build/modern/mutationOptions.d.ts +10 -1
- package/build/modern/mutationOptions.d.ts.map +1 -0
- package/build/modern/mutationOptions.js +5 -5
- package/build/modern/mutationOptions.js.map +1 -1
- package/build/modern/queryCache.cjs +13 -37
- package/build/modern/queryCache.cjs.map +1 -1
- package/build/modern/queryCache.d.cts +10 -1
- package/build/modern/queryCache.d.cts.map +1 -0
- package/build/modern/queryCache.d.ts +10 -1
- package/build/modern/queryCache.d.ts.map +1 -0
- package/build/modern/queryCache.js +12 -12
- package/build/modern/queryCache.js.map +1 -1
- package/build/modern/queryClient-C07d0chJ.d.cts +97 -0
- package/build/modern/queryClient-C07d0chJ.d.cts.map +1 -0
- package/build/modern/queryClient-hf6i_vCa.d.ts +97 -0
- package/build/modern/queryClient-hf6i_vCa.d.ts.map +1 -0
- package/build/modern/queryClient.cjs +104 -142
- package/build/modern/queryClient.cjs.map +1 -1
- package/build/modern/queryClient.d.cts +2 -1
- package/build/modern/queryClient.d.ts +2 -1
- package/build/modern/queryClient.js +103 -117
- package/build/modern/queryClient.js.map +1 -1
- package/build/modern/queryOptions.cjs +6 -30
- package/build/modern/queryOptions.cjs.map +1 -1
- package/build/modern/queryOptions.d.cts +19 -4
- package/build/modern/queryOptions.d.cts.map +1 -0
- package/build/modern/queryOptions.d.ts +19 -4
- package/build/modern/queryOptions.d.ts.map +1 -0
- package/build/modern/queryOptions.js +5 -5
- package/build/modern/queryOptions.js.map +1 -1
- package/build/modern/types-BzZi3_rS.d.cts +33 -0
- package/build/modern/types-BzZi3_rS.d.cts.map +1 -0
- package/build/modern/types-BzZi3_rS.d.ts +33 -0
- package/build/modern/types-BzZi3_rS.d.ts.map +1 -0
- package/build/modern/types.cjs +0 -19
- package/build/modern/types.d.cts +2 -11
- package/build/modern/types.d.ts +2 -11
- package/build/modern/types.js +1 -1
- package/build/modern/useBaseQuery.cjs +77 -139
- package/build/modern/useBaseQuery.cjs.map +1 -1
- package/build/modern/useBaseQuery.d.cts +2 -2
- package/build/modern/useBaseQuery.d.ts +2 -2
- package/build/modern/useBaseQuery.js +75 -123
- package/build/modern/useBaseQuery.js.map +1 -1
- package/build/modern/useInfiniteQuery.cjs +8 -36
- package/build/modern/useInfiniteQuery.cjs.map +1 -1
- package/build/modern/useInfiniteQuery.d.cts +2 -3
- package/build/modern/useInfiniteQuery.d.ts +2 -3
- package/build/modern/useInfiniteQuery.js +6 -10
- package/build/modern/useInfiniteQuery.js.map +1 -1
- package/build/modern/useIsFetching.cjs +23 -51
- package/build/modern/useIsFetching.cjs.map +1 -1
- package/build/modern/useIsFetching.d.cts +10 -2
- package/build/modern/useIsFetching.d.cts.map +1 -0
- package/build/modern/useIsFetching.d.ts +10 -2
- package/build/modern/useIsFetching.d.ts.map +1 -0
- package/build/modern/useIsFetching.js +21 -25
- package/build/modern/useIsFetching.js.map +1 -1
- package/build/modern/useMutation.cjs +42 -76
- package/build/modern/useMutation.cjs.map +1 -1
- package/build/modern/useMutation.d.cts +17 -3
- package/build/modern/useMutation.d.cts.map +1 -0
- package/build/modern/useMutation.d.ts +17 -3
- package/build/modern/useMutation.d.ts.map +1 -0
- package/build/modern/useMutation.js +39 -59
- package/build/modern/useMutation.js.map +1 -1
- package/build/modern/useMutationState.cjs +38 -75
- package/build/modern/useMutationState.cjs.map +1 -1
- package/build/modern/useMutationState.d.cts +16 -4
- package/build/modern/useMutationState.d.cts.map +1 -0
- package/build/modern/useMutationState.d.ts +16 -4
- package/build/modern/useMutationState.d.ts.map +1 -0
- package/build/modern/useMutationState.js +35 -55
- package/build/modern/useMutationState.js.map +1 -1
- package/build/modern/usePrefetchInfiniteQuery.cjs +19 -50
- package/build/modern/usePrefetchInfiniteQuery.cjs.map +1 -1
- package/build/modern/usePrefetchInfiniteQuery.d.cts +11 -2
- package/build/modern/usePrefetchInfiniteQuery.d.cts.map +1 -0
- package/build/modern/usePrefetchInfiniteQuery.d.ts +11 -2
- package/build/modern/usePrefetchInfiniteQuery.d.ts.map +1 -0
- package/build/modern/usePrefetchInfiniteQuery.js +17 -24
- package/build/modern/usePrefetchInfiniteQuery.js.map +1 -1
- package/build/modern/usePrefetchQuery.cjs +19 -48
- package/build/modern/usePrefetchQuery.cjs.map +1 -1
- package/build/modern/usePrefetchQuery.d.cts +11 -2
- package/build/modern/usePrefetchQuery.d.cts.map +1 -0
- package/build/modern/usePrefetchQuery.d.ts +11 -2
- package/build/modern/usePrefetchQuery.d.ts.map +1 -0
- package/build/modern/usePrefetchQuery.js +17 -22
- package/build/modern/usePrefetchQuery.js.map +1 -1
- package/build/modern/useQueries.cjs +56 -112
- package/build/modern/useQueries.cjs.map +1 -1
- package/build/modern/useQueries.d.cts +63 -3
- package/build/modern/useQueries.d.cts.map +1 -0
- package/build/modern/useQueries.d.ts +63 -3
- package/build/modern/useQueries.d.ts.map +1 -0
- package/build/modern/useQueries.js +54 -95
- package/build/modern/useQueries.js.map +1 -1
- package/build/modern/useQuery.cjs +8 -32
- package/build/modern/useQuery.cjs.map +1 -1
- package/build/modern/useQuery.d.cts +2 -6
- package/build/modern/useQuery.d.ts +2 -6
- package/build/modern/useQuery.js +6 -6
- package/build/modern/useQuery.js.map +1 -1
- package/build/modern/useQueryClient.cjs +12 -44
- package/build/modern/useQueryClient.cjs.map +1 -1
- package/build/modern/useQueryClient.d.cts +6 -1
- package/build/modern/useQueryClient.d.cts.map +1 -0
- package/build/modern/useQueryClient.d.ts +6 -1
- package/build/modern/useQueryClient.d.ts.map +1 -0
- package/build/modern/useQueryClient.js +10 -18
- package/build/modern/useQueryClient.js.map +1 -1
- package/build/modern/utils.cjs +40 -89
- package/build/modern/utils.cjs.map +1 -1
- package/build/modern/utils.d.cts +11 -6
- package/build/modern/utils.d.cts.map +1 -0
- package/build/modern/utils.d.ts +11 -6
- package/build/modern/utils.d.ts.map +1 -0
- package/build/modern/utils.js +32 -57
- package/build/modern/utils.js.map +1 -1
- package/build/modern/vueQueryPlugin.cjs +60 -102
- package/build/modern/vueQueryPlugin.cjs.map +1 -1
- package/build/modern/vueQueryPlugin.d.cts +23 -2
- package/build/modern/vueQueryPlugin.d.cts.map +1 -0
- package/build/modern/vueQueryPlugin.d.ts +23 -2
- package/build/modern/vueQueryPlugin.d.ts.map +1 -0
- package/build/modern/vueQueryPlugin.js +58 -76
- package/build/modern/vueQueryPlugin.js.map +1 -1
- package/package.json +5 -7
- package/src/index.ts +5 -1
- package/src/infiniteQueryOptions.ts +5 -7
- package/src/queryClient.ts +150 -36
- package/src/queryOptions.ts +32 -14
- package/src/useMutation.ts +4 -4
- package/src/useMutationState.ts +33 -8
- package/src/usePrefetchInfiniteQuery.ts +22 -42
- package/src/usePrefetchQuery.ts +29 -5
- package/src/useQuery.ts +19 -9
- package/build/legacy/_tsup-dts-rollup.d.cts +0 -884
- package/build/legacy/_tsup-dts-rollup.d.ts +0 -884
- package/build/legacy/index.cjs.map +0 -1
- package/build/legacy/index.js.map +0 -1
- package/build/legacy/types.cjs.map +0 -1
- package/build/legacy/types.js.map +0 -1
- package/build/modern/_tsup-dts-rollup.d.cts +0 -884
- package/build/modern/_tsup-dts-rollup.d.ts +0 -884
- package/build/modern/index.cjs.map +0 -1
- package/build/modern/index.js.map +0 -1
- package/build/modern/types.cjs.map +0 -1
- package/build/modern/types.js.map +0 -1
package/build/legacy/utils.cjs
CHANGED
|
@@ -1,105 +1,56 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/utils.ts
|
|
21
|
-
var utils_exports = {};
|
|
22
|
-
__export(utils_exports, {
|
|
23
|
-
VUE_QUERY_CLIENT: () => VUE_QUERY_CLIENT,
|
|
24
|
-
cloneDeep: () => cloneDeep,
|
|
25
|
-
cloneDeepUnref: () => cloneDeepUnref,
|
|
26
|
-
getClientKey: () => getClientKey,
|
|
27
|
-
toValueDeep: () => toValueDeep,
|
|
28
|
-
updateState: () => updateState
|
|
29
|
-
});
|
|
30
|
-
module.exports = __toCommonJS(utils_exports);
|
|
31
|
-
var import_vue_demi = require("vue-demi");
|
|
32
|
-
var VUE_QUERY_CLIENT = "VUE_QUERY_CLIENT";
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let vue_demi = require("vue-demi");
|
|
3
|
+
//#region src/utils.ts
|
|
4
|
+
const VUE_QUERY_CLIENT = "VUE_QUERY_CLIENT";
|
|
33
5
|
function getClientKey(key) {
|
|
34
|
-
|
|
35
|
-
|
|
6
|
+
const suffix = key ? `:${key}` : "";
|
|
7
|
+
return `${VUE_QUERY_CLIENT}${suffix}`;
|
|
36
8
|
}
|
|
37
9
|
function updateState(state, update) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
10
|
+
Object.keys(state).forEach((key) => {
|
|
11
|
+
state[key] = update[key];
|
|
12
|
+
});
|
|
41
13
|
}
|
|
42
14
|
function _cloneDeep(value, customize, currentKey = "", currentLevel = 0) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
(val, index) => _cloneDeep(val, customize, String(index), currentLevel + 1)
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
if (typeof value === "object" && isPlainObject(value)) {
|
|
58
|
-
const entries = Object.entries(value).map(([key, val]) => [
|
|
59
|
-
key,
|
|
60
|
-
_cloneDeep(val, customize, key, currentLevel + 1)
|
|
61
|
-
]);
|
|
62
|
-
return Object.fromEntries(entries);
|
|
63
|
-
}
|
|
64
|
-
return value;
|
|
15
|
+
if (customize) {
|
|
16
|
+
const result = customize(value, currentKey, currentLevel);
|
|
17
|
+
if (result === void 0 && (0, vue_demi.isRef)(value)) return result;
|
|
18
|
+
if (result !== void 0) return result;
|
|
19
|
+
}
|
|
20
|
+
if (Array.isArray(value)) return value.map((val, index) => _cloneDeep(val, customize, String(index), currentLevel + 1));
|
|
21
|
+
if (typeof value === "object" && isPlainObject(value)) {
|
|
22
|
+
const entries = Object.entries(value).map(([key, val]) => [key, _cloneDeep(val, customize, key, currentLevel + 1)]);
|
|
23
|
+
return Object.fromEntries(entries);
|
|
24
|
+
}
|
|
25
|
+
return value;
|
|
65
26
|
}
|
|
66
27
|
function cloneDeep(value, customize) {
|
|
67
|
-
|
|
28
|
+
return _cloneDeep(value, customize);
|
|
68
29
|
}
|
|
69
30
|
function cloneDeepUnref(obj, unrefGetters = false) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
return cloneDeepUnref(val(), unrefGetters);
|
|
76
|
-
}
|
|
77
|
-
if ((0, import_vue_demi.isRef)(val)) {
|
|
78
|
-
return cloneDeepUnref((0, import_vue_demi.unref)(val), unrefGetters);
|
|
79
|
-
}
|
|
80
|
-
return void 0;
|
|
81
|
-
});
|
|
31
|
+
return cloneDeep(obj, (val, key, level) => {
|
|
32
|
+
if (level === 1 && key === "queryKey") return cloneDeepUnref(val, true);
|
|
33
|
+
if (unrefGetters && isFunction(val)) return cloneDeepUnref(val(), unrefGetters);
|
|
34
|
+
if ((0, vue_demi.isRef)(val)) return cloneDeepUnref((0, vue_demi.unref)(val), unrefGetters);
|
|
35
|
+
});
|
|
82
36
|
}
|
|
83
37
|
function isPlainObject(value) {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
const prototype = Object.getPrototypeOf(value);
|
|
88
|
-
return prototype === null || prototype === Object.prototype;
|
|
38
|
+
if (Object.prototype.toString.call(value) !== "[object Object]") return false;
|
|
39
|
+
const prototype = Object.getPrototypeOf(value);
|
|
40
|
+
return prototype === null || prototype === Object.prototype;
|
|
89
41
|
}
|
|
90
42
|
function isFunction(value) {
|
|
91
|
-
|
|
43
|
+
return typeof value === "function";
|
|
92
44
|
}
|
|
93
45
|
function toValueDeep(source) {
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
});
|
|
46
|
+
return isFunction(source) ? source() : cloneDeepUnref(source);
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
exports.VUE_QUERY_CLIENT = VUE_QUERY_CLIENT;
|
|
50
|
+
exports.cloneDeep = cloneDeep;
|
|
51
|
+
exports.cloneDeepUnref = cloneDeepUnref;
|
|
52
|
+
exports.getClientKey = getClientKey;
|
|
53
|
+
exports.toValueDeep = toValueDeep;
|
|
54
|
+
exports.updateState = updateState;
|
|
55
|
+
|
|
105
56
|
//# sourceMappingURL=utils.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils.ts"],"sourcesContent":["import { isRef, unref } from 'vue-demi'\nimport type { MaybeRefDeep } from './types'\n\nexport const VUE_QUERY_CLIENT = 'VUE_QUERY_CLIENT'\n\nexport function getClientKey(key?: string) {\n const suffix = key ? `:${key}` : ''\n return `${VUE_QUERY_CLIENT}${suffix}`\n}\n\nexport function updateState(\n state: Record<string, any>,\n update: Record<string, any>,\n): void {\n Object.keys(state).forEach((key) => {\n state[key] = update[key]\n })\n}\n\n// Helper function for cloning deep objects where\n// the level and key is provided to the callback function.\nfunction _cloneDeep<T>(\n value: MaybeRefDeep<T>,\n customize?: (\n val: MaybeRefDeep<T>,\n key: string,\n level: number,\n ) => T | undefined,\n currentKey: string = '',\n currentLevel: number = 0,\n): T {\n if (customize) {\n const result = customize(value, currentKey, currentLevel)\n if (result === undefined && isRef(value)) {\n return result as T\n }\n if (result !== undefined) {\n return result\n }\n }\n\n if (Array.isArray(value)) {\n return value.map((val, index) =>\n _cloneDeep(val, customize, String(index), currentLevel + 1),\n ) as unknown as T\n }\n\n if (typeof value === 'object' && isPlainObject(value)) {\n const entries = Object.entries(value).map(([key, val]) => [\n key,\n _cloneDeep(val, customize, key, currentLevel + 1),\n ])\n return Object.fromEntries(entries)\n }\n\n return value as T\n}\n\nexport function cloneDeep<T>(\n value: MaybeRefDeep<T>,\n customize?: (\n val: MaybeRefDeep<T>,\n key: string,\n level: number,\n ) => T | undefined,\n): T {\n return _cloneDeep(value, customize)\n}\n\nexport function cloneDeepUnref<T>(\n obj: MaybeRefDeep<T>,\n unrefGetters = false,\n): T {\n return cloneDeep(obj, (val, key, level) => {\n // Check if we're at the top level and the key is 'queryKey'\n //\n // If so, take the recursive descent where we resolve\n // getters to values as well as refs.\n if (level === 1 && key === 'queryKey') {\n return cloneDeepUnref(val, true)\n }\n\n // Resolve getters to values if specified.\n if (unrefGetters && isFunction(val)) {\n // Cast due to older TS versions not allowing calling\n // on certain intersection types.\n return cloneDeepUnref((val as Function)(), unrefGetters)\n }\n\n // Unref refs and continue to recurse into the value.\n if (isRef(val)) {\n return cloneDeepUnref(unref(val), unrefGetters)\n }\n\n return undefined\n })\n}\n\n// eslint-disable-next-line @typescript-eslint/no-wrapper-object-types\nfunction isPlainObject(value: unknown): value is Object {\n if (Object.prototype.toString.call(value) !== '[object Object]') {\n return false\n }\n\n const prototype = Object.getPrototypeOf(value)\n return prototype === null || prototype === Object.prototype\n}\n\nfunction isFunction(value: unknown): value is Function {\n return typeof value === 'function'\n}\n\nexport function toValueDeep<T>(source: (() => T) | MaybeRefDeep<T>): T {\n return isFunction(source) ? source() : cloneDeepUnref(source)\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.cjs","names":["isRef","unref"],"sources":["../../src/utils.ts"],"sourcesContent":["import { isRef, unref } from 'vue-demi'\nimport type { MaybeRefDeep } from './types'\n\nexport const VUE_QUERY_CLIENT = 'VUE_QUERY_CLIENT'\n\nexport function getClientKey(key?: string) {\n const suffix = key ? `:${key}` : ''\n return `${VUE_QUERY_CLIENT}${suffix}`\n}\n\nexport function updateState(\n state: Record<string, any>,\n update: Record<string, any>,\n): void {\n Object.keys(state).forEach((key) => {\n state[key] = update[key]\n })\n}\n\n// Helper function for cloning deep objects where\n// the level and key is provided to the callback function.\nfunction _cloneDeep<T>(\n value: MaybeRefDeep<T>,\n customize?: (\n val: MaybeRefDeep<T>,\n key: string,\n level: number,\n ) => T | undefined,\n currentKey: string = '',\n currentLevel: number = 0,\n): T {\n if (customize) {\n const result = customize(value, currentKey, currentLevel)\n if (result === undefined && isRef(value)) {\n return result as T\n }\n if (result !== undefined) {\n return result\n }\n }\n\n if (Array.isArray(value)) {\n return value.map((val, index) =>\n _cloneDeep(val, customize, String(index), currentLevel + 1),\n ) as unknown as T\n }\n\n if (typeof value === 'object' && isPlainObject(value)) {\n const entries = Object.entries(value).map(([key, val]) => [\n key,\n _cloneDeep(val, customize, key, currentLevel + 1),\n ])\n return Object.fromEntries(entries)\n }\n\n return value as T\n}\n\nexport function cloneDeep<T>(\n value: MaybeRefDeep<T>,\n customize?: (\n val: MaybeRefDeep<T>,\n key: string,\n level: number,\n ) => T | undefined,\n): T {\n return _cloneDeep(value, customize)\n}\n\nexport function cloneDeepUnref<T>(\n obj: MaybeRefDeep<T>,\n unrefGetters = false,\n): T {\n return cloneDeep(obj, (val, key, level) => {\n // Check if we're at the top level and the key is 'queryKey'\n //\n // If so, take the recursive descent where we resolve\n // getters to values as well as refs.\n if (level === 1 && key === 'queryKey') {\n return cloneDeepUnref(val, true)\n }\n\n // Resolve getters to values if specified.\n if (unrefGetters && isFunction(val)) {\n // Cast due to older TS versions not allowing calling\n // on certain intersection types.\n return cloneDeepUnref((val as Function)(), unrefGetters)\n }\n\n // Unref refs and continue to recurse into the value.\n if (isRef(val)) {\n return cloneDeepUnref(unref(val), unrefGetters)\n }\n\n return undefined\n })\n}\n\n// eslint-disable-next-line @typescript-eslint/no-wrapper-object-types\nfunction isPlainObject(value: unknown): value is Object {\n if (Object.prototype.toString.call(value) !== '[object Object]') {\n return false\n }\n\n const prototype = Object.getPrototypeOf(value)\n return prototype === null || prototype === Object.prototype\n}\n\nfunction isFunction(value: unknown): value is Function {\n return typeof value === 'function'\n}\n\nexport function toValueDeep<T>(source: (() => T) | MaybeRefDeep<T>): T {\n return isFunction(source) ? source() : cloneDeepUnref(source)\n}\n"],"mappings":";;;AAGA,MAAa,mBAAmB;AAEhC,SAAgB,aAAa,KAAc;CACzC,MAAM,SAAS,MAAM,IAAI,QAAQ;CACjC,OAAO,GAAG,mBAAmB;AAC/B;AAEA,SAAgB,YACd,OACA,QACM;CACN,OAAO,KAAK,KAAK,CAAC,CAAC,SAAS,QAAQ;EAClC,MAAM,OAAO,OAAO;CACtB,CAAC;AACH;AAIA,SAAS,WACP,OACA,WAKA,aAAqB,IACrB,eAAuB,GACpB;CACH,IAAI,WAAW;EACb,MAAM,SAAS,UAAU,OAAO,YAAY,YAAY;EACxD,IAAI,WAAW,KAAA,MAAA,GAAaA,SAAAA,MAAAA,CAAM,KAAK,GACrC,OAAO;EAET,IAAI,WAAW,KAAA,GACb,OAAO;CAEX;CAEA,IAAI,MAAM,QAAQ,KAAK,GACrB,OAAO,MAAM,KAAK,KAAK,UACrB,WAAW,KAAK,WAAW,OAAO,KAAK,GAAG,eAAe,CAAC,CAC5D;CAGF,IAAI,OAAO,UAAU,YAAY,cAAc,KAAK,GAAG;EACrD,MAAM,UAAU,OAAO,QAAQ,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,SAAS,CACxD,KACA,WAAW,KAAK,WAAW,KAAK,eAAe,CAAC,CAClD,CAAC;EACD,OAAO,OAAO,YAAY,OAAO;CACnC;CAEA,OAAO;AACT;AAEA,SAAgB,UACd,OACA,WAKG;CACH,OAAO,WAAW,OAAO,SAAS;AACpC;AAEA,SAAgB,eACd,KACA,eAAe,OACZ;CACH,OAAO,UAAU,MAAM,KAAK,KAAK,UAAU;EAKzC,IAAI,UAAU,KAAK,QAAQ,YACzB,OAAO,eAAe,KAAK,IAAI;EAIjC,IAAI,gBAAgB,WAAW,GAAG,GAGhC,OAAO,eAAgB,IAAiB,GAAG,YAAY;EAIzD,KAAA,GAAIA,SAAAA,MAAAA,CAAM,GAAG,GACX,OAAO,gBAAA,GAAeC,SAAAA,MAAAA,CAAM,GAAG,GAAG,YAAY;CAIlD,CAAC;AACH;AAGA,SAAS,cAAc,OAAiC;CACtD,IAAI,OAAO,UAAU,SAAS,KAAK,KAAK,MAAM,mBAC5C,OAAO;CAGT,MAAM,YAAY,OAAO,eAAe,KAAK;CAC7C,OAAO,cAAc,QAAQ,cAAc,OAAO;AACpD;AAEA,SAAS,WAAW,OAAmC;CACrD,OAAO,OAAO,UAAU;AAC1B;AAEA,SAAgB,YAAe,QAAwC;CACrE,OAAO,WAAW,MAAM,IAAI,OAAO,IAAI,eAAe,MAAM;AAC9D"}
|
package/build/legacy/utils.d.cts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { o as MaybeRefDeep } from "./types-BzZi3_rS.cjs";
|
|
2
|
+
//#region src/utils.d.ts
|
|
3
|
+
declare const VUE_QUERY_CLIENT = "VUE_QUERY_CLIENT";
|
|
4
|
+
declare function getClientKey(key?: string): string;
|
|
5
|
+
declare function updateState(state: Record<string, any>, update: Record<string, any>): void;
|
|
6
|
+
declare function cloneDeep<T>(value: MaybeRefDeep<T>, customize?: (val: MaybeRefDeep<T>, key: string, level: number) => T | undefined): T;
|
|
7
|
+
declare function cloneDeepUnref<T>(obj: MaybeRefDeep<T>, unrefGetters?: boolean): T;
|
|
8
|
+
declare function toValueDeep<T>(source: (() => T) | MaybeRefDeep<T>): T;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { VUE_QUERY_CLIENT, cloneDeep, cloneDeepUnref, getClientKey, toValueDeep, updateState };
|
|
11
|
+
//# sourceMappingURL=utils.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.cts","names":[],"sources":["../../src/utils.ts"],"mappings":";;cAGa;iBAEG,aAAa;iBAKb,YACd,OAAO,qBACP,QAAQ;iBA8CM,UAAU,GACxB,OAAO,aAAa,IACpB,aACE,KAAK,aAAa,IAClB,aACA,kBACG,gBACJ;iBAIa,eAAe,GAC7B,KAAK,aAAa,IAClB,yBACC;iBAwCa,YAAY,GAAG,eAAe,KAAK,aAAa,KAAK"}
|
package/build/legacy/utils.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { o as MaybeRefDeep } from "./types-BzZi3_rS.js";
|
|
2
|
+
//#region src/utils.d.ts
|
|
3
|
+
declare const VUE_QUERY_CLIENT = "VUE_QUERY_CLIENT";
|
|
4
|
+
declare function getClientKey(key?: string): string;
|
|
5
|
+
declare function updateState(state: Record<string, any>, update: Record<string, any>): void;
|
|
6
|
+
declare function cloneDeep<T>(value: MaybeRefDeep<T>, customize?: (val: MaybeRefDeep<T>, key: string, level: number) => T | undefined): T;
|
|
7
|
+
declare function cloneDeepUnref<T>(obj: MaybeRefDeep<T>, unrefGetters?: boolean): T;
|
|
8
|
+
declare function toValueDeep<T>(source: (() => T) | MaybeRefDeep<T>): T;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { VUE_QUERY_CLIENT, cloneDeep, cloneDeepUnref, getClientKey, toValueDeep, updateState };
|
|
11
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","names":[],"sources":["../../src/utils.ts"],"mappings":";;cAGa;iBAEG,aAAa;iBAKb,YACd,OAAO,qBACP,QAAQ;iBA8CM,UAAU,GACxB,OAAO,aAAa,IACpB,aACE,KAAK,aAAa,IAClB,aACA,kBACG,gBACJ;iBAIa,eAAe,GAC7B,KAAK,aAAa,IAClB,yBACC;iBAwCa,YAAY,GAAG,eAAe,KAAK,aAAa,KAAK"}
|
package/build/legacy/utils.js
CHANGED
|
@@ -1,75 +1,50 @@
|
|
|
1
|
-
// src/utils.ts
|
|
2
1
|
import { isRef, unref } from "vue-demi";
|
|
3
|
-
|
|
2
|
+
//#region src/utils.ts
|
|
3
|
+
const VUE_QUERY_CLIENT = "VUE_QUERY_CLIENT";
|
|
4
4
|
function getClientKey(key) {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
const suffix = key ? `:${key}` : "";
|
|
6
|
+
return `${VUE_QUERY_CLIENT}${suffix}`;
|
|
7
7
|
}
|
|
8
8
|
function updateState(state, update) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
Object.keys(state).forEach((key) => {
|
|
10
|
+
state[key] = update[key];
|
|
11
|
+
});
|
|
12
12
|
}
|
|
13
13
|
function _cloneDeep(value, customize, currentKey = "", currentLevel = 0) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
(val, index) => _cloneDeep(val, customize, String(index), currentLevel + 1)
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
if (typeof value === "object" && isPlainObject(value)) {
|
|
29
|
-
const entries = Object.entries(value).map(([key, val]) => [
|
|
30
|
-
key,
|
|
31
|
-
_cloneDeep(val, customize, key, currentLevel + 1)
|
|
32
|
-
]);
|
|
33
|
-
return Object.fromEntries(entries);
|
|
34
|
-
}
|
|
35
|
-
return value;
|
|
14
|
+
if (customize) {
|
|
15
|
+
const result = customize(value, currentKey, currentLevel);
|
|
16
|
+
if (result === void 0 && isRef(value)) return result;
|
|
17
|
+
if (result !== void 0) return result;
|
|
18
|
+
}
|
|
19
|
+
if (Array.isArray(value)) return value.map((val, index) => _cloneDeep(val, customize, String(index), currentLevel + 1));
|
|
20
|
+
if (typeof value === "object" && isPlainObject(value)) {
|
|
21
|
+
const entries = Object.entries(value).map(([key, val]) => [key, _cloneDeep(val, customize, key, currentLevel + 1)]);
|
|
22
|
+
return Object.fromEntries(entries);
|
|
23
|
+
}
|
|
24
|
+
return value;
|
|
36
25
|
}
|
|
37
26
|
function cloneDeep(value, customize) {
|
|
38
|
-
|
|
27
|
+
return _cloneDeep(value, customize);
|
|
39
28
|
}
|
|
40
29
|
function cloneDeepUnref(obj, unrefGetters = false) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
return cloneDeepUnref(val(), unrefGetters);
|
|
47
|
-
}
|
|
48
|
-
if (isRef(val)) {
|
|
49
|
-
return cloneDeepUnref(unref(val), unrefGetters);
|
|
50
|
-
}
|
|
51
|
-
return void 0;
|
|
52
|
-
});
|
|
30
|
+
return cloneDeep(obj, (val, key, level) => {
|
|
31
|
+
if (level === 1 && key === "queryKey") return cloneDeepUnref(val, true);
|
|
32
|
+
if (unrefGetters && isFunction(val)) return cloneDeepUnref(val(), unrefGetters);
|
|
33
|
+
if (isRef(val)) return cloneDeepUnref(unref(val), unrefGetters);
|
|
34
|
+
});
|
|
53
35
|
}
|
|
54
36
|
function isPlainObject(value) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const prototype = Object.getPrototypeOf(value);
|
|
59
|
-
return prototype === null || prototype === Object.prototype;
|
|
37
|
+
if (Object.prototype.toString.call(value) !== "[object Object]") return false;
|
|
38
|
+
const prototype = Object.getPrototypeOf(value);
|
|
39
|
+
return prototype === null || prototype === Object.prototype;
|
|
60
40
|
}
|
|
61
41
|
function isFunction(value) {
|
|
62
|
-
|
|
42
|
+
return typeof value === "function";
|
|
63
43
|
}
|
|
64
44
|
function toValueDeep(source) {
|
|
65
|
-
|
|
45
|
+
return isFunction(source) ? source() : cloneDeepUnref(source);
|
|
66
46
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
cloneDeepUnref,
|
|
71
|
-
getClientKey,
|
|
72
|
-
toValueDeep,
|
|
73
|
-
updateState
|
|
74
|
-
};
|
|
47
|
+
//#endregion
|
|
48
|
+
export { VUE_QUERY_CLIENT, cloneDeep, cloneDeepUnref, getClientKey, toValueDeep, updateState };
|
|
49
|
+
|
|
75
50
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils.ts"],"sourcesContent":["import { isRef, unref } from 'vue-demi'\nimport type { MaybeRefDeep } from './types'\n\nexport const VUE_QUERY_CLIENT = 'VUE_QUERY_CLIENT'\n\nexport function getClientKey(key?: string) {\n const suffix = key ? `:${key}` : ''\n return `${VUE_QUERY_CLIENT}${suffix}`\n}\n\nexport function updateState(\n state: Record<string, any>,\n update: Record<string, any>,\n): void {\n Object.keys(state).forEach((key) => {\n state[key] = update[key]\n })\n}\n\n// Helper function for cloning deep objects where\n// the level and key is provided to the callback function.\nfunction _cloneDeep<T>(\n value: MaybeRefDeep<T>,\n customize?: (\n val: MaybeRefDeep<T>,\n key: string,\n level: number,\n ) => T | undefined,\n currentKey: string = '',\n currentLevel: number = 0,\n): T {\n if (customize) {\n const result = customize(value, currentKey, currentLevel)\n if (result === undefined && isRef(value)) {\n return result as T\n }\n if (result !== undefined) {\n return result\n }\n }\n\n if (Array.isArray(value)) {\n return value.map((val, index) =>\n _cloneDeep(val, customize, String(index), currentLevel + 1),\n ) as unknown as T\n }\n\n if (typeof value === 'object' && isPlainObject(value)) {\n const entries = Object.entries(value).map(([key, val]) => [\n key,\n _cloneDeep(val, customize, key, currentLevel + 1),\n ])\n return Object.fromEntries(entries)\n }\n\n return value as T\n}\n\nexport function cloneDeep<T>(\n value: MaybeRefDeep<T>,\n customize?: (\n val: MaybeRefDeep<T>,\n key: string,\n level: number,\n ) => T | undefined,\n): T {\n return _cloneDeep(value, customize)\n}\n\nexport function cloneDeepUnref<T>(\n obj: MaybeRefDeep<T>,\n unrefGetters = false,\n): T {\n return cloneDeep(obj, (val, key, level) => {\n // Check if we're at the top level and the key is 'queryKey'\n //\n // If so, take the recursive descent where we resolve\n // getters to values as well as refs.\n if (level === 1 && key === 'queryKey') {\n return cloneDeepUnref(val, true)\n }\n\n // Resolve getters to values if specified.\n if (unrefGetters && isFunction(val)) {\n // Cast due to older TS versions not allowing calling\n // on certain intersection types.\n return cloneDeepUnref((val as Function)(), unrefGetters)\n }\n\n // Unref refs and continue to recurse into the value.\n if (isRef(val)) {\n return cloneDeepUnref(unref(val), unrefGetters)\n }\n\n return undefined\n })\n}\n\n// eslint-disable-next-line @typescript-eslint/no-wrapper-object-types\nfunction isPlainObject(value: unknown): value is Object {\n if (Object.prototype.toString.call(value) !== '[object Object]') {\n return false\n }\n\n const prototype = Object.getPrototypeOf(value)\n return prototype === null || prototype === Object.prototype\n}\n\nfunction isFunction(value: unknown): value is Function {\n return typeof value === 'function'\n}\n\nexport function toValueDeep<T>(source: (() => T) | MaybeRefDeep<T>): T {\n return isFunction(source) ? source() : cloneDeepUnref(source)\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","names":[],"sources":["../../src/utils.ts"],"sourcesContent":["import { isRef, unref } from 'vue-demi'\nimport type { MaybeRefDeep } from './types'\n\nexport const VUE_QUERY_CLIENT = 'VUE_QUERY_CLIENT'\n\nexport function getClientKey(key?: string) {\n const suffix = key ? `:${key}` : ''\n return `${VUE_QUERY_CLIENT}${suffix}`\n}\n\nexport function updateState(\n state: Record<string, any>,\n update: Record<string, any>,\n): void {\n Object.keys(state).forEach((key) => {\n state[key] = update[key]\n })\n}\n\n// Helper function for cloning deep objects where\n// the level and key is provided to the callback function.\nfunction _cloneDeep<T>(\n value: MaybeRefDeep<T>,\n customize?: (\n val: MaybeRefDeep<T>,\n key: string,\n level: number,\n ) => T | undefined,\n currentKey: string = '',\n currentLevel: number = 0,\n): T {\n if (customize) {\n const result = customize(value, currentKey, currentLevel)\n if (result === undefined && isRef(value)) {\n return result as T\n }\n if (result !== undefined) {\n return result\n }\n }\n\n if (Array.isArray(value)) {\n return value.map((val, index) =>\n _cloneDeep(val, customize, String(index), currentLevel + 1),\n ) as unknown as T\n }\n\n if (typeof value === 'object' && isPlainObject(value)) {\n const entries = Object.entries(value).map(([key, val]) => [\n key,\n _cloneDeep(val, customize, key, currentLevel + 1),\n ])\n return Object.fromEntries(entries)\n }\n\n return value as T\n}\n\nexport function cloneDeep<T>(\n value: MaybeRefDeep<T>,\n customize?: (\n val: MaybeRefDeep<T>,\n key: string,\n level: number,\n ) => T | undefined,\n): T {\n return _cloneDeep(value, customize)\n}\n\nexport function cloneDeepUnref<T>(\n obj: MaybeRefDeep<T>,\n unrefGetters = false,\n): T {\n return cloneDeep(obj, (val, key, level) => {\n // Check if we're at the top level and the key is 'queryKey'\n //\n // If so, take the recursive descent where we resolve\n // getters to values as well as refs.\n if (level === 1 && key === 'queryKey') {\n return cloneDeepUnref(val, true)\n }\n\n // Resolve getters to values if specified.\n if (unrefGetters && isFunction(val)) {\n // Cast due to older TS versions not allowing calling\n // on certain intersection types.\n return cloneDeepUnref((val as Function)(), unrefGetters)\n }\n\n // Unref refs and continue to recurse into the value.\n if (isRef(val)) {\n return cloneDeepUnref(unref(val), unrefGetters)\n }\n\n return undefined\n })\n}\n\n// eslint-disable-next-line @typescript-eslint/no-wrapper-object-types\nfunction isPlainObject(value: unknown): value is Object {\n if (Object.prototype.toString.call(value) !== '[object Object]') {\n return false\n }\n\n const prototype = Object.getPrototypeOf(value)\n return prototype === null || prototype === Object.prototype\n}\n\nfunction isFunction(value: unknown): value is Function {\n return typeof value === 'function'\n}\n\nexport function toValueDeep<T>(source: (() => T) | MaybeRefDeep<T>): T {\n return isFunction(source) ? source() : cloneDeepUnref(source)\n}\n"],"mappings":";;AAGA,MAAa,mBAAmB;AAEhC,SAAgB,aAAa,KAAc;CACzC,MAAM,SAAS,MAAM,IAAI,QAAQ;CACjC,OAAO,GAAG,mBAAmB;AAC/B;AAEA,SAAgB,YACd,OACA,QACM;CACN,OAAO,KAAK,KAAK,CAAC,CAAC,SAAS,QAAQ;EAClC,MAAM,OAAO,OAAO;CACtB,CAAC;AACH;AAIA,SAAS,WACP,OACA,WAKA,aAAqB,IACrB,eAAuB,GACpB;CACH,IAAI,WAAW;EACb,MAAM,SAAS,UAAU,OAAO,YAAY,YAAY;EACxD,IAAI,WAAW,KAAA,KAAa,MAAM,KAAK,GACrC,OAAO;EAET,IAAI,WAAW,KAAA,GACb,OAAO;CAEX;CAEA,IAAI,MAAM,QAAQ,KAAK,GACrB,OAAO,MAAM,KAAK,KAAK,UACrB,WAAW,KAAK,WAAW,OAAO,KAAK,GAAG,eAAe,CAAC,CAC5D;CAGF,IAAI,OAAO,UAAU,YAAY,cAAc,KAAK,GAAG;EACrD,MAAM,UAAU,OAAO,QAAQ,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,SAAS,CACxD,KACA,WAAW,KAAK,WAAW,KAAK,eAAe,CAAC,CAClD,CAAC;EACD,OAAO,OAAO,YAAY,OAAO;CACnC;CAEA,OAAO;AACT;AAEA,SAAgB,UACd,OACA,WAKG;CACH,OAAO,WAAW,OAAO,SAAS;AACpC;AAEA,SAAgB,eACd,KACA,eAAe,OACZ;CACH,OAAO,UAAU,MAAM,KAAK,KAAK,UAAU;EAKzC,IAAI,UAAU,KAAK,QAAQ,YACzB,OAAO,eAAe,KAAK,IAAI;EAIjC,IAAI,gBAAgB,WAAW,GAAG,GAGhC,OAAO,eAAgB,IAAiB,GAAG,YAAY;EAIzD,IAAI,MAAM,GAAG,GACX,OAAO,eAAe,MAAM,GAAG,GAAG,YAAY;CAIlD,CAAC;AACH;AAGA,SAAS,cAAc,OAAiC;CACtD,IAAI,OAAO,UAAU,SAAS,KAAK,KAAK,MAAM,mBAC5C,OAAO;CAGT,MAAM,YAAY,OAAO,eAAe,KAAK;CAC7C,OAAO,cAAc,QAAQ,cAAc,OAAO;AACpD;AAEA,SAAS,WAAW,OAAmC;CACrD,OAAO,OAAO,UAAU;AAC1B;AAEA,SAAgB,YAAe,QAAwC;CACrE,OAAO,WAAW,MAAM,IAAI,OAAO,IAAI,eAAe,MAAM;AAC9D"}
|
|
@@ -1,105 +1,63 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
18
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_utils = require("./utils.cjs");
|
|
3
|
+
const require_queryClient = require("./queryClient.cjs");
|
|
4
|
+
const require_devtools_devtools = require("./devtools/devtools.cjs");
|
|
5
|
+
let _tanstack_query_core = require("@tanstack/query-core");
|
|
6
|
+
let vue_demi = require("vue-demi");
|
|
7
|
+
//#region src/vueQueryPlugin.ts
|
|
8
|
+
const VueQueryPlugin = { install: (app, options = {}) => {
|
|
9
|
+
const clientKey = require_utils.getClientKey(options.queryClientKey);
|
|
10
|
+
let client;
|
|
11
|
+
if ("queryClient" in options && options.queryClient) client = options.queryClient;
|
|
12
|
+
else {
|
|
13
|
+
const clientConfig = "queryClientConfig" in options ? options.queryClientConfig : void 0;
|
|
14
|
+
client = new require_queryClient.QueryClient(clientConfig);
|
|
15
|
+
}
|
|
16
|
+
if (!_tanstack_query_core.environmentManager.isServer()) client.mount();
|
|
17
|
+
let persisterUnmount = () => {};
|
|
18
|
+
if (options.clientPersister) {
|
|
19
|
+
if (client.isRestoring) client.isRestoring.value = true;
|
|
20
|
+
const [unmount, promise] = options.clientPersister(client);
|
|
21
|
+
persisterUnmount = unmount;
|
|
22
|
+
promise.then(() => {
|
|
23
|
+
var _options$clientPersis;
|
|
24
|
+
if (client.isRestoring) client.isRestoring.value = false;
|
|
25
|
+
(_options$clientPersis = options.clientPersisterOnSuccess) === null || _options$clientPersis === void 0 || _options$clientPersis.call(options, client);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
const cleanup = () => {
|
|
29
|
+
client.unmount();
|
|
30
|
+
persisterUnmount();
|
|
31
|
+
};
|
|
32
|
+
if (app.onUnmount) app.onUnmount(cleanup);
|
|
33
|
+
else {
|
|
34
|
+
const originalUnmount = app.unmount;
|
|
35
|
+
app.unmount = function vueQueryUnmount() {
|
|
36
|
+
cleanup();
|
|
37
|
+
originalUnmount();
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
if (vue_demi.isVue2) app.mixin({ beforeCreate() {
|
|
41
|
+
if (!this._provided) {
|
|
42
|
+
const provideCache = {};
|
|
43
|
+
Object.defineProperty(this, "_provided", {
|
|
44
|
+
get: () => provideCache,
|
|
45
|
+
set: (v) => Object.assign(provideCache, v)
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
this._provided[clientKey] = client;
|
|
49
|
+
if (process.env.NODE_ENV === "development") {
|
|
50
|
+
if (this === this.$root && options.enableDevtoolsV6Plugin) require_devtools_devtools.setupDevtools(this, client);
|
|
51
|
+
}
|
|
52
|
+
} });
|
|
53
|
+
else {
|
|
54
|
+
app.provide(clientKey, client);
|
|
55
|
+
if (process.env.NODE_ENV === "development") {
|
|
56
|
+
if (options.enableDevtoolsV6Plugin) require_devtools_devtools.setupDevtools(app, client);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
} };
|
|
60
|
+
//#endregion
|
|
61
|
+
exports.VueQueryPlugin = VueQueryPlugin;
|
|
19
62
|
|
|
20
|
-
// src/vueQueryPlugin.ts
|
|
21
|
-
var vueQueryPlugin_exports = {};
|
|
22
|
-
__export(vueQueryPlugin_exports, {
|
|
23
|
-
VueQueryPlugin: () => VueQueryPlugin
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(vueQueryPlugin_exports);
|
|
26
|
-
var import_vue_demi = require("vue-demi");
|
|
27
|
-
var import_query_core = require("@tanstack/query-core");
|
|
28
|
-
var import_queryClient = require("./queryClient.cjs");
|
|
29
|
-
var import_utils = require("./utils.cjs");
|
|
30
|
-
var import_devtools = require("./devtools/devtools.cjs");
|
|
31
|
-
var VueQueryPlugin = {
|
|
32
|
-
install: (app, options = {}) => {
|
|
33
|
-
const clientKey = (0, import_utils.getClientKey)(options.queryClientKey);
|
|
34
|
-
let client;
|
|
35
|
-
if ("queryClient" in options && options.queryClient) {
|
|
36
|
-
client = options.queryClient;
|
|
37
|
-
} else {
|
|
38
|
-
const clientConfig = "queryClientConfig" in options ? options.queryClientConfig : void 0;
|
|
39
|
-
client = new import_queryClient.QueryClient(clientConfig);
|
|
40
|
-
}
|
|
41
|
-
if (!import_query_core.environmentManager.isServer()) {
|
|
42
|
-
client.mount();
|
|
43
|
-
}
|
|
44
|
-
let persisterUnmount = () => {
|
|
45
|
-
};
|
|
46
|
-
if (options.clientPersister) {
|
|
47
|
-
if (client.isRestoring) {
|
|
48
|
-
client.isRestoring.value = true;
|
|
49
|
-
}
|
|
50
|
-
const [unmount, promise] = options.clientPersister(client);
|
|
51
|
-
persisterUnmount = unmount;
|
|
52
|
-
promise.then(() => {
|
|
53
|
-
var _a;
|
|
54
|
-
if (client.isRestoring) {
|
|
55
|
-
client.isRestoring.value = false;
|
|
56
|
-
}
|
|
57
|
-
(_a = options.clientPersisterOnSuccess) == null ? void 0 : _a.call(options, client);
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
const cleanup = () => {
|
|
61
|
-
client.unmount();
|
|
62
|
-
persisterUnmount();
|
|
63
|
-
};
|
|
64
|
-
if (app.onUnmount) {
|
|
65
|
-
app.onUnmount(cleanup);
|
|
66
|
-
} else {
|
|
67
|
-
const originalUnmount = app.unmount;
|
|
68
|
-
app.unmount = function vueQueryUnmount() {
|
|
69
|
-
cleanup();
|
|
70
|
-
originalUnmount();
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
if (import_vue_demi.isVue2) {
|
|
74
|
-
app.mixin({
|
|
75
|
-
beforeCreate() {
|
|
76
|
-
if (!this._provided) {
|
|
77
|
-
const provideCache = {};
|
|
78
|
-
Object.defineProperty(this, "_provided", {
|
|
79
|
-
get: () => provideCache,
|
|
80
|
-
set: (v) => Object.assign(provideCache, v)
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
this._provided[clientKey] = client;
|
|
84
|
-
if (process.env.NODE_ENV === "development") {
|
|
85
|
-
if (this === this.$root && options.enableDevtoolsV6Plugin) {
|
|
86
|
-
(0, import_devtools.setupDevtools)(this, client);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
} else {
|
|
92
|
-
app.provide(clientKey, client);
|
|
93
|
-
if (process.env.NODE_ENV === "development") {
|
|
94
|
-
if (options.enableDevtoolsV6Plugin) {
|
|
95
|
-
(0, import_devtools.setupDevtools)(app, client);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
102
|
-
0 && (module.exports = {
|
|
103
|
-
VueQueryPlugin
|
|
104
|
-
});
|
|
105
63
|
//# sourceMappingURL=vueQueryPlugin.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/vueQueryPlugin.ts"],"sourcesContent":["import { isVue2 } from 'vue-demi'\nimport { environmentManager } from '@tanstack/query-core'\n\nimport { QueryClient } from './queryClient'\nimport { getClientKey } from './utils'\nimport { setupDevtools } from './devtools/devtools'\nimport type { QueryClientConfig } from './types'\n\ntype ClientPersister = (client: QueryClient) => [() => void, Promise<void>]\n\ninterface CommonOptions {\n enableDevtoolsV6Plugin?: boolean\n queryClientKey?: string\n clientPersister?: ClientPersister\n clientPersisterOnSuccess?: (client: QueryClient) => void\n}\n\ninterface ConfigOptions extends CommonOptions {\n queryClientConfig?: QueryClientConfig\n}\n\ninterface ClientOptions extends CommonOptions {\n queryClient?: QueryClient\n}\n\nexport type VueQueryPluginOptions = ConfigOptions | ClientOptions\n\nexport const VueQueryPlugin = {\n install: (app: any, options: VueQueryPluginOptions = {}) => {\n const clientKey = getClientKey(options.queryClientKey)\n let client: QueryClient\n\n if ('queryClient' in options && options.queryClient) {\n client = options.queryClient\n } else {\n const clientConfig =\n 'queryClientConfig' in options ? options.queryClientConfig : undefined\n client = new QueryClient(clientConfig)\n }\n\n if (!environmentManager.isServer()) {\n client.mount()\n }\n\n let persisterUnmount = () => {\n // noop\n }\n\n if (options.clientPersister) {\n if (client.isRestoring) {\n client.isRestoring.value = true\n }\n const [unmount, promise] = options.clientPersister(client)\n persisterUnmount = unmount\n promise.then(() => {\n if (client.isRestoring) {\n client.isRestoring.value = false\n }\n options.clientPersisterOnSuccess?.(client)\n })\n }\n\n const cleanup = () => {\n client.unmount()\n persisterUnmount()\n }\n\n if (app.onUnmount) {\n app.onUnmount(cleanup)\n } else {\n const originalUnmount = app.unmount\n app.unmount = function vueQueryUnmount() {\n cleanup()\n originalUnmount()\n }\n }\n\n if (isVue2) {\n app.mixin({\n beforeCreate() {\n // HACK: taken from provide(): https://github.com/vuejs/composition-api/blob/master/src/apis/inject.ts#L30\n if (!this._provided) {\n const provideCache = {}\n Object.defineProperty(this, '_provided', {\n get: () => provideCache,\n set: (v) => Object.assign(provideCache, v),\n })\n }\n\n this._provided[clientKey] = client\n\n if (process.env.NODE_ENV === 'development') {\n if (this === this.$root && options.enableDevtoolsV6Plugin) {\n setupDevtools(this, client)\n }\n }\n },\n })\n } else {\n app.provide(clientKey, client)\n\n if (process.env.NODE_ENV === 'development') {\n if (options.enableDevtoolsV6Plugin) {\n setupDevtools(app, client)\n }\n }\n }\n },\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"vueQueryPlugin.cjs","names":["getClientKey","QueryClient","environmentManager","isVue2"],"sources":["../../src/vueQueryPlugin.ts"],"sourcesContent":["import { isVue2 } from 'vue-demi'\nimport { environmentManager } from '@tanstack/query-core'\n\nimport { QueryClient } from './queryClient'\nimport { getClientKey } from './utils'\nimport { setupDevtools } from './devtools/devtools'\nimport type { QueryClientConfig } from './types'\n\ntype ClientPersister = (client: QueryClient) => [() => void, Promise<void>]\n\ninterface CommonOptions {\n enableDevtoolsV6Plugin?: boolean\n queryClientKey?: string\n clientPersister?: ClientPersister\n clientPersisterOnSuccess?: (client: QueryClient) => void\n}\n\ninterface ConfigOptions extends CommonOptions {\n queryClientConfig?: QueryClientConfig\n}\n\ninterface ClientOptions extends CommonOptions {\n queryClient?: QueryClient\n}\n\nexport type VueQueryPluginOptions = ConfigOptions | ClientOptions\n\nexport const VueQueryPlugin = {\n install: (app: any, options: VueQueryPluginOptions = {}) => {\n const clientKey = getClientKey(options.queryClientKey)\n let client: QueryClient\n\n if ('queryClient' in options && options.queryClient) {\n client = options.queryClient\n } else {\n const clientConfig =\n 'queryClientConfig' in options ? options.queryClientConfig : undefined\n client = new QueryClient(clientConfig)\n }\n\n if (!environmentManager.isServer()) {\n client.mount()\n }\n\n let persisterUnmount = () => {\n // noop\n }\n\n if (options.clientPersister) {\n if (client.isRestoring) {\n client.isRestoring.value = true\n }\n const [unmount, promise] = options.clientPersister(client)\n persisterUnmount = unmount\n promise.then(() => {\n if (client.isRestoring) {\n client.isRestoring.value = false\n }\n options.clientPersisterOnSuccess?.(client)\n })\n }\n\n const cleanup = () => {\n client.unmount()\n persisterUnmount()\n }\n\n if (app.onUnmount) {\n app.onUnmount(cleanup)\n } else {\n const originalUnmount = app.unmount\n app.unmount = function vueQueryUnmount() {\n cleanup()\n originalUnmount()\n }\n }\n\n if (isVue2) {\n app.mixin({\n beforeCreate() {\n // HACK: taken from provide(): https://github.com/vuejs/composition-api/blob/master/src/apis/inject.ts#L30\n if (!this._provided) {\n const provideCache = {}\n Object.defineProperty(this, '_provided', {\n get: () => provideCache,\n set: (v) => Object.assign(provideCache, v),\n })\n }\n\n this._provided[clientKey] = client\n\n if (process.env.NODE_ENV === 'development') {\n if (this === this.$root && options.enableDevtoolsV6Plugin) {\n setupDevtools(this, client)\n }\n }\n },\n })\n } else {\n app.provide(clientKey, client)\n\n if (process.env.NODE_ENV === 'development') {\n if (options.enableDevtoolsV6Plugin) {\n setupDevtools(app, client)\n }\n }\n }\n },\n}\n"],"mappings":";;;;;;;AA2BA,MAAa,iBAAiB,EAC5B,UAAU,KAAU,UAAiC,CAAC,MAAM;CAC1D,MAAM,YAAYA,cAAAA,aAAa,QAAQ,cAAc;CACrD,IAAI;CAEJ,IAAI,iBAAiB,WAAW,QAAQ,aACtC,SAAS,QAAQ;MACZ;EACL,MAAM,eACJ,uBAAuB,UAAU,QAAQ,oBAAoB,KAAA;EAC/D,SAAS,IAAIC,oBAAAA,YAAY,YAAY;CACvC;CAEA,IAAI,CAACC,qBAAAA,mBAAmB,SAAS,GAC/B,OAAO,MAAM;CAGf,IAAI,yBAAyB,CAE7B;CAEA,IAAI,QAAQ,iBAAiB;EAC3B,IAAI,OAAO,aACT,OAAO,YAAY,QAAQ;EAE7B,MAAM,CAAC,SAAS,WAAW,QAAQ,gBAAgB,MAAM;EACzD,mBAAmB;EACnB,QAAQ,WAAW;;GACjB,IAAI,OAAO,aACT,OAAO,YAAY,QAAQ;GAE7B,CAAA,wBAAA,QAAQ,8BAAA,QAAA,0BAAA,KAAA,KAAA,sBAAA,KAAA,SAA2B,MAAM;EAC3C,CAAC;CACH;CAEA,MAAM,gBAAgB;EACpB,OAAO,QAAQ;EACf,iBAAiB;CACnB;CAEA,IAAI,IAAI,WACN,IAAI,UAAU,OAAO;MAChB;EACL,MAAM,kBAAkB,IAAI;EAC5B,IAAI,UAAU,SAAS,kBAAkB;GACvC,QAAQ;GACR,gBAAgB;EAClB;CACF;CAEA,IAAIC,SAAAA,QACF,IAAI,MAAM,EACR,eAAe;EAEb,IAAI,CAAC,KAAK,WAAW;GACnB,MAAM,eAAe,CAAC;GACtB,OAAO,eAAe,MAAM,aAAa;IACvC,WAAW;IACX,MAAM,MAAM,OAAO,OAAO,cAAc,CAAC;GAC3C,CAAC;EACH;EAEA,KAAK,UAAU,aAAa;EAE5B,IAAI,QAAQ,IAAI,aAAa,eACvB;OAAA,SAAS,KAAK,SAAS,QAAQ,wBACjC,0BAAA,cAAc,MAAM,MAAM;EAAA;CAGhC,EACF,CAAC;MACI;EACL,IAAI,QAAQ,WAAW,MAAM;EAE7B,IAAI,QAAQ,IAAI,aAAa,eACvB;OAAA,QAAQ,wBACV,0BAAA,cAAc,KAAK,MAAM;EAAA;CAG/B;AACF,EACF"}
|
|
@@ -1,2 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { t as QueryClient } from "./queryClient-C07d0chJ.cjs";
|
|
2
|
+
import { u as QueryClientConfig } from "./types-BzZi3_rS.cjs";
|
|
3
|
+
//#region src/vueQueryPlugin.d.ts
|
|
4
|
+
type ClientPersister = (client: QueryClient) => [() => void, Promise<void>];
|
|
5
|
+
interface CommonOptions {
|
|
6
|
+
enableDevtoolsV6Plugin?: boolean;
|
|
7
|
+
queryClientKey?: string;
|
|
8
|
+
clientPersister?: ClientPersister;
|
|
9
|
+
clientPersisterOnSuccess?: (client: QueryClient) => void;
|
|
10
|
+
}
|
|
11
|
+
interface ConfigOptions extends CommonOptions {
|
|
12
|
+
queryClientConfig?: QueryClientConfig;
|
|
13
|
+
}
|
|
14
|
+
interface ClientOptions extends CommonOptions {
|
|
15
|
+
queryClient?: QueryClient;
|
|
16
|
+
}
|
|
17
|
+
type VueQueryPluginOptions = ConfigOptions | ClientOptions;
|
|
18
|
+
declare const VueQueryPlugin: {
|
|
19
|
+
install: (app: any, options?: VueQueryPluginOptions) => void;
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { VueQueryPlugin, VueQueryPluginOptions };
|
|
23
|
+
//# sourceMappingURL=vueQueryPlugin.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vueQueryPlugin.d.cts","names":[],"sources":["../../src/vueQueryPlugin.ts"],"mappings":";;;KAQK,mBAAmB,QAAQ,6BAA6B;UAEnD;EACR;EACA;EACA,kBAAkB;EAClB,4BAA4B,QAAQ;;UAG5B,sBAAsB;EAC9B,oBAAoB;;UAGZ,sBAAsB;EAC9B,cAAc;;KAGJ,wBAAwB,gBAAgB;cAEvC;EACI,UAAA,UAAG,UAAW"}
|
|
@@ -1,2 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { t as QueryClient } from "./queryClient-hf6i_vCa.js";
|
|
2
|
+
import { u as QueryClientConfig } from "./types-BzZi3_rS.js";
|
|
3
|
+
//#region src/vueQueryPlugin.d.ts
|
|
4
|
+
type ClientPersister = (client: QueryClient) => [() => void, Promise<void>];
|
|
5
|
+
interface CommonOptions {
|
|
6
|
+
enableDevtoolsV6Plugin?: boolean;
|
|
7
|
+
queryClientKey?: string;
|
|
8
|
+
clientPersister?: ClientPersister;
|
|
9
|
+
clientPersisterOnSuccess?: (client: QueryClient) => void;
|
|
10
|
+
}
|
|
11
|
+
interface ConfigOptions extends CommonOptions {
|
|
12
|
+
queryClientConfig?: QueryClientConfig;
|
|
13
|
+
}
|
|
14
|
+
interface ClientOptions extends CommonOptions {
|
|
15
|
+
queryClient?: QueryClient;
|
|
16
|
+
}
|
|
17
|
+
type VueQueryPluginOptions = ConfigOptions | ClientOptions;
|
|
18
|
+
declare const VueQueryPlugin: {
|
|
19
|
+
install: (app: any, options?: VueQueryPluginOptions) => void;
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { VueQueryPlugin, VueQueryPluginOptions };
|
|
23
|
+
//# sourceMappingURL=vueQueryPlugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vueQueryPlugin.d.ts","names":[],"sources":["../../src/vueQueryPlugin.ts"],"mappings":";;;KAQK,mBAAmB,QAAQ,6BAA6B;UAEnD;EACR;EACA;EACA,kBAAkB;EAClB,4BAA4B,QAAQ;;UAG5B,sBAAsB;EAC9B,oBAAoB;;UAGZ,sBAAsB;EAC9B,cAAc;;KAGJ,wBAAwB,gBAAgB;cAEvC;EACI,UAAA,UAAG,UAAW"}
|