@tanstack/vue-query 5.104.1 → 5.104.3

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.
Files changed (343) hide show
  1. package/build/legacy/devtools/devtools.cjs +6 -0
  2. package/build/legacy/devtools/devtools.cjs.map +1 -1
  3. package/build/legacy/devtools/devtools.d.cts +7 -1
  4. package/build/legacy/devtools/devtools.d.cts.map +1 -1
  5. package/build/legacy/devtools/devtools.d.ts +7 -1
  6. package/build/legacy/devtools/devtools.d.ts.map +1 -1
  7. package/build/legacy/devtools/devtools.js +6 -0
  8. package/build/legacy/devtools/devtools.js.map +1 -1
  9. package/build/legacy/devtools/utils.cjs +21 -0
  10. package/build/legacy/devtools/utils.cjs.map +1 -1
  11. package/build/legacy/devtools/utils.d.cts +21 -0
  12. package/build/legacy/devtools/utils.d.cts.map +1 -1
  13. package/build/legacy/devtools/utils.d.ts +21 -0
  14. package/build/legacy/devtools/utils.d.ts.map +1 -1
  15. package/build/legacy/devtools/utils.js +21 -0
  16. package/build/legacy/devtools/utils.js.map +1 -1
  17. package/build/legacy/index.d.cts +6 -6
  18. package/build/legacy/index.d.ts +6 -6
  19. package/build/legacy/{infiniteQueryOptions-NucMX_M_.d.ts → infiniteQueryOptions-BaoKhSzb.d.ts} +26 -27
  20. package/build/legacy/infiniteQueryOptions-BaoKhSzb.d.ts.map +1 -0
  21. package/build/legacy/{infiniteQueryOptions-CnTRbIP5.d.cts → infiniteQueryOptions-ClNe2-FB.d.cts} +26 -27
  22. package/build/legacy/infiniteQueryOptions-ClNe2-FB.d.cts.map +1 -0
  23. package/build/legacy/infiniteQueryOptions.cjs.map +1 -1
  24. package/build/legacy/infiniteQueryOptions.d.cts +1 -1
  25. package/build/legacy/infiniteQueryOptions.d.ts +1 -1
  26. package/build/legacy/infiniteQueryOptions.js.map +1 -1
  27. package/build/legacy/mutationCache.cjs.map +1 -1
  28. package/build/legacy/mutationCache.d.cts +1 -1
  29. package/build/legacy/mutationCache.d.cts.map +1 -1
  30. package/build/legacy/mutationCache.d.ts +1 -1
  31. package/build/legacy/mutationCache.d.ts.map +1 -1
  32. package/build/legacy/mutationCache.js.map +1 -1
  33. package/build/legacy/mutationOptions.cjs.map +1 -1
  34. package/build/legacy/mutationOptions.d.cts +5 -13
  35. package/build/legacy/mutationOptions.d.cts.map +1 -1
  36. package/build/legacy/mutationOptions.d.ts +5 -13
  37. package/build/legacy/mutationOptions.d.ts.map +1 -1
  38. package/build/legacy/mutationOptions.js.map +1 -1
  39. package/build/legacy/queryCache.cjs.map +1 -1
  40. package/build/legacy/queryCache.d.cts +1 -1
  41. package/build/legacy/queryCache.d.cts.map +1 -1
  42. package/build/legacy/queryCache.d.ts +1 -1
  43. package/build/legacy/queryCache.d.ts.map +1 -1
  44. package/build/legacy/queryCache.js.map +1 -1
  45. package/build/legacy/{queryClient-Bn2Ql_Lu.d.cts → queryClient-BK9W57Qu.d.cts} +3 -3
  46. package/build/legacy/queryClient-BK9W57Qu.d.cts.map +1 -0
  47. package/build/legacy/{queryClient-B6mLtXOj.d.ts → queryClient-BoBzDWAZ.d.ts} +3 -3
  48. package/build/legacy/queryClient-BoBzDWAZ.d.ts.map +1 -0
  49. package/build/legacy/queryClient.cjs.map +1 -1
  50. package/build/legacy/queryClient.d.cts +1 -1
  51. package/build/legacy/queryClient.d.ts +1 -1
  52. package/build/legacy/queryClient.js.map +1 -1
  53. package/build/{modern/queryOptions-CwqQgQmQ.d.cts → legacy/queryOptions-BvmZtmiU.d.cts} +14 -19
  54. package/build/legacy/queryOptions-BvmZtmiU.d.cts.map +1 -0
  55. package/build/{modern/queryOptions-CsM5TXD2.d.ts → legacy/queryOptions-gpn5D4rf.d.ts} +14 -19
  56. package/build/legacy/queryOptions-gpn5D4rf.d.ts.map +1 -0
  57. package/build/legacy/queryOptions.cjs.map +1 -1
  58. package/build/legacy/queryOptions.d.cts +1 -1
  59. package/build/legacy/queryOptions.d.ts +1 -1
  60. package/build/legacy/queryOptions.js.map +1 -1
  61. package/build/{modern/types-JpJB72CS.d.cts → legacy/types-sdZdiLgo.d.cts} +48 -3
  62. package/build/legacy/types-sdZdiLgo.d.cts.map +1 -0
  63. package/build/legacy/{types-JpJB72CS.d.cts → types-sdZdiLgo.d.ts} +48 -3
  64. package/build/legacy/types-sdZdiLgo.d.ts.map +1 -0
  65. package/build/legacy/types.d.cts +1 -1
  66. package/build/legacy/types.d.ts +1 -1
  67. package/build/legacy/useBaseQuery.cjs +1 -1
  68. package/build/legacy/useBaseQuery.cjs.map +1 -1
  69. package/build/legacy/useBaseQuery.d.cts +1 -1
  70. package/build/legacy/useBaseQuery.d.ts +1 -1
  71. package/build/legacy/useBaseQuery.js +1 -1
  72. package/build/legacy/useBaseQuery.js.map +1 -1
  73. package/build/legacy/useInfiniteQuery.cjs.map +1 -1
  74. package/build/legacy/useInfiniteQuery.d.cts +1 -1
  75. package/build/legacy/useInfiniteQuery.d.ts +1 -1
  76. package/build/legacy/useInfiniteQuery.js.map +1 -1
  77. package/build/legacy/useIsFetching.cjs +0 -3
  78. package/build/legacy/useIsFetching.cjs.map +1 -1
  79. package/build/legacy/useIsFetching.d.cts +6 -5
  80. package/build/legacy/useIsFetching.d.cts.map +1 -1
  81. package/build/legacy/useIsFetching.d.ts +6 -5
  82. package/build/legacy/useIsFetching.d.ts.map +1 -1
  83. package/build/legacy/useIsFetching.js +0 -3
  84. package/build/legacy/useIsFetching.js.map +1 -1
  85. package/build/legacy/useMutation.cjs +2 -8
  86. package/build/legacy/useMutation.cjs.map +1 -1
  87. package/build/legacy/useMutation.d.cts +17 -11
  88. package/build/legacy/useMutation.d.cts.map +1 -1
  89. package/build/legacy/useMutation.d.ts +17 -11
  90. package/build/legacy/useMutation.d.ts.map +1 -1
  91. package/build/legacy/useMutation.js +2 -8
  92. package/build/legacy/useMutation.js.map +1 -1
  93. package/build/legacy/useMutationState.cjs +7 -6
  94. package/build/legacy/useMutationState.cjs.map +1 -1
  95. package/build/legacy/useMutationState.d.cts +16 -8
  96. package/build/legacy/useMutationState.d.cts.map +1 -1
  97. package/build/legacy/useMutationState.d.ts +16 -8
  98. package/build/legacy/useMutationState.d.ts.map +1 -1
  99. package/build/legacy/useMutationState.js +7 -6
  100. package/build/legacy/useMutationState.js.map +1 -1
  101. package/build/legacy/usePrefetchInfiniteQuery.cjs +5 -3
  102. package/build/legacy/usePrefetchInfiniteQuery.cjs.map +1 -1
  103. package/build/legacy/usePrefetchInfiniteQuery.d.cts +6 -5
  104. package/build/legacy/usePrefetchInfiniteQuery.d.cts.map +1 -1
  105. package/build/legacy/usePrefetchInfiniteQuery.d.ts +6 -5
  106. package/build/legacy/usePrefetchInfiniteQuery.d.ts.map +1 -1
  107. package/build/legacy/usePrefetchInfiniteQuery.js +5 -3
  108. package/build/legacy/usePrefetchInfiniteQuery.js.map +1 -1
  109. package/build/legacy/usePrefetchQuery.cjs +5 -3
  110. package/build/legacy/usePrefetchQuery.cjs.map +1 -1
  111. package/build/legacy/usePrefetchQuery.d.cts +6 -5
  112. package/build/legacy/usePrefetchQuery.d.cts.map +1 -1
  113. package/build/legacy/usePrefetchQuery.d.ts +6 -5
  114. package/build/legacy/usePrefetchQuery.d.ts.map +1 -1
  115. package/build/legacy/usePrefetchQuery.js +5 -3
  116. package/build/legacy/usePrefetchQuery.js.map +1 -1
  117. package/build/legacy/useQueries.cjs +1 -4
  118. package/build/legacy/useQueries.cjs.map +1 -1
  119. package/build/legacy/useQueries.d.cts +4 -7
  120. package/build/legacy/useQueries.d.cts.map +1 -1
  121. package/build/legacy/useQueries.d.ts +4 -7
  122. package/build/legacy/useQueries.d.ts.map +1 -1
  123. package/build/legacy/useQueries.js +1 -4
  124. package/build/legacy/useQueries.js.map +1 -1
  125. package/build/legacy/useQuery.cjs.map +1 -1
  126. package/build/legacy/useQuery.d.cts +12 -15
  127. package/build/legacy/useQuery.d.cts.map +1 -1
  128. package/build/legacy/useQuery.d.ts +12 -15
  129. package/build/legacy/useQuery.d.ts.map +1 -1
  130. package/build/legacy/useQuery.js.map +1 -1
  131. package/build/legacy/useQueryClient.cjs +3 -3
  132. package/build/legacy/useQueryClient.cjs.map +1 -1
  133. package/build/legacy/useQueryClient.d.cts +4 -4
  134. package/build/legacy/useQueryClient.d.ts +4 -4
  135. package/build/legacy/useQueryClient.js +3 -3
  136. package/build/legacy/useQueryClient.js.map +1 -1
  137. package/build/legacy/utils.cjs +54 -6
  138. package/build/legacy/utils.cjs.map +1 -1
  139. package/build/legacy/utils.d.cts +34 -7
  140. package/build/legacy/utils.d.cts.map +1 -1
  141. package/build/legacy/utils.d.ts +34 -7
  142. package/build/legacy/utils.d.ts.map +1 -1
  143. package/build/legacy/utils.js +54 -6
  144. package/build/legacy/utils.js.map +1 -1
  145. package/build/legacy/vueQueryPlugin.cjs +0 -3
  146. package/build/legacy/vueQueryPlugin.cjs.map +1 -1
  147. package/build/legacy/vueQueryPlugin.d.cts +6 -5
  148. package/build/legacy/vueQueryPlugin.d.cts.map +1 -1
  149. package/build/legacy/vueQueryPlugin.d.ts +6 -5
  150. package/build/legacy/vueQueryPlugin.d.ts.map +1 -1
  151. package/build/legacy/vueQueryPlugin.js +0 -3
  152. package/build/legacy/vueQueryPlugin.js.map +1 -1
  153. package/build/modern/devtools/devtools.cjs +6 -0
  154. package/build/modern/devtools/devtools.cjs.map +1 -1
  155. package/build/modern/devtools/devtools.d.cts +7 -1
  156. package/build/modern/devtools/devtools.d.cts.map +1 -1
  157. package/build/modern/devtools/devtools.d.ts +7 -1
  158. package/build/modern/devtools/devtools.d.ts.map +1 -1
  159. package/build/modern/devtools/devtools.js +6 -0
  160. package/build/modern/devtools/devtools.js.map +1 -1
  161. package/build/modern/devtools/utils.cjs +21 -0
  162. package/build/modern/devtools/utils.cjs.map +1 -1
  163. package/build/modern/devtools/utils.d.cts +21 -0
  164. package/build/modern/devtools/utils.d.cts.map +1 -1
  165. package/build/modern/devtools/utils.d.ts +21 -0
  166. package/build/modern/devtools/utils.d.ts.map +1 -1
  167. package/build/modern/devtools/utils.js +21 -0
  168. package/build/modern/devtools/utils.js.map +1 -1
  169. package/build/modern/index.d.cts +6 -6
  170. package/build/modern/index.d.ts +6 -6
  171. package/build/modern/{infiniteQueryOptions-NucMX_M_.d.ts → infiniteQueryOptions-BaoKhSzb.d.ts} +26 -27
  172. package/build/modern/infiniteQueryOptions-BaoKhSzb.d.ts.map +1 -0
  173. package/build/modern/{infiniteQueryOptions-CnTRbIP5.d.cts → infiniteQueryOptions-ClNe2-FB.d.cts} +26 -27
  174. package/build/modern/infiniteQueryOptions-ClNe2-FB.d.cts.map +1 -0
  175. package/build/modern/infiniteQueryOptions.cjs.map +1 -1
  176. package/build/modern/infiniteQueryOptions.d.cts +1 -1
  177. package/build/modern/infiniteQueryOptions.d.ts +1 -1
  178. package/build/modern/infiniteQueryOptions.js.map +1 -1
  179. package/build/modern/mutationCache.cjs.map +1 -1
  180. package/build/modern/mutationCache.d.cts +1 -1
  181. package/build/modern/mutationCache.d.cts.map +1 -1
  182. package/build/modern/mutationCache.d.ts +1 -1
  183. package/build/modern/mutationCache.d.ts.map +1 -1
  184. package/build/modern/mutationCache.js.map +1 -1
  185. package/build/modern/mutationOptions.cjs.map +1 -1
  186. package/build/modern/mutationOptions.d.cts +5 -13
  187. package/build/modern/mutationOptions.d.cts.map +1 -1
  188. package/build/modern/mutationOptions.d.ts +5 -13
  189. package/build/modern/mutationOptions.d.ts.map +1 -1
  190. package/build/modern/mutationOptions.js.map +1 -1
  191. package/build/modern/queryCache.cjs.map +1 -1
  192. package/build/modern/queryCache.d.cts +1 -1
  193. package/build/modern/queryCache.d.cts.map +1 -1
  194. package/build/modern/queryCache.d.ts +1 -1
  195. package/build/modern/queryCache.d.ts.map +1 -1
  196. package/build/modern/queryCache.js.map +1 -1
  197. package/build/modern/{queryClient-Bn2Ql_Lu.d.cts → queryClient-BK9W57Qu.d.cts} +3 -3
  198. package/build/modern/queryClient-BK9W57Qu.d.cts.map +1 -0
  199. package/build/modern/{queryClient-B6mLtXOj.d.ts → queryClient-BoBzDWAZ.d.ts} +3 -3
  200. package/build/modern/queryClient-BoBzDWAZ.d.ts.map +1 -0
  201. package/build/modern/queryClient.cjs.map +1 -1
  202. package/build/modern/queryClient.d.cts +1 -1
  203. package/build/modern/queryClient.d.ts +1 -1
  204. package/build/modern/queryClient.js.map +1 -1
  205. package/build/{legacy/queryOptions-CwqQgQmQ.d.cts → modern/queryOptions-BvmZtmiU.d.cts} +14 -19
  206. package/build/modern/queryOptions-BvmZtmiU.d.cts.map +1 -0
  207. package/build/{legacy/queryOptions-CsM5TXD2.d.ts → modern/queryOptions-gpn5D4rf.d.ts} +14 -19
  208. package/build/modern/queryOptions-gpn5D4rf.d.ts.map +1 -0
  209. package/build/modern/queryOptions.cjs.map +1 -1
  210. package/build/modern/queryOptions.d.cts +1 -1
  211. package/build/modern/queryOptions.d.ts +1 -1
  212. package/build/modern/queryOptions.js.map +1 -1
  213. package/build/modern/{types-JpJB72CS.d.ts → types-sdZdiLgo.d.cts} +48 -3
  214. package/build/modern/types-sdZdiLgo.d.cts.map +1 -0
  215. package/build/{legacy/types-JpJB72CS.d.ts → modern/types-sdZdiLgo.d.ts} +48 -3
  216. package/build/modern/types-sdZdiLgo.d.ts.map +1 -0
  217. package/build/modern/types.d.cts +1 -1
  218. package/build/modern/types.d.ts +1 -1
  219. package/build/modern/useBaseQuery.cjs +1 -1
  220. package/build/modern/useBaseQuery.cjs.map +1 -1
  221. package/build/modern/useBaseQuery.d.cts +1 -1
  222. package/build/modern/useBaseQuery.d.ts +1 -1
  223. package/build/modern/useBaseQuery.js +1 -1
  224. package/build/modern/useBaseQuery.js.map +1 -1
  225. package/build/modern/useInfiniteQuery.cjs.map +1 -1
  226. package/build/modern/useInfiniteQuery.d.cts +1 -1
  227. package/build/modern/useInfiniteQuery.d.ts +1 -1
  228. package/build/modern/useInfiniteQuery.js.map +1 -1
  229. package/build/modern/useIsFetching.cjs +0 -3
  230. package/build/modern/useIsFetching.cjs.map +1 -1
  231. package/build/modern/useIsFetching.d.cts +6 -5
  232. package/build/modern/useIsFetching.d.cts.map +1 -1
  233. package/build/modern/useIsFetching.d.ts +6 -5
  234. package/build/modern/useIsFetching.d.ts.map +1 -1
  235. package/build/modern/useIsFetching.js +0 -3
  236. package/build/modern/useIsFetching.js.map +1 -1
  237. package/build/modern/useMutation.cjs +2 -8
  238. package/build/modern/useMutation.cjs.map +1 -1
  239. package/build/modern/useMutation.d.cts +17 -11
  240. package/build/modern/useMutation.d.cts.map +1 -1
  241. package/build/modern/useMutation.d.ts +17 -11
  242. package/build/modern/useMutation.d.ts.map +1 -1
  243. package/build/modern/useMutation.js +2 -8
  244. package/build/modern/useMutation.js.map +1 -1
  245. package/build/modern/useMutationState.cjs +7 -6
  246. package/build/modern/useMutationState.cjs.map +1 -1
  247. package/build/modern/useMutationState.d.cts +16 -8
  248. package/build/modern/useMutationState.d.cts.map +1 -1
  249. package/build/modern/useMutationState.d.ts +16 -8
  250. package/build/modern/useMutationState.d.ts.map +1 -1
  251. package/build/modern/useMutationState.js +7 -6
  252. package/build/modern/useMutationState.js.map +1 -1
  253. package/build/modern/usePrefetchInfiniteQuery.cjs +5 -3
  254. package/build/modern/usePrefetchInfiniteQuery.cjs.map +1 -1
  255. package/build/modern/usePrefetchInfiniteQuery.d.cts +6 -5
  256. package/build/modern/usePrefetchInfiniteQuery.d.cts.map +1 -1
  257. package/build/modern/usePrefetchInfiniteQuery.d.ts +6 -5
  258. package/build/modern/usePrefetchInfiniteQuery.d.ts.map +1 -1
  259. package/build/modern/usePrefetchInfiniteQuery.js +5 -3
  260. package/build/modern/usePrefetchInfiniteQuery.js.map +1 -1
  261. package/build/modern/usePrefetchQuery.cjs +5 -3
  262. package/build/modern/usePrefetchQuery.cjs.map +1 -1
  263. package/build/modern/usePrefetchQuery.d.cts +6 -5
  264. package/build/modern/usePrefetchQuery.d.cts.map +1 -1
  265. package/build/modern/usePrefetchQuery.d.ts +6 -5
  266. package/build/modern/usePrefetchQuery.d.ts.map +1 -1
  267. package/build/modern/usePrefetchQuery.js +5 -3
  268. package/build/modern/usePrefetchQuery.js.map +1 -1
  269. package/build/modern/useQueries.cjs +1 -4
  270. package/build/modern/useQueries.cjs.map +1 -1
  271. package/build/modern/useQueries.d.cts +4 -7
  272. package/build/modern/useQueries.d.cts.map +1 -1
  273. package/build/modern/useQueries.d.ts +4 -7
  274. package/build/modern/useQueries.d.ts.map +1 -1
  275. package/build/modern/useQueries.js +1 -4
  276. package/build/modern/useQueries.js.map +1 -1
  277. package/build/modern/useQuery.cjs.map +1 -1
  278. package/build/modern/useQuery.d.cts +12 -15
  279. package/build/modern/useQuery.d.cts.map +1 -1
  280. package/build/modern/useQuery.d.ts +12 -15
  281. package/build/modern/useQuery.d.ts.map +1 -1
  282. package/build/modern/useQuery.js.map +1 -1
  283. package/build/modern/useQueryClient.cjs +3 -3
  284. package/build/modern/useQueryClient.cjs.map +1 -1
  285. package/build/modern/useQueryClient.d.cts +4 -4
  286. package/build/modern/useQueryClient.d.ts +4 -4
  287. package/build/modern/useQueryClient.js +3 -3
  288. package/build/modern/useQueryClient.js.map +1 -1
  289. package/build/modern/utils.cjs +54 -6
  290. package/build/modern/utils.cjs.map +1 -1
  291. package/build/modern/utils.d.cts +34 -7
  292. package/build/modern/utils.d.cts.map +1 -1
  293. package/build/modern/utils.d.ts +34 -7
  294. package/build/modern/utils.d.ts.map +1 -1
  295. package/build/modern/utils.js +54 -6
  296. package/build/modern/utils.js.map +1 -1
  297. package/build/modern/vueQueryPlugin.cjs +0 -3
  298. package/build/modern/vueQueryPlugin.cjs.map +1 -1
  299. package/build/modern/vueQueryPlugin.d.cts +6 -5
  300. package/build/modern/vueQueryPlugin.d.cts.map +1 -1
  301. package/build/modern/vueQueryPlugin.d.ts +6 -5
  302. package/build/modern/vueQueryPlugin.d.ts.map +1 -1
  303. package/build/modern/vueQueryPlugin.js +0 -3
  304. package/build/modern/vueQueryPlugin.js.map +1 -1
  305. package/package.json +4 -5
  306. package/src/devtools/devtools.ts +6 -0
  307. package/src/devtools/utils.ts +21 -0
  308. package/src/index.ts +5 -1
  309. package/src/infiniteQueryOptions.ts +2 -8
  310. package/src/mutationCache.ts +4 -2
  311. package/src/mutationOptions.ts +4 -12
  312. package/src/queryCache.ts +6 -2
  313. package/src/queryClient.ts +55 -52
  314. package/src/queryOptions.ts +22 -25
  315. package/src/types.ts +47 -2
  316. package/src/useBaseQuery.ts +8 -2
  317. package/src/useInfiniteQuery.ts +15 -14
  318. package/src/useIsFetching.ts +6 -4
  319. package/src/useMutation.ts +15 -9
  320. package/src/useMutationState.ts +23 -7
  321. package/src/usePrefetchInfiniteQuery.ts +9 -3
  322. package/src/usePrefetchQuery.ts +9 -3
  323. package/src/useQueries.ts +1 -4
  324. package/src/useQuery.ts +10 -12
  325. package/src/useQueryClient.ts +3 -3
  326. package/src/utils.ts +55 -9
  327. package/src/vueQueryPlugin.ts +4 -3
  328. package/build/legacy/infiniteQueryOptions-CnTRbIP5.d.cts.map +0 -1
  329. package/build/legacy/infiniteQueryOptions-NucMX_M_.d.ts.map +0 -1
  330. package/build/legacy/queryClient-B6mLtXOj.d.ts.map +0 -1
  331. package/build/legacy/queryClient-Bn2Ql_Lu.d.cts.map +0 -1
  332. package/build/legacy/queryOptions-CsM5TXD2.d.ts.map +0 -1
  333. package/build/legacy/queryOptions-CwqQgQmQ.d.cts.map +0 -1
  334. package/build/legacy/types-JpJB72CS.d.cts.map +0 -1
  335. package/build/legacy/types-JpJB72CS.d.ts.map +0 -1
  336. package/build/modern/infiniteQueryOptions-CnTRbIP5.d.cts.map +0 -1
  337. package/build/modern/infiniteQueryOptions-NucMX_M_.d.ts.map +0 -1
  338. package/build/modern/queryClient-B6mLtXOj.d.ts.map +0 -1
  339. package/build/modern/queryClient-Bn2Ql_Lu.d.cts.map +0 -1
  340. package/build/modern/queryOptions-CsM5TXD2.d.ts.map +0 -1
  341. package/build/modern/queryOptions-CwqQgQmQ.d.cts.map +0 -1
  342. package/build/modern/types-JpJB72CS.d.cts.map +0 -1
  343. package/build/modern/types-JpJB72CS.d.ts.map +0 -1
