@tanstack/vue-query 5.104.0 → 5.104.2

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 +6 -6
  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 +1 @@
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 /** Enables the legacy Vue Devtools v6 plugin panel. Prefer `@tanstack/vue-query-devtools` for Vue 3 apps. */\n enableDevtoolsV6Plugin?: boolean\n /**\n * Distinguishes multiple `QueryClient`s provided in the same app — pass the same key to `useQueryClient` to\n * pick this one. Only needed when installing more than one client.\n */\n queryClientKey?: string\n /**\n * Restores a persisted cache before the app mounts. While it runs, `queryClient.isRestoring` is `true`, which\n * suppresses fetches — see `usePersistQueryClient` in `@tanstack/query-persist-client-core` for building one.\n */\n clientPersister?: ClientPersister\n /** Called once `clientPersister`'s returned promise resolves and the cache has finished restoring. */\n clientPersisterOnSuccess?: (client: QueryClient) => void\n}\n\ninterface ConfigOptions extends CommonOptions {\n /** Options for the `QueryClient` the plugin constructs. Ignored if `queryClient` is also set. */\n queryClientConfig?: QueryClientConfig\n}\n\ninterface ClientOptions extends CommonOptions {\n /** Use your own `QueryClient` instance instead of having the plugin construct one from `queryClientConfig`. */\n queryClient?: QueryClient\n}\n\nexport type VueQueryPluginOptions = ConfigOptions | ClientOptions\n\n/**\n * Installs a `QueryClient` on the Vue app, making it available to every descendant component through\n * `useQueryClient` — the Vue equivalent of React's `QueryClientProvider`, but wired up as an app-level plugin\n * instead of a wrapping component.\n *\n * @example\n * ```ts\n * import { createApp } from 'vue'\n * import { VueQueryPlugin } from '@tanstack/vue-query'\n *\n * const app = createApp(App)\n * app.use(VueQueryPlugin)\n * ```\n *\n * @example\n * Pass a `queryClient` you constructed yourself — useful for SSR, where you need a fresh `QueryClient` per\n * request, or when the same instance also needs to be used outside of Vue components:\n * ```ts\n * import { QueryClient, VueQueryPlugin } from '@tanstack/vue-query'\n *\n * const queryClient = new QueryClient()\n * app.use(VueQueryPlugin, { queryClient })\n * ```\n *\n * @example\n * Or pass `queryClientConfig` to let the plugin construct the `QueryClient` for you, with your own defaults:\n * ```ts\n * app.use(VueQueryPlugin, {\n * queryClientConfig: {\n * defaultOptions: { queries: { staleTime: 5 * 1000 } },\n * },\n * })\n * ```\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyEA,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,QAAQ,2BAA2B,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
+ {"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 /** Enables the legacy Vue Devtools v6 plugin panel. Prefer `@tanstack/vue-query-devtools` for Vue 3 apps. */\n enableDevtoolsV6Plugin?: boolean\n /**\n * Distinguishes multiple `QueryClient`s provided in the same app — pass the same key to `useQueryClient` to\n * pick this one. Only needed when installing more than one client.\n */\n queryClientKey?: string\n /**\n * Restores a persisted cache before the app mounts. While it runs, `queryClient.isRestoring` is `true`, which\n * suppresses fetches — see `usePersistQueryClient` in `@tanstack/query-persist-client-core` for building one.\n */\n clientPersister?: ClientPersister\n /** Called once `clientPersister`'s returned promise resolves and the cache has finished restoring. */\n clientPersisterOnSuccess?: (client: QueryClient) => void\n}\n\ninterface ConfigOptions extends CommonOptions {\n /** Options for the `QueryClient` the plugin constructs. Ignored if `queryClient` is also set. */\n queryClientConfig?: QueryClientConfig\n}\n\ninterface ClientOptions extends CommonOptions {\n /** Use your own `QueryClient` instance instead of having the plugin construct one from `queryClientConfig`. */\n queryClient?: QueryClient\n}\n\n/**\n * The options accepted by `VueQueryPlugin`: either a `queryClient` to install, or a `queryClientConfig` for the\n * client the plugin creates, plus the shared options.\n */\nexport type VueQueryPluginOptions = ConfigOptions | ClientOptions\n\n/**\n * Installs a `QueryClient` on the Vue app, making it available to every descendant component through\n * `useQueryClient` — the Vue equivalent of React's `QueryClientProvider`, but wired up as an app-level plugin\n * instead of a wrapping component.\n * @example\n * ```ts\n * import { createApp } from 'vue'\n * import { VueQueryPlugin } from '@tanstack/vue-query'\n *\n * const app = createApp(App)\n * app.use(VueQueryPlugin)\n * ```\n * @example\n * Pass a `queryClient` you constructed yourself — useful for SSR, where you need a fresh `QueryClient` per\n * request, or when the same instance also needs to be used outside of Vue components:\n * ```ts\n * import { QueryClient, VueQueryPlugin } from '@tanstack/vue-query'\n *\n * const queryClient = new QueryClient()\n * app.use(VueQueryPlugin, { queryClient })\n * ```\n * @example\n * Or pass `queryClientConfig` to let the plugin construct the `QueryClient` for you, with your own defaults:\n * ```ts\n * app.use(VueQueryPlugin, {\n * queryClientConfig: {\n * defaultOptions: { queries: { staleTime: 5 * 1000 } },\n * },\n * })\n * ```\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0EA,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,QAAQ,2BAA2B,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,5 +1,5 @@
1
- import { u as QueryClientConfig } from "./types-JpJB72CS.cjs";
2
- import { t as QueryClient } from "./queryClient-Bn2Ql_Lu.cjs";
1
+ import { u as QueryClientConfig } from "./types-sdZdiLgo.cjs";
2
+ import { t as QueryClient } from "./queryClient-BK9W57Qu.cjs";
3
3
  //#region src/vueQueryPlugin.d.ts
4
4
  type ClientPersister = (client: QueryClient) => [() => void, Promise<void>];
5
5
  interface CommonOptions {
@@ -26,12 +26,15 @@ interface ClientOptions extends CommonOptions {
26
26
  /** Use your own `QueryClient` instance instead of having the plugin construct one from `queryClientConfig`. */
