@tanstack/vue-query 5.102.8 → 5.103.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (329) hide show
  1. package/build/legacy/devtools/devtools.d.cts +1 -1
  2. package/build/legacy/devtools/devtools.d.ts +1 -1
  3. package/build/legacy/index.d.cts +8 -6
  4. package/build/legacy/index.d.ts +8 -6
  5. package/build/legacy/infiniteQueryOptions-CEDiLwh5.d.ts +365 -0
  6. package/build/legacy/infiniteQueryOptions-CEDiLwh5.d.ts.map +1 -0
  7. package/build/legacy/infiniteQueryOptions-qN6sOJM-.d.cts +365 -0
  8. package/build/legacy/infiniteQueryOptions-qN6sOJM-.d.cts.map +1 -0
  9. package/build/legacy/infiniteQueryOptions.cjs.map +1 -1
  10. package/build/legacy/infiniteQueryOptions.d.cts +1 -1
  11. package/build/legacy/infiniteQueryOptions.d.ts +1 -1
  12. package/build/legacy/infiniteQueryOptions.js.map +1 -1
  13. package/build/legacy/mutationCache.cjs +5 -0
  14. package/build/legacy/mutationCache.cjs.map +1 -1
  15. package/build/legacy/mutationCache.d.cts +6 -1
  16. package/build/legacy/mutationCache.d.cts.map +1 -1
  17. package/build/legacy/mutationCache.d.ts +6 -1
  18. package/build/legacy/mutationCache.d.ts.map +1 -1
  19. package/build/legacy/mutationCache.js +5 -0
  20. package/build/legacy/mutationCache.js.map +1 -1
  21. package/build/legacy/mutationOptions.cjs.map +1 -1
  22. package/build/legacy/mutationOptions.d.cts +121 -1
  23. package/build/legacy/mutationOptions.d.cts.map +1 -1
  24. package/build/legacy/mutationOptions.d.ts +121 -1
  25. package/build/legacy/mutationOptions.d.ts.map +1 -1
  26. package/build/legacy/mutationOptions.js.map +1 -1
  27. package/build/legacy/queryCache.cjs +5 -0
  28. package/build/legacy/queryCache.cjs.map +1 -1
  29. package/build/legacy/queryCache.d.cts +6 -1
  30. package/build/legacy/queryCache.d.cts.map +1 -1
  31. package/build/legacy/queryCache.d.ts +6 -1
  32. package/build/legacy/queryCache.d.ts.map +1 -1
  33. package/build/legacy/queryCache.js +5 -0
  34. package/build/legacy/queryCache.js.map +1 -1
  35. package/build/legacy/queryClient-CZeNAt68.d.cts +71 -0
  36. package/build/legacy/queryClient-CZeNAt68.d.cts.map +1 -0
  37. package/build/legacy/queryClient-Cv73nzNT.d.ts +71 -0
  38. package/build/legacy/queryClient-Cv73nzNT.d.ts.map +1 -0
  39. package/build/legacy/queryClient.cjs +7 -0
  40. package/build/legacy/queryClient.cjs.map +1 -1
  41. package/build/legacy/queryClient.d.cts +1 -1
  42. package/build/legacy/queryClient.d.ts +1 -1
  43. package/build/legacy/queryClient.js +7 -0
  44. package/build/legacy/queryClient.js.map +1 -1
  45. package/build/legacy/queryOptions-DPDwdVBu.d.ts +227 -0
  46. package/build/legacy/queryOptions-DPDwdVBu.d.ts.map +1 -0
  47. package/build/legacy/queryOptions-rkZ3sk6g.d.cts +227 -0
  48. package/build/legacy/queryOptions-rkZ3sk6g.d.cts.map +1 -0
  49. package/build/legacy/queryOptions.cjs.map +1 -1
  50. package/build/legacy/queryOptions.d.cts +2 -19
  51. package/build/legacy/queryOptions.d.ts +2 -19
  52. package/build/legacy/queryOptions.js.map +1 -1
  53. package/build/{modern/types-BzZi3_rS.d.cts → legacy/types-JpJB72CS.d.cts} +19 -1
  54. package/build/legacy/types-JpJB72CS.d.cts.map +1 -0
  55. package/build/legacy/{types-BzZi3_rS.d.cts → types-JpJB72CS.d.ts} +19 -1
  56. package/build/legacy/types-JpJB72CS.d.ts.map +1 -0
  57. package/build/legacy/types.d.cts +1 -1
  58. package/build/legacy/types.d.ts +1 -1
  59. package/build/legacy/useBaseQuery.cjs +8 -0
  60. package/build/legacy/useBaseQuery.cjs.map +1 -1
  61. package/build/legacy/useBaseQuery.d.cts +1 -1
  62. package/build/legacy/useBaseQuery.d.ts +1 -1
  63. package/build/legacy/useBaseQuery.js +8 -0
  64. package/build/legacy/useBaseQuery.js.map +1 -1
  65. package/build/legacy/useInfiniteQuery.cjs.map +1 -1
  66. package/build/legacy/useInfiniteQuery.d.cts +1 -1
  67. package/build/legacy/useInfiniteQuery.d.ts +1 -1
  68. package/build/legacy/useInfiniteQuery.js.map +1 -1
  69. package/build/legacy/useIsFetching.cjs +41 -0
  70. package/build/legacy/useIsFetching.cjs.map +1 -1
  71. package/build/legacy/useIsFetching.d.cts +47 -6
  72. package/build/legacy/useIsFetching.d.cts.map +1 -1
  73. package/build/legacy/useIsFetching.d.ts +47 -6
  74. package/build/legacy/useIsFetching.d.ts.map +1 -1
  75. package/build/legacy/useIsFetching.js +41 -0
  76. package/build/legacy/useIsFetching.js.map +1 -1
  77. package/build/legacy/useMutation.cjs +170 -9
  78. package/build/legacy/useMutation.cjs.map +1 -1
  79. package/build/legacy/useMutation.d.cts +164 -3
  80. package/build/legacy/useMutation.d.cts.map +1 -1
  81. package/build/legacy/useMutation.d.ts +164 -3
  82. package/build/legacy/useMutation.d.ts.map +1 -1
  83. package/build/legacy/useMutation.js +170 -9
  84. package/build/legacy/useMutation.js.map +1 -1
  85. package/build/legacy/useMutationState.cjs +103 -0
  86. package/build/legacy/useMutationState.cjs.map +1 -1
  87. package/build/legacy/useMutationState.d.cts +111 -7
  88. package/build/legacy/useMutationState.d.cts.map +1 -1
  89. package/build/legacy/useMutationState.d.ts +111 -7
  90. package/build/legacy/useMutationState.d.ts.map +1 -1
  91. package/build/legacy/useMutationState.js +103 -0
  92. package/build/legacy/useMutationState.js.map +1 -1
  93. package/build/legacy/usePrefetchInfiniteQuery.cjs +46 -0
  94. package/build/legacy/usePrefetchInfiniteQuery.cjs.map +1 -1
  95. package/build/legacy/usePrefetchInfiniteQuery.d.cts +48 -2
  96. package/build/legacy/usePrefetchInfiniteQuery.d.cts.map +1 -1
  97. package/build/legacy/usePrefetchInfiniteQuery.d.ts +48 -2
  98. package/build/legacy/usePrefetchInfiniteQuery.d.ts.map +1 -1
  99. package/build/legacy/usePrefetchInfiniteQuery.js +46 -0
  100. package/build/legacy/usePrefetchInfiniteQuery.js.map +1 -1
  101. package/build/legacy/usePrefetchQuery.cjs +37 -0
  102. package/build/legacy/usePrefetchQuery.cjs.map +1 -1
  103. package/build/legacy/usePrefetchQuery.d.cts +39 -2
  104. package/build/legacy/usePrefetchQuery.d.cts.map +1 -1
  105. package/build/legacy/usePrefetchQuery.d.ts +39 -2
  106. package/build/legacy/usePrefetchQuery.d.ts.map +1 -1
  107. package/build/legacy/usePrefetchQuery.js +37 -0
  108. package/build/legacy/usePrefetchQuery.js.map +1 -1
  109. package/build/legacy/useQueries.cjs +123 -0
  110. package/build/legacy/useQueries.cjs.map +1 -1
  111. package/build/legacy/useQueries.d.cts +126 -2
  112. package/build/legacy/useQueries.d.cts.map +1 -1
  113. package/build/legacy/useQueries.d.ts +126 -2
  114. package/build/legacy/useQueries.d.ts.map +1 -1
  115. package/build/legacy/useQueries.js +123 -0
  116. package/build/legacy/useQueries.js.map +1 -1
  117. package/build/legacy/useQuery.cjs.map +1 -1
  118. package/build/legacy/useQuery.d.cts +248 -2
  119. package/build/legacy/useQuery.d.cts.map +1 -0
  120. package/build/legacy/useQuery.d.ts +248 -2
  121. package/build/legacy/useQuery.d.ts.map +1 -0
  122. package/build/legacy/useQuery.js.map +1 -1
  123. package/build/legacy/useQueryClient.cjs +21 -0
  124. package/build/legacy/useQueryClient.cjs.map +1 -1
  125. package/build/legacy/useQueryClient.d.cts +22 -1
  126. package/build/legacy/useQueryClient.d.cts.map +1 -1
  127. package/build/legacy/useQueryClient.d.ts +22 -1
  128. package/build/legacy/useQueryClient.d.ts.map +1 -1
  129. package/build/legacy/useQueryClient.js +21 -0
  130. package/build/legacy/useQueryClient.js.map +1 -1
  131. package/build/legacy/utils.cjs +15 -0
  132. package/build/legacy/utils.cjs.map +1 -1
  133. package/build/legacy/utils.d.cts +16 -1
  134. package/build/legacy/utils.d.cts.map +1 -1
  135. package/build/legacy/utils.d.ts +16 -1
  136. package/build/legacy/utils.d.ts.map +1 -1
  137. package/build/legacy/utils.js +15 -0
  138. package/build/legacy/utils.js.map +1 -1
  139. package/build/legacy/vueQueryPlugin.cjs +34 -0
  140. package/build/legacy/vueQueryPlugin.cjs.map +1 -1
  141. package/build/legacy/vueQueryPlugin.d.cts +48 -2
  142. package/build/legacy/vueQueryPlugin.d.cts.map +1 -1
  143. package/build/legacy/vueQueryPlugin.d.ts +48 -2
  144. package/build/legacy/vueQueryPlugin.d.ts.map +1 -1
  145. package/build/legacy/vueQueryPlugin.js +34 -0
  146. package/build/legacy/vueQueryPlugin.js.map +1 -1
  147. package/build/modern/devtools/devtools.d.cts +1 -1
  148. package/build/modern/devtools/devtools.d.ts +1 -1
  149. package/build/modern/index.d.cts +8 -6
  150. package/build/modern/index.d.ts +8 -6
  151. package/build/modern/infiniteQueryOptions-CEDiLwh5.d.ts +365 -0
  152. package/build/modern/infiniteQueryOptions-CEDiLwh5.d.ts.map +1 -0
  153. package/build/modern/infiniteQueryOptions-qN6sOJM-.d.cts +365 -0
  154. package/build/modern/infiniteQueryOptions-qN6sOJM-.d.cts.map +1 -0
  155. package/build/modern/infiniteQueryOptions.cjs.map +1 -1
  156. package/build/modern/infiniteQueryOptions.d.cts +1 -1
  157. package/build/modern/infiniteQueryOptions.d.ts +1 -1
  158. package/build/modern/infiniteQueryOptions.js.map +1 -1
  159. package/build/modern/mutationCache.cjs +5 -0
  160. package/build/modern/mutationCache.cjs.map +1 -1
  161. package/build/modern/mutationCache.d.cts +6 -1
  162. package/build/modern/mutationCache.d.cts.map +1 -1
  163. package/build/modern/mutationCache.d.ts +6 -1
  164. package/build/modern/mutationCache.d.ts.map +1 -1
  165. package/build/modern/mutationCache.js +5 -0
  166. package/build/modern/mutationCache.js.map +1 -1
  167. package/build/modern/mutationOptions.cjs.map +1 -1
  168. package/build/modern/mutationOptions.d.cts +121 -1
  169. package/build/modern/mutationOptions.d.cts.map +1 -1
  170. package/build/modern/mutationOptions.d.ts +121 -1
  171. package/build/modern/mutationOptions.d.ts.map +1 -1
  172. package/build/modern/mutationOptions.js.map +1 -1
  173. package/build/modern/queryCache.cjs +5 -0
  174. package/build/modern/queryCache.cjs.map +1 -1
  175. package/build/modern/queryCache.d.cts +6 -1
  176. package/build/modern/queryCache.d.cts.map +1 -1
  177. package/build/modern/queryCache.d.ts +6 -1
  178. package/build/modern/queryCache.d.ts.map +1 -1
  179. package/build/modern/queryCache.js +5 -0
  180. package/build/modern/queryCache.js.map +1 -1
  181. package/build/modern/queryClient-CZeNAt68.d.cts +71 -0
  182. package/build/modern/queryClient-CZeNAt68.d.cts.map +1 -0
  183. package/build/modern/queryClient-Cv73nzNT.d.ts +71 -0
  184. package/build/modern/queryClient-Cv73nzNT.d.ts.map +1 -0
  185. package/build/modern/queryClient.cjs +7 -0
  186. package/build/modern/queryClient.cjs.map +1 -1
  187. package/build/modern/queryClient.d.cts +1 -1
  188. package/build/modern/queryClient.d.ts +1 -1
  189. package/build/modern/queryClient.js +7 -0
  190. package/build/modern/queryClient.js.map +1 -1
  191. package/build/modern/queryOptions-DPDwdVBu.d.ts +227 -0
  192. package/build/modern/queryOptions-DPDwdVBu.d.ts.map +1 -0
  193. package/build/modern/queryOptions-rkZ3sk6g.d.cts +227 -0
  194. package/build/modern/queryOptions-rkZ3sk6g.d.cts.map +1 -0
  195. package/build/modern/queryOptions.cjs.map +1 -1
  196. package/build/modern/queryOptions.d.cts +2 -19
  197. package/build/modern/queryOptions.d.ts +2 -19
  198. package/build/modern/queryOptions.js.map +1 -1
  199. package/build/modern/{types-BzZi3_rS.d.ts → types-JpJB72CS.d.cts} +19 -1
  200. package/build/modern/types-JpJB72CS.d.cts.map +1 -0
  201. package/build/{legacy/types-BzZi3_rS.d.ts → modern/types-JpJB72CS.d.ts} +19 -1
  202. package/build/modern/types-JpJB72CS.d.ts.map +1 -0
  203. package/build/modern/types.d.cts +1 -1
  204. package/build/modern/types.d.ts +1 -1
  205. package/build/modern/useBaseQuery.cjs +8 -0
  206. package/build/modern/useBaseQuery.cjs.map +1 -1
  207. package/build/modern/useBaseQuery.d.cts +1 -1
  208. package/build/modern/useBaseQuery.d.ts +1 -1
  209. package/build/modern/useBaseQuery.js +8 -0
  210. package/build/modern/useBaseQuery.js.map +1 -1
  211. package/build/modern/useInfiniteQuery.cjs.map +1 -1
  212. package/build/modern/useInfiniteQuery.d.cts +1 -1
  213. package/build/modern/useInfiniteQuery.d.ts +1 -1
  214. package/build/modern/useInfiniteQuery.js.map +1 -1
  215. package/build/modern/useIsFetching.cjs +41 -0
  216. package/build/modern/useIsFetching.cjs.map +1 -1
  217. package/build/modern/useIsFetching.d.cts +47 -6
  218. package/build/modern/useIsFetching.d.cts.map +1 -1
  219. package/build/modern/useIsFetching.d.ts +47 -6
  220. package/build/modern/useIsFetching.d.ts.map +1 -1
  221. package/build/modern/useIsFetching.js +41 -0
  222. package/build/modern/useIsFetching.js.map +1 -1
  223. package/build/modern/useMutation.cjs +170 -9
  224. package/build/modern/useMutation.cjs.map +1 -1
  225. package/build/modern/useMutation.d.cts +164 -3
  226. package/build/modern/useMutation.d.cts.map +1 -1
  227. package/build/modern/useMutation.d.ts +164 -3
  228. package/build/modern/useMutation.d.ts.map +1 -1
  229. package/build/modern/useMutation.js +170 -9
  230. package/build/modern/useMutation.js.map +1 -1
  231. package/build/modern/useMutationState.cjs +103 -0
  232. package/build/modern/useMutationState.cjs.map +1 -1
  233. package/build/modern/useMutationState.d.cts +111 -7
  234. package/build/modern/useMutationState.d.cts.map +1 -1
  235. package/build/modern/useMutationState.d.ts +111 -7
  236. package/build/modern/useMutationState.d.ts.map +1 -1
  237. package/build/modern/useMutationState.js +103 -0
  238. package/build/modern/useMutationState.js.map +1 -1
  239. package/build/modern/usePrefetchInfiniteQuery.cjs +46 -0
  240. package/build/modern/usePrefetchInfiniteQuery.cjs.map +1 -1
  241. package/build/modern/usePrefetchInfiniteQuery.d.cts +48 -2
  242. package/build/modern/usePrefetchInfiniteQuery.d.cts.map +1 -1
  243. package/build/modern/usePrefetchInfiniteQuery.d.ts +48 -2
  244. package/build/modern/usePrefetchInfiniteQuery.d.ts.map +1 -1
  245. package/build/modern/usePrefetchInfiniteQuery.js +46 -0
  246. package/build/modern/usePrefetchInfiniteQuery.js.map +1 -1
  247. package/build/modern/usePrefetchQuery.cjs +37 -0
  248. package/build/modern/usePrefetchQuery.cjs.map +1 -1
  249. package/build/modern/usePrefetchQuery.d.cts +39 -2
  250. package/build/modern/usePrefetchQuery.d.cts.map +1 -1
  251. package/build/modern/usePrefetchQuery.d.ts +39 -2
  252. package/build/modern/usePrefetchQuery.d.ts.map +1 -1
  253. package/build/modern/usePrefetchQuery.js +37 -0
  254. package/build/modern/usePrefetchQuery.js.map +1 -1
  255. package/build/modern/useQueries.cjs +123 -0
  256. package/build/modern/useQueries.cjs.map +1 -1
  257. package/build/modern/useQueries.d.cts +126 -2
  258. package/build/modern/useQueries.d.cts.map +1 -1
  259. package/build/modern/useQueries.d.ts +126 -2
  260. package/build/modern/useQueries.d.ts.map +1 -1
  261. package/build/modern/useQueries.js +123 -0
  262. package/build/modern/useQueries.js.map +1 -1
  263. package/build/modern/useQuery.cjs.map +1 -1
  264. package/build/modern/useQuery.d.cts +248 -2
  265. package/build/modern/useQuery.d.cts.map +1 -0
  266. package/build/modern/useQuery.d.ts +248 -2
  267. package/build/modern/useQuery.d.ts.map +1 -0
  268. package/build/modern/useQuery.js.map +1 -1
  269. package/build/modern/useQueryClient.cjs +21 -0
  270. package/build/modern/useQueryClient.cjs.map +1 -1
  271. package/build/modern/useQueryClient.d.cts +22 -1
  272. package/build/modern/useQueryClient.d.cts.map +1 -1
  273. package/build/modern/useQueryClient.d.ts +22 -1
  274. package/build/modern/useQueryClient.d.ts.map +1 -1
  275. package/build/modern/useQueryClient.js +21 -0
  276. package/build/modern/useQueryClient.js.map +1 -1
  277. package/build/modern/utils.cjs +15 -0
  278. package/build/modern/utils.cjs.map +1 -1
  279. package/build/modern/utils.d.cts +16 -1
  280. package/build/modern/utils.d.cts.map +1 -1
  281. package/build/modern/utils.d.ts +16 -1
  282. package/build/modern/utils.d.ts.map +1 -1
  283. package/build/modern/utils.js +15 -0
  284. package/build/modern/utils.js.map +1 -1
  285. package/build/modern/vueQueryPlugin.cjs +34 -0
  286. package/build/modern/vueQueryPlugin.cjs.map +1 -1
  287. package/build/modern/vueQueryPlugin.d.cts +48 -2
  288. package/build/modern/vueQueryPlugin.d.cts.map +1 -1
  289. package/build/modern/vueQueryPlugin.d.ts +48 -2
  290. package/build/modern/vueQueryPlugin.d.ts.map +1 -1
  291. package/build/modern/vueQueryPlugin.js +34 -0
  292. package/build/modern/vueQueryPlugin.js.map +1 -1
  293. package/package.json +10 -10
  294. package/src/index.ts +9 -9
  295. package/src/infiniteQueryOptions.ts +86 -0
  296. package/src/mutationCache.ts +5 -0
  297. package/src/mutationOptions.ts +123 -0
  298. package/src/queryCache.ts +5 -0
  299. package/src/queryClient.ts +17 -1
  300. package/src/queryOptions.ts +276 -10
  301. package/src/types.ts +18 -0
  302. package/src/useBaseQuery.ts +9 -1
  303. package/src/useInfiniteQuery.ts +240 -0
  304. package/src/useIsFetching.ts +46 -3
  305. package/src/useMutation.ts +170 -17
  306. package/src/useMutationState.ts +111 -4
  307. package/src/usePrefetchInfiniteQuery.ts +46 -0
  308. package/src/usePrefetchQuery.ts +37 -0
  309. package/src/useQueries.ts +124 -1
  310. package/src/useQuery.ts +240 -79
  311. package/src/useQueryClient.ts +21 -0
  312. package/src/utils.ts +15 -0
  313. package/src/vueQueryPlugin.ts +46 -0
  314. package/build/legacy/queryClient-C07d0chJ.d.cts +0 -97
  315. package/build/legacy/queryClient-C07d0chJ.d.cts.map +0 -1
  316. package/build/legacy/queryClient-hf6i_vCa.d.ts +0 -97
  317. package/build/legacy/queryClient-hf6i_vCa.d.ts.map +0 -1
  318. package/build/legacy/queryOptions.d.cts.map +0 -1
  319. package/build/legacy/queryOptions.d.ts.map +0 -1
  320. package/build/legacy/types-BzZi3_rS.d.cts.map +0 -1
  321. package/build/legacy/types-BzZi3_rS.d.ts.map +0 -1
  322. package/build/modern/queryClient-C07d0chJ.d.cts +0 -97
  323. package/build/modern/queryClient-C07d0chJ.d.cts.map +0 -1
  324. package/build/modern/queryClient-hf6i_vCa.d.ts +0 -97
  325. package/build/modern/queryClient-hf6i_vCa.d.ts.map +0 -1
  326. package/build/modern/queryOptions.d.cts.map +0 -1
  327. package/build/modern/queryOptions.d.ts.map +0 -1
  328. package/build/modern/types-BzZi3_rS.d.cts.map +0 -1
  329. package/build/modern/types-BzZi3_rS.d.ts.map +0 -1