@@ -1,10 +1,18 @@
1
- import { s as MaybeRefOrGetter } from "./types-JpJB72CS.js";
2
- import { i as UndefinedInitialQueryOptions, o as UseQueryOptions, t as DefinedInitialQueryOptions } from "./queryOptions-CsM5TXD2.js";
3
- import { t as QueryClient$1 } from "./queryClient-B6mLtXOj.js";
4
- import { s as UseBaseQueryReturnType } from "./infiniteQueryOptions-NucMX_M_.js";
1
+ import { s as MaybeRefOrGetter } from "./types-sdZdiLgo.js";
2
+ import { i as UndefinedInitialQueryOptions, o as UseQueryOptions, t as DefinedInitialQueryOptions } from "./queryOptions-gpn5D4rf.js";
3
+ import { t as QueryClient$1 } from "./queryClient-BoBzDWAZ.js";
4
+ import { s as UseBaseQueryReturnType } from "./infiniteQueryOptions-BaoKhSzb.js";
5
5
  import { DefaultError, DefinedQueryObserverResult, QueryKey } from "@tanstack/query-core";
6
6
  //#region src/useQuery.d.ts
7
+ /**
8
+ * The result of `useQuery` when `initialData` is omitted or may be `undefined` — `data` may be `undefined`
9
+ * while the query is `pending`. See {@link UseBaseQueryReturnType}.
10
+ */
7
11
  export type UseQueryReturnType<TData, TError> = UseBaseQueryReturnType<TData, TError>;