27
27
  queryClient?: QueryClient;
28
28
  }
29
+ /**
30
+ * The options accepted by `VueQueryPlugin`: either a `queryClient` to install, or a `queryClientConfig` for the
31
+ * client the plugin creates, plus the shared options.
32
+ */
29
33
  export type VueQueryPluginOptions = ConfigOptions | ClientOptions;
30
34
  /**
31
35
  * Installs a `QueryClient` on the Vue app, making it available to every descendant component through
32
36
  * `useQueryClient` — the Vue equivalent of React's `QueryClientProvider`, but wired up as an app-level plugin
33
37
  * instead of a wrapping component.
34
- *
35
38
  * @example
36
39
  * ```ts
37
40
  * import { createApp } from 'vue'
@@ -40,7 +43,6 @@ export type VueQueryPluginOptions = ConfigOptions | ClientOptions;
40
43
  * const app = createApp(App)
41
44
  * app.use(VueQueryPlugin)
42
45
  * ```
43
- *
44
46
  * @example
45
47
  * Pass a `queryClient` you constructed yourself — useful for SSR, where you need a fresh `QueryClient` per
46
48
  * request, or when the same instance also needs to be used outside of Vue components:
@@ -50,7 +52,6 @@ export type VueQueryPluginOptions = ConfigOptions | ClientOptions;
50
52
  * const queryClient = new QueryClient()
51
53
  * app.use(VueQueryPlugin, { queryClient })
52
54
  * ```
53
- *
54
55
  * @example
55
56
  * Or pass `queryClientConfig` to let the plugin construct the `QueryClient` for you, with your own defaults:
56
57
  * ```ts
@@ -1 +1 @@
1
- {"version":3,"file":"vueQueryPlugin.d.cts","names":[],"sources":["../../src/vueQueryPlugin.ts"],"mappings":";;;KAQK,mBAAmB,QAAQ,6BAA6B;UAEnD;;EAER;;;;;EAKA;;;;;EAKA,kBAAkB;;EAElB,4BAA4B,QAAQ;;UAG5B,sBAAsB;;EAE9B,oBAAoB;;UAGZ,sBAAsB;;EAE9B,cAAc;;YAGJ,wBAAwB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAoCvC;EACI,UAAA,UAAG,UAAW"}
1
+ {"version":3,"file":"vueQueryPlugin.d.cts","names":[],"sources":["../../src/vueQueryPlugin.ts"],"mappings":";;;KAQK,mBAAmB,QAAQ,6BAA6B;UAEnD;;EAER;;;;;EAKA;;;;;EAKA,kBAAkB;;EAElB,4BAA4B,QAAQ;;UAG5B,sBAAsB;;EAE9B,oBAAoB;;UAGZ,sBAAsB;;EAE9B,cAAc;;;;;;YAOJ,wBAAwB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAiCvC;EACI,UAAA,UAAG,UAAW"}
@@ -1,5 +1,5 @@
1
- import { u as QueryClientConfig } from "./types-JpJB72CS.js";
2
- import { t as QueryClient } from "./queryClient-B6mLtXOj.js";
1
+ import { u as QueryClientConfig } from "./types-sdZdiLgo.js";
2
+ import { t as QueryClient } from "./queryClient-BoBzDWAZ.js";
3
3
  //#region src/vueQueryPlugin.d.ts
4
4
  type ClientPersister = (client: QueryClient) => [() => void, Promise<void>];
5
5
  interface CommonOptions {
@@ -26,12 +26,15 @@ interface ClientOptions extends CommonOptions {
26
26
  /** Use your own `QueryClient` instance instead of having the plugin construct one from `queryClientConfig`. */