@@ -0,0 +1,365 @@
1
+ import { a as MaybeRef, d as ShallowOption, o as MaybeRefDeep, s as MaybeRefOrGetter, t as DeepUnwrapRef } from "./types-JpJB72CS.cjs";
2
+ import { o as UseQueryOptions } from "./queryOptions-rkZ3sk6g.cjs";
3
+ import { t as QueryClient$1 } from "./queryClient-CZeNAt68.cjs";
4
+ import { DefaultError, InfiniteData, InfiniteQueryObserverOptions, InfiniteQueryObserverResult, NonUndefinedGuard, QueryKey, QueryKeyWithDataTag, QueryObserver, QueryObserverResult } from "@tanstack/query-core";
5
+ import { Ref } from "vue-demi";
6
+ //#region src/useBaseQuery.d.ts
7
+ type UseBaseQueryReturnType<TData, TError, TResult = QueryObserverResult<TData, TError>> = { [K in keyof TResult]: K extends 'fetchNextPage' | 'fetchPreviousPage' | 'refetch' ? TResult[K] : Ref<Readonly<TResult>[K]>; } & {
8
+ suspense: () => Promise<TResult>;
9
+ };
10
+ type UseQueryOptionsGeneric<TQueryFnData, TError, TData, TQueryData, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = UseQueryOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey> | UseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>;
11
+ /**
12
+ * Base implementation shared by `useQuery` and `useInfiniteQuery`.
13
+ *
14
+ * @param Observer - The observer class from query-core (`QueryObserver` or `InfiniteQueryObserver`).
15
+ * @param options - A `ref`, plain value, or reactive getter resolving to the query options.
16
+ * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one provided by `VueQueryPlugin`
17
+ * will be used.
18
+ */
19
+ declare function useBaseQuery<TQueryFnData, TError, TData, TQueryData, TQueryKey extends QueryKey, TPageParam>(Observer: typeof QueryObserver, options: MaybeRefOrGetter<UseQueryOptionsGeneric<TQueryFnData, TError, TData, TQueryData, TQueryKey, TPageParam>>, queryClient?: QueryClient$1): UseBaseQueryReturnType<TData, TError>;
20
+ //#endregion
21
+ //#region src/useInfiniteQuery.d.ts
22
+ type UseInfiniteQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = MaybeRef<{ [Property in keyof InfiniteQueryObserverOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>]: Property extends 'enabled' ? MaybeRefOrGetter<InfiniteQueryObserverOptions<TQueryFnData, TError, TData, DeepUnwrapRef<TQueryKey>, TPageParam>[Property]> : MaybeRefDeep<InfiniteQueryObserverOptions<TQueryFnData, TError, TData, DeepUnwrapRef<TQueryKey>, TPageParam>[Property]>; } & ShallowOption>;
23
+ type UseInfiniteQueryReturnType<TData, TError> = UseBaseQueryReturnType<TData, TError, InfiniteQueryObserverResult<TData, TError>>;
24
+ /**
25
+ * The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of
26
+ * `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`.
27
+ *
28
+ * This overload is selected when `initialData` is set, so the resulting `data` is never `undefined`.
29
+ *
30
+ * `enabled` tracks reactive dependencies automatically as a `ref`, a plain value, or a reactive getter
31
+ * (`() => ...`). `queryKey` reacts through a `ref` for the array itself, or `ref`s and reactive getters as
32
+ * individual entries — the array itself can't be a bare getter.
33
+ *
34
+ * @remarks Keep in mind that imperative fetch calls, such as `fetchNextPage`, may interfere with the default
35
+ * refetch behavior, resulting in outdated data. Make sure to call these functions only in response to user
36
+ * actions, or add conditions like `hasNextPage && !isFetching`.
37
+ * @param options - The {@link DefinedInitialDataInfiniteOptions} to use — everything you can pass to
38
+ * `useInfiniteQuery`, with `initialData` set.
39
+ * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one provided by `VueQueryPlugin`
40
+ * will be used.
41
+ * @returns The same properties as `useQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,
42
+ * `hasNextPage`, `hasPreviousPage`, `isFetchingNextPage`, and `isFetchingPreviousPage`. `data.value.pages` and
43
+ * `data.value.pageParams` are also added, as long as a `select` doesn't change `TData` away from its default
44
+ * `InfiniteData<TQueryFnData>` shape.
45
+ *
46
+ * @example
47
+ * ```vue
48
+ * <script setup lang="ts">
49
+ * import { useInfiniteQuery } from '@tanstack/vue-query'
50
+ *
51
+ * // `data` is never `undefined`, thanks to `initialData` — even if a refetch fails, so the
52
+ * // list stays visible alongside the error.
53
+ * const { data, isError, error } = useInfiniteQuery({
54
+ * queryKey: ['projects'],
55
+ * queryFn: ({ pageParam }) => fetchProjects(pageParam),
56
+ * initialPageParam: 0,
57
+ * getNextPageParam: (lastPage) => lastPage.nextId,
58
+ * initialData: { pages: [], pageParams: [] },
59
+ * })
60
+ * </script>
61
+ *
62
+ * <template>
63
+ * <span v-if="isError">Error: {{ error.message }}</span>
64
+ * <ul>
65
+ * <template v-for="page in data.pages" :key="page.nextId">
66
+ * <li v-for="project in page.projects" :key="project.id">{{ project.name }}</li>
67
+ * </template>
68
+ * </ul>
69
+ * </template>
70
+ * ```
71
+ */
72
+ declare function useInfiniteQuery<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: MaybeRefOrGetter<DefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>>, queryClient?: QueryClient$1): UseInfiniteQueryReturnType<TData, TError>;
73
+ /**
74
+ * The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of
75
+ * `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`.
76
+ *
77
+ * `enabled` tracks reactive dependencies automatically as a `ref`, a plain value, or a reactive getter
78
+ * (`() => ...`). `queryKey` reacts through a `ref` for the array itself, or `ref`s and reactive getters as
79
+ * individual entries — the array itself can't be a bare getter.
80
+ *
81
+ * @remarks Keep in mind that imperative fetch calls, such as `fetchNextPage`, may interfere with the default
82
+ * refetch behavior, resulting in outdated data. Make sure to call these functions only in response to user
83
+ * actions, or add conditions like `hasNextPage && !isFetching`.
84
+ * @param options - The {@link UndefinedInitialDataInfiniteOptions} to use — everything you can pass to
85
+ * `useInfiniteQuery`.
86
+ * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one provided by `VueQueryPlugin`
87
+ * will be used.
88
+ * @returns The same properties as `useQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,
89
+ * `hasNextPage`, `hasPreviousPage`, `isFetchingNextPage`, and `isFetchingPreviousPage`. `data.value.pages` and
90
+ * `data.value.pageParams` are also added, as long as a `select` doesn't change `TData` away from its default
91
+ * `InfiniteData<TQueryFnData>` shape.
92
+ *
93
+ * @example
94
+ * Fetching the next page from a "Load More" button click:
95
+ * ```vue
96
+ * <script setup lang="ts">
97
+ * import { useInfiniteQuery } from '@tanstack/vue-query'
98
+ *
99
+ * const {
100
+ * data,
101
+ * isPending,
102
+ * isError,
103
+ * error,
104
+ * fetchNextPage,
105
+ * hasNextPage,
106
+ * isFetching,
107
+ * isFetchingNextPage,
108
+ * } = useInfiniteQuery({
109
+ * queryKey: ['projects'],
110
+ * queryFn: ({ pageParam }) => fetchProjects(pageParam),
111
+ * initialPageParam: 0,
112
+ * getNextPageParam: (lastPage) => lastPage.nextId,
113
+ * })
114
+ * </script>
115
+ *
116
+ * <template>
117
+ * <span v-if="isPending">Loading...</span>
118
+ * <span v-else-if="isError">Error: {{ error.message }}</span>
119
+ * <template v-else>
120
+ * <ul>
121
+ * <template v-for="page in data.pages" :key="page.nextId">
122
+ * <li v-for="project in page.projects" :key="project.id">{{ project.name }}</li>
123
+ * </template>
124
+ * </ul>
125
+ * <button @click="fetchNextPage()" :disabled="!hasNextPage || isFetching">
126
+ * {{ isFetchingNextPage ? 'Loading more...' : hasNextPage ? 'Load More' : 'Nothing more to load' }}
127
+ * </button>
128
+ * </template>
129
+ * </template>
130
+ * ```
131
+ *
132
+ * @example
133
+ * Fetching the next page automatically as the user scrolls, using an `IntersectionObserver` on a
134
+ * sentinel element after the list:
135
+ * ```vue
136
+ * <script setup lang="ts">
137
+ * import { onUnmounted, ref, watch } from 'vue'
138
+ * import { useInfiniteQuery } from '@tanstack/vue-query'
139
+ *
140
+ * const {
141
+ * data,
142
+ * isPending,
143
+ * isError,
144
+ * error,
145
+ * fetchNextPage,
146
+ * hasNextPage,
147
+ * isFetching,
148
+ * isFetchingNextPage,
149
+ * } = useInfiniteQuery({
150
+ * queryKey: ['projects'],
151
+ * queryFn: ({ pageParam }) => fetchProjects(pageParam),
152
+ * initialPageParam: 0,
153
+ * getNextPageParam: (lastPage) => lastPage.nextId,
154
+ * })
155
+ *
156
+ * const sentinel = ref<HTMLElement>()
157
+ * let observer: IntersectionObserver | undefined
158
+ *
159
+ * watch(sentinel, (el) => {
160
+ * observer?.disconnect()
161
+ * if (el == null) return
162
+ *
163
+ * observer = new IntersectionObserver(([entry]) => {
164
+ * if (entry?.isIntersecting && hasNextPage.value && !isFetching.value) {
165
+ * fetchNextPage()
166
+ * }
167
+ * })
168
+ * observer.observe(el)
169
+ * })
170
+ *
171
+ * onUnmounted(() => observer?.disconnect())
172
+ * </script>
173
+ *
174
+ * <template>
175
+ * <span v-if="isPending">Loading...</span>
176
+ * <span v-else-if="isError">Error: {{ error.message }}</span>
177
+ * <template v-else>
178
+ * <ul>
179
+ * <template v-for="page in data.pages" :key="page.nextId">
180
+ * <li v-for="project in page.projects" :key="project.id">{{ project.name }}</li>
181
+ * </template>
182
+ * </ul>
183
+ * <div ref="sentinel">{{ isFetchingNextPage ? 'Loading more...' : '' }}</div>
184
+ * </template>
185
+ * </template>
186
+ * ```
187
+ */
188
+ declare function useInfiniteQuery<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: MaybeRefOrGetter<UndefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>>, queryClient?: QueryClient$1): UseInfiniteQueryReturnType<TData, TError>;
189
+ /**
190
+ * Fallback overload for options whose `initialData` presence isn't statically known — for example, a
191
+ * `ref`/reactive object built up conditionally, rather than a plain object literal. Prefer one of the other
192
+ * overloads when possible, since they infer whether `data` can be `undefined` from `initialData` directly.
193
+ *
194
+ * `enabled` tracks reactive dependencies automatically as a `ref`, a plain value, or a reactive getter
195
+ * (`() => ...`). `queryKey` reacts through a `ref` for the array itself, or `ref`s and reactive getters as
196
+ * individual entries — the array itself can't be a bare getter.
197
+ *
198
+ * @param options - A `ref`, plain value, or reactive getter resolving to the {@link UseInfiniteQueryOptions} to
199
+ * use.
200
+ * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one provided by `VueQueryPlugin`
201
+ * will be used.
202
+ * @returns The same properties as `useQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,
203
+ * `hasNextPage`, `hasPreviousPage`, `isFetchingNextPage`, and `isFetchingPreviousPage`.
204
+ *
205
+ * @example
206
+ * Passing a whole-options getter so `maxPages` reacts to a setting stored elsewhere, not just `queryKey`:
207
+ * ```vue
208
+ * <script setup lang="ts">
209
+ * import { useInfiniteQuery } from '@tanstack/vue-query'
210
+ *
211
+ * const props = defineProps<{ projectId: number; maxPages: number }>()
212
+ *
213
+ * const { data } = useInfiniteQuery(() => ({
214
+ * queryKey: ['project', props.projectId, 'issues'],
215
+ * queryFn: ({ pageParam }) => fetchIssues(props.projectId, pageParam),
216
+ * initialPageParam: 0,
217
+ * getNextPageParam: (lastPage) => lastPage.nextId,
218
+ * maxPages: props.maxPages,
219
+ * }))
220
+ * </script>
221
+ *
222
+ * <template>
223
+ * <template v-for="page in data?.pages" :key="page.nextId">
224
+ * <li v-for="issue in page.issues" :key="issue.id">{{ issue.title }}</li>
225
+ * </template>
226
+ * </template>
227
+ * ```
228
+ *
229
+ * @example
230
+ * A query that's disabled, type-safe, until `postId` is set — pass `skipToken` as `queryFn` instead of
231
+ * setting `enabled: false`. This requires a whole-options getter: `queryFn` isn't itself reactive, so the
232
+ * getter is what re-evaluates it on every change to `props.postId`:
233
+ * ```vue
234
+ * <script setup lang="ts">
235
+ * import { skipToken, useInfiniteQuery } from '@tanstack/vue-query'
236
+ *
237
+ * const props = defineProps<{ postId: string | undefined }>()
238
+ *
239
+ * // Use `isLoading`, not `isPending`, so the loading state doesn't show while the query is disabled.
240
+ * const { data, isLoading, isError, error } = useInfiniteQuery(() => {
241
+ * const postId = props.postId
242
+ * return {
243
+ * queryKey: ['post', postId, 'comments'],
244
+ * queryFn:
245
+ * postId != null
246
+ * ? ({ pageParam }) => fetchComments(postId, pageParam)
247
+ * : skipToken,
248
+ * initialPageParam: 0,
249
+ * getNextPageParam: (lastPage) => lastPage.nextId,
250
+ * }
251
+ * })
252
+ * </script>
253
+ *
254
+ * <template>
255
+ * <span v-if="props.postId == null">Select a post</span>
256
+ * <span v-else-if="isLoading">Loading...</span>
257
+ * <span v-else-if="isError">Error: {{ error.message }}</span>
258
+ * <ul v-else>
259
+ * <template v-for="page in data.pages" :key="page.nextId">
260
+ * <li v-for="comment in page.comments" :key="comment.id">{{ comment.text }}</li>
261
+ * </template>
262
+ * </ul>
263
+ * </template>
264
+ * ```
265
+ */
266
+ declare function useInfiniteQuery<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: MaybeRefOrGetter<UseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>>, queryClient?: QueryClient$1): UseInfiniteQueryReturnType<TData, TError>;
267
+ //#endregion
268
+ //#region src/infiniteQueryOptions.d.ts
269
+ /**
270
+ * The options accepted by the `infiniteQueryOptions` overload selected when no `initialData` is set — `data`
271
+ * may be `undefined` while the query is `pending`.
272
+ *
273
+ * @template TQueryFnData - The type of a single page, as your `queryFn` resolves it.
274
+ * @template TError - The type of errors your `queryFn` may throw.
275
+ * @template TData - The type `data` ends up as after `select` runs — defaults to `InfiniteData<TQueryFnData>`,
276
+ * the shape of all fetched pages plus their page params.
277
+ * @template TQueryKey - The type of your `queryKey`.
278
+ * @template TPageParam - The type of the parameter passed to `queryFn` to fetch a given page.
279
+ */
280
+ type UndefinedInitialDataInfiniteOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = UseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam> & {
281
+ initialData?: undefined;
282
+ };
283
+ /**
284
+ * The options accepted by the `infiniteQueryOptions` overload selected when `initialData` is set — `data` is
285
+ * never `undefined`.
286
+ *
287
+ * @template TQueryFnData - The type of a single page, as your `queryFn` resolves it.
288
+ * @template TError - The type of errors your `queryFn` may throw.
289
+ * @template TData - The type `data` ends up as after `select` runs — defaults to `InfiniteData<TQueryFnData>`,
290
+ * the shape of all fetched pages plus their page params.
291
+ * @template TQueryKey - The type of your `queryKey`.
292
+ * @template TPageParam - The type of the parameter passed to `queryFn` to fetch a given page.
293
+ */
294
+ type DefinedInitialDataInfiniteOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = UseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam> & {
295
+ /**
296
+ * If set, this value will be used as the initial data for the query cache (as long as the query hasn't been
297
+ * created or cached yet). If set to a function, the function will be called **once** during the shared/root
298
+ * query initialization, and be expected to synchronously return the initial data. Initial data is
299
+ * considered stale by default unless a `staleTime` has been set. `initialData` **is persisted** to the
300
+ * cache.
301
+ */
302
+ initialData: NonUndefinedGuard<InfiniteData<TQueryFnData, TPageParam>> | (() => NonUndefinedGuard<InfiniteData<TQueryFnData, TPageParam>>);
303
+ };
304
+ /**
305
+ * You can generally pass everything to `infiniteQueryOptions` that you can also pass to `useInfiniteQuery`.
306
+ * These options can be shared across hooks and imperative APIs such as `queryClient.infiniteQuery`.
307
+ * `options.queryKey` is required and is the query key to generate options for.
308
+ *
309
+ * @see {@link useInfiniteQuery} to run an infinite query with these options.
310
+ * @param options - The {@link UndefinedInitialDataInfiniteOptions} to use — everything you can pass to
311
+ * `useInfiniteQuery`.
312
+ * @returns The same options object, typed so that `queryKey` carries the inferred data type.
313
+ *
314
+ * @example
315
+ * ```vue
316
+ * <script setup lang="ts">
317
+ * import { infiniteQueryOptions, useInfiniteQuery } from '@tanstack/vue-query'
318
+ *
319
+ * const projectsOptions = infiniteQueryOptions({
320
+ * queryKey: ['projects'],
321
+ * queryFn: ({ pageParam }) => fetchProjects(pageParam),
322
+ * initialPageParam: 0,
323
+ * getNextPageParam: (lastPage) => lastPage.nextId,
324
+ * })
325
+ *
326
+ * const { data, isError, error, fetchNextPage } = useInfiniteQuery(projectsOptions)
327
+ * </script>
328
+ * ```
329
+ */
330
+ declare function infiniteQueryOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UndefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>): UndefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam> & QueryKeyWithDataTag<TQueryKey, InfiniteData<TQueryFnData>, TError>;
331
+ /**
332
+ * You can generally pass everything to `infiniteQueryOptions` that you can also pass to `useInfiniteQuery`.
333
+ * These options can be shared across hooks and imperative APIs such as `queryClient.infiniteQuery`.
334
+ * `options.queryKey` is required and is the query key to generate options for.
335
+ *
336
+ * This overload is selected when `initialData` is set, so the resulting `data` is never `undefined`.
337
+ *
338
+ * @see {@link useInfiniteQuery} to run an infinite query with these options.
339
+ * @param options - The {@link DefinedInitialDataInfiniteOptions} to use — everything you can pass to
340
+ * `useInfiniteQuery`, with `initialData` set.
341
+ * @returns The same options object, typed so that `queryKey` carries the inferred data type.
342
+ *
343
+ * @example
344
+ * ```vue
345
+ * <script setup lang="ts">
346
+ * import { infiniteQueryOptions, useInfiniteQuery } from '@tanstack/vue-query'
347
+ *
348
+ * const projectsOptions = infiniteQueryOptions({
349
+ * queryKey: ['projects'],
350
+ * queryFn: ({ pageParam }) => fetchProjects(pageParam),
351
+ * initialPageParam: 0,
352
+ * getNextPageParam: (lastPage) => lastPage.nextId,
353
+ * initialData: { pages: [], pageParams: [] },
354
+ * })
355
+ *
356
+ * // `data` is never `undefined`, thanks to `initialData` — even if a refetch fails, so the
357
+ * // list stays visible alongside the error.
358
+ * const { data, isError, error } = useInfiniteQuery(projectsOptions)
359
+ * </script>
360
+ * ```
361
+ */
362
+ declare function infiniteQueryOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: DefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>): DefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam> & QueryKeyWithDataTag<TQueryKey, InfiniteData<TQueryFnData>, TError>;
363
+ //#endregion
364
+ export { UseInfiniteQueryReturnType as a, useBaseQuery as c, UseInfiniteQueryOptions as i, UndefinedInitialDataInfiniteOptions as n, useInfiniteQuery as o, infiniteQueryOptions as r, UseBaseQueryReturnType as s, DefinedInitialDataInfiniteOptions as t };
365
+ //# sourceMappingURL=infiniteQueryOptions-qN6sOJM-.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"infiniteQueryOptions-qN6sOJM-.d.cts","names":[],"sources":["../../src/useBaseQuery.ts","../../src/useInfiniteQuery.ts","../../src/infiniteQueryOptions.ts"],"mappings":";;;;;;KA0BY,uBACV,OACA,QACA,UAAU,oBAAoB,OAAO,cAEpC,WAAW,UAAU,8DAIlB,QAAQ,KACR,IAAI,SAAS,SAAS;EAE1B,gBAAgB,QAAQ;;KAGrB,uBACH,cACA,QACA,OACA,YACA,kBAAkB,WAAW,UAC7B,wBAEE,gBAAgB,cAAc,QAAQ,OAAO,YAAY,aACzD,wBAAwB,cAAc,QAAQ,OAAO,WAAW;;;;;;;;;iBAUpD,aACd,cACA,QACA,OACA,YACA,kBAAkB,UAClB,YAEA,iBAAiB,eACjB,SAAS,iBACP,uBACE,cACA,QACA,OACA,YACA,WACA,cAGJ,cAAc,gBACb,uBAAuB,OAAO;;;KCtDrB,wBACV,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAC7B,wBACE,YAEC,kBAAkB,6BACjB,cACA,QACA,OACA,WACA,cACE,6BACA,iBACE,6BACE,cACA,QACA,OACA,cAAc,YACd,YACA,aAEJ,aACE,6BACE,cACA,QACA,OACA,cAAc,YACd,YACA,gBAEN;KAGM,2BAA2B,OAAO,UAAU,uBACtD,OACA,QACA,4BAA4B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmDrB,iBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,iBACP,kCACE,cACA,QACA,OACA,WACA,cAGJ,cAAc,gBACb,2BAA2B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqHrB,iBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,iBACP,oCACE,cACA,QACA,OACA,WACA,cAGJ,cAAc,gBACb,2BAA2B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA+ErB,iBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,iBACP,wBAAwB,cAAc,QAAQ,OAAO,WAAW,cAElE,cAAc,gBACb,2BAA2B,OAAO;;;;;;;;;;;;;;KCjVzB,oCACV,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,wBACE,wBACF,cACA,QACA,OACA,WACA;EAEA;;;;;;;;;;;;;KAcU,kCACV,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,wBACE,wBACF,cACA,QACA,OACA,WACA;;;;;;;;EASA,aACI,kBAAkB,aAAa,cAAc,sBACtC,kBAAkB,aAAa,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6B1C,qBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,oCACP,cACA,QACA,OACA,WACA,cAED,oCACD,cACA,QACA,OACA,WACA,cAEA,oBAAoB,WAAW,aAAa,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiC7C,qBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,kCACP,cACA,QACA,OACA,WACA,cAED,kCACD,cACA,QACA,OACA,WACA,cAEA,oBAAoB,WAAW,aAAa,eAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"infiniteQueryOptions.cjs","names":[],"sources":["../../src/infiniteQueryOptions.ts"],"sourcesContent":["import type {\n DefaultError,\n InfiniteData,\n NonUndefinedGuard,\n QueryKey,\n QueryKeyWithDataTag,\n} from '@tanstack/query-core'\nimport type { UseInfiniteQueryOptions } from './useInfiniteQuery'\n\nexport type UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n initialData?: undefined\n}\n\nexport type DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n initialData:\n | NonUndefinedGuard<InfiniteData<TQueryFnData, TPageParam>>\n | (() => NonUndefinedGuard<InfiniteData<TQueryFnData, TPageParam>>)\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> &\n QueryKeyWithDataTag<TQueryKey, InfiniteData<TQueryFnData>, TError>\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> &\n QueryKeyWithDataTag<TQueryKey, InfiniteData<TQueryFnData>, TError>\n\nexport function infiniteQueryOptions(options: unknown) {\n return options\n}\n"],"mappings":";;AAyFA,SAAgB,qBAAqB,SAAkB;CACrD,OAAO;AACT"}
1
+ {"version":3,"file":"infiniteQueryOptions.cjs","names":[],"sources":["../../src/infiniteQueryOptions.ts"],"sourcesContent":["import type {\n DefaultError,\n InfiniteData,\n NonUndefinedGuard,\n QueryKey,\n QueryKeyWithDataTag,\n} from '@tanstack/query-core'\nimport type { UseInfiniteQueryOptions } from './useInfiniteQuery'\n\n/**\n * The options accepted by the `infiniteQueryOptions` overload selected when no `initialData` is set — `data`\n * may be `undefined` while the query is `pending`.\n *\n * @template TQueryFnData - The type of a single page, as your `queryFn` resolves it.\n * @template TError - The type of errors your `queryFn` may throw.\n * @template TData - The type `data` ends up as after `select` runs — defaults to `InfiniteData<TQueryFnData>`,\n * the shape of all fetched pages plus their page params.\n * @template TQueryKey - The type of your `queryKey`.\n * @template TPageParam - The type of the parameter passed to `queryFn` to fetch a given page.\n */\nexport type UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n initialData?: undefined\n}\n\n/**\n * The options accepted by the `infiniteQueryOptions` overload selected when `initialData` is set — `data` is\n * never `undefined`.\n *\n * @template TQueryFnData - The type of a single page, as your `queryFn` resolves it.\n * @template TError - The type of errors your `queryFn` may throw.\n * @template TData - The type `data` ends up as after `select` runs — defaults to `InfiniteData<TQueryFnData>`,\n * the shape of all fetched pages plus their page params.\n * @template TQueryKey - The type of your `queryKey`.\n * @template TPageParam - The type of the parameter passed to `queryFn` to fetch a given page.\n */\nexport type DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n /**\n * If set, this value will be used as the initial data for the query cache (as long as the query hasn't been\n * created or cached yet). If set to a function, the function will be called **once** during the shared/root\n * query initialization, and be expected to synchronously return the initial data. Initial data is\n * considered stale by default unless a `staleTime` has been set. `initialData` **is persisted** to the\n * cache.\n */\n initialData:\n | NonUndefinedGuard<InfiniteData<TQueryFnData, TPageParam>>\n | (() => NonUndefinedGuard<InfiniteData<TQueryFnData, TPageParam>>)\n}\n\n/**\n * You can generally pass everything to `infiniteQueryOptions` that you can also pass to `useInfiniteQuery`.\n * These options can be shared across hooks and imperative APIs such as `queryClient.infiniteQuery`.\n * `options.queryKey` is required and is the query key to generate options for.\n *\n * @see {@link useInfiniteQuery} to run an infinite query with these options.\n * @param options - The {@link UndefinedInitialDataInfiniteOptions} to use — everything you can pass to\n * `useInfiniteQuery`.\n * @returns The same options object, typed so that `queryKey` carries the inferred data type.\n *\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { infiniteQueryOptions, useInfiniteQuery } from '@tanstack/vue-query'\n *\n * const projectsOptions = infiniteQueryOptions({\n * queryKey: ['projects'],\n * queryFn: ({ pageParam }) => fetchProjects(pageParam),\n * initialPageParam: 0,\n * getNextPageParam: (lastPage) => lastPage.nextId,\n * })\n *\n * const { data, isError, error, fetchNextPage } = useInfiniteQuery(projectsOptions)\n * </script>\n * ```\n */\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> &\n QueryKeyWithDataTag<TQueryKey, InfiniteData<TQueryFnData>, TError>\n\n/**\n * You can generally pass everything to `infiniteQueryOptions` that you can also pass to `useInfiniteQuery`.\n * These options can be shared across hooks and imperative APIs such as `queryClient.infiniteQuery`.\n * `options.queryKey` is required and is the query key to generate options for.\n *\n * This overload is selected when `initialData` is set, so the resulting `data` is never `undefined`.\n *\n * @see {@link useInfiniteQuery} to run an infinite query with these options.\n * @param options - The {@link DefinedInitialDataInfiniteOptions} to use — everything you can pass to\n * `useInfiniteQuery`, with `initialData` set.\n * @returns The same options object, typed so that `queryKey` carries the inferred data type.\n *\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { infiniteQueryOptions, useInfiniteQuery } from '@tanstack/vue-query'\n *\n * const projectsOptions = infiniteQueryOptions({\n * queryKey: ['projects'],\n * queryFn: ({ pageParam }) => fetchProjects(pageParam),\n * initialPageParam: 0,\n * getNextPageParam: (lastPage) => lastPage.nextId,\n * initialData: { pages: [], pageParams: [] },\n * })\n *\n * // `data` is never `undefined`, thanks to `initialData` — even if a refetch fails, so the\n * // list stays visible alongside the error.\n * const { data, isError, error } = useInfiniteQuery(projectsOptions)\n * </script>\n * ```\n */\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> &\n QueryKeyWithDataTag<TQueryKey, InfiniteData<TQueryFnData>, TError>\n\nexport function infiniteQueryOptions(options: unknown) {\n return options\n}\n"],"mappings":";;AA+KA,SAAgB,qBAAqB,SAAkB;CACrD,OAAO;AACT"}
@@ -1,2 +1,2 @@
1
- import { h as infiniteQueryOptions, m as UndefinedInitialDataInfiniteOptions, p as DefinedInitialDataInfiniteOptions } from "./queryClient-C07d0chJ.cjs";
1
+ import { n as UndefinedInitialDataInfiniteOptions, r as infiniteQueryOptions, t as DefinedInitialDataInfiniteOptions } from "./infiniteQueryOptions-qN6sOJM-.cjs";
2
2
  export { DefinedInitialDataInfiniteOptions, UndefinedInitialDataInfiniteOptions, infiniteQueryOptions };