12
+ /**
13
+ * The result of `useQuery` when `initialData` is set — `data` is never `undefined` (unless a `select` changes
14
+ * `TData` to include `undefined`).
15
+ */
8
16
  export type UseQueryDefinedReturnType<TData, TError> = UseBaseQueryReturnType<TData, TError, DefinedQueryObserverResult<TData, TError>>;
9
17
  /**
10
18
  * This overload is selected when `initialData` is set, so the resulting `data` is never `undefined` (unless
@@ -14,7 +22,6 @@ export type UseQueryDefinedReturnType<TData, TError> = UseBaseQueryReturnType<TD
14
22
  * (`() => ...`). `queryKey` reacts through a `ref` or a reactive getter for the array itself, or `ref`s and
15
23
  * reactive getters as individual entries. Other options are read once when passed as a plain value, and stay
16
24
  * reactive when passed as a `ref` or a `computed`.
17
- *
18
25
  * @param options - The {@link DefinedInitialQueryOptions} to use — everything you can pass to `useQuery`, with
19
26
  * `initialData` set.
20
27
  * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one provided by `VueQueryPlugin`
@@ -22,7 +29,6 @@ export type UseQueryDefinedReturnType<TData, TError> = UseBaseQueryReturnType<TD
22
29
  * @returns The current query result, typed so that `data` is never `undefined` (unless a `select` changes
23
30
  * `TData` to include `undefined`). `status` never resolves to `pending` in this overload's type, since
24
31
  * `initialData` guarantees data upfront.
25
- *
26
32
  * @example
27
33
  * ```vue
28
34
  * <script setup lang="ts">
@@ -51,13 +57,11 @@ export declare function useQuery<TQueryFnData = unknown, TError = DefaultError,
51
57
  * (`() => ...`). `queryKey` reacts through a `ref` or a reactive getter for the array itself, or `ref`s and
52
58
  * reactive getters as individual entries. Other options are read once when passed as a plain value, and stay
53
59
  * reactive when passed as a `ref` or a `computed`.
54
- *
55
60
  * @param options - The {@link UndefinedInitialQueryOptions} to use — everything you can pass to `useQuery`.
56
61
  * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one provided by `VueQueryPlugin`
57
62
  * will be used.
58
63
  * @returns The current query result. `status` is `pending` if there is no cached data to display, `error` if
59
64
  * the last fetch attempt failed, or `success` if the query has data to display.
60
- *
61
65
  * @example
62
66
  * A query key built from a reactive `ref` — the query refetches whenever `postId` changes:
63
67
  * ```vue
@@ -78,7 +82,6 @@ export declare function useQuery<TQueryFnData = unknown, TError = DefaultError,
78
82
  * <h1 v-else>{{ data.title }}</h1>
79
83
  * </template>
80
84
  * ```
81
- *
82
85
  * @example
83
86
  * `select` derives whatever `data` a component needs from the cached value, without changing what's
84
87
  * actually stored in the cache — the cache still holds the full `Post[]`, but `data` here is a `number`:
@@ -99,7 +102,6 @@ export declare function useQuery<TQueryFnData = unknown, TError = DefaultError,
99
102
  * <span v-else>{{ data }} posts</span>
100
103
  * </template>
101
104
  * ```
102
- *
103
105
  * @example
104
106
  * A dependent query, only enabled once `postId` is set — use `isLoading`, not `isPending`, so the
105
107
  * loading state doesn't show while the query is disabled:
@@ -124,7 +126,6 @@ export declare function useQuery<TQueryFnData = unknown, TError = DefaultError,
124
126
  * <h1 v-else>{{ data?.title }}</h1>
125
127
  * </template>
126
128
  * ```
127
- *
128
129
  * @example
129
130
  * Seeding a detail query from an already-cached list, to skip the loading state. `initialDataUpdatedAt` carries
130
131
  * over the list's own fetch time, so that if you set a `staleTime`, it's measured from when the list was
@@ -153,7 +154,6 @@ export declare function useQuery<TQueryFnData = unknown, TError = DefaultError,
153
154
  * <h1 v-else>{{ data?.title }}</h1>
154
155
  * </template>
155
156
  * ```
156
- *
157
157
  * @example
158
158
  * Paginated data, keeping the previous page's data visible while the next page loads:
159
159
  * ```vue
@@ -193,12 +193,10 @@ export declare function useQuery<TQueryFnData = unknown, TError = DefaultError,
193
193
  *
194
194
  * When `options` itself is a reactive getter, the whole object is re-evaluated on every change to its
195
195
  * dependencies, so any option inside it — not just `queryKey` and `enabled` — can change over time.
196
- *
197
196
  * @param options - A `ref`, plain value, or reactive getter resolving to the {@link UseQueryOptions} to use.
198
197
  * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one provided by `VueQueryPlugin`
199
198
  * will be used.
200
199
  * @returns The current query result, with `data` typed as possibly `undefined`.
201
- *
202
200
  * @example
203
201
  * Passing a whole-options getter so `staleTime` reacts to a setting stored elsewhere, not just `queryKey`:
204
202
  * ```vue
@@ -218,7 +216,6 @@ export declare function useQuery<TQueryFnData = unknown, TError = DefaultError,
218
216
  * <h1 v-if="data">{{ data.title }}</h1>
219
217
  * </template>
220
218
  * ```
221
- *
222
219
  * @example
223
220
  * `skipToken` disables the query in a type-safe way, without a non-null assertion on `props.postId` —
224
221
  * `queryFn` is only ever called when it's defined. The whole-options getter re-evaluates `queryFn` on every
@@ -1 +1 @@
1
- {"version":3,"file":"useQuery.d.ts","names":["QueryClient"],"sources":["../../src/useQuery.ts"],"mappings":";;;;;;YAgBY,mBAAmB,OAAO,UAAU,uBAC9C,OACA;YAGU,0BAA0B,OAAO,UAAU,uBACrD,OACA,QACA,2BAA2B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA0CpB,SACd,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAE7B,SAAS,2BAA2B,cAAc,QAAQ,OAAO,YACjE,cAAcA,gBACb,0BAA0B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAyIpB,SACd,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAE7B,SAAS,6BAA6B,cAAc,QAAQ,OAAO,YACnE,cAAcA,gBACb,mBAAmB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAoEb,SACd,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAE7B,SAAS,iBACP,gBAAgB,cAAc,QAAQ,OAAO,cAAc,aAE7D,cAAcA,gBACb,mBAAmB,OAAO"}
1
+ {"version":3,"file":"useQuery.d.ts","names":["QueryClient"],"sources":["../../src/useQuery.ts"],"mappings":";;;;;;;;;;YAoBY,mBAAmB,OAAO,UAAU,uBAC9C,OACA;;;;;YAOU,0BAA0B,OAAO,UAAU,uBACrD,OACA,QACA,2BAA2B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAwCpB,SACd,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAE7B,SAAS,2BAA2B,cAAc,QAAQ,OAAO,YACjE,cAAcA,gBACb,0BAA0B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAmIpB,SACd,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAE7B,SAAS,6BAA6B,cAAc,QAAQ,OAAO,YACnE,cAAcA,gBACb,mBAAmB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAiEb,SACd,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAE7B,SAAS,iBACP,gBAAgB,cAAc,QAAQ,OAAO,cAAc,aAE7D,cAAcA,gBACb,mBAAmB,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"useQuery.js","names":[],"sources":["../../src/useQuery.ts"],"sourcesContent":["import { QueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n DefaultError,\n DefinedQueryObserverResult,\n QueryKey,\n} from '@tanstack/query-core'\nimport type { UseBaseQueryReturnType } from './useBaseQuery'\nimport type { MaybeRefOrGetter } from './types'\nimport type { QueryClient } from './queryClient'\nimport type {\n DefinedInitialQueryOptions,\n UndefinedInitialQueryOptions,\n UseQueryOptions,\n} from './queryOptions'\n\nexport type UseQueryReturnType<TData, TError> = UseBaseQueryReturnType<\n TData,\n TError\n>\n\nexport type UseQueryDefinedReturnType<TData, TError> = UseBaseQueryReturnType<\n TData,\n TError,\n DefinedQueryObserverResult<TData, TError>\n>\n\n/**\n * This overload is selected when `initialData` is set, so the resulting `data` is never `undefined` (unless\n * a `select` changes `TData` to include `undefined`).\n *\n * `enabled` tracks reactive dependencies automatically as a `ref`, a plain value, or a reactive getter\n * (`() => ...`). `queryKey` reacts through a `ref` or a reactive getter for the array itself, or `ref`s and\n * reactive getters as individual entries. Other options are read once when passed as a plain value, and stay\n * reactive when passed as a `ref` or a `computed`.\n *\n * @param options - The {@link DefinedInitialQueryOptions} to use — everything you can pass to `useQuery`, with\n * `initialData` set.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one provided by `VueQueryPlugin`\n * will be used.\n * @returns The current query result, typed so that `data` is never `undefined` (unless a `select` changes\n * `TData` to include `undefined`). `status` never resolves to `pending` in this overload's type, since\n * `initialData` guarantees data upfront.\n *\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { useQuery } from '@tanstack/vue-query'\n *\n * // `data` is `Post[]`, never `undefined`, thanks to `initialData` — even if a refetch fails,\n * // so the list stays visible alongside the error.\n * const { data, isError, error } = useQuery({\n * queryKey: ['posts'],\n * queryFn: fetchPosts,\n * initialData: [],\n * })\n * </script>\n *\n * <template>\n * <span v-if=\"isError\">Error: {{ error.message }}</span>\n * <ul>\n * <li v-for=\"post in data\" :key=\"post.id\">{{ post.title }}</li>\n * </ul>\n * </template>\n * ```\n */\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: DefinedInitialQueryOptions<TQueryFnData, TError, TData, TQueryKey>,\n queryClient?: QueryClient,\n): UseQueryDefinedReturnType<TData, TError>\n\n/**\n * `enabled` tracks reactive dependencies automatically as a `ref`, a plain value, or a reactive getter\n * (`() => ...`). `queryKey` reacts through a `ref` or a reactive getter for the array itself, or `ref`s and\n * reactive getters as individual entries. Other options are read once when passed as a plain value, and stay\n * reactive when passed as a `ref` or a `computed`.\n *\n * @param options - The {@link UndefinedInitialQueryOptions} to use — everything you can pass to `useQuery`.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one provided by `VueQueryPlugin`\n * will be used.\n * @returns The current query result. `status` is `pending` if there is no cached data to display, `error` if\n * the last fetch attempt failed, or `success` if the query has data to display.\n *\n * @example\n * A query key built from a reactive `ref` — the query refetches whenever `postId` changes:\n * ```vue\n * <script setup lang=\"ts\">\n * import { ref } from 'vue'\n * import { useQuery } from '@tanstack/vue-query'\n *\n * const postId = ref(1)\n * const { status, data, error } = useQuery({\n * queryKey: ['post', postId],\n * queryFn: () => fetchPost(postId.value),\n * })\n * </script>\n *\n * <template>\n * <span v-if=\"status === 'pending'\">Loading...</span>\n * <span v-else-if=\"status === 'error'\">Error: {{ error.message }}</span>\n * <h1 v-else>{{ data.title }}</h1>\n * </template>\n * ```\n *\n * @example\n * `select` derives whatever `data` a component needs from the cached value, without changing what's\n * actually stored in the cache — the cache still holds the full `Post[]`, but `data` here is a `number`:\n * ```vue\n * <script setup lang=\"ts\">\n * import { useQuery } from '@tanstack/vue-query'\n *\n * const { data, isPending, isError, error } = useQuery({\n * queryKey: ['posts'],\n * queryFn: fetchPosts,\n * select: (posts) => posts.length,\n * })\n * </script>\n *\n * <template>\n * <span v-if=\"isPending\">Loading...</span>\n * <span v-else-if=\"isError\">Error: {{ error.message }}</span>\n * <span v-else>{{ data }} posts</span>\n * </template>\n * ```\n *\n * @example\n * A dependent query, only enabled once `postId` is set — use `isLoading`, not `isPending`, so the\n * loading state doesn't show while the query is disabled:\n * ```vue\n * <script setup lang=\"ts\">\n * import { ref } from 'vue'\n * import { useQuery } from '@tanstack/vue-query'\n *\n * const props = defineProps<{ postId: number | undefined }>()\n *\n * const { data, isLoading, isError, error } = useQuery({\n * queryKey: ['post', props.postId],\n * queryFn: () => fetchPost(props.postId!),\n * enabled: () => props.postId != null,\n * })\n * </script>\n *\n * <template>\n * <span v-if=\"props.postId == null\">Select a post</span>\n * <span v-else-if=\"isLoading\">Loading...</span>\n * <span v-else-if=\"isError\">Error: {{ error.message }}</span>\n * <h1 v-else>{{ data?.title }}</h1>\n * </template>\n * ```\n *\n * @example\n * Seeding a detail query from an already-cached list, to skip the loading state. `initialDataUpdatedAt` carries\n * over the list's own fetch time, so that if you set a `staleTime`, it's measured from when the list was\n * fetched rather than from now:\n * ```vue\n * <script setup lang=\"ts\">\n * import { useQuery, useQueryClient } from '@tanstack/vue-query'\n *\n * const props = defineProps<{ postId: number }>()\n * const queryClient = useQueryClient()\n *\n * const { data, isError, error } = useQuery({\n * queryKey: ['post', props.postId],\n * queryFn: () => fetchPost(props.postId),\n * initialData: () =>\n * queryClient\n * .getQueryData<Array<Post>>(['posts'])\n * ?.find((post) => post.id === props.postId),\n * initialDataUpdatedAt: () =>\n * queryClient.getQueryState(['posts'])?.dataUpdatedAt,\n * })\n * </script>\n *\n * <template>\n * <span v-if=\"isError\">Error: {{ error.message }}</span>\n * <h1 v-else>{{ data?.title }}</h1>\n * </template>\n * ```\n *\n * @example\n * Paginated data, keeping the previous page's data visible while the next page loads:\n * ```vue\n * <script setup lang=\"ts\">\n * import { ref } from 'vue'\n * import { keepPreviousData, useQuery } from '@tanstack/vue-query'\n *\n * const page = ref(0)\n *\n * const { data, isPlaceholderData, isError, error } = useQuery({\n * queryKey: ['posts', page],\n * queryFn: () => fetchPosts(page.value),\n * placeholderData: keepPreviousData,\n * })\n * </script>\n *\n * <template>\n * <span v-if=\"isError\">Error: {{ error.message }}</span>\n * <template v-else>\n * <ul>\n * <li v-for=\"post in data\" :key=\"post.id\">{{ post.title }}</li>\n * </ul>\n * <button :disabled=\"isPlaceholderData\" @click=\"page++\">Next Page</button>\n * </template>\n * </template>\n * ```\n */\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UndefinedInitialQueryOptions<TQueryFnData, TError, TData, TQueryKey>,\n queryClient?: QueryClient,\n): UseQueryReturnType<TData, TError>\n\n/**\n * Fallback overload for options whose `initialData` presence isn't statically known — for example, a\n * `ref`/reactive object built up conditionally, rather than a plain object literal. Prefer one of the other\n * overloads when possible, since they infer whether `data` can be `undefined` from `initialData` directly.\n *\n * `enabled` tracks reactive dependencies automatically as a `ref`, a plain value, or a reactive getter\n * (`() => ...`). `queryKey` reacts through a `ref` or a reactive getter for the array itself, or `ref`s and\n * reactive getters as individual entries.\n *\n * When `options` itself is a reactive getter, the whole object is re-evaluated on every change to its\n * dependencies, so any option inside it — not just `queryKey` and `enabled` — can change over time.\n *\n * @param options - A `ref`, plain value, or reactive getter resolving to the {@link UseQueryOptions} to use.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one provided by `VueQueryPlugin`\n * will be used.\n * @returns The current query result, with `data` typed as possibly `undefined`.\n *\n * @example\n * Passing a whole-options getter so `staleTime` reacts to a setting stored elsewhere, not just `queryKey`:\n * ```vue\n * <script setup lang=\"ts\">\n * import { useQuery } from '@tanstack/vue-query'\n *\n * const props = defineProps<{ id: number; staleTime: number }>()\n *\n * const { data } = useQuery(() => ({\n * queryKey: ['post', props.id],\n * queryFn: () => fetchPost(props.id),\n * staleTime: props.staleTime,\n * }))\n * </script>\n *\n * <template>\n * <h1 v-if=\"data\">{{ data.title }}</h1>\n * </template>\n * ```\n *\n * @example\n * `skipToken` disables the query in a type-safe way, without a non-null assertion on `props.postId` —\n * `queryFn` is only ever called when it's defined. The whole-options getter re-evaluates `queryFn` on every\n * change to `props.postId`. `queryFn` can also be a `computed`, but never a bare getter, since a function\n * there is the query function itself. `refetch` doesn't work while `queryFn` is `skipToken` — use\n * `enabled: false` instead if you need to trigger the query manually:\n * ```vue\n * <script setup lang=\"ts\">\n * import { skipToken, useQuery } from '@tanstack/vue-query'\n *\n * const props = defineProps<{ postId: number | undefined }>()\n *\n * const { data, isLoading, isError, error } = useQuery(() => {\n * const postId = props.postId\n * return {\n * queryKey: ['post', postId],\n * queryFn: postId != null ? () => fetchPost(postId) : skipToken,\n * }\n * })\n * </script>\n *\n * <template>\n * <span v-if=\"props.postId == null\">Select a post</span>\n * <span v-else-if=\"isLoading\">Loading...</span>\n * <span v-else-if=\"isError\">Error: {{ error.message }}</span>\n * <h1 v-else>{{ data?.title }}</h1>\n * </template>\n * ```\n */\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: MaybeRefOrGetter<\n UseQueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey>\n >,\n queryClient?: QueryClient,\n): UseQueryReturnType<TData, TError>\n\nexport function useQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: MaybeRefOrGetter<\n UseQueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey>\n >,\n queryClient?: QueryClient,\n):\n UseQueryReturnType<TData, TError> | UseQueryDefinedReturnType<TData, TError> {\n return useBaseQuery(QueryObserver, options, queryClient)\n}\n"],"mappings":";;;AA2SA,SAAgB,SAMd,SAGA,aAE6E;CAC7E,OAAO,aAAa,eAAe,SAAS,WAAW;AACzD"}
1
+ {"version":3,"file":"useQuery.js","names":[],"sources":["../../src/useQuery.ts"],"sourcesContent":["import { QueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n DefaultError,\n DefinedQueryObserverResult,\n QueryKey,\n} from '@tanstack/query-core'\nimport type { UseBaseQueryReturnType } from './useBaseQuery'\nimport type { MaybeRefOrGetter } from './types'\nimport type { QueryClient } from './queryClient'\nimport type {\n DefinedInitialQueryOptions,\n UndefinedInitialQueryOptions,\n UseQueryOptions,\n} from './queryOptions'\n\n/**\n * The result of `useQuery` when `initialData` is omitted or may be `undefined` — `data` may be `undefined`\n * while the query is `pending`. See {@link UseBaseQueryReturnType}.\n */\nexport type UseQueryReturnType<TData, TError> = UseBaseQueryReturnType<\n TData,\n TError\n>\n\n/**\n * The result of `useQuery` when `initialData` is set — `data` is never `undefined` (unless a `select` changes\n * `TData` to include `undefined`).\n */\nexport type UseQueryDefinedReturnType<TData, TError> = UseBaseQueryReturnType<\n TData,\n TError,\n DefinedQueryObserverResult<TData, TError>\n>\n\n/**\n * This overload is selected when `initialData` is set, so the resulting `data` is never `undefined` (unless\n * a `select` changes `TData` to include `undefined`).\n *\n * `enabled` tracks reactive dependencies automatically as a `ref`, a plain value, or a reactive getter\n * (`() => ...`). `queryKey` reacts through a `ref` or a reactive getter for the array itself, or `ref`s and\n * reactive getters as individual entries. Other options are read once when passed as a plain value, and stay\n * reactive when passed as a `ref` or a `computed`.\n * @param options - The {@link DefinedInitialQueryOptions} to use — everything you can pass to `useQuery`, with\n * `initialData` set.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one provided by `VueQueryPlugin`\n * will be used.\n * @returns The current query result, typed so that `data` is never `undefined` (unless a `select` changes\n * `TData` to include `undefined`). `status` never resolves to `pending` in this overload's type, since\n * `initialData` guarantees data upfront.\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { useQuery } from '@tanstack/vue-query'\n *\n * // `data` is `Post[]`, never `undefined`, thanks to `initialData` — even if a refetch fails,\n * // so the list stays visible alongside the error.\n * const { data, isError, error } = useQuery({\n * queryKey: ['posts'],\n * queryFn: fetchPosts,\n * initialData: [],\n * })\n * </script>\n *\n * <template>\n * <span v-if=\"isError\">Error: {{ error.message }}</span>\n * <ul>\n * <li v-for=\"post in data\" :key=\"post.id\">{{ post.title }}</li>\n * </ul>\n * </template>\n * ```\n */\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: DefinedInitialQueryOptions<TQueryFnData, TError, TData, TQueryKey>,\n queryClient?: QueryClient,\n): UseQueryDefinedReturnType<TData, TError>\n\n/**\n * `enabled` tracks reactive dependencies automatically as a `ref`, a plain value, or a reactive getter\n * (`() => ...`). `queryKey` reacts through a `ref` or a reactive getter for the array itself, or `ref`s and\n * reactive getters as individual entries. Other options are read once when passed as a plain value, and stay\n * reactive when passed as a `ref` or a `computed`.\n * @param options - The {@link UndefinedInitialQueryOptions} to use — everything you can pass to `useQuery`.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one provided by `VueQueryPlugin`\n * will be used.\n * @returns The current query result. `status` is `pending` if there is no cached data to display, `error` if\n * the last fetch attempt failed, or `success` if the query has data to display.\n * @example\n * A query key built from a reactive `ref` — the query refetches whenever `postId` changes:\n * ```vue\n * <script setup lang=\"ts\">\n * import { ref } from 'vue'\n * import { useQuery } from '@tanstack/vue-query'\n *\n * const postId = ref(1)\n * const { status, data, error } = useQuery({\n * queryKey: ['post', postId],\n * queryFn: () => fetchPost(postId.value),\n * })\n * </script>\n *\n * <template>\n * <span v-if=\"status === 'pending'\">Loading...</span>\n * <span v-else-if=\"status === 'error'\">Error: {{ error.message }}</span>\n * <h1 v-else>{{ data.title }}</h1>\n * </template>\n * ```\n * @example\n * `select` derives whatever `data` a component needs from the cached value, without changing what's\n * actually stored in the cache — the cache still holds the full `Post[]`, but `data` here is a `number`:\n * ```vue\n * <script setup lang=\"ts\">\n * import { useQuery } from '@tanstack/vue-query'\n *\n * const { data, isPending, isError, error } = useQuery({\n * queryKey: ['posts'],\n * queryFn: fetchPosts,\n * select: (posts) => posts.length,\n * })\n * </script>\n *\n * <template>\n * <span v-if=\"isPending\">Loading...</span>\n * <span v-else-if=\"isError\">Error: {{ error.message }}</span>\n * <span v-else>{{ data }} posts</span>\n * </template>\n * ```\n * @example\n * A dependent query, only enabled once `postId` is set — use `isLoading`, not `isPending`, so the\n * loading state doesn't show while the query is disabled:\n * ```vue\n * <script setup lang=\"ts\">\n * import { ref } from 'vue'\n * import { useQuery } from '@tanstack/vue-query'\n *\n * const props = defineProps<{ postId: number | undefined }>()\n *\n * const { data, isLoading, isError, error } = useQuery({\n * queryKey: ['post', props.postId],\n * queryFn: () => fetchPost(props.postId!),\n * enabled: () => props.postId != null,\n * })\n * </script>\n *\n * <template>\n * <span v-if=\"props.postId == null\">Select a post</span>\n * <span v-else-if=\"isLoading\">Loading...</span>\n * <span v-else-if=\"isError\">Error: {{ error.message }}</span>\n * <h1 v-else>{{ data?.title }}</h1>\n * </template>\n * ```\n * @example\n * Seeding a detail query from an already-cached list, to skip the loading state. `initialDataUpdatedAt` carries\n * over the list's own fetch time, so that if you set a `staleTime`, it's measured from when the list was\n * fetched rather than from now:\n * ```vue\n * <script setup lang=\"ts\">\n * import { useQuery, useQueryClient } from '@tanstack/vue-query'\n *\n * const props = defineProps<{ postId: number }>()\n * const queryClient = useQueryClient()\n *\n * const { data, isError, error } = useQuery({\n * queryKey: ['post', props.postId],\n * queryFn: () => fetchPost(props.postId),\n * initialData: () =>\n * queryClient\n * .getQueryData<Array<Post>>(['posts'])\n * ?.find((post) => post.id === props.postId),\n * initialDataUpdatedAt: () =>\n * queryClient.getQueryState(['posts'])?.dataUpdatedAt,\n * })\n * </script>\n *\n * <template>\n * <span v-if=\"isError\">Error: {{ error.message }}</span>\n * <h1 v-else>{{ data?.title }}</h1>\n * </template>\n * ```\n * @example\n * Paginated data, keeping the previous page's data visible while the next page loads:\n * ```vue\n * <script setup lang=\"ts\">\n * import { ref } from 'vue'\n * import { keepPreviousData, useQuery } from '@tanstack/vue-query'\n *\n * const page = ref(0)\n *\n * const { data, isPlaceholderData, isError, error } = useQuery({\n * queryKey: ['posts', page],\n * queryFn: () => fetchPosts(page.value),\n * placeholderData: keepPreviousData,\n * })\n * </script>\n *\n * <template>\n * <span v-if=\"isError\">Error: {{ error.message }}</span>\n * <template v-else>\n * <ul>\n * <li v-for=\"post in data\" :key=\"post.id\">{{ post.title }}</li>\n * </ul>\n * <button :disabled=\"isPlaceholderData\" @click=\"page++\">Next Page</button>\n * </template>\n * </template>\n * ```\n */\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UndefinedInitialQueryOptions<TQueryFnData, TError, TData, TQueryKey>,\n queryClient?: QueryClient,\n): UseQueryReturnType<TData, TError>\n\n/**\n * Fallback overload for options whose `initialData` presence isn't statically known — for example, a\n * `ref`/reactive object built up conditionally, rather than a plain object literal. Prefer one of the other\n * overloads when possible, since they infer whether `data` can be `undefined` from `initialData` directly.\n *\n * `enabled` tracks reactive dependencies automatically as a `ref`, a plain value, or a reactive getter\n * (`() => ...`). `queryKey` reacts through a `ref` or a reactive getter for the array itself, or `ref`s and\n * reactive getters as individual entries.\n *\n * When `options` itself is a reactive getter, the whole object is re-evaluated on every change to its\n * dependencies, so any option inside it — not just `queryKey` and `enabled` — can change over time.\n * @param options - A `ref`, plain value, or reactive getter resolving to the {@link UseQueryOptions} to use.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one provided by `VueQueryPlugin`\n * will be used.\n * @returns The current query result, with `data` typed as possibly `undefined`.\n * @example\n * Passing a whole-options getter so `staleTime` reacts to a setting stored elsewhere, not just `queryKey`:\n * ```vue\n * <script setup lang=\"ts\">\n * import { useQuery } from '@tanstack/vue-query'\n *\n * const props = defineProps<{ id: number; staleTime: number }>()\n *\n * const { data } = useQuery(() => ({\n * queryKey: ['post', props.id],\n * queryFn: () => fetchPost(props.id),\n * staleTime: props.staleTime,\n * }))\n * </script>\n *\n * <template>\n * <h1 v-if=\"data\">{{ data.title }}</h1>\n * </template>\n * ```\n * @example\n * `skipToken` disables the query in a type-safe way, without a non-null assertion on `props.postId` —\n * `queryFn` is only ever called when it's defined. The whole-options getter re-evaluates `queryFn` on every\n * change to `props.postId`. `queryFn` can also be a `computed`, but never a bare getter, since a function\n * there is the query function itself. `refetch` doesn't work while `queryFn` is `skipToken` — use\n * `enabled: false` instead if you need to trigger the query manually:\n * ```vue\n * <script setup lang=\"ts\">\n * import { skipToken, useQuery } from '@tanstack/vue-query'\n *\n * const props = defineProps<{ postId: number | undefined }>()\n *\n * const { data, isLoading, isError, error } = useQuery(() => {\n * const postId = props.postId\n * return {\n * queryKey: ['post', postId],\n * queryFn: postId != null ? () => fetchPost(postId) : skipToken,\n * }\n * })\n * </script>\n *\n * <template>\n * <span v-if=\"props.postId == null\">Select a post</span>\n * <span v-else-if=\"isLoading\">Loading...</span>\n * <span v-else-if=\"isError\">Error: {{ error.message }}</span>\n * <h1 v-else>{{ data?.title }}</h1>\n * </template>\n * ```\n */\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: MaybeRefOrGetter<\n UseQueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey>\n >,\n queryClient?: QueryClient,\n): UseQueryReturnType<TData, TError>\n\nexport function useQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: MaybeRefOrGetter<\n UseQueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey>\n >,\n queryClient?: QueryClient,\n):\n | UseQueryReturnType<TData, TError>\n | UseQueryDefinedReturnType<TData, TError> {\n return useBaseQuery(QueryObserver, options, queryClient)\n}\n"],"mappings":";;;AAwSA,SAAgB,SAMd,SAGA,aAG2C;CAC3C,OAAO,aAAa,eAAe,SAAS,WAAW;AACzD"}
@@ -5,11 +5,11 @@ let vue_demi = require("vue-demi");
5
5
  /**
6
6
  * Retrieves the `QueryClient` installed by `VueQueryPlugin`, via Vue's `inject`. Must be called inside
7
7
  * `setup()` or another function that supports an injection context.
8
- *
9
8
  * @param id - The `queryClientKey` passed to `VueQueryPlugin` — only needed when multiple `QueryClient`s are
10
9
  * installed in the same app.
11
- * @throws If called outside an injection context, or if no `QueryClient` was installed via `VueQueryPlugin`.
12
- *
10
+ * @returns The installed `QueryClient`.
11
+ * @throws {Error} If called outside an injection context, or if no `QueryClient` was installed via
12
+ * `VueQueryPlugin`.
13
13
  * @example
14
14
  * ```vue
15
15
  * <script setup lang="ts">
@@ -1 +1 @@
1
- {"version":3,"file":"useQueryClient.cjs","names":["hasInjectionContext","getClientKey","inject"],"sources":["../../src/useQueryClient.ts"],"sourcesContent":["import { hasInjectionContext, inject } from 'vue-demi'\n\nimport { getClientKey } from './utils'\nimport type { QueryClient } from './queryClient'\n\n/**\n * Retrieves the `QueryClient` installed by `VueQueryPlugin`, via Vue's `inject`. Must be called inside\n * `setup()` or another function that supports an injection context.\n *\n * @param id - The `queryClientKey` passed to `VueQueryPlugin` — only needed when multiple `QueryClient`s are\n * installed in the same app.\n * @throws If called outside an injection context, or if no `QueryClient` was installed via `VueQueryPlugin`.\n *\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { useQueryClient } from '@tanstack/vue-query'\n *\n * const queryClient = useQueryClient()\n *\n * function invalidate() {\n * queryClient.invalidateQueries({ queryKey: ['todos'] })\n * }\n * </script>\n * ```\n */\nexport function useQueryClient(id = ''): QueryClient {\n // ensures that `inject()` can be used\n if (!hasInjectionContext()) {\n throw new Error(\n 'vue-query hooks can only be used inside setup() function or functions that support injection context.',\n )\n }\n\n const key = getClientKey(id)\n const queryClient = inject<QueryClient>(key)\n\n if (!queryClient) {\n throw new Error(\n \"No 'queryClient' found in Vue context, use 'VueQueryPlugin' to properly initialize the library.\",\n )\n }\n\n return queryClient\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,SAAgB,eAAe,KAAK,IAAiB;CAEnD,IAAI,EAAA,GAACA,SAAAA,oBAAAA,CAAoB,GACvB,MAAM,IAAI,MACR,uGACF;CAGF,MAAM,MAAMC,cAAAA,aAAa,EAAE;CAC3B,MAAM,eAAA,GAAcC,SAAAA,OAAAA,CAAoB,GAAG;CAE3C,IAAI,CAAC,aACH,MAAM,IAAI,MACR,iGACF;CAGF,OAAO;AACT"}
1
+ {"version":3,"file":"useQueryClient.cjs","names":["hasInjectionContext","getClientKey","inject"],"sources":["../../src/useQueryClient.ts"],"sourcesContent":["import { hasInjectionContext, inject } from 'vue-demi'\n\nimport { getClientKey } from './utils'\nimport type { QueryClient } from './queryClient'\n\n/**\n * Retrieves the `QueryClient` installed by `VueQueryPlugin`, via Vue's `inject`. Must be called inside\n * `setup()` or another function that supports an injection context.\n * @param id - The `queryClientKey` passed to `VueQueryPlugin` — only needed when multiple `QueryClient`s are\n * installed in the same app.\n * @returns The installed `QueryClient`.\n * @throws {Error} If called outside an injection context, or if no `QueryClient` was installed via\n * `VueQueryPlugin`.\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { useQueryClient } from '@tanstack/vue-query'\n *\n * const queryClient = useQueryClient()\n *\n * function invalidate() {\n * queryClient.invalidateQueries({ queryKey: ['todos'] })\n * }\n * </script>\n * ```\n */\nexport function useQueryClient(id = ''): QueryClient {\n // ensures that `inject()` can be used\n if (!hasInjectionContext()) {\n throw new Error(\n 'vue-query hooks can only be used inside setup() function or functions that support injection context.',\n )\n }\n\n const key = getClientKey(id)\n const queryClient = inject<QueryClient>(key)\n\n if (!queryClient) {\n throw new Error(\n \"No 'queryClient' found in Vue context, use 'VueQueryPlugin' to properly initialize the library.\",\n )\n }\n\n return queryClient\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,SAAgB,eAAe,KAAK,IAAiB;CAEnD,IAAI,EAAA,GAACA,SAAAA,oBAAAA,CAAoB,GACvB,MAAM,IAAI,MACR,uGACF;CAGF,MAAM,MAAMC,cAAAA,aAAa,EAAE;CAC3B,MAAM,eAAA,GAAcC,SAAAA,OAAAA,CAAoB,GAAG;CAE3C,IAAI,CAAC,aACH,MAAM,IAAI,MACR,iGACF;CAGF,OAAO;AACT"}
@@ -1,13 +1,13 @@
1
- import { t as QueryClient } from "./queryClient-Bn2Ql_Lu.cjs";
1
+ import { t as QueryClient } from "./queryClient-BK9W57Qu.cjs";
2
2
  //#region src/useQueryClient.d.ts
3
3
  /**
4
4
  * Retrieves the `QueryClient` installed by `VueQueryPlugin`, via Vue's `inject`. Must be called inside
5
5
  * `setup()` or another function that supports an injection context.
6
- *
7
6
  * @param id - The `queryClientKey` passed to `VueQueryPlugin` — only needed when multiple `QueryClient`s are
8
7
  * installed in the same app.
9
- * @throws If called outside an injection context, or if no `QueryClient` was installed via `VueQueryPlugin`.
10
- *
8
+ * @returns The installed `QueryClient`.
9
+ * @throws {Error} If called outside an injection context, or if no `QueryClient` was installed via
10
+ * `VueQueryPlugin`.
11
11
  * @example
12
12
  * ```vue
13
13
  * <script setup lang="ts">
@@ -1,13 +1,13 @@
1
- import { t as QueryClient } from "./queryClient-B6mLtXOj.js";
1
+ import { t as QueryClient } from "./queryClient-BoBzDWAZ.js";
2
2
  //#region src/useQueryClient.d.ts
3
3
  /**
4
4
  * Retrieves the `QueryClient` installed by `VueQueryPlugin`, via Vue's `inject`. Must be called inside
5
5
  * `setup()` or another function that supports an injection context.
6
- *
7
6
  * @param id - The `queryClientKey` passed to `VueQueryPlugin` — only needed when multiple `QueryClient`s are
8
7
  * installed in the same app.
9
- * @throws If called outside an injection context, or if no `QueryClient` was installed via `VueQueryPlugin`.
10
- *
8
+ * @returns The installed `QueryClient`.
9
+ * @throws {Error} If called outside an injection context, or if no `QueryClient` was installed via
10
+ * `VueQueryPlugin`.
11
11
  * @example
12
12
  * ```vue
13
13
  * <script setup lang="ts">
@@ -4,11 +4,11 @@ import { hasInjectionContext, inject } from "vue-demi";
4
4
  /**
5
5
  * Retrieves the `QueryClient` installed by `VueQueryPlugin`, via Vue's `inject`. Must be called inside
6
6
  * `setup()` or another function that supports an injection context.
7
- *
8
7
  * @param id - The `queryClientKey` passed to `VueQueryPlugin` — only needed when multiple `QueryClient`s are
9
8
  * installed in the same app.
10
- * @throws If called outside an injection context, or if no `QueryClient` was installed via `VueQueryPlugin`.
11
- *
9
+ * @returns The installed `QueryClient`.
10
+ * @throws {Error} If called outside an injection context, or if no `QueryClient` was installed via
11
+ * `VueQueryPlugin`.
12
12
  * @example
13
13
  * ```vue
14
14
  * <script setup lang="ts">
@@ -1 +1 @@
1
- {"version":3,"file":"useQueryClient.js","names":[],"sources":["../../src/useQueryClient.ts"],"sourcesContent":["import { hasInjectionContext, inject } from 'vue-demi'\n\nimport { getClientKey } from './utils'\nimport type { QueryClient } from './queryClient'\n\n/**\n * Retrieves the `QueryClient` installed by `VueQueryPlugin`, via Vue's `inject`. Must be called inside\n * `setup()` or another function that supports an injection context.\n *\n * @param id - The `queryClientKey` passed to `VueQueryPlugin` — only needed when multiple `QueryClient`s are\n * installed in the same app.\n * @throws If called outside an injection context, or if no `QueryClient` was installed via `VueQueryPlugin`.\n *\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { useQueryClient } from '@tanstack/vue-query'\n *\n * const queryClient = useQueryClient()\n *\n * function invalidate() {\n * queryClient.invalidateQueries({ queryKey: ['todos'] })\n * }\n * </script>\n * ```\n */\nexport function useQueryClient(id = ''): QueryClient {\n // ensures that `inject()` can be used\n if (!hasInjectionContext()) {\n throw new Error(\n 'vue-query hooks can only be used inside setup() function or functions that support injection context.',\n )\n }\n\n const key = getClientKey(id)\n const queryClient = inject<QueryClient>(key)\n\n if (!queryClient) {\n throw new Error(\n \"No 'queryClient' found in Vue context, use 'VueQueryPlugin' to properly initialize the library.\",\n )\n }\n\n return queryClient\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA0BA,SAAgB,eAAe,KAAK,IAAiB;CAEnD,IAAI,CAAC,oBAAoB,GACvB,MAAM,IAAI,MACR,uGACF;CAGF,MAAM,MAAM,aAAa,EAAE;CAC3B,MAAM,cAAc,OAAoB,GAAG;CAE3C,IAAI,CAAC,aACH,MAAM,IAAI,MACR,iGACF;CAGF,OAAO;AACT"}
1
+ {"version":3,"file":"useQueryClient.js","names":[],"sources":["../../src/useQueryClient.ts"],"sourcesContent":["import { hasInjectionContext, inject } from 'vue-demi'\n\nimport { getClientKey } from './utils'\nimport type { QueryClient } from './queryClient'\n\n/**\n * Retrieves the `QueryClient` installed by `VueQueryPlugin`, via Vue's `inject`. Must be called inside\n * `setup()` or another function that supports an injection context.\n * @param id - The `queryClientKey` passed to `VueQueryPlugin` — only needed when multiple `QueryClient`s are\n * installed in the same app.\n * @returns The installed `QueryClient`.\n * @throws {Error} If called outside an injection context, or if no `QueryClient` was installed via\n * `VueQueryPlugin`.\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { useQueryClient } from '@tanstack/vue-query'\n *\n * const queryClient = useQueryClient()\n *\n * function invalidate() {\n * queryClient.invalidateQueries({ queryKey: ['todos'] })\n * }\n * </script>\n * ```\n */\nexport function useQueryClient(id = ''): QueryClient {\n // ensures that `inject()` can be used\n if (!hasInjectionContext()) {\n throw new Error(\n 'vue-query hooks can only be used inside setup() function or functions that support injection context.',\n )\n }\n\n const key = getClientKey(id)\n const queryClient = inject<QueryClient>(key)\n\n if (!queryClient) {\n throw new Error(\n \"No 'queryClient' found in Vue context, use 'VueQueryPlugin' to properly initialize the library.\",\n )\n }\n\n return queryClient\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA0BA,SAAgB,eAAe,KAAK,IAAiB;CAEnD,IAAI,CAAC,oBAAoB,GACvB,MAAM,IAAI,MACR,uGACF;CAGF,MAAM,MAAM,aAAa,EAAE;CAC3B,MAAM,cAAc,OAAoB,GAAG;CAE3C,IAAI,CAAC,aACH,MAAM,IAAI,MACR,iGACF;CAGF,OAAO;AACT"}
@@ -1,19 +1,42 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  let vue_demi = require("vue-demi");
3
3
  //#region src/utils.ts
4
- /** @internal Base Vue injection key `VueQueryPlugin` provides the `QueryClient` under. */
4
+ /**
5
+ * Base Vue injection key `VueQueryPlugin` provides the `QueryClient` under.
6
+ * @internal
7
+ */
5
8
  const VUE_QUERY_CLIENT = "VUE_QUERY_CLIENT";
6
- /** @internal Builds the injection key `useQueryClient`/`VueQueryPlugin` use for a given `queryClientKey`. */
9
+ /**
10
+ * Builds the injection key `useQueryClient`/`VueQueryPlugin` use for a given `queryClientKey`.
11
+ * @internal
12
+ * @param key - The `queryClientKey`. Without it, the base key is used.
13
+ * @returns The injection key.
14
+ */
7
15
  function getClientKey(key) {
8
16
  const suffix = key ? `:${key}` : "";
9
17
  return `${VUE_QUERY_CLIENT}${suffix}`;
10
18
  }
11
- /** @internal Copies each property from `update` onto `state`, in place, for every key already on `state`. */
19
+ /**
20
+ * Copies each property from `update` onto `state`, in place, for every key already on `state`.
21
+ * @internal
22
+ * @param state - The object to update.
23
+ * @param update - The object to copy the values from.
24
+ */
12
25
  function updateState(state, update) {
13
26
  Object.keys(state).forEach((key) => {
14
27
  state[key] = update[key];
15
28
  });
16
29
  }
30
+ /**
31
+ * Recursive implementation of {@link cloneDeep}, which also tracks the key and nesting level of
32
+ * the current node for `customize`.
33
+ * @param value - The value to clone.
34
+ * @param customize - Called for every node with its key and nesting level. If it returns a value
35
+ * other than `undefined`, that value is used instead of recursing.
36
+ * @param currentKey - The key of the current node.
37
+ * @param currentLevel - The nesting level of the current node.
38
+ * @returns The cloned value.
39
+ */
17
40
  function _cloneDeep(value, customize, currentKey = "", currentLevel = 0) {
18
41
  if (customize) {
19
42
  const result = customize(value, currentKey, currentLevel);
@@ -28,18 +51,27 @@ function _cloneDeep(value, customize, currentKey = "", currentLevel = 0) {
28
51
  return value;
29
52
  }
30
53
  /**
31
- * @internal Deep-clones `value`, recursing into arrays and plain objects. `customize`, if provided, can
54
+ * Deep-clones `value`, recursing into arrays and plain objects. `customize`, if provided, can
32
55
  * intercept any node (by key and nesting level) and substitute its own return value instead of recursing
33
56
  * further.
57
+ * @internal
58
+ * @param value - The value to clone.
59
+ * @param customize - Called for every node with its key and nesting level. If it returns a value
60
+ * other than `undefined`, that value is used instead of recursing.
61
+ * @returns The cloned value.
34
62
  */
35
63
  function cloneDeep(value, customize) {
36
64
  return _cloneDeep(value, customize);
37
65
  }
38
66
  /**
39
- * @internal Deep-clones `value` like {@link cloneDeep}, additionally unwrapping any `ref`s it encounters (and,
67
+ * Deep-clones `value` like {@link cloneDeep}, additionally unwrapping any `ref`s it encounters (and,
40
68
  * if `unrefGetters` is `true`, calling any functions it encounters and unwrapping their result too). Always
41
69
  * resolves `queryKey` this way, regardless of `unrefGetters` — this is what lets a `queryKey` containing `ref`s
42
70
  * be passed straight through to `@tanstack/query-core`.
71
+ * @internal
72
+ * @param obj - The value to clone.
73
+ * @param unrefGetters - Whether to also call functions and unwrap their result.
74
+ * @returns The cloned value, with `ref`s unwrapped.
43
75
  */
44
76
  function cloneDeepUnref(obj, unrefGetters = false) {
45
77
  return cloneDeep(obj, (val, key, level) => {
@@ -48,15 +80,31 @@ function cloneDeepUnref(obj, unrefGetters = false) {
48
80
  if ((0, vue_demi.isRef)(val)) return cloneDeepUnref((0, vue_demi.unref)(val), unrefGetters);
49
81
  });
50
82
  }
83
+ /**
84
+ * Checks whether a value is a plain object, created with an object literal or
85
+ * `Object.create(null)`.
86
+ * @param value - The value to check.
87
+ * @returns `true` if `value` is a plain object.
88
+ */
51
89
  function isPlainObject(value) {
52
90
  if (Object.prototype.toString.call(value) !== "[object Object]") return false;
53
91
  const prototype = Object.getPrototypeOf(value);
54
92
  return prototype === null || prototype === Object.prototype;
55
93
  }
94
+ /**
95
+ * Checks whether a value is a function.
96
+ * @param value - The value to check.
97
+ * @returns `true` if `value` is a function.
98
+ */
56
99
  function isFunction(value) {
57
100
  return typeof value === "function";
58
101
  }
59
- /** @internal Resolves `source` to a plain value — calls it if it's a function, otherwise deep-unwraps it. */
102
+ /**
103
+ * Resolves `source` to a plain value — calls it if it's a function, otherwise deep-unwraps it.
104
+ * @internal
105
+ * @param source - A getter, or a value that may contain `ref`s.
106
+ * @returns The resolved plain value.
107
+ */
60
108
  function toValueDeep(source) {
61
109
  return isFunction(source) ? source() : cloneDeepUnref(source);
62
110
  }
@@ -1 +1 @@
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\n/** @internal Base Vue injection key `VueQueryPlugin` provides the `QueryClient` under. */\nexport const VUE_QUERY_CLIENT = 'VUE_QUERY_CLIENT'\n\n/** @internal Builds the injection key `useQueryClient`/`VueQueryPlugin` use for a given `queryClientKey`. */\nexport function getClientKey(key?: string) {\n const suffix = key ? `:${key}` : ''\n return `${VUE_QUERY_CLIENT}${suffix}`\n}\n\n/** @internal Copies each property from `update` onto `state`, in place, for every key already on `state`. */\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\n/**\n * @internal Deep-clones `value`, recursing into arrays and plain objects. `customize`, if provided, can\n * intercept any node (by key and nesting level) and substitute its own return value instead of recursing\n * further.\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\n/**\n * @internal Deep-clones `value` like {@link cloneDeep}, additionally unwrapping any `ref`s it encounters (and,\n * if `unrefGetters` is `true`, calling any functions it encounters and unwrapping their result too). Always\n * resolves `queryKey` this way, regardless of `unrefGetters` — this is what lets a `queryKey` containing `ref`s\n * be passed straight through to `@tanstack/query-core`.\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\n/** @internal Resolves `source` to a plain value — calls it if it's a function, otherwise deep-unwraps it. */\nexport function toValueDeep<T>(source: (() => T) | MaybeRefDeep<T>): T {\n return isFunction(source) ? source() : cloneDeepUnref(source)\n}\n"],"mappings":";;;;AAIA,MAAa,mBAAmB;;AAGhC,SAAgB,aAAa,KAAc;CACzC,MAAM,SAAS,MAAM,IAAI,QAAQ;CACjC,OAAO,GAAG,mBAAmB;AAC/B;;AAGA,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;;;;;;AAOA,SAAgB,UACd,OACA,WAKG;CACH,OAAO,WAAW,OAAO,SAAS;AACpC;;;;;;;AAQA,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;;AAGA,SAAgB,YAAe,QAAwC;CACrE,OAAO,WAAW,MAAM,IAAI,OAAO,IAAI,eAAe,MAAM;AAC9D"}
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\n/**\n * Base Vue injection key `VueQueryPlugin` provides the `QueryClient` under.\n * @internal\n */\nexport const VUE_QUERY_CLIENT = 'VUE_QUERY_CLIENT'\n\n/**\n * Builds the injection key `useQueryClient`/`VueQueryPlugin` use for a given `queryClientKey`.\n * @internal\n * @param key - The `queryClientKey`. Without it, the base key is used.\n * @returns The injection key.\n */\nexport function getClientKey(key?: string) {\n const suffix = key ? `:${key}` : ''\n return `${VUE_QUERY_CLIENT}${suffix}`\n}\n\n/**\n * Copies each property from `update` onto `state`, in place, for every key already on `state`.\n * @internal\n * @param state - The object to update.\n * @param update - The object to copy the values from.\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/**\n * Recursive implementation of {@link cloneDeep}, which also tracks the key and nesting level of\n * the current node for `customize`.\n * @param value - The value to clone.\n * @param customize - Called for every node with its key and nesting level. If it returns a value\n * other than `undefined`, that value is used instead of recursing.\n * @param currentKey - The key of the current node.\n * @param currentLevel - The nesting level of the current node.\n * @returns The cloned value.\n */\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\n/**\n * Deep-clones `value`, recursing into arrays and plain objects. `customize`, if provided, can\n * intercept any node (by key and nesting level) and substitute its own return value instead of recursing\n * further.\n * @internal\n * @param value - The value to clone.\n * @param customize - Called for every node with its key and nesting level. If it returns a value\n * other than `undefined`, that value is used instead of recursing.\n * @returns The cloned value.\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\n/**\n * Deep-clones `value` like {@link cloneDeep}, additionally unwrapping any `ref`s it encounters (and,\n * if `unrefGetters` is `true`, calling any functions it encounters and unwrapping their result too). Always\n * resolves `queryKey` this way, regardless of `unrefGetters` — this is what lets a `queryKey` containing `ref`s\n * be passed straight through to `@tanstack/query-core`.\n * @internal\n * @param obj - The value to clone.\n * @param unrefGetters - Whether to also call functions and unwrap their result.\n * @returns The cloned value, with `ref`s unwrapped.\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/**\n * Checks whether a value is a plain object, created with an object literal or\n * `Object.create(null)`.\n * @param value - The value to check.\n * @returns `true` if `value` is a plain object.\n */\n// oxlint-disable-next-line typescript/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\n/**\n * Checks whether a value is a function.\n * @param value - The value to check.\n * @returns `true` if `value` is a function.\n */\nfunction isFunction(value: unknown): value is Function {\n return typeof value === 'function'\n}\n\n/**\n * Resolves `source` to a plain value — calls it if it's a function, otherwise deep-unwraps it.\n * @internal\n * @param source - A getter, or a value that may contain `ref`s.\n * @returns The resolved plain value.\n */\nexport function toValueDeep<T>(source: (() => T) | MaybeRefDeep<T>): T {\n return isFunction(source) ? source() : cloneDeepUnref(source)\n}\n"],"mappings":";;;;;;;AAOA,MAAa,mBAAmB;;;;;;;AAQhC,SAAgB,aAAa,KAAc;CACzC,MAAM,SAAS,MAAM,IAAI,QAAQ;CACjC,OAAO,GAAG,mBAAmB;AAC/B;;;;;;;AAQA,SAAgB,YACd,OACA,QACM;CACN,OAAO,KAAK,KAAK,CAAC,CAAC,SAAS,QAAQ;EAClC,MAAM,OAAO,OAAO;CACtB,CAAC;AACH;;;;;;;;;;;AAYA,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;;;;;;;;;;;AAYA,SAAgB,UACd,OACA,WAKG;CACH,OAAO,WAAW,OAAO,SAAS;AACpC;;;;;;;;;;;AAYA,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;;;;;;;AASA,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;;;;;;AAOA,SAAS,WAAW,OAAmC;CACrD,OAAO,OAAO,UAAU;AAC1B;;;;;;;AAQA,SAAgB,YAAe,QAAwC;CACrE,OAAO,WAAW,MAAM,IAAI,OAAO,IAAI,eAAe,MAAM;AAC9D"}
@@ -1,25 +1,52 @@
1
- import { o as MaybeRefDeep } from "./types-JpJB72CS.cjs";
1
+ import { o as MaybeRefDeep } from "./types-sdZdiLgo.cjs";
2
2
  //#region src/utils.d.ts
3
- /** @internal Base Vue injection key `VueQueryPlugin` provides the `QueryClient` under. */
3
+ /**
4
+ * Base Vue injection key `VueQueryPlugin` provides the `QueryClient` under.
5
+ * @internal
6
+ */
4
7
  export declare const VUE_QUERY_CLIENT = "VUE_QUERY_CLIENT";
5
- /** @internal Builds the injection key `useQueryClient`/`VueQueryPlugin` use for a given `queryClientKey`. */
8
+ /**
9
+ * Builds the injection key `useQueryClient`/`VueQueryPlugin` use for a given `queryClientKey`.
10
+ * @internal
11
+ * @param key - The `queryClientKey`. Without it, the base key is used.
12
+ * @returns The injection key.
13
+ */
6
14
  export declare function getClientKey(key?: string): string;
7
- /** @internal Copies each property from `update` onto `state`, in place, for every key already on `state`. */
15
+ /**
16
+ * Copies each property from `update` onto `state`, in place, for every key already on `state`.
17
+ * @internal
18
+ * @param state - The object to update.
19
+ * @param update - The object to copy the values from.
20
+ */
8
21
  export declare function updateState(state: Record<string, any>, update: Record<string, any>): void;
9
22
  /**
10
- * @internal Deep-clones `value`, recursing into arrays and plain objects. `customize`, if provided, can
23
+ * Deep-clones `value`, recursing into arrays and plain objects. `customize`, if provided, can
11
24
  * intercept any node (by key and nesting level) and substitute its own return value instead of recursing
12
25
  * further.
26
+ * @internal
27
+ * @param value - The value to clone.
28
+ * @param customize - Called for every node with its key and nesting level. If it returns a value
29
+ * other than `undefined`, that value is used instead of recursing.
30
+ * @returns The cloned value.
13
31
  */
14
32
  export declare function cloneDeep<T>(value: MaybeRefDeep<T>, customize?: (val: MaybeRefDeep<T>, key: string, level: number) => T | undefined): T;
15
33
  /**
16
- * @internal Deep-clones `value` like {@link cloneDeep}, additionally unwrapping any `ref`s it encounters (and,
34
+ * Deep-clones `value` like {@link cloneDeep}, additionally unwrapping any `ref`s it encounters (and,
17
35
  * if `unrefGetters` is `true`, calling any functions it encounters and unwrapping their result too). Always
18
36
  * resolves `queryKey` this way, regardless of `unrefGetters` — this is what lets a `queryKey` containing `ref`s
19
37
  * be passed straight through to `@tanstack/query-core`.
38
+ * @internal
39
+ * @param obj - The value to clone.
40
+ * @param unrefGetters - Whether to also call functions and unwrap their result.
41
+ * @returns The cloned value, with `ref`s unwrapped.
20
42
  */
21
43
  export declare function cloneDeepUnref<T>(obj: MaybeRefDeep<T>, unrefGetters?: boolean): T;
22
- /** @internal Resolves `source` to a plain value — calls it if it's a function, otherwise deep-unwraps it. */
44
+ /**
45
+ * Resolves `source` to a plain value — calls it if it's a function, otherwise deep-unwraps it.
46
+ * @internal
47
+ * @param source - A getter, or a value that may contain `ref`s.
48
+ * @returns The resolved plain value.
49
+ */
23
50
  export declare function toValueDeep<T>(source: (() => T) | MaybeRefDeep<T>): T;
24
51
  //#endregion
25
52
  //# sourceMappingURL=utils.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.cts","names":[],"sources":["../../src/utils.ts"],"mappings":";;;qBAIa;;wBAGG,aAAa;;wBAMb,YACd,OAAO,qBACP,QAAQ;;;;;;wBAmDM,UAAU,GACxB,OAAO,aAAa,IACpB,aACE,KAAK,aAAa,IAClB,aACA,kBACG,gBACJ;;;;;;;wBAUa,eAAe,GAC7B,KAAK,aAAa,IAClB,yBACC;;wBAyCa,YAAY,GAAG,eAAe,KAAK,aAAa,KAAK"}
1
+ {"version":3,"file":"utils.d.cts","names":[],"sources":["../../src/utils.ts"],"mappings":";;;;;;qBAOa;;;;;;;wBAQG,aAAa;;;;;;;wBAWb,YACd,OAAO,qBACP,QAAQ;;;;;;;;;;;wBAgEM,UAAU,GACxB,OAAO,aAAa,IACpB,aACE,KAAK,aAAa,IAClB,aACA,kBACG,gBACJ;;;;;;;;;;;wBAca,eAAe,GAC7B,KAAK,aAAa,IAClB,yBACC;;;;;;;wBAyDa,YAAY,GAAG,eAAe,KAAK,aAAa,KAAK"}
@@ -1,25 +1,52 @@
1
- import { o as MaybeRefDeep } from "./types-JpJB72CS.js";
1
+ import { o as MaybeRefDeep } from "./types-sdZdiLgo.js";
2
2
  //#region src/utils.d.ts
3
- /** @internal Base Vue injection key `VueQueryPlugin` provides the `QueryClient` under. */
3
+ /**
4
+ * Base Vue injection key `VueQueryPlugin` provides the `QueryClient` under.
5
+ * @internal
6
+ */
4
7
  export declare const VUE_QUERY_CLIENT = "VUE_QUERY_CLIENT";
5
- /** @internal Builds the injection key `useQueryClient`/`VueQueryPlugin` use for a given `queryClientKey`. */
8
+ /**
9
+ * Builds the injection key `useQueryClient`/`VueQueryPlugin` use for a given `queryClientKey`.
10
+ * @internal
11
+ * @param key - The `queryClientKey`. Without it, the base key is used.
12
+ * @returns The injection key.
13
+ */
6
14
  export declare function getClientKey(key?: string): string;
7
- /** @internal Copies each property from `update` onto `state`, in place, for every key already on `state`. */
15
+ /**
16
+ * Copies each property from `update` onto `state`, in place, for every key already on `state`.
17
+ * @internal
18
+ * @param state - The object to update.
19
+ * @param update - The object to copy the values from.
20
+ */
8
21
  export declare function updateState(state: Record<string, any>, update: Record<string, any>): void;
9
22
  /**
10
- * @internal Deep-clones `value`, recursing into arrays and plain objects. `customize`, if provided, can
23
+ * Deep-clones `value`, recursing into arrays and plain objects. `customize`, if provided, can
11
24
  * intercept any node (by key and nesting level) and substitute its own return value instead of recursing
12
25
  * further.
26
+ * @internal
27
+ * @param value - The value to clone.
28
+ * @param customize - Called for every node with its key and nesting level. If it returns a value
29
+ * other than `undefined`, that value is used instead of recursing.
30
+ * @returns The cloned value.
13
31
  */
14
32
  export declare function cloneDeep<T>(value: MaybeRefDeep<T>, customize?: (val: MaybeRefDeep<T>, key: string, level: number) => T | undefined): T;
15
33
  /**
16
- * @internal Deep-clones `value` like {@link cloneDeep}, additionally unwrapping any `ref`s it encounters (and,
34
+ * Deep-clones `value` like {@link cloneDeep}, additionally unwrapping any `ref`s it encounters (and,
17
35
  * if `unrefGetters` is `true`, calling any functions it encounters and unwrapping their result too). Always
18
36
  * resolves `queryKey` this way, regardless of `unrefGetters` — this is what lets a `queryKey` containing `ref`s
19
37
  * be passed straight through to `@tanstack/query-core`.
38
+ * @internal
39
+ * @param obj - The value to clone.
40
+ * @param unrefGetters - Whether to also call functions and unwrap their result.
41
+ * @returns The cloned value, with `ref`s unwrapped.
20
42
  */
21
43
  export declare function cloneDeepUnref<T>(obj: MaybeRefDeep<T>, unrefGetters?: boolean): T;
22
- /** @internal Resolves `source` to a plain value — calls it if it's a function, otherwise deep-unwraps it. */
44
+ /**
45
+ * Resolves `source` to a plain value — calls it if it's a function, otherwise deep-unwraps it.
46
+ * @internal
47
+ * @param source - A getter, or a value that may contain `ref`s.
48
+ * @returns The resolved plain value.
49
+ */
23
50
  export declare function toValueDeep<T>(source: (() => T) | MaybeRefDeep<T>): T;
24
51
  //#endregion
25
52
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","names":[],"sources":["../../src/utils.ts"],"mappings":";;;qBAIa;;wBAGG,aAAa;;wBAMb,YACd,OAAO,qBACP,QAAQ;;;;;;wBAmDM,UAAU,GACxB,OAAO,aAAa,IACpB,aACE,KAAK,aAAa,IAClB,aACA,kBACG,gBACJ;;;;;;;wBAUa,eAAe,GAC7B,KAAK,aAAa,IAClB,yBACC;;wBAyCa,YAAY,GAAG,eAAe,KAAK,aAAa,KAAK"}
1
+ {"version":3,"file":"utils.d.ts","names":[],"sources":["../../src/utils.ts"],"mappings":";;;;;;qBAOa;;;;;;;wBAQG,aAAa;;;;;;;wBAWb,YACd,OAAO,qBACP,QAAQ;;;;;;;;;;;wBAgEM,UAAU,GACxB,OAAO,aAAa,IACpB,aACE,KAAK,aAAa,IAClB,aACA,kBACG,gBACJ;;;;;;;;;;;wBAca,eAAe,GAC7B,KAAK,aAAa,IAClB,yBACC;;;;;;;wBAyDa,YAAY,GAAG,eAAe,KAAK,aAAa,KAAK"}