27
27
  queryClient?: QueryClient;
28
28
  }
29
+ /**
30
+ * The options accepted by `VueQueryPlugin`: either a `queryClient` to install, or a `queryClientConfig` for the
31
+ * client the plugin creates, plus the shared options.
32
+ */
29
33
  export type VueQueryPluginOptions = ConfigOptions | ClientOptions;
30
34
  /**
31
35
  * Installs a `QueryClient` on the Vue app, making it available to every descendant component through
32
36
  * `useQueryClient` — the Vue equivalent of React's `QueryClientProvider`, but wired up as an app-level plugin
33
37
  * instead of a wrapping component.
34
- *
35
38
  * @example
36
39
  * ```ts
37
40
  * import { createApp } from 'vue'
@@ -40,7 +43,6 @@ export type VueQueryPluginOptions = ConfigOptions | ClientOptions;
40
43
  * const app = createApp(App)
41
44
  * app.use(VueQueryPlugin)
42
45
  * ```
43
- *
44
46
  * @example
45
47
  * Pass a `queryClient` you constructed yourself — useful for SSR, where you need a fresh `QueryClient` per
46
48
  * request, or when the same instance also needs to be used outside of Vue components:
@@ -50,7 +52,6 @@ export type VueQueryPluginOptions = ConfigOptions | ClientOptions;
50
52
  * const queryClient = new QueryClient()
51
53
  * app.use(VueQueryPlugin, { queryClient })
52
54
  * ```
53
- *
54
55
  * @example
55
56
  * Or pass `queryClientConfig` to let the plugin construct the `QueryClient` for you, with your own defaults:
56
57
  * ```ts
@@ -1 +1 @@
1
- {"version":3,"file":"vueQueryPlugin.d.ts","names":[],"sources":["../../src/vueQueryPlugin.ts"],"mappings":";;;KAQK,mBAAmB,QAAQ,6BAA6B;UAEnD;;EAER;;;;;EAKA;;;;;EAKA,kBAAkB;;EAElB,4BAA4B,QAAQ;;UAG5B,sBAAsB;;EAE9B,oBAAoB;;UAGZ,sBAAsB;;EAE9B,cAAc;;YAGJ,wBAAwB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAoCvC;EACI,UAAA,UAAG,UAAW"}
1
+ {"version":3,"file":"vueQueryPlugin.d.ts","names":[],"sources":["../../src/vueQueryPlugin.ts"],"mappings":";;;KAQK,mBAAmB,QAAQ,6BAA6B;UAEnD;;EAER;;;;;EAKA;;;;;EAKA,kBAAkB;;EAElB,4BAA4B,QAAQ;;UAG5B,sBAAsB;;EAE9B,oBAAoB;;UAGZ,sBAAsB;;EAE9B,cAAc;;;;;;YAOJ,wBAAwB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAiCvC;EACI,UAAA,UAAG,UAAW"}
@@ -8,7 +8,6 @@ import { isVue2 } from "vue-demi";
8
8
  * Installs a `QueryClient` on the Vue app, making it available to every descendant component through
9
9
  * `useQueryClient` — the Vue equivalent of React's `QueryClientProvider`, but wired up as an app-level plugin
10
10
  * instead of a wrapping component.
11
- *
12
11
  * @example
13
12
  * ```ts
14
13
  * import { createApp } from 'vue'
@@ -17,7 +16,6 @@ import { isVue2 } from "vue-demi";
17
16
  * const app = createApp(App)
18
17
  * app.use(VueQueryPlugin)
19
18
  * ```
20
- *
21
19
  * @example
22
20
  * Pass a `queryClient` you constructed yourself — useful for SSR, where you need a fresh `QueryClient` per
23
21
  * request, or when the same instance also needs to be used outside of Vue components:
@@ -27,7 +25,6 @@ import { isVue2 } from "vue-demi";
27
25
  * const queryClient = new QueryClient()
28
26
  * app.use(VueQueryPlugin, { queryClient })
29
27
  * ```
30
- *
31
28
  * @example
32
29
  * Or pass `queryClientConfig` to let the plugin construct the `QueryClient` for you, with your own defaults:
33
30
  * ```ts
@@ -1 +1 @@
1
- {"version":3,"file":"vueQueryPlugin.js","names":["QueryClient"],"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 /** Enables the legacy Vue Devtools v6 plugin panel. Prefer `@tanstack/vue-query-devtools` for Vue 3 apps. */\n enableDevtoolsV6Plugin?: boolean\n /**\n * Distinguishes multiple `QueryClient`s provided in the same app — pass the same key to `useQueryClient` to\n * pick this one. Only needed when installing more than one client.\n */\n queryClientKey?: string\n /**\n * Restores a persisted cache before the app mounts. While it runs, `queryClient.isRestoring` is `true`, which\n * suppresses fetches — see `usePersistQueryClient` in `@tanstack/query-persist-client-core` for building one.\n */\n clientPersister?: ClientPersister\n /** Called once `clientPersister`'s returned promise resolves and the cache has finished restoring. */\n clientPersisterOnSuccess?: (client: QueryClient) => void\n}\n\ninterface ConfigOptions extends CommonOptions {\n /** Options for the `QueryClient` the plugin constructs. Ignored if `queryClient` is also set. */\n queryClientConfig?: QueryClientConfig\n}\n\ninterface ClientOptions extends CommonOptions {\n /** Use your own `QueryClient` instance instead of having the plugin construct one from `queryClientConfig`. */\n queryClient?: QueryClient\n}\n\nexport type VueQueryPluginOptions = ConfigOptions | ClientOptions\n\n/**\n * Installs a `QueryClient` on the Vue app, making it available to every descendant component through\n * `useQueryClient` — the Vue equivalent of React's `QueryClientProvider`, but wired up as an app-level plugin\n * instead of a wrapping component.\n *\n * @example\n * ```ts\n * import { createApp } from 'vue'\n * import { VueQueryPlugin } from '@tanstack/vue-query'\n *\n * const app = createApp(App)\n * app.use(VueQueryPlugin)\n * ```\n *\n * @example\n * Pass a `queryClient` you constructed yourself — useful for SSR, where you need a fresh `QueryClient` per\n * request, or when the same instance also needs to be used outside of Vue components:\n * ```ts\n * import { QueryClient, VueQueryPlugin } from '@tanstack/vue-query'\n *\n * const queryClient = new QueryClient()\n * app.use(VueQueryPlugin, { queryClient })\n * ```\n *\n * @example\n * Or pass `queryClientConfig` to let the plugin construct the `QueryClient` for you, with your own defaults:\n * ```ts\n * app.use(VueQueryPlugin, {\n * queryClientConfig: {\n * defaultOptions: { queries: { staleTime: 5 * 1000 } },\n * },\n * })\n * ```\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyEA,MAAa,iBAAiB,EAC5B,UAAU,KAAU,UAAiC,CAAC,MAAM;CAC1D,MAAM,YAAY,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,IAAIA,cAAY,YAAY;CACvC;CAEA,IAAI,CAAC,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,QAAQ,2BAA2B,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,IAAI,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,cAAc,MAAM,MAAM;EAAA;CAGhC,EACF,CAAC;MACI;EACL,IAAI,QAAQ,WAAW,MAAM;EAE7B,IAAI,QAAQ,IAAI,aAAa,eACvB;OAAA,QAAQ,wBACV,cAAc,KAAK,MAAM;EAAA;CAG/B;AACF,EACF"}
1
+ {"version":3,"file":"vueQueryPlugin.js","names":["QueryClient"],"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 /** Enables the legacy Vue Devtools v6 plugin panel. Prefer `@tanstack/vue-query-devtools` for Vue 3 apps. */\n enableDevtoolsV6Plugin?: boolean\n /**\n * Distinguishes multiple `QueryClient`s provided in the same app — pass the same key to `useQueryClient` to\n * pick this one. Only needed when installing more than one client.\n */\n queryClientKey?: string\n /**\n * Restores a persisted cache before the app mounts. While it runs, `queryClient.isRestoring` is `true`, which\n * suppresses fetches — see `usePersistQueryClient` in `@tanstack/query-persist-client-core` for building one.\n */\n clientPersister?: ClientPersister\n /** Called once `clientPersister`'s returned promise resolves and the cache has finished restoring. */\n clientPersisterOnSuccess?: (client: QueryClient) => void\n}\n\ninterface ConfigOptions extends CommonOptions {\n /** Options for the `QueryClient` the plugin constructs. Ignored if `queryClient` is also set. */\n queryClientConfig?: QueryClientConfig\n}\n\ninterface ClientOptions extends CommonOptions {\n /** Use your own `QueryClient` instance instead of having the plugin construct one from `queryClientConfig`. */\n queryClient?: QueryClient\n}\n\n/**\n * The options accepted by `VueQueryPlugin`: either a `queryClient` to install, or a `queryClientConfig` for the\n * client the plugin creates, plus the shared options.\n */\nexport type VueQueryPluginOptions = ConfigOptions | ClientOptions\n\n/**\n * Installs a `QueryClient` on the Vue app, making it available to every descendant component through\n * `useQueryClient` — the Vue equivalent of React's `QueryClientProvider`, but wired up as an app-level plugin\n * instead of a wrapping component.\n * @example\n * ```ts\n * import { createApp } from 'vue'\n * import { VueQueryPlugin } from '@tanstack/vue-query'\n *\n * const app = createApp(App)\n * app.use(VueQueryPlugin)\n * ```\n * @example\n * Pass a `queryClient` you constructed yourself — useful for SSR, where you need a fresh `QueryClient` per\n * request, or when the same instance also needs to be used outside of Vue components:\n * ```ts\n * import { QueryClient, VueQueryPlugin } from '@tanstack/vue-query'\n *\n * const queryClient = new QueryClient()\n * app.use(VueQueryPlugin, { queryClient })\n * ```\n * @example\n * Or pass `queryClientConfig` to let the plugin construct the `QueryClient` for you, with your own defaults:\n * ```ts\n * app.use(VueQueryPlugin, {\n * queryClientConfig: {\n * defaultOptions: { queries: { staleTime: 5 * 1000 } },\n * },\n * })\n * ```\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0EA,MAAa,iBAAiB,EAC5B,UAAU,KAAU,UAAiC,CAAC,MAAM;CAC1D,MAAM,YAAY,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,IAAIA,cAAY,YAAY;CACvC;CAEA,IAAI,CAAC,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,QAAQ,2BAA2B,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,IAAI,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,cAAc,MAAM,MAAM;EAAA;CAGhC,EACF,CAAC;MACI;EACL,IAAI,QAAQ,WAAW,MAAM;EAE7B,IAAI,QAAQ,IAAI,aAAa,eACvB;OAAA,QAAQ,wBACV,cAAc,KAAK,MAAM;EAAA;CAG/B;AACF,EACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/vue-query",
3
- "version": "5.104.0",
3
+ "version": "5.104.2",
4
4
  "description": "Hooks for managing, caching and syncing asynchronous and remote data in Vue",
5
5
  "author": "Damian Osipiuk",
6
6
  "license": "MIT",
@@ -40,14 +40,14 @@
40
40
  ],
41
41
  "dependencies": {
42
42
  "@tanstack/match-sorter-utils": "^9.1.2",
43
- "@tanstack/query-core": "5.104.0",
43
+ "@tanstack/query-core": "5.104.2",
44
44
  "@vue/devtools-api": "^6.6.3",
45
45
  "vue-demi": "^0.14.10"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@tanstack/query-test-utils": "0.0.0",
49
49
  "@vue/composition-api": "1.7.2",
50
- "eslint-plugin-vue": "^10.11.1",
50
+ "typescript": "6.0.3",
51
51
  "unplugin-vue": "^8.0.0",
52
52
  "vue": "^3.5.43",
53
53
  "vue2": "npm:vue@2.6",
@@ -65,14 +65,14 @@
65
65
  "scripts": {
66
66
  "clean": "premove ./build ./coverage ./dist-ts ./.cache/test-types",
67
67
  "compile": "node ../../node_modules/typescript/lib/tsc.js --project tsconfig.json",
68
- "test:eslint": "eslint --concurrency=auto ./src",
69
- "test:types": "vue-demi-switch 3 && pnpm run \"/^test:types:ts[0-9]{2}$/\"",
70
- "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts56 --tsBuildInfoFile .cache/test-types/ts56.tsbuildinfo",
68
+ "test:oxlint": "oxlint ./src",
69
+ "test:types": "vue-demi-switch 3 && npm-run-all --serial test:types:*",
71
70
  "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts57 --tsBuildInfoFile .cache/test-types/ts57.tsbuildinfo",
72
71
  "test:types:ts58": "node ../../node_modules/typescript58/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts58 --tsBuildInfoFile .cache/test-types/ts58.tsbuildinfo",
73
72
  "test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts59 --tsBuildInfoFile .cache/test-types/ts59.tsbuildinfo",
74
73
  "test:types:tscurrent": "tsc --project tsconfig.json --outDir .cache/test-types/tscurrent --tsBuildInfoFile .cache/test-types/tscurrent.tsbuildinfo",
75
74
  "test:types:ts70": "node ../../node_modules/typescript70/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts70 --tsBuildInfoFile .cache/test-types/ts70.tsbuildinfo",
75
+ "test:types:ts71": "node ../../node_modules/typescript71/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts71 --tsBuildInfoFile .cache/test-types/ts71.tsbuildinfo",
76
76
  "test:lib": "pnpm run test:lib:2 && pnpm run test:lib:2.7 && pnpm run test:lib:3",
77
77
  "test:lib:2": "vue-demi-switch 2 vue2 && vitest",
78
78
  "test:lib:2.7": "vue-demi-switch 2.7 vue2.7 && vitest",
@@ -14,6 +14,12 @@ import type { QueryClient } from '../queryClient'
14
14
  const pluginId = 'vue-query'
15
15
  const pluginName = 'Vue Query'
16
16
 
17
+ /**
18
+ * Registers the Vue Query plugin with the Vue devtools, adding a query inspector and a timeline
19
+ * layer for query cache events.
20
+ * @param app - The Vue app instance.
21
+ * @param queryClient - The client whose query cache is shown in the devtools.
22
+ */
17
23
  export function setupDevtools(app: any, queryClient: QueryClient) {
18
24
  setupDevtoolsPlugin(
19
25
  {
@@ -10,6 +10,12 @@ enum QueryState {
10
10
  Paused,
11
11
  }
12
12
 
13
+ /**
14
+ * Returns the devtools state of a query: fetching, paused, inactive (no observers), stale, or fresh,
15
+ * checked in that order.
16
+ * @param query - The query to check.
17
+ * @returns A `QueryState` value, used to label, color, and sort the query.
18
+ */
13
19
  export function getQueryState(query: Query): QueryState {
14
20
  if (query.state.fetchStatus === 'fetching') {
15
21
  return QueryState.Fetching
@@ -27,6 +33,11 @@ export function getQueryState(query: Query): QueryState {
27
33
  return QueryState.Fresh
28
34
  }
29
35
 
36
+ /**
37
+ * Returns the label of a query's devtools state, shown in the inspector.
38
+ * @param query - The query to label.
39
+ * @returns `'fetching'`, `'paused'`, `'stale'`, `'inactive'`, or `'fresh'`.
40
+ */
30
41
  export function getQueryStateLabel(query: Query): string {
31
42
  const queryState = getQueryState(query)
32
43
 
@@ -46,6 +57,11 @@ export function getQueryStateLabel(query: Query): string {
46
57
  return 'fresh'
47
58
  }
48
59
 
60
+ /**
61
+ * Returns the text color of a query's state label in the inspector.
62
+ * @param query - The query to get the color for.
63
+ * @returns Black for stale queries, otherwise white, as a hex number.
64
+ */
49
65
  export function getQueryStatusFg(query: Query): number {
50
66
  const queryState = getQueryState(query)
51
67
 
@@ -56,6 +72,11 @@ export function getQueryStatusFg(query: Query): number {
56
72
  return 0xffffff
57
73
  }
58
74
 
75
+ /**
76
+ * Returns the background color of a query's state label in the inspector.
77
+ * @param query - The query to get the color for.
78
+ * @returns The color for the query's state, as a hex number.
79
+ */
59
80
  export function getQueryStatusBg(query: Query): number {
60
81
  const queryState = getQueryState(query)
61
82
 
package/src/index.ts CHANGED
@@ -38,7 +38,11 @@ export type {
38
38
  UseInfiniteQueryOptions,
39
39
  UseInfiniteQueryReturnType,
40
40
  } from './useInfiniteQuery'
41
- export type { UseMutationOptions, UseMutationReturnType } from './useMutation'
41
+ export type {
42
+ MutationResult,
43
+ UseMutationOptions,
44
+ UseMutationReturnType,
45
+ } from './useMutation'
42
46
  export type { MutationOptions } from './types'
43
47
  export type { UseQueriesOptions, UseQueriesResults } from './useQueries'
44
48
  export type {
@@ -10,7 +10,6 @@ import type { UseInfiniteQueryOptions } from './useInfiniteQuery'
10
10
  /**
11
11
  * The options accepted by the `infiniteQueryOptions` overload selected when no `initialData` is set — `data`
12
12
  * may be `undefined` while the query is `pending`.
13
- *
14
13
  * @template TQueryFnData - The type of a single page, as your `queryFn` resolves it.
15
14
  * @template TError - The type of errors your `queryFn` may throw.
16
15
  * @template TData - The type `data` ends up as after `select` runs — defaults to `InfiniteData<TQueryFnData>`,
@@ -37,7 +36,6 @@ export type UndefinedInitialDataInfiniteOptions<
37
36
  /**
38
37
  * The options accepted by the `infiniteQueryOptions` overload selected when `initialData` is set — `data` is
39
38
  * never `undefined` (unless a `select` changes `TData` to include `undefined`).
40
- *
41
39
  * @template TQueryFnData - The type of a single page, as your `queryFn` resolves it.
42
40
  * @template TError - The type of errors your `queryFn` may throw.
43
41
  * @template TData - The type `data` ends up as after `select` runs — defaults to `InfiniteData<TQueryFnData>`,
@@ -74,12 +72,10 @@ export type DefinedInitialDataInfiniteOptions<
74
72
  * You can generally pass everything to `infiniteQueryOptions` that you can also pass to `useInfiniteQuery`.
75
73
  * These options can be shared across hooks and imperative APIs such as `queryClient.infiniteQuery`.
76
74
  * `options.queryKey` is required and is the query key to generate options for.
77
- *
78
- * @see {@link useInfiniteQuery} to run an infinite query with these options.
79
75
  * @param options - The {@link UndefinedInitialDataInfiniteOptions} to use — everything you can pass to
80
76
  * `useInfiniteQuery`.
81
77
  * @returns The same options object, typed so that `queryKey` carries the inferred data type.
82
- *
78
+ * @see {@link useInfiniteQuery} to run an infinite query with these options.
83
79
  * @example
84
80
  * ```vue
85
81
  * <script setup lang="ts">
@@ -126,12 +122,10 @@ export function infiniteQueryOptions<
126
122
  *
127
123
  * This overload is selected when `initialData` is set, so the resulting `data` is never `undefined` (unless
128
124
  * a `select` changes `TData` to include `undefined`).
129
- *
130
- * @see {@link useInfiniteQuery} to run an infinite query with these options.
131
125
  * @param options - The {@link DefinedInitialDataInfiniteOptions} to use — everything you can pass to
132
126
  * `useInfiniteQuery`, with `initialData` set.
133
127
  * @returns The same options object, typed so that `queryKey` carries the inferred data type.
134
- *
128
+ * @see {@link useInfiniteQuery} to run an infinite query with these options.
135
129
  * @example
136
130
  * ```vue
137
131
  * <script setup lang="ts">
@@ -13,7 +13,7 @@ import type { MaybeRefDeep } from './types'
13
13
  * `queryClient.getMutationCache()` — `QueryClient` constructs one of these by default.
14
14
  */
15
15
  export class MutationCache extends MC {
16
- find<
16
+ override find<
17
17
  TData = unknown,
18
18
  TError = DefaultError,
19
19
  TVariables = any,
@@ -24,7 +24,9 @@ export class MutationCache extends MC {
24
24
  return super.find(cloneDeepUnref(filters))
25
25
  }
26
26
 
27
- findAll(filters: MaybeRefDeep<MutationFilters> = {}): Array<Mutation> {
27
+ override findAll(
28
+ filters: MaybeRefDeep<MutationFilters> = {},
29
+ ): Array<Mutation> {
28
30
  return super.findAll(cloneDeepUnref(filters))
29
31
  }
30
32
  }
@@ -9,12 +9,10 @@ import type { MutationOptions } from './types'
9
9
  * Unlike a `queryKey` property on a query's options (e.g. `queryOptions({ queryKey: [...] })`), `mutationKey`
10
10
  * entries that are reactive getters (`() => id.value`) are never unwrapped — the getter function itself is
11
11
  * stored as the entry, rather than its current value. `ref` entries are still unwrapped normally.
12
- *
13
- * @see {@link useMutation} to run the mutation these options describe.
14
12
  * @param options - The mutation options to use, identical to what you'd pass to `useMutation`, with a
15
13
  * required `mutationKey`.
16
14
  * @returns The same options object, unchanged.
17
- *
15
+ * @see {@link useMutation} to run the mutation these options describe.
18
16
  * @example
19
17
  * Looking the mutation up elsewhere via its `mutationKey`, e.g. for a global "saving…" indicator:
20
18
  * ```vue
@@ -54,12 +52,10 @@ export function mutationOptions<
54
52
  * Same as the plain-object overload with a required `mutationKey`, but for options that close over reactive
55
53
  * state (`ref`s read inside the function body). Wrap them in a getter so `useMutation` and the other consumers
56
54
  * always read the current values instead of the ones captured when the options were created.
57
- *
58
- * @see {@link useMutation} to run the mutation these options describe.
59
55
  * @param options - A function returning the mutation options to use, with a required `mutationKey`,
60
56
  * re-evaluated on demand.
61
57
  * @returns A function that returns the same options object, unchanged.
62
- *
58
+ * @see {@link useMutation} to run the mutation these options describe.
63
59
  * @example
64
60
  * ```vue
65
61
  * <script setup lang="ts">
@@ -101,13 +97,11 @@ export function mutationOptions<
101
97
  * `mutationKey` is required on this overload — use this when you don't need to target the mutation via a
102
98
  * `mutationKey` filter later (e.g. with `useMutationState`); it can still be observed through other filters,
103
99
  * such as `status`.
104
- *
105
- * @see {@link useMutation} to run the mutation these options describe.
106
100
  * @param options - The mutation options to use, identical to what you'd pass to `useMutation`, without a
107
101
  * `mutationKey`.
108
102
  * @returns The same options object, unchanged.
109
103
  * @remarks See the other overload's example for looking a mutation up via `useMutationState`.
110
- *
104
+ * @see {@link useMutation} to run the mutation these options describe.
111
105
  * @example
112
106
  * ```vue
113
107
  * <script setup lang="ts">
@@ -144,12 +138,10 @@ export function mutationOptions<
144
138
  * Same as the plain-object overload without a `mutationKey`, but for options that close over reactive state
145
139
  * (`ref`s read inside the function body). Wrap them in a getter so `useMutation` and the other consumers
146
140
  * always read the current values instead of the ones captured when the options were created.
147
- *
148
- * @see {@link useMutation} to run the mutation these options describe.
149
141
  * @param options - A function returning the mutation options to use, without a `mutationKey`, re-evaluated on
150
142
  * demand.
151
143
  * @returns A function that returns the same options object, unchanged.
152
- *
144
+ * @see {@link useMutation} to run the mutation these options describe.
153
145
  * @example
154
146
  * ```vue
155
147
  * <script setup lang="ts">
package/src/queryCache.ts CHANGED
@@ -14,13 +14,17 @@ import type { MaybeRefDeep } from './types'
14
14
  * `queryClient.getQueryCache()` — `QueryClient` constructs one of these by default.
15
15
  */
16
16
  export class QueryCache extends QC {
17
- find<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData>(
17
+ override find<
18
+ TQueryFnData = unknown,
19
+ TError = DefaultError,
20
+ TData = TQueryFnData,
21
+ >(
18
22
  filters: MaybeRefDeep<WithRequired<QueryFilters, 'queryKey'>>,
19
23
  ): Query<TQueryFnData, TError, TData> | undefined {
20
24
  return super.find(cloneDeepUnref(filters))
21
25
  }
22
26
 
23
- findAll(filters: MaybeRefDeep<QueryFilters> = {}): Array<Query> {
27
+ override findAll(filters: MaybeRefDeep<QueryFilters> = {}): Array<Query> {
24
28
  return super.findAll(cloneDeepUnref(filters))
25
29
  }
26
30
  }