@@ -1,2 +1,2 @@
1
- import { h as infiniteQueryOptions, m as UndefinedInitialDataInfiniteOptions, p as DefinedInitialDataInfiniteOptions } from "./queryClient-hf6i_vCa.js";
1
+ import { n as UndefinedInitialDataInfiniteOptions, r as infiniteQueryOptions, t as DefinedInitialDataInfiniteOptions } from "./infiniteQueryOptions-CEDiLwh5.js";
2
2
  export { DefinedInitialDataInfiniteOptions, UndefinedInitialDataInfiniteOptions, infiniteQueryOptions };
@@ -1 +1 @@
1
- {"version":3,"file":"infiniteQueryOptions.js","names":[],"sources":["../../src/infiniteQueryOptions.ts"],"sourcesContent":["import type {\n DefaultError,\n InfiniteData,\n NonUndefinedGuard,\n QueryKey,\n QueryKeyWithDataTag,\n} from '@tanstack/query-core'\nimport type { UseInfiniteQueryOptions } from './useInfiniteQuery'\n\nexport type UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n initialData?: undefined\n}\n\nexport type DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n initialData:\n | NonUndefinedGuard<InfiniteData<TQueryFnData, TPageParam>>\n | (() => NonUndefinedGuard<InfiniteData<TQueryFnData, TPageParam>>)\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> &\n QueryKeyWithDataTag<TQueryKey, InfiniteData<TQueryFnData>, TError>\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> &\n QueryKeyWithDataTag<TQueryKey, InfiniteData<TQueryFnData>, TError>\n\nexport function infiniteQueryOptions(options: unknown) {\n return options\n}\n"],"mappings":";AAyFA,SAAgB,qBAAqB,SAAkB;CACrD,OAAO;AACT"}
1
+ {"version":3,"file":"infiniteQueryOptions.js","names":[],"sources":["../../src/infiniteQueryOptions.ts"],"sourcesContent":["import type {\n DefaultError,\n InfiniteData,\n NonUndefinedGuard,\n QueryKey,\n QueryKeyWithDataTag,\n} from '@tanstack/query-core'\nimport type { UseInfiniteQueryOptions } from './useInfiniteQuery'\n\n/**\n * The options accepted by the `infiniteQueryOptions` overload selected when no `initialData` is set — `data`\n * may be `undefined` while the query is `pending`.\n *\n * @template TQueryFnData - The type of a single page, as your `queryFn` resolves it.\n * @template TError - The type of errors your `queryFn` may throw.\n * @template TData - The type `data` ends up as after `select` runs — defaults to `InfiniteData<TQueryFnData>`,\n * the shape of all fetched pages plus their page params.\n * @template TQueryKey - The type of your `queryKey`.\n * @template TPageParam - The type of the parameter passed to `queryFn` to fetch a given page.\n */\nexport type UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n initialData?: undefined\n}\n\n/**\n * The options accepted by the `infiniteQueryOptions` overload selected when `initialData` is set — `data` is\n * never `undefined`.\n *\n * @template TQueryFnData - The type of a single page, as your `queryFn` resolves it.\n * @template TError - The type of errors your `queryFn` may throw.\n * @template TData - The type `data` ends up as after `select` runs — defaults to `InfiniteData<TQueryFnData>`,\n * the shape of all fetched pages plus their page params.\n * @template TQueryKey - The type of your `queryKey`.\n * @template TPageParam - The type of the parameter passed to `queryFn` to fetch a given page.\n */\nexport type DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n /**\n * If set, this value will be used as the initial data for the query cache (as long as the query hasn't been\n * created or cached yet). If set to a function, the function will be called **once** during the shared/root\n * query initialization, and be expected to synchronously return the initial data. Initial data is\n * considered stale by default unless a `staleTime` has been set. `initialData` **is persisted** to the\n * cache.\n */\n initialData:\n | NonUndefinedGuard<InfiniteData<TQueryFnData, TPageParam>>\n | (() => NonUndefinedGuard<InfiniteData<TQueryFnData, TPageParam>>)\n}\n\n/**\n * You can generally pass everything to `infiniteQueryOptions` that you can also pass to `useInfiniteQuery`.\n * These options can be shared across hooks and imperative APIs such as `queryClient.infiniteQuery`.\n * `options.queryKey` is required and is the query key to generate options for.\n *\n * @see {@link useInfiniteQuery} to run an infinite query with these options.\n * @param options - The {@link UndefinedInitialDataInfiniteOptions} to use — everything you can pass to\n * `useInfiniteQuery`.\n * @returns The same options object, typed so that `queryKey` carries the inferred data type.\n *\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { infiniteQueryOptions, useInfiniteQuery } from '@tanstack/vue-query'\n *\n * const projectsOptions = infiniteQueryOptions({\n * queryKey: ['projects'],\n * queryFn: ({ pageParam }) => fetchProjects(pageParam),\n * initialPageParam: 0,\n * getNextPageParam: (lastPage) => lastPage.nextId,\n * })\n *\n * const { data, isError, error, fetchNextPage } = useInfiniteQuery(projectsOptions)\n * </script>\n * ```\n */\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> &\n QueryKeyWithDataTag<TQueryKey, InfiniteData<TQueryFnData>, TError>\n\n/**\n * You can generally pass everything to `infiniteQueryOptions` that you can also pass to `useInfiniteQuery`.\n * These options can be shared across hooks and imperative APIs such as `queryClient.infiniteQuery`.\n * `options.queryKey` is required and is the query key to generate options for.\n *\n * This overload is selected when `initialData` is set, so the resulting `data` is never `undefined`.\n *\n * @see {@link useInfiniteQuery} to run an infinite query with these options.\n * @param options - The {@link DefinedInitialDataInfiniteOptions} to use — everything you can pass to\n * `useInfiniteQuery`, with `initialData` set.\n * @returns The same options object, typed so that `queryKey` carries the inferred data type.\n *\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { infiniteQueryOptions, useInfiniteQuery } from '@tanstack/vue-query'\n *\n * const projectsOptions = infiniteQueryOptions({\n * queryKey: ['projects'],\n * queryFn: ({ pageParam }) => fetchProjects(pageParam),\n * initialPageParam: 0,\n * getNextPageParam: (lastPage) => lastPage.nextId,\n * initialData: { pages: [], pageParams: [] },\n * })\n *\n * // `data` is never `undefined`, thanks to `initialData` — even if a refetch fails, so the\n * // list stays visible alongside the error.\n * const { data, isError, error } = useInfiniteQuery(projectsOptions)\n * </script>\n * ```\n */\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> &\n QueryKeyWithDataTag<TQueryKey, InfiniteData<TQueryFnData>, TError>\n\nexport function infiniteQueryOptions(options: unknown) {\n return options\n}\n"],"mappings":";AA+KA,SAAgB,qBAAqB,SAAkB;CACrD,OAAO;AACT"}
@@ -2,6 +2,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_utils = require("./utils.cjs");
3
3
  let _tanstack_query_core = require("@tanstack/query-core");
4
4
  //#region src/mutationCache.ts
5
+ /**
6
+ * Vue-aware subclass of `@tanstack/query-core`'s `MutationCache`. `find`/`findAll` also accept a
7
+ * {@link MaybeRefDeep} filters object, so `ref`s can be passed directly without unwrapping. Access it via
8
+ * `queryClient.getMutationCache()` — `QueryClient` constructs one of these by default.
9
+ */
5
10
  var MutationCache = class extends _tanstack_query_core.MutationCache {
6
11
  find(filters) {
7
12
  return super.find(require_utils.cloneDeepUnref(filters));
@@ -1 +1 @@
1
- {"version":3,"file":"mutationCache.cjs","names":["MC","cloneDeepUnref"],"sources":["../../src/mutationCache.ts"],"sourcesContent":["import { MutationCache as MC } from '@tanstack/query-core'\nimport { cloneDeepUnref } from './utils'\nimport type {\n DefaultError,\n Mutation,\n MutationFilters,\n} from '@tanstack/query-core'\nimport type { MaybeRefDeep } from './types'\n\nexport class MutationCache extends MC {\n find<\n TData = unknown,\n TError = DefaultError,\n TVariables = any,\n TOnMutateResult = unknown,\n >(\n filters: MaybeRefDeep<MutationFilters>,\n ): Mutation<TData, TError, TVariables, TOnMutateResult> | undefined {\n return super.find(cloneDeepUnref(filters))\n }\n\n findAll(filters: MaybeRefDeep<MutationFilters> = {}): Array<Mutation> {\n return super.findAll(cloneDeepUnref(filters))\n }\n}\n"],"mappings":";;;;AASA,IAAa,gBAAb,cAAmCA,qBAAAA,cAAG;CACpC,KAME,SACkE;EAClE,OAAO,MAAM,KAAKC,cAAAA,eAAe,OAAO,CAAC;CAC3C;CAEA,QAAQ,UAAyC,CAAC,GAAoB;EACpE,OAAO,MAAM,QAAQA,cAAAA,eAAe,OAAO,CAAC;CAC9C;AACF"}
1
+ {"version":3,"file":"mutationCache.cjs","names":["MC","cloneDeepUnref"],"sources":["../../src/mutationCache.ts"],"sourcesContent":["import { MutationCache as MC } from '@tanstack/query-core'\nimport { cloneDeepUnref } from './utils'\nimport type {\n DefaultError,\n Mutation,\n MutationFilters,\n} from '@tanstack/query-core'\nimport type { MaybeRefDeep } from './types'\n\n/**\n * Vue-aware subclass of `@tanstack/query-core`'s `MutationCache`. `find`/`findAll` also accept a\n * {@link MaybeRefDeep} filters object, so `ref`s can be passed directly without unwrapping. Access it via\n * `queryClient.getMutationCache()` — `QueryClient` constructs one of these by default.\n */\nexport class MutationCache extends MC {\n find<\n TData = unknown,\n TError = DefaultError,\n TVariables = any,\n TOnMutateResult = unknown,\n >(\n filters: MaybeRefDeep<MutationFilters>,\n ): Mutation<TData, TError, TVariables, TOnMutateResult> | undefined {\n return super.find(cloneDeepUnref(filters))\n }\n\n findAll(filters: MaybeRefDeep<MutationFilters> = {}): Array<Mutation> {\n return super.findAll(cloneDeepUnref(filters))\n }\n}\n"],"mappings":";;;;;;;;;AAcA,IAAa,gBAAb,cAAmCA,qBAAAA,cAAG;CACpC,KAME,SACkE;EAClE,OAAO,MAAM,KAAKC,cAAAA,eAAe,OAAO,CAAC;CAC3C;CAEA,QAAQ,UAAyC,CAAC,GAAoB;EACpE,OAAO,MAAM,QAAQA,cAAAA,eAAe,OAAO,CAAC;CAC9C;AACF"}
@@ -1,6 +1,11 @@
1
- import { o as MaybeRefDeep } from "./types-BzZi3_rS.cjs";
1
+ import { o as MaybeRefDeep } from "./types-JpJB72CS.cjs";
2
2
  import { DefaultError, Mutation, MutationCache as MutationCache$1, MutationFilters } from "@tanstack/query-core";
3
3
  //#region src/mutationCache.d.ts
4
+ /**
5
+ * Vue-aware subclass of `@tanstack/query-core`'s `MutationCache`. `find`/`findAll` also accept a
6
+ * {@link MaybeRefDeep} filters object, so `ref`s can be passed directly without unwrapping. Access it via
7
+ * `queryClient.getMutationCache()` — `QueryClient` constructs one of these by default.
8
+ */
4
9
  declare class MutationCache extends MutationCache$1 {
5
10
  find<TData = unknown, TError = DefaultError, TVariables = any, TOnMutateResult = unknown>(filters: MaybeRefDeep<MutationFilters>): Mutation<TData, TError, TVariables, TOnMutateResult> | undefined;
6
11
  findAll(filters?: MaybeRefDeep<MutationFilters>): Array<Mutation>;
@@ -1 +1 @@
1
- {"version":3,"file":"mutationCache.d.cts","names":[],"sources":["../../src/mutationCache.ts"],"mappings":";;;cASa,sBAAsB;EACjC,KACE,iBACA,SAAS,cACT,kBACA,2BAEA,SAAS,aAAa,mBACrB,SAAS,OAAO,QAAQ,YAAY;EAIvC,QAAQ,UAAS,aAAa,mBAAwB,MAAM"}
1
+ {"version":3,"file":"mutationCache.d.cts","names":[],"sources":["../../src/mutationCache.ts"],"mappings":";;;;;;;;cAca,sBAAsB;EACjC,KACE,iBACA,SAAS,cACT,kBACA,2BAEA,SAAS,aAAa,mBACrB,SAAS,OAAO,QAAQ,YAAY;EAIvC,QAAQ,UAAS,aAAa,mBAAwB,MAAM"}
@@ -1,6 +1,11 @@
1
- import { o as MaybeRefDeep } from "./types-BzZi3_rS.js";
1
+ import { o as MaybeRefDeep } from "./types-JpJB72CS.js";
2
2
  import { DefaultError, Mutation, MutationCache as MutationCache$1, MutationFilters } from "@tanstack/query-core";
3
3
  //#region src/mutationCache.d.ts
4
+ /**
5
+ * Vue-aware subclass of `@tanstack/query-core`'s `MutationCache`. `find`/`findAll` also accept a
6
+ * {@link MaybeRefDeep} filters object, so `ref`s can be passed directly without unwrapping. Access it via
7
+ * `queryClient.getMutationCache()` — `QueryClient` constructs one of these by default.
8
+ */
4
9
  declare class MutationCache extends MutationCache$1 {
5
10
  find<TData = unknown, TError = DefaultError, TVariables = any, TOnMutateResult = unknown>(filters: MaybeRefDeep<MutationFilters>): Mutation<TData, TError, TVariables, TOnMutateResult> | undefined;
6
11
  findAll(filters?: MaybeRefDeep<MutationFilters>): Array<Mutation>;
@@ -1 +1 @@
1
- {"version":3,"file":"mutationCache.d.ts","names":[],"sources":["../../src/mutationCache.ts"],"mappings":";;;cASa,sBAAsB;EACjC,KACE,iBACA,SAAS,cACT,kBACA,2BAEA,SAAS,aAAa,mBACrB,SAAS,OAAO,QAAQ,YAAY;EAIvC,QAAQ,UAAS,aAAa,mBAAwB,MAAM"}
1
+ {"version":3,"file":"mutationCache.d.ts","names":[],"sources":["../../src/mutationCache.ts"],"mappings":";;;;;;;;cAca,sBAAsB;EACjC,KACE,iBACA,SAAS,cACT,kBACA,2BAEA,SAAS,aAAa,mBACrB,SAAS,OAAO,QAAQ,YAAY;EAIvC,QAAQ,UAAS,aAAa,mBAAwB,MAAM"}
@@ -1,6 +1,11 @@
1
1
  import { cloneDeepUnref } from "./utils.js";
2
2
  import { MutationCache as MutationCache$1 } from "@tanstack/query-core";
3
3
  //#region src/mutationCache.ts
4
+ /**
5
+ * Vue-aware subclass of `@tanstack/query-core`'s `MutationCache`. `find`/`findAll` also accept a
6
+ * {@link MaybeRefDeep} filters object, so `ref`s can be passed directly without unwrapping. Access it via
7
+ * `queryClient.getMutationCache()` — `QueryClient` constructs one of these by default.
8
+ */
4
9
  var MutationCache = class extends MutationCache$1 {
5
10
  find(filters) {
6
11
  return super.find(cloneDeepUnref(filters));
@@ -1 +1 @@
1
- {"version":3,"file":"mutationCache.js","names":["MC"],"sources":["../../src/mutationCache.ts"],"sourcesContent":["import { MutationCache as MC } from '@tanstack/query-core'\nimport { cloneDeepUnref } from './utils'\nimport type {\n DefaultError,\n Mutation,\n MutationFilters,\n} from '@tanstack/query-core'\nimport type { MaybeRefDeep } from './types'\n\nexport class MutationCache extends MC {\n find<\n TData = unknown,\n TError = DefaultError,\n TVariables = any,\n TOnMutateResult = unknown,\n >(\n filters: MaybeRefDeep<MutationFilters>,\n ): Mutation<TData, TError, TVariables, TOnMutateResult> | undefined {\n return super.find(cloneDeepUnref(filters))\n }\n\n findAll(filters: MaybeRefDeep<MutationFilters> = {}): Array<Mutation> {\n return super.findAll(cloneDeepUnref(filters))\n }\n}\n"],"mappings":";;;AASA,IAAa,gBAAb,cAAmCA,gBAAG;CACpC,KAME,SACkE;EAClE,OAAO,MAAM,KAAK,eAAe,OAAO,CAAC;CAC3C;CAEA,QAAQ,UAAyC,CAAC,GAAoB;EACpE,OAAO,MAAM,QAAQ,eAAe,OAAO,CAAC;CAC9C;AACF"}
1
+ {"version":3,"file":"mutationCache.js","names":["MC"],"sources":["../../src/mutationCache.ts"],"sourcesContent":["import { MutationCache as MC } from '@tanstack/query-core'\nimport { cloneDeepUnref } from './utils'\nimport type {\n DefaultError,\n Mutation,\n MutationFilters,\n} from '@tanstack/query-core'\nimport type { MaybeRefDeep } from './types'\n\n/**\n * Vue-aware subclass of `@tanstack/query-core`'s `MutationCache`. `find`/`findAll` also accept a\n * {@link MaybeRefDeep} filters object, so `ref`s can be passed directly without unwrapping. Access it via\n * `queryClient.getMutationCache()` — `QueryClient` constructs one of these by default.\n */\nexport class MutationCache extends MC {\n find<\n TData = unknown,\n TError = DefaultError,\n TVariables = any,\n TOnMutateResult = unknown,\n >(\n filters: MaybeRefDeep<MutationFilters>,\n ): Mutation<TData, TError, TVariables, TOnMutateResult> | undefined {\n return super.find(cloneDeepUnref(filters))\n }\n\n findAll(filters: MaybeRefDeep<MutationFilters> = {}): Array<Mutation> {\n return super.findAll(cloneDeepUnref(filters))\n }\n}\n"],"mappings":";;;;;;;;AAcA,IAAa,gBAAb,cAAmCA,gBAAG;CACpC,KAME,SACkE;EAClE,OAAO,MAAM,KAAK,eAAe,OAAO,CAAC;CAC3C;CAEA,QAAQ,UAAyC,CAAC,GAAoB;EACpE,OAAO,MAAM,QAAQ,eAAe,OAAO,CAAC;CAC9C;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"mutationOptions.cjs","names":[],"sources":["../../src/mutationOptions.ts"],"sourcesContent":["import type { DefaultError, WithRequired } from '@tanstack/query-core'\nimport type { MutationOptions } from './types'\n\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: WithRequired<\n MutationOptions<TData, TError, TVariables, TOnMutateResult>,\n 'mutationKey'\n >,\n): WithRequired<\n MutationOptions<TData, TError, TVariables, TOnMutateResult>,\n 'mutationKey'\n>\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: () => WithRequired<\n MutationOptions<TData, TError, TVariables, TOnMutateResult>,\n 'mutationKey'\n >,\n): () => WithRequired<\n MutationOptions<TData, TError, TVariables, TOnMutateResult>,\n 'mutationKey'\n>\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: Omit<\n MutationOptions<TData, TError, TVariables, TOnMutateResult>,\n 'mutationKey'\n >,\n): Omit<\n MutationOptions<TData, TError, TVariables, TOnMutateResult>,\n 'mutationKey'\n>\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: () => Omit<\n MutationOptions<TData, TError, TVariables, TOnMutateResult>,\n 'mutationKey'\n >,\n): () => Omit<\n MutationOptions<TData, TError, TVariables, TOnMutateResult>,\n 'mutationKey'\n>\nexport function mutationOptions(options: unknown) {\n return options\n}\n"],"mappings":";;AA2DA,SAAgB,gBAAgB,SAAkB;CAChD,OAAO;AACT"}
1
+ {"version":3,"file":"mutationOptions.cjs","names":[],"sources":["../../src/mutationOptions.ts"],"sourcesContent":["import type { DefaultError, WithRequired } from '@tanstack/query-core'\nimport type { MutationOptions } from './types'\n\n/**\n * You can generally pass everything to `mutationOptions` that you can also pass to `useMutation`. A\n * `mutationKey` is required on this overload so the mutation can be looked up later, e.g. with\n * `useMutationState`.\n *\n * @see {@link useMutation} to run the mutation these options describe.\n * @param options - The mutation options to use, identical to what you'd pass to `useMutation`, with a\n * required `mutationKey`.\n * @returns The same options object, unchanged.\n *\n * @example\n * Looking the mutation up elsewhere via its `mutationKey`, e.g. for a global \"saving…\" indicator:\n * ```vue\n * <script setup lang=\"ts\">\n * import { mutationOptions, useMutationState } from '@tanstack/vue-query'\n * import { computed } from 'vue'\n *\n * const createPostOptions = mutationOptions({\n * mutationKey: ['posts', 'create'],\n * mutationFn: createPost,\n * })\n *\n * // Call `useMutationState` once — it manages its own subscription — then derive from its result.\n * const creatingPosts = useMutationState({\n * filters: { mutationKey: createPostOptions.mutationKey, status: 'pending' },\n * })\n * const isCreatingPost = computed(() => creatingPosts.value.length > 0)\n * </script>\n * ```\n */\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: WithRequired<\n MutationOptions<TData, TError, TVariables, TOnMutateResult>,\n 'mutationKey'\n >,\n): WithRequired<\n MutationOptions<TData, TError, TVariables, TOnMutateResult>,\n 'mutationKey'\n>\n\n/**\n * Same as the plain-object overload with a required `mutationKey`, but for options that close over reactive\n * state (`ref`s read inside the function body). Wrap them in a getter so `useMutation` and the other consumers\n * always read the current values instead of the ones captured when the options were created.\n *\n * @see {@link useMutation} to run the mutation these options describe.\n * @param options - A function returning the mutation options to use, with a required `mutationKey`,\n * re-evaluated on demand.\n * @returns A function that returns the same options object, unchanged.\n *\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { mutationOptions, useMutation } from '@tanstack/vue-query'\n *\n * const props = defineProps<{ userId: number }>()\n *\n * const createPostOptions = mutationOptions(() => ({\n * mutationKey: ['posts', 'create'],\n * // Reacts to changes on `props.userId`, unlike the plain-object overload.\n * mutationFn: (title: string) => createPost({ title, userId: props.userId }),\n * }))\n *\n * const mutation = useMutation(createPostOptions)\n * </script>\n *\n * <template>\n * <button @click=\"mutation.mutate('Hello')\">Create</button>\n * </template>\n * ```\n */\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: () => WithRequired<\n MutationOptions<TData, TError, TVariables, TOnMutateResult>,\n 'mutationKey'\n >,\n): () => WithRequired<\n MutationOptions<TData, TError, TVariables, TOnMutateResult>,\n 'mutationKey'\n>\n\n/**\n * You can generally pass everything to `mutationOptions` that you can also pass to `useMutation`. No\n * `mutationKey` is required on this overload — use this when you don't need to target the mutation via a\n * `mutationKey` filter later (e.g. with `useMutationState`); it can still be observed through other filters,\n * such as `status`.\n *\n * @see {@link useMutation} to run the mutation these options describe.\n * @param options - The mutation options to use, identical to what you'd pass to `useMutation`, without a\n * `mutationKey`.\n * @returns The same options object, unchanged.\n * @remarks See the other overload's example for looking a mutation up via `useMutationState`.\n *\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { mutationOptions, useMutation } from '@tanstack/vue-query'\n *\n * const createPostOptions = mutationOptions({\n * mutationFn: createPost,\n * })\n *\n * const mutation = useMutation(createPostOptions)\n * </script>\n *\n * <template>\n * <button @click=\"mutation.mutate({ title: 'Hello' })\">Create</button>\n * </template>\n * ```\n */\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: Omit<\n MutationOptions<TData, TError, TVariables, TOnMutateResult>,\n 'mutationKey'\n >,\n): Omit<\n MutationOptions<TData, TError, TVariables, TOnMutateResult>,\n 'mutationKey'\n>\n\n/**\n * Same as the plain-object overload without a `mutationKey`, but for options that close over reactive state\n * (`ref`s read inside the function body). Wrap them in a getter so `useMutation` and the other consumers\n * always read the current values instead of the ones captured when the options were created.\n *\n * @see {@link useMutation} to run the mutation these options describe.\n * @param options - A function returning the mutation options to use, without a `mutationKey`, re-evaluated on\n * demand.\n * @returns A function that returns the same options object, unchanged.\n *\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { mutationOptions, useMutation } from '@tanstack/vue-query'\n *\n * const props = defineProps<{ userId: number }>()\n *\n * const createPostOptions = mutationOptions(() => ({\n * // Reacts to changes on `props.userId`, unlike the plain-object overload.\n * mutationFn: (title: string) => createPost({ title, userId: props.userId }),\n * }))\n *\n * const mutation = useMutation(createPostOptions)\n * </script>\n *\n * <template>\n * <button @click=\"mutation.mutate('Hello')\">Create</button>\n * </template>\n * ```\n */\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: () => Omit<\n MutationOptions<TData, TError, TVariables, TOnMutateResult>,\n 'mutationKey'\n >,\n): () => Omit<\n MutationOptions<TData, TError, TVariables, TOnMutateResult>,\n 'mutationKey'\n>\nexport function mutationOptions(options: unknown) {\n return options\n}\n"],"mappings":";;AAsLA,SAAgB,gBAAgB,SAAkB;CAChD,OAAO;AACT"}