@tanstack/vue-query 5.106.1 → 5.107.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 (144) 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 +4 -4
  4. package/build/legacy/index.d.ts +4 -4
  5. package/build/legacy/{infiniteQueryOptions-CkULbee9.d.cts → infiniteQueryOptions-BSwO8rvy.d.cts} +49 -8
  6. package/build/legacy/infiniteQueryOptions-BSwO8rvy.d.cts.map +1 -0
  7. package/build/legacy/{infiniteQueryOptions-CGWmFi6_.d.ts → infiniteQueryOptions-Bq8UQFvj.d.ts} +49 -8
  8. package/build/legacy/infiniteQueryOptions-Bq8UQFvj.d.ts.map +1 -0
  9. package/build/legacy/infiniteQueryOptions.d.cts +1 -1
  10. package/build/legacy/infiniteQueryOptions.d.ts +1 -1
  11. package/build/{modern/queryClient-BGn8uIej.d.cts → legacy/queryClient-BSSPWSvX.d.cts} +2 -2
  12. package/build/legacy/{queryClient-BGn8uIej.d.cts.map → queryClient-BSSPWSvX.d.cts.map} +1 -1
  13. package/build/{modern/queryClient-Ba4HSFnn.d.ts → legacy/queryClient-Bgw9hMbf.d.ts} +2 -2
  14. package/build/legacy/{queryClient-Ba4HSFnn.d.ts.map → queryClient-Bgw9hMbf.d.ts.map} +1 -1
  15. package/build/legacy/queryClient.d.cts +1 -1
  16. package/build/legacy/queryClient.d.ts +1 -1
  17. package/build/{modern/queryOptions-BuZEBLtg.d.cts → legacy/queryOptions-B-eHjgaY.d.cts} +12 -4
  18. package/build/legacy/queryOptions-B-eHjgaY.d.cts.map +1 -0
  19. package/build/{modern/queryOptions-dXiBZnGk.d.ts → legacy/queryOptions-D1-foH1W.d.ts} +12 -4
  20. package/build/legacy/queryOptions-D1-foH1W.d.ts.map +1 -0
  21. package/build/legacy/queryOptions.cjs.map +1 -1
  22. package/build/legacy/queryOptions.d.cts +2 -2
  23. package/build/legacy/queryOptions.d.ts +2 -2
  24. package/build/legacy/queryOptions.js.map +1 -1
  25. package/build/legacy/useBaseQuery.cjs +11 -5
  26. package/build/legacy/useBaseQuery.cjs.map +1 -1
  27. package/build/legacy/useBaseQuery.d.cts +1 -1
  28. package/build/legacy/useBaseQuery.d.ts +1 -1
  29. package/build/legacy/useBaseQuery.js +11 -5
  30. package/build/legacy/useBaseQuery.js.map +1 -1
  31. package/build/legacy/useInfiniteQuery.cjs.map +1 -1
  32. package/build/legacy/useInfiniteQuery.d.cts +2 -2
  33. package/build/legacy/useInfiniteQuery.d.ts +2 -2
  34. package/build/legacy/useInfiniteQuery.js.map +1 -1
  35. package/build/legacy/useIsFetching.d.cts +1 -1
  36. package/build/legacy/useIsFetching.d.ts +1 -1
  37. package/build/legacy/useMutation.d.cts +1 -1
  38. package/build/legacy/useMutation.d.ts +1 -1
  39. package/build/legacy/useMutationState.d.cts +1 -1
  40. package/build/legacy/useMutationState.d.ts +1 -1
  41. package/build/legacy/usePrefetchInfiniteQuery.d.cts +1 -1
  42. package/build/legacy/usePrefetchInfiniteQuery.d.ts +1 -1
  43. package/build/legacy/usePrefetchQuery.d.cts +1 -1
  44. package/build/legacy/usePrefetchQuery.d.ts +1 -1
  45. package/build/legacy/useQueries.cjs +1 -1
  46. package/build/legacy/useQueries.cjs.map +1 -1
  47. package/build/legacy/useQueries.d.cts +2 -2
  48. package/build/legacy/useQueries.d.ts +2 -2
  49. package/build/legacy/useQueries.js +1 -1
  50. package/build/legacy/useQueries.js.map +1 -1
  51. package/build/legacy/useQuery.cjs.map +1 -1
  52. package/build/legacy/useQuery.d.cts +25 -4
  53. package/build/legacy/useQuery.d.cts.map +1 -1
  54. package/build/legacy/useQuery.d.ts +25 -4
  55. package/build/legacy/useQuery.d.ts.map +1 -1
  56. package/build/legacy/useQuery.js.map +1 -1
  57. package/build/legacy/useQueryClient.d.cts +1 -1
  58. package/build/legacy/useQueryClient.d.ts +1 -1
  59. package/build/legacy/vueQueryPlugin.cjs +2 -0
  60. package/build/legacy/vueQueryPlugin.cjs.map +1 -1
  61. package/build/legacy/vueQueryPlugin.d.cts +1 -1
  62. package/build/legacy/vueQueryPlugin.d.ts +1 -1
  63. package/build/legacy/vueQueryPlugin.js +2 -0
  64. package/build/legacy/vueQueryPlugin.js.map +1 -1
  65. package/build/modern/devtools/devtools.d.cts +1 -1
  66. package/build/modern/devtools/devtools.d.ts +1 -1
  67. package/build/modern/index.d.cts +4 -4
  68. package/build/modern/index.d.ts +4 -4
  69. package/build/modern/{infiniteQueryOptions-CkULbee9.d.cts → infiniteQueryOptions-BSwO8rvy.d.cts} +49 -8
  70. package/build/modern/infiniteQueryOptions-BSwO8rvy.d.cts.map +1 -0
  71. package/build/modern/{infiniteQueryOptions-CGWmFi6_.d.ts → infiniteQueryOptions-Bq8UQFvj.d.ts} +49 -8
  72. package/build/modern/infiniteQueryOptions-Bq8UQFvj.d.ts.map +1 -0
  73. package/build/modern/infiniteQueryOptions.d.cts +1 -1
  74. package/build/modern/infiniteQueryOptions.d.ts +1 -1
  75. package/build/{legacy/queryClient-BGn8uIej.d.cts → modern/queryClient-BSSPWSvX.d.cts} +2 -2
  76. package/build/modern/{queryClient-BGn8uIej.d.cts.map → queryClient-BSSPWSvX.d.cts.map} +1 -1
  77. package/build/{legacy/queryClient-Ba4HSFnn.d.ts → modern/queryClient-Bgw9hMbf.d.ts} +2 -2
  78. package/build/modern/{queryClient-Ba4HSFnn.d.ts.map → queryClient-Bgw9hMbf.d.ts.map} +1 -1
  79. package/build/modern/queryClient.d.cts +1 -1
  80. package/build/modern/queryClient.d.ts +1 -1
  81. package/build/{legacy/queryOptions-BuZEBLtg.d.cts → modern/queryOptions-B-eHjgaY.d.cts} +12 -4
  82. package/build/modern/queryOptions-B-eHjgaY.d.cts.map +1 -0
  83. package/build/{legacy/queryOptions-dXiBZnGk.d.ts → modern/queryOptions-D1-foH1W.d.ts} +12 -4
  84. package/build/modern/queryOptions-D1-foH1W.d.ts.map +1 -0
  85. package/build/modern/queryOptions.cjs.map +1 -1
  86. package/build/modern/queryOptions.d.cts +2 -2
  87. package/build/modern/queryOptions.d.ts +2 -2
  88. package/build/modern/queryOptions.js.map +1 -1
  89. package/build/modern/useBaseQuery.cjs +11 -5
  90. package/build/modern/useBaseQuery.cjs.map +1 -1
  91. package/build/modern/useBaseQuery.d.cts +1 -1
  92. package/build/modern/useBaseQuery.d.ts +1 -1
  93. package/build/modern/useBaseQuery.js +11 -5
  94. package/build/modern/useBaseQuery.js.map +1 -1
  95. package/build/modern/useInfiniteQuery.cjs.map +1 -1
  96. package/build/modern/useInfiniteQuery.d.cts +2 -2
  97. package/build/modern/useInfiniteQuery.d.ts +2 -2
  98. package/build/modern/useInfiniteQuery.js.map +1 -1
  99. package/build/modern/useIsFetching.d.cts +1 -1
  100. package/build/modern/useIsFetching.d.ts +1 -1
  101. package/build/modern/useMutation.d.cts +1 -1
  102. package/build/modern/useMutation.d.ts +1 -1
  103. package/build/modern/useMutationState.d.cts +1 -1
  104. package/build/modern/useMutationState.d.ts +1 -1
  105. package/build/modern/usePrefetchInfiniteQuery.d.cts +1 -1
  106. package/build/modern/usePrefetchInfiniteQuery.d.ts +1 -1
  107. package/build/modern/usePrefetchQuery.d.cts +1 -1
  108. package/build/modern/usePrefetchQuery.d.ts +1 -1
  109. package/build/modern/useQueries.cjs +1 -1
  110. package/build/modern/useQueries.cjs.map +1 -1
  111. package/build/modern/useQueries.d.cts +2 -2
  112. package/build/modern/useQueries.d.ts +2 -2
  113. package/build/modern/useQueries.js +1 -1
  114. package/build/modern/useQueries.js.map +1 -1
  115. package/build/modern/useQuery.cjs.map +1 -1
  116. package/build/modern/useQuery.d.cts +25 -4
  117. package/build/modern/useQuery.d.cts.map +1 -1
  118. package/build/modern/useQuery.d.ts +25 -4
  119. package/build/modern/useQuery.d.ts.map +1 -1
  120. package/build/modern/useQuery.js.map +1 -1
  121. package/build/modern/useQueryClient.d.cts +1 -1
  122. package/build/modern/useQueryClient.d.ts +1 -1
  123. package/build/modern/vueQueryPlugin.cjs +2 -0
  124. package/build/modern/vueQueryPlugin.cjs.map +1 -1
  125. package/build/modern/vueQueryPlugin.d.cts +1 -1
  126. package/build/modern/vueQueryPlugin.d.ts +1 -1
  127. package/build/modern/vueQueryPlugin.js +2 -0
  128. package/build/modern/vueQueryPlugin.js.map +1 -1
  129. package/package.json +2 -2
  130. package/src/index.ts +2 -0
  131. package/src/queryOptions.ts +23 -9
  132. package/src/useBaseQuery.ts +68 -8
  133. package/src/useInfiniteQuery.ts +19 -9
  134. package/src/useQueries.ts +7 -2
  135. package/src/useQuery.ts +22 -1
  136. package/src/vueQueryPlugin.ts +13 -6
  137. package/build/legacy/infiniteQueryOptions-CGWmFi6_.d.ts.map +0 -1
  138. package/build/legacy/infiniteQueryOptions-CkULbee9.d.cts.map +0 -1
  139. package/build/legacy/queryOptions-BuZEBLtg.d.cts.map +0 -1
  140. package/build/legacy/queryOptions-dXiBZnGk.d.ts.map +0 -1
  141. package/build/modern/infiniteQueryOptions-CGWmFi6_.d.ts.map +0 -1
  142. package/build/modern/infiniteQueryOptions-CkULbee9.d.cts.map +0 -1
  143. package/build/modern/queryOptions-BuZEBLtg.d.cts.map +0 -1
  144. package/build/modern/queryOptions-dXiBZnGk.d.ts.map +0 -1
@@ -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\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,CAAA,wBAAA,QAAQ,8BAAA,QAAA,0BAAA,KAAA,KAAA,sBAAA,KAAA,SAA2B,MAAM;EAC3C,CAAC;CACH;CAEA,MAAM,gBAAgB;EACpB,OAAO,QAAQ;EACf,iBAAiB;CACnB;CAEA,IAAI,IAAI,WACN,IAAI,UAAU,OAAO;MAChB;EACL,MAAM,kBAAkB,IAAI;EAC5B,IAAI,UAAU,SAAS,kBAAkB;GACvC,QAAQ;GACR,gBAAgB;EAClB;CACF;CAEA,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 () => {\n if (client.isRestoring) {\n client.isRestoring.value = false\n }\n options.clientPersisterOnSuccess?.(client)\n },\n () => {\n if (client.isRestoring) {\n client.isRestoring.value = false\n }\n },\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.enableDevtoolsV6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Q,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,4 +1,4 @@
1
- import { t as QueryClient } from "../queryClient-BGn8uIej.cjs";
1
+ import { t as QueryClient } from "../queryClient-BSSPWSvX.cjs";
2
2
  /**
3
3
  * Registers the Vue Query plugin with the Vue devtools, adding a query inspector and a timeline
4
4
  * layer for query cache events.
@@ -1,4 +1,4 @@
1
- import { t as QueryClient } from "../queryClient-Ba4HSFnn.js";
1
+ import { t as QueryClient } from "../queryClient-Bgw9hMbf.js";
2
2
  /**
3
3
  * Registers the Vue Query plugin with the Vue devtools, adding a query inspector and a timeline
4
4
  * layer for query cache events.
@@ -1,10 +1,10 @@
1
1
  import { c as MutationOptions } from "./types-u_Tu5Ybs.cjs";
2
- import { a as UndefinedInitialQueryOptionsWithDataTag, i as UndefinedInitialQueryOptions, n as DefinedInitialQueryOptionsWithDataTag, o as UseQueryOptions, r as QueryOptions, s as queryOptions, t as DefinedInitialQueryOptions } from "./queryOptions-BuZEBLtg.cjs";
3
- import { t as QueryClient } from "./queryClient-BGn8uIej.cjs";
2
+ import { a as UndefinedInitialQueryOptionsWithDataTag, c as queryOptions, i as UndefinedInitialQueryOptions, n as DefinedInitialQueryOptionsWithDataTag, o as UseQueryOptions, r as QueryOptions, s as VueQueryEnabledOption, t as DefinedInitialQueryOptions } from "./queryOptions-B-eHjgaY.cjs";
3
+ import { t as QueryClient } from "./queryClient-BSSPWSvX.cjs";
4
4
  import { useQueryClient } from "./useQueryClient.cjs";
5
5
  import { VueQueryPlugin, VueQueryPluginOptions } from "./vueQueryPlugin.cjs";
6
6
  import { QueryCache } from "./queryCache.cjs";
7
- import { a as UseInfiniteQueryReturnType, i as UseInfiniteQueryOptions, n as UndefinedInitialDataInfiniteOptions, o as useInfiniteQuery, r as infiniteQueryOptions, t as DefinedInitialDataInfiniteOptions } from "./infiniteQueryOptions-CkULbee9.cjs";
7
+ import { a as UseInfiniteQueryOptions, i as UseInfiniteQueryDefinedReturnType, n as UndefinedInitialDataInfiniteOptions, o as UseInfiniteQueryReturnType, r as infiniteQueryOptions, s as useInfiniteQuery, t as DefinedInitialDataInfiniteOptions } from "./infiniteQueryOptions-BSwO8rvy.cjs";
8
8
  import { MutationCache } from "./mutationCache.cjs";
9
9
  import { mutationOptions } from "./mutationOptions.cjs";
10
10
  import { UseQueryDefinedReturnType, UseQueryReturnType, useQuery } from "./useQuery.cjs";
@@ -16,4 +16,4 @@ import { UseIsFetchingFilters, useIsFetching } from "./useIsFetching.cjs";
16
16
  import { MutationStateOptions, UseIsMutatingFilters, useIsMutating, useMutationState } from "./useMutationState.cjs";
17
17
  import { VUE_QUERY_CLIENT } from "./utils.cjs";
18
18
  export * from "@tanstack/query-core";
19
- export { type DefinedInitialDataInfiniteOptions, type DefinedInitialQueryOptions, type DefinedInitialQueryOptionsWithDataTag, MutationCache, type MutationOptions, type MutationResult, type MutationStateOptions, QueryCache, QueryClient, type QueryOptions, type UndefinedInitialDataInfiniteOptions, type UndefinedInitialQueryOptions, type UndefinedInitialQueryOptionsWithDataTag, type UseInfiniteQueryOptions, type UseInfiniteQueryReturnType, type UseIsFetchingFilters, type UseIsMutatingFilters, type UseMutationOptions, type UseMutationReturnType, type UsePrefetchInfiniteQueryOptions, type UsePrefetchQueryOptions, type UseQueriesOptions, type UseQueriesResults, type UseQueryDefinedReturnType, type UseQueryOptions, type UseQueryReturnType, VUE_QUERY_CLIENT, VueQueryPlugin, type VueQueryPluginOptions, infiniteQueryOptions, mutationOptions, queryOptions, useInfiniteQuery, useIsFetching, useIsMutating, useMutation, useMutationState, usePrefetchInfiniteQuery, usePrefetchQuery, useQueries, useQuery, useQueryClient };
19
+ export { type DefinedInitialDataInfiniteOptions, type DefinedInitialQueryOptions, type DefinedInitialQueryOptionsWithDataTag, MutationCache, type MutationOptions, type MutationResult, type MutationStateOptions, QueryCache, QueryClient, type QueryOptions, type UndefinedInitialDataInfiniteOptions, type UndefinedInitialQueryOptions, type UndefinedInitialQueryOptionsWithDataTag, type UseInfiniteQueryDefinedReturnType, type UseInfiniteQueryOptions, type UseInfiniteQueryReturnType, type UseIsFetchingFilters, type UseIsMutatingFilters, type UseMutationOptions, type UseMutationReturnType, type UsePrefetchInfiniteQueryOptions, type UsePrefetchQueryOptions, type UseQueriesOptions, type UseQueriesResults, type UseQueryDefinedReturnType, type UseQueryOptions, type UseQueryReturnType, VUE_QUERY_CLIENT, type VueQueryEnabledOption, VueQueryPlugin, type VueQueryPluginOptions, infiniteQueryOptions, mutationOptions, queryOptions, useInfiniteQuery, useIsFetching, useIsMutating, useMutation, useMutationState, usePrefetchInfiniteQuery, usePrefetchQuery, useQueries, useQuery, useQueryClient };
@@ -1,10 +1,10 @@
1
1
  import { c as MutationOptions } from "./types-u_Tu5Ybs.js";
2
- import { a as UndefinedInitialQueryOptionsWithDataTag, i as UndefinedInitialQueryOptions, n as DefinedInitialQueryOptionsWithDataTag, o as UseQueryOptions, r as QueryOptions, s as queryOptions, t as DefinedInitialQueryOptions } from "./queryOptions-dXiBZnGk.js";
3
- import { t as QueryClient } from "./queryClient-Ba4HSFnn.js";
2
+ import { a as UndefinedInitialQueryOptionsWithDataTag, c as queryOptions, i as UndefinedInitialQueryOptions, n as DefinedInitialQueryOptionsWithDataTag, o as UseQueryOptions, r as QueryOptions, s as VueQueryEnabledOption, t as DefinedInitialQueryOptions } from "./queryOptions-D1-foH1W.js";
3
+ import { t as QueryClient } from "./queryClient-Bgw9hMbf.js";
4
4
  import { useQueryClient } from "./useQueryClient.js";
5
5
  import { VueQueryPlugin, VueQueryPluginOptions } from "./vueQueryPlugin.js";
6
6
  import { QueryCache } from "./queryCache.js";
7
- import { a as UseInfiniteQueryReturnType, i as UseInfiniteQueryOptions, n as UndefinedInitialDataInfiniteOptions, o as useInfiniteQuery, r as infiniteQueryOptions, t as DefinedInitialDataInfiniteOptions } from "./infiniteQueryOptions-CGWmFi6_.js";
7
+ import { a as UseInfiniteQueryOptions, i as UseInfiniteQueryDefinedReturnType, n as UndefinedInitialDataInfiniteOptions, o as UseInfiniteQueryReturnType, r as infiniteQueryOptions, s as useInfiniteQuery, t as DefinedInitialDataInfiniteOptions } from "./infiniteQueryOptions-Bq8UQFvj.js";
8
8
  import { MutationCache } from "./mutationCache.js";
9
9
  import { mutationOptions } from "./mutationOptions.js";
10
10
  import { UseQueryDefinedReturnType, UseQueryReturnType, useQuery } from "./useQuery.js";
@@ -16,4 +16,4 @@ import { UseIsFetchingFilters, useIsFetching } from "./useIsFetching.js";
16
16
  import { MutationStateOptions, UseIsMutatingFilters, useIsMutating, useMutationState } from "./useMutationState.js";
17
17
  import { VUE_QUERY_CLIENT } from "./utils.js";
18
18
  export * from "@tanstack/query-core";
19
- export { type DefinedInitialDataInfiniteOptions, type DefinedInitialQueryOptions, type DefinedInitialQueryOptionsWithDataTag, MutationCache, type MutationOptions, type MutationResult, type MutationStateOptions, QueryCache, QueryClient, type QueryOptions, type UndefinedInitialDataInfiniteOptions, type UndefinedInitialQueryOptions, type UndefinedInitialQueryOptionsWithDataTag, type UseInfiniteQueryOptions, type UseInfiniteQueryReturnType, type UseIsFetchingFilters, type UseIsMutatingFilters, type UseMutationOptions, type UseMutationReturnType, type UsePrefetchInfiniteQueryOptions, type UsePrefetchQueryOptions, type UseQueriesOptions, type UseQueriesResults, type UseQueryDefinedReturnType, type UseQueryOptions, type UseQueryReturnType, VUE_QUERY_CLIENT, VueQueryPlugin, type VueQueryPluginOptions, infiniteQueryOptions, mutationOptions, queryOptions, useInfiniteQuery, useIsFetching, useIsMutating, useMutation, useMutationState, usePrefetchInfiniteQuery, usePrefetchQuery, useQueries, useQuery, useQueryClient };
19
+ export { type DefinedInitialDataInfiniteOptions, type DefinedInitialQueryOptions, type DefinedInitialQueryOptionsWithDataTag, MutationCache, type MutationOptions, type MutationResult, type MutationStateOptions, QueryCache, QueryClient, type QueryOptions, type UndefinedInitialDataInfiniteOptions, type UndefinedInitialQueryOptions, type UndefinedInitialQueryOptionsWithDataTag, type UseInfiniteQueryDefinedReturnType, type UseInfiniteQueryOptions, type UseInfiniteQueryReturnType, type UseIsFetchingFilters, type UseIsMutatingFilters, type UseMutationOptions, type UseMutationReturnType, type UsePrefetchInfiniteQueryOptions, type UsePrefetchQueryOptions, type UseQueriesOptions, type UseQueriesResults, type UseQueryDefinedReturnType, type UseQueryOptions, type UseQueryReturnType, VUE_QUERY_CLIENT, type VueQueryEnabledOption, VueQueryPlugin, type VueQueryPluginOptions, infiniteQueryOptions, mutationOptions, queryOptions, useInfiniteQuery, useIsFetching, useIsMutating, useMutation, useMutationState, usePrefetchInfiniteQuery, usePrefetchQuery, useQueries, useQuery, useQueryClient };
@@ -1,11 +1,16 @@
1
1
  import { a as MaybeRef, d as ShallowOption, o as MaybeRefDeep, s as MaybeRefOrGetter, t as DeepUnwrapRef } from "./types-u_Tu5Ybs.cjs";
2
- import { o as UseQueryOptions } from "./queryOptions-BuZEBLtg.cjs";
3
- import { t as QueryClient$1 } from "./queryClient-BGn8uIej.cjs";
4
- import { DefaultError, InfiniteData, InfiniteQueryObserverOptions, InfiniteQueryObserverResult, InitialDataFunction, NonUndefinedGuard, QueryKey, QueryKeyWithDataTag, QueryObserver, QueryObserverResult } from "@tanstack/query-core";
2
+ import { o as UseQueryOptions, s as VueQueryEnabledOption } from "./queryOptions-B-eHjgaY.cjs";
3
+ import { t as QueryClient$1 } from "./queryClient-BSSPWSvX.cjs";
4
+ import { DefaultError, DefinedInfiniteQueryObserverResult, InfiniteData, InfiniteQueryObserverOptions, InfiniteQueryObserverResult, InitialDataFunction, NonUndefinedGuard, QueryKey, QueryKeyWithDataTag, QueryObserver, QueryObserverResult } from "@tanstack/query-core";
5
5
  import { Ref } from "vue-demi";
6
+ /**
7
+ * Readonly view of a union that stays a union. A single `Readonly<Union>` collapses the members, which
8
+ * drops the `status` / `isSuccess` / `isPending` discriminants.
9
+ */
10
+ type ReadonlyQueryState<T> = T extends any ? { readonly [K in keyof T]: T[K]; } : never;
6
11
  /**
7
12
  * The result of the query composables: every property of the observer result wrapped in a `Ref`, except
8
- * the `refetch`, `fetchNextPage`, and `fetchPreviousPage` functions, plus `suspense`.
13
+ * the `refetch`, `fetchNextPage`, and `fetchPreviousPage` functions, plus `suspense` and `state`.
9
14
  */
10
15
  type UseBaseQueryReturnType<TData, TError, TResult = QueryObserverResult<TData, TError>> = { [K in keyof TResult]: K extends 'fetchNextPage' | 'fetchPreviousPage' | 'refetch' ? TResult[K] : Ref<Readonly<TResult>[K]>; } & {
11
16
  /**
@@ -17,6 +22,37 @@ type UseBaseQueryReturnType<TData, TError, TResult = QueryObserverResult<TData,
17
22
  * `true`, in which case it rejects.
18
23
  */
19
24
  suspense: () => Promise<TResult>;
25
+ /**
26
+ * The query result as one readonly reactive object. `data`, `error`, `status`, `isPending`, and the other
27
+ * fields are plain values — read `state.data`, not `state.data.value`.
28
+ *
29
+ * The object is a discriminated union, so a check on `status`, `isSuccess`, `isPending`, or `isError`
30
+ * narrows the other fields. When `status` is `'success'` (or `isSuccess` is `true`), `data` is `TData`.
31
+ * When `status` is `'pending'` (or `isPending` is `true`), `data` is `undefined` and `error` is `null`.
32
+ * @example
33
+ * ```vue
34
+ * <script setup lang="ts">
35
+ * import { useQuery } from '@tanstack/vue-query'
36
+ *
37
+ * const { state } = useQuery({
38
+ * queryKey: ['post'],
39
+ * queryFn: fetchPost,
40
+ * })
41
+ *
42
+ * if (state.status === 'success') {
43
+ * // `state.data` is `Post`, not `Post | undefined`
44
+ * console.log(state.data.title)
45
+ * }
46
+ * </script>
47
+ *
48
+ * <template>
49
+ * <span v-if="state.status === 'pending'">Loading...</span>
50
+ * <span v-else-if="state.status === 'error'">Error: {{ state.error.message }}</span>
51
+ * <h1 v-else>{{ state.data.title }}</h1>
52
+ * </template>
53
+ * ```
54
+ */
55
+ state: ReadonlyQueryState<TResult>;
20
56
  };
21
57
  type UseQueryOptionsGeneric<TQueryFnData, TError, TData, TQueryData, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = UseQueryOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey> | UseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>;
22
58
  /**
@@ -33,12 +69,17 @@ declare function useBaseQuery<TQueryFnData, TError, TData, TQueryData, TQueryKey
33
69
  * `@tanstack/query-core`, plus the `shallow` option. Each option except `shallow` can also be a `ref` (and
34
70
  * `enabled` a reactive getter).
35
71
  */
36
- 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>;
72
+ 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' ? VueQueryEnabledOption<TQueryFnData, TError, InfiniteData<TQueryFnData, TPageParam>, DeepUnwrapRef<TQueryKey>> : MaybeRefDeep<InfiniteQueryObserverOptions<TQueryFnData, TError, TData, DeepUnwrapRef<TQueryKey>, TPageParam>[Property]>; } & ShallowOption>;
37
73
  /**
38
74
  * The result of `useInfiniteQuery`: {@link InfiniteQueryObserverResult} from `@tanstack/query-core`, with
39
75
  * its properties wrapped in `Ref`s as in {@link UseBaseQueryReturnType}.
40
76
  */
41
77
  type UseInfiniteQueryReturnType<TData, TError> = UseBaseQueryReturnType<TData, TError, InfiniteQueryObserverResult<TData, TError>>;
78
+ /**
79
+ * The result of `useInfiniteQuery` when `initialData` is set — `data` is never `undefined` (unless a `select`
80
+ * changes `TData` to include `undefined`).
81
+ */
82
+ type UseInfiniteQueryDefinedReturnType<TData, TError> = UseBaseQueryReturnType<TData, TError, DefinedInfiniteQueryObserverResult<TData, TError>>;
42
83
  /**
43
84
  * The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of
44
85
  * `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`.
@@ -86,7 +127,7 @@ type UseInfiniteQueryReturnType<TData, TError> = UseBaseQueryReturnType<TData, T
86
127
  * </template>
87
128
  * ```
88
129
  */
89
- 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>;
130
+ 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): UseInfiniteQueryDefinedReturnType<TData, TError>;
90
131
  /**
91
132
  * The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of
92
133
  * `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`.
@@ -365,5 +406,5 @@ declare function infiniteQueryOptions<TQueryFnData, TError = DefaultError, TData
365
406
  * ```
366
407
  */
367
408
  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>;
368
- export { UseInfiniteQueryReturnType as a, useBaseQuery as c, UseInfiniteQueryOptions as i, UndefinedInitialDataInfiniteOptions as n, useInfiniteQuery as o, infiniteQueryOptions as r, UseBaseQueryReturnType as s, DefinedInitialDataInfiniteOptions as t };
369
- //# sourceMappingURL=infiniteQueryOptions-CkULbee9.d.cts.map
409
+ export { UseInfiniteQueryOptions as a, UseBaseQueryReturnType as c, UseInfiniteQueryDefinedReturnType as i, useBaseQuery as l, UndefinedInitialDataInfiniteOptions as n, UseInfiniteQueryReturnType as o, infiniteQueryOptions as r, useInfiniteQuery as s, DefinedInitialDataInfiniteOptions as t };
410
+ //# sourceMappingURL=infiniteQueryOptions-BSwO8rvy.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"infiniteQueryOptions-BSwO8rvy.d.cts","names":["QueryClient","QueryClient"],"sources":["../../src/useBaseQuery.ts","../../src/useInfiniteQuery.ts","../../src/infiniteQueryOptions.ts"],"mappings":";;;;;;;;;KA8BK,mBAAmB,KAAK,4BACb,WAAW,IAAI,EAAE;;;;;KAOrB,uBACV,OACA,QACA,UAAU,oBAAoB,OAAO,cAEpC,WAAW,UAAU,8DAIlB,QAAQ,KACR,IAAI,SAAS,SAAS;;;;;;;;;EAU1B,gBAAgB,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+BxB,OAAO,mBAAmB;;KAGvB,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,kB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,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,wBACE,wBACF,cACA,QACA,OACA,WACA;EAEA,0BAEI,kBAAkB,aAAa,cAAc,eAC7C,oBACE,kBAAkB,aAAa,cAAc;;;;;;;;;;;;KAczC,kCACV,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,wBACE,wBACF,cACA,QACA,OACA,WACA;;;;;;;;EASA,aACI,kBAAkB,aAAa,cAAc,sBACtC,kBAAkB,aAAa,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiC1C,qBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,kCACP,cACA,QACA,OACA,WACA,cAED,kCACD,cACA,QACA,OACA,WACA,cAEA,oBAAoB,WAAW,aAAa,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;iBA0B7C,qBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,oCACP,cACA,QACA,OACA,WACA,cAED,oCACD,cACA,QACA,OACA,WACA,cAEA,oBAAoB,WAAW,aAAa,eAAe"}
@@ -1,11 +1,16 @@
1
1
  import { a as MaybeRef, d as ShallowOption, o as MaybeRefDeep, s as MaybeRefOrGetter, t as DeepUnwrapRef } from "./types-u_Tu5Ybs.js";
2
- import { o as UseQueryOptions } from "./queryOptions-dXiBZnGk.js";
3
- import { t as QueryClient$1 } from "./queryClient-Ba4HSFnn.js";
4
- import { DefaultError, InfiniteData, InfiniteQueryObserverOptions, InfiniteQueryObserverResult, InitialDataFunction, NonUndefinedGuard, QueryKey, QueryKeyWithDataTag, QueryObserver, QueryObserverResult } from "@tanstack/query-core";
2
+ import { o as UseQueryOptions, s as VueQueryEnabledOption } from "./queryOptions-D1-foH1W.js";
3
+ import { t as QueryClient$1 } from "./queryClient-Bgw9hMbf.js";
4
+ import { DefaultError, DefinedInfiniteQueryObserverResult, InfiniteData, InfiniteQueryObserverOptions, InfiniteQueryObserverResult, InitialDataFunction, NonUndefinedGuard, QueryKey, QueryKeyWithDataTag, QueryObserver, QueryObserverResult } from "@tanstack/query-core";
5
5
  import { Ref } from "vue-demi";
6
+ /**
7
+ * Readonly view of a union that stays a union. A single `Readonly<Union>` collapses the members, which
8
+ * drops the `status` / `isSuccess` / `isPending` discriminants.
9
+ */
10
+ type ReadonlyQueryState<T> = T extends any ? { readonly [K in keyof T]: T[K]; } : never;
6
11
  /**
7
12
  * The result of the query composables: every property of the observer result wrapped in a `Ref`, except
8
- * the `refetch`, `fetchNextPage`, and `fetchPreviousPage` functions, plus `suspense`.
13
+ * the `refetch`, `fetchNextPage`, and `fetchPreviousPage` functions, plus `suspense` and `state`.
9
14
  */
10
15
  type UseBaseQueryReturnType<TData, TError, TResult = QueryObserverResult<TData, TError>> = { [K in keyof TResult]: K extends 'fetchNextPage' | 'fetchPreviousPage' | 'refetch' ? TResult[K] : Ref<Readonly<TResult>[K]>; } & {
11
16
  /**
@@ -17,6 +22,37 @@ type UseBaseQueryReturnType<TData, TError, TResult = QueryObserverResult<TData,
17
22
  * `true`, in which case it rejects.
18
23
  */
19
24
  suspense: () => Promise<TResult>;
25
+ /**
26
+ * The query result as one readonly reactive object. `data`, `error`, `status`, `isPending`, and the other
27
+ * fields are plain values — read `state.data`, not `state.data.value`.
28
+ *
29
+ * The object is a discriminated union, so a check on `status`, `isSuccess`, `isPending`, or `isError`
30
+ * narrows the other fields. When `status` is `'success'` (or `isSuccess` is `true`), `data` is `TData`.
31
+ * When `status` is `'pending'` (or `isPending` is `true`), `data` is `undefined` and `error` is `null`.
32
+ * @example
33
+ * ```vue
34
+ * <script setup lang="ts">
35
+ * import { useQuery } from '@tanstack/vue-query'
36
+ *
37
+ * const { state } = useQuery({
38
+ * queryKey: ['post'],
39
+ * queryFn: fetchPost,
40
+ * })
41
+ *
42
+ * if (state.status === 'success') {
43
+ * // `state.data` is `Post`, not `Post | undefined`
44
+ * console.log(state.data.title)
45
+ * }
46
+ * </script>
47
+ *
48
+ * <template>
49
+ * <span v-if="state.status === 'pending'">Loading...</span>
50
+ * <span v-else-if="state.status === 'error'">Error: {{ state.error.message }}</span>
51
+ * <h1 v-else>{{ state.data.title }}</h1>
52
+ * </template>
53
+ * ```
54
+ */
55
+ state: ReadonlyQueryState<TResult>;
20
56
  };
21
57
  type UseQueryOptionsGeneric<TQueryFnData, TError, TData, TQueryData, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = UseQueryOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey> | UseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>;
22
58
  /**
@@ -33,12 +69,17 @@ declare function useBaseQuery<TQueryFnData, TError, TData, TQueryData, TQueryKey
33
69
  * `@tanstack/query-core`, plus the `shallow` option. Each option except `shallow` can also be a `ref` (and
34
70
  * `enabled` a reactive getter).
35
71
  */
36
- 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>;
72
+ 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' ? VueQueryEnabledOption<TQueryFnData, TError, InfiniteData<TQueryFnData, TPageParam>, DeepUnwrapRef<TQueryKey>> : MaybeRefDeep<InfiniteQueryObserverOptions<TQueryFnData, TError, TData, DeepUnwrapRef<TQueryKey>, TPageParam>[Property]>; } & ShallowOption>;
37
73
  /**
38
74
  * The result of `useInfiniteQuery`: {@link InfiniteQueryObserverResult} from `@tanstack/query-core`, with
39
75
  * its properties wrapped in `Ref`s as in {@link UseBaseQueryReturnType}.
40
76
  */
41
77
  type UseInfiniteQueryReturnType<TData, TError> = UseBaseQueryReturnType<TData, TError, InfiniteQueryObserverResult<TData, TError>>;
78
+ /**
79
+ * The result of `useInfiniteQuery` when `initialData` is set — `data` is never `undefined` (unless a `select`
80
+ * changes `TData` to include `undefined`).
81
+ */
82
+ type UseInfiniteQueryDefinedReturnType<TData, TError> = UseBaseQueryReturnType<TData, TError, DefinedInfiniteQueryObserverResult<TData, TError>>;
42
83
  /**
43
84
  * The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of
44
85
  * `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`.
@@ -86,7 +127,7 @@ type UseInfiniteQueryReturnType<TData, TError> = UseBaseQueryReturnType<TData, T
86
127
  * </template>
87
128
  * ```
88
129
  */
89
- 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>;
130
+ 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): UseInfiniteQueryDefinedReturnType<TData, TError>;
90
131
  /**
91
132
  * The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of
92
133
  * `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`.
@@ -365,5 +406,5 @@ declare function infiniteQueryOptions<TQueryFnData, TError = DefaultError, TData
365
406
  * ```
366
407
  */
367
408
  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>;
368
- export { UseInfiniteQueryReturnType as a, useBaseQuery as c, UseInfiniteQueryOptions as i, UndefinedInitialDataInfiniteOptions as n, useInfiniteQuery as o, infiniteQueryOptions as r, UseBaseQueryReturnType as s, DefinedInitialDataInfiniteOptions as t };
369
- //# sourceMappingURL=infiniteQueryOptions-CGWmFi6_.d.ts.map
409
+ export { UseInfiniteQueryOptions as a, UseBaseQueryReturnType as c, UseInfiniteQueryDefinedReturnType as i, useBaseQuery as l, UndefinedInitialDataInfiniteOptions as n, UseInfiniteQueryReturnType as o, infiniteQueryOptions as r, useInfiniteQuery as s, DefinedInitialDataInfiniteOptions as t };
410
+ //# sourceMappingURL=infiniteQueryOptions-Bq8UQFvj.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"infiniteQueryOptions-Bq8UQFvj.d.ts","names":["QueryClient","QueryClient"],"sources":["../../src/useBaseQuery.ts","../../src/useInfiniteQuery.ts","../../src/infiniteQueryOptions.ts"],"mappings":";;;;;;;;;KA8BK,mBAAmB,KAAK,4BACb,WAAW,IAAI,EAAE;;;;;KAOrB,uBACV,OACA,QACA,UAAU,oBAAoB,OAAO,cAEpC,WAAW,UAAU,8DAIlB,QAAQ,KACR,IAAI,SAAS,SAAS;;;;;;;;;EAU1B,gBAAgB,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+BxB,OAAO,mBAAmB;;KAGvB,uBACH,cACA,QACA,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AQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,iBACP,wBAAwB,cAAc,QAAQ,OAAO,WAAW,cAElE,cAAcA,gBACb,2BAA2B,OAAO;;;;;;;;;;;;KC9VzB,oCACV,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,wBACE,wBACF,cACA,QACA,OACA,WACA;EAEA,0BAEI,kBAAkB,aAAa,cAAc,eAC7C,oBACE,kBAAkB,aAAa,cAAc;;;;;;;;;;;;KAczC,kCACV,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,wBACE,wBACF,cACA,QACA,OACA,WACA;;;;;;;;EASA,aACI,kBAAkB,aAAa,cAAc,sBACtC,kBAAkB,aAAa,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiC1C,qBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,kCACP,cACA,QACA,OACA,WACA,cAED,kCACD,cACA,QACA,OACA,WACA,cAEA,oBAAoB,WAAW,aAAa,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;iBA0B7C,qBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,oCACP,cACA,QACA,OACA,WACA,cAED,oCACD,cACA,QACA,OACA,WACA,cAEA,oBAAoB,WAAW,aAAa,eAAe"}
@@ -1,2 +1,2 @@
1
- import { n as UndefinedInitialDataInfiniteOptions, r as infiniteQueryOptions, t as DefinedInitialDataInfiniteOptions } from "./infiniteQueryOptions-CkULbee9.cjs";
1
+ import { n as UndefinedInitialDataInfiniteOptions, r as infiniteQueryOptions, t as DefinedInitialDataInfiniteOptions } from "./infiniteQueryOptions-BSwO8rvy.cjs";
2
2
  export { DefinedInitialDataInfiniteOptions, UndefinedInitialDataInfiniteOptions, infiniteQueryOptions };
@@ -1,2 +1,2 @@
1
- import { n as UndefinedInitialDataInfiniteOptions, r as infiniteQueryOptions, t as DefinedInitialDataInfiniteOptions } from "./infiniteQueryOptions-CGWmFi6_.js";
1
+ import { n as UndefinedInitialDataInfiniteOptions, r as infiniteQueryOptions, t as DefinedInitialDataInfiniteOptions } from "./infiniteQueryOptions-Bq8UQFvj.js";
2
2
  export { DefinedInitialDataInfiniteOptions, UndefinedInitialDataInfiniteOptions, infiniteQueryOptions };
@@ -1,5 +1,5 @@
1
1
  import { a as MaybeRef, l as NoUnknown, o as MaybeRefDeep, s as MaybeRefOrGetter, u as QueryClientConfig } from "./types-u_Tu5Ybs.cjs";
2
- import { o as UseQueryOptions } from "./queryOptions-BuZEBLtg.cjs";
2
+ import { o as UseQueryOptions } from "./queryOptions-B-eHjgaY.cjs";
3
3
  import { CancelOptions, DefaultError, DefaultOptions, EnsureQueryDataOptions, FetchInfiniteQueryOptions, FetchQueryOptions, InferDataFromTag, InferErrorFromTag, InfiniteData, InfiniteQueryExecuteOptions, InvalidateOptions, InvalidateQueryFilters, MutationFilters, MutationKey, MutationObserverOptions, OmitKeyof, QueryClient, QueryExecuteOptions, QueryFilters, QueryKey, QueryObserverOptions, QueryState, RefetchOptions, RefetchQueryFilters, ResetOptions, SetDataOptions, Updater } from "@tanstack/query-core";
4
4
  import { Ref } from "vue-demi";
5
5
  type VueQueryExecutionOptions<TOptions extends {
@@ -128,4 +128,4 @@ declare class QueryClient$1 extends QueryClient {
128
128
  getMutationDefaults(mutationKey: MaybeRefDeep<MutationKey>): MutationObserverOptions<any, any, any, any>;
129
129
  }
130
130
  export { QueryClient$1 as t };
131
- //# sourceMappingURL=queryClient-BGn8uIej.d.cts.map
131
+ //# sourceMappingURL=queryClient-BSSPWSvX.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"queryClient-BGn8uIej.d.cts","names":["QueryClient","QC"],"sources":["../../src/queryClient.ts"],"mappings":";;;;KA2CK,yBAAyB;EAAmB;KAC/C,YACG,kBAAkB,WAAW,6BAC1B,aAAa,SAA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;EAGG,cACP,wBACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,aACP,4BACE,cACA,QACA,OACA,WACA,eAGH,QACD,MAAM,eAAe,MAAM,aAAa,iBACpC,aAAa,cAAc,cAC3B;;;;;;;;;EAkCG,mBACP,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,0BACP,cACA,QACA,OACA,WACA,cAED,QAAQ,aAAa,OAAO;;;;;EAKtB,mBACP,cACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,aACP,0BACE,cACA,QACA,OACA,WACA,eAGH,QAAQ,aAAa,OAAO;;;;;;;;;EA8BtB,sBACP,cACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,0BACP,cACA,QACA,OACA,WACA,cAED;;;;;EAKM,sBACP,cACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,aACP,0BACE,cACA,QACA,OACA,WACA,eAGH;EAsBM,kBAAkB,SAAS,aAAa;EAIxC,iBACP,wBACA,SAAS,cACT,QAAQ,cACR,aAAa,cAEb,UAAU,aAAa,WACvB,SAAS,aACP,KAAK,gBAAgB,cAAc,QAAQ,OAAO;EAM7C,iBACP,UAAU,aAAa,YACtB,UAAU;EAIJ,oBACP,iBACA,SAAS,cACT,mBACA,2BAEA,aAAa,aAAa,cAC1B,SAAS,aACP,wBAAwB,OAAO,QAAQ,YAAY;EAS9C,oBACP,aAAa,aAAa,eACzB"}
1
+ {"version":3,"file":"queryClient-BSSPWSvX.d.cts","names":["QueryClient","QC"],"sources":["../../src/queryClient.ts"],"mappings":";;;;KA2CK,yBAAyB;EAAmB;KAC/C,YACG,kBAAkB,WAAW,6BAC1B,aAAa,SAAS,sBACtB,8BACE,iBAAiB,aAAa,SAAS,cACvC,aAAa,SAAS;;;;;;;;;;;;;;;cAiBnBA,s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,aACP,4BACE,cACA,QACA,OACA,WACA,eAGH,QACD,MAAM,eAAe,MAAM,aAAa,iBACpC,aAAa,cAAc,cAC3B;;;;;;;;;EAkCG,mBACP,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,0BACP,cACA,QACA,OACA,WACA,cAED,QAAQ,aAAa,OAAO;;;;;EAKtB,mBACP,cACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,aACP,0BACE,cACA,QACA,OACA,WACA,eAGH,QAAQ,aAAa,OAAO;;;;;;;;;EA8BtB,sBACP,cACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,0BACP,cACA,QACA,OACA,WACA,cAED;;;;;EAKM,sBACP,cACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,aACP,0BACE,cACA,QACA,OACA,WACA,eAGH;EAsBM,kBAAkB,SAAS,aAAa;EAIxC,iBACP,wBACA,SAAS,cACT,QAAQ,cACR,aAAa,cAEb,UAAU,aAAa,WACvB,SAAS,aACP,KAAK,gBAAgB,cAAc,QAAQ,OAAO;EAM7C,iBACP,UAAU,aAAa,YACtB,UAAU;EAIJ,oBACP,iBACA,SAAS,cACT,mBACA,2BAEA,aAAa,aAAa,cAC1B,SAAS,aACP,wBAAwB,OAAO,QAAQ,YAAY;EAS9C,oBACP,aAAa,aAAa,eACzB"}
@@ -1,5 +1,5 @@
1
1
  import { a as MaybeRef, l as NoUnknown, o as MaybeRefDeep, s as MaybeRefOrGetter, u as QueryClientConfig } from "./types-u_Tu5Ybs.js";
2
- import { o as UseQueryOptions } from "./queryOptions-dXiBZnGk.js";
2
+ import { o as UseQueryOptions } from "./queryOptions-D1-foH1W.js";
3
3
  import { CancelOptions, DefaultError, DefaultOptions, EnsureQueryDataOptions, FetchInfiniteQueryOptions, FetchQueryOptions, InferDataFromTag, InferErrorFromTag, InfiniteData, InfiniteQueryExecuteOptions, InvalidateOptions, InvalidateQueryFilters, MutationFilters, MutationKey, MutationObserverOptions, OmitKeyof, QueryClient, QueryExecuteOptions, QueryFilters, QueryKey, QueryObserverOptions, QueryState, RefetchOptions, RefetchQueryFilters, ResetOptions, SetDataOptions, Updater } from "@tanstack/query-core";
4
4
  import { Ref } from "vue-demi";
5
5
  type VueQueryExecutionOptions<TOptions extends {
@@ -128,4 +128,4 @@ declare class QueryClient$1 extends QueryClient {
128
128
  getMutationDefaults(mutationKey: MaybeRefDeep<MutationKey>): MutationObserverOptions<any, any, any, any>;
129
129
  }
130
130
  export { QueryClient$1 as t };
131
- //# sourceMappingURL=queryClient-Ba4HSFnn.d.ts.map
131
+ //# sourceMappingURL=queryClient-Bgw9hMbf.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"queryClient-Ba4HSFnn.d.ts","names":["QueryClient","QC"],"sources":["../../src/queryClient.ts"],"mappings":";;;;KA2CK,yBAAyB;EAAmB;KAC/C,YACG,kBAAkB,WAAW,6BAC1B,aAAa,SAAS,sBACtB,8BACE,iBAAiB,aAAa,SAAS,cACvC,aAAa,SAAS;;;;;;;;;;;;;;;cAiBnBA,sBAAoBC;EACnB,YAAA,SAAQ;;;;;EAapB,cAAc;EAEL,WACP,UAAS,aAAa,KAAK;EAKpB,WACP,UAAS,aAAa,KAAK;EAKpB,aACP,iBACA,wBAAwB,WAAW,UAEnC,UAAU,kBACT,iBAAiB,OAAO;;EAElB,aAAa,iBACpB,UAAU,aAAa,YACtB;;;;;;;;;;EAgBM,gBACP,cACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAE7B,SAAS,uBAAuB,cAAc,QAAQ,OAAO,aAC5D,QAAQ;;;;;EAKF,gBACP,cACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAE7B,SAAS,yBACP,uBAAuB,cAAc,QAAQ,OAAO,cAErD,QAAQ;EAqBF,eAAe,iBACtB,SAAS,aAAa,gBACrB,OAAO,UAA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cACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,aACP,0BACE,cACA,QACA,OACA,WACA,eAGH;EAsBM,kBAAkB,SAAS,aAAa;EAIxC,iBACP,wBACA,SAAS,cACT,QAAQ,cACR,aAAa,cAEb,UAAU,aAAa,WACvB,SAAS,aACP,KAAK,gBAAgB,cAAc,QAAQ,OAAO;EAM7C,iBACP,UAAU,aAAa,YACtB,UAAU;EAIJ,oBACP,iBACA,SAAS,cACT,mBACA,2BAEA,aAAa,aAAa,cAC1B,SAAS,aACP,wBAAwB,OAAO,QAAQ,YAAY;EAS9C,oBACP,aAAa,aAAa,eACzB"}
1
+ {"version":3,"file":"queryClient-Bgw9hMbf.d.ts","names":["QueryClient","QC"],"sources":["../../src/queryClient.ts"],"mappings":";;;;KA2CK,yBAAyB;EAAmB;KAC/C,YACG,kBAAkB,WAAW,6BAC1B,aAAa,SAAS,sBACtB,8BACE,iBAAiB,aAAa,SAAS,cACvC,aAAa,SAAS;;;;;;;;;;;;;;;cAiBnBA,sBAAoBC;EACnB,YAAA,SAAQ;;;;;EAapB,cAAc;EAEL,WACP,UAAS,aAAa,KAAK;EAKpB,WACP,UAAS,aAAa,KAAK;EAKpB,aACP,iBACA,wBAAwB,WAAW,UAEnC,UAAU,kBACT,iBAAiB,OAAO;;EAElB,aAAa,iBACpB,UAAU,aAAa,YACtB;;;;;;;;;;EAgBM,gBACP,cACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAE7B,SAAS,uBAAuB,cAAc,QAAQ,OAAO,aAC5D,QAAQ;;;;;EAKF,gBACP,cACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAE7B,SAAS,yBACP,uBAAuB,cAAc,QAAQ,OAAO,cAErD,QAAQ;EAqBF,eAAe,iBACtB,SAAS,aAAa,gBACrB,OAAO,UAAU;EAIX,aACP,wBACA,wBAAwB,WAAW,UACnC,uBAAuB,iBAAiB,cAAc,kBAEtD,UAAU,iBAC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A,OACA,WACA,eAGH;EAsBM,kBAAkB,SAAS,aAAa;EAIxC,iBACP,wBACA,SAAS,cACT,QAAQ,cACR,aAAa,cAEb,UAAU,aAAa,WACvB,SAAS,aACP,KAAK,gBAAgB,cAAc,QAAQ,OAAO;EAM7C,iBACP,UAAU,aAAa,YACtB,UAAU;EAIJ,oBACP,iBACA,SAAS,cACT,mBACA,2BAEA,aAAa,aAAa,cAC1B,SAAS,aACP,wBAAwB,OAAO,QAAQ,YAAY;EAS9C,oBACP,aAAa,aAAa,eACzB"}
@@ -1,2 +1,2 @@
1
- import { t as QueryClient } from "./queryClient-BGn8uIej.cjs";
1
+ import { t as QueryClient } from "./queryClient-BSSPWSvX.cjs";
2
2
  export { QueryClient };
@@ -1,2 +1,2 @@
1
- import { t as QueryClient } from "./queryClient-Ba4HSFnn.js";
1
+ import { t as QueryClient } from "./queryClient-Bgw9hMbf.js";
2
2
  export { QueryClient };
@@ -1,5 +1,12 @@
1
1
  import { a as MaybeRef, d as ShallowOption, o as MaybeRefDeep, s as MaybeRefOrGetter, t as DeepUnwrapRef } from "./types-u_Tu5Ybs.cjs";
2
2
  import { DefaultError, InitialDataFunction, NonUndefinedGuard, QueryBooleanOption, QueryKey, QueryKeyWithDataTag, QueryObserverOptions } from "@tanstack/query-core";
3
+ /**
4
+ * `enabled` for Vue Query. A `ref`, `computed`, or plain boolean is reactive. A zero-argument getter
5
+ * (`() => ...`) is too: it is called while tracking dependencies. query-core's `(query) => boolean` is
6
+ * kept as that callback and is not tracked by Vue — a `ref` read inside it is current when core calls it,
7
+ * and a `ref` change does not by itself call it again.
8
+ */
9
+ type VueQueryEnabledOption<TQueryFnData, TError, TQueryData, TQueryKey extends QueryKey> = MaybeRefOrGetter<boolean | undefined> | QueryBooleanOption<TQueryFnData, TError, TQueryData, TQueryKey>;
3
10
  /**
4
11
  * The plain, unwrapped options that `queryOptions` hands back, and what `useQuery`, `useQueries`, and the
5
12
  * `queryClient` methods see once `ref`s have been resolved. To pass options in, use
@@ -11,11 +18,12 @@ import { DefaultError, InitialDataFunction, NonUndefinedGuard, QueryBooleanOptio
11
18
  * `TQueryFnData` and can be configured independently of it.
12
19
  * @template TQueryKey - The type of your `queryKey`.
13
20
  */
14
- type QueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = { [Property in keyof QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>]: Property extends 'enabled' ? MaybeRefOrGetter<boolean | undefined> | (() => QueryBooleanOption<TQueryFnData, TError, TQueryData, DeepUnwrapRef<TQueryKey>>) : Property extends 'queryKey' ? MaybeRefOrGetter<TQueryKey> : QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, DeepUnwrapRef<TQueryKey>>[Property]; } & ShallowOption;
21
+ type QueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = { [Property in keyof QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>]: Property extends 'enabled' ? VueQueryEnabledOption<TQueryFnData, TError, TQueryData, DeepUnwrapRef<TQueryKey>> : Property extends 'queryKey' ? MaybeRefOrGetter<TQueryKey> : QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, DeepUnwrapRef<TQueryKey>>[Property]; } & ShallowOption;
15
22
  type SkipTokenForUseQuery = symbol;
16
23
  /**
17
24
  * The options accepted by `queryOptions`, `useQuery`, and the other query hooks. `enabled` tracks reactive
18
- * dependencies automatically as a `ref`, a plain value, or a reactive getter (`() => ...`). `queryKey` reacts
25
+ * dependencies as a `ref`, a plain boolean, or a zero-argument getter (`() => ...`). query-core's
26
+ * `(query) => boolean` callback is accepted too and is passed through untracked. `queryKey` reacts
19
27
  * through a `ref` or a reactive getter for the array itself, or `ref`s and reactive getters as individual
20
28
  * entries. Other options are read once when passed as a plain value, and stay reactive when passed as a `ref`
21
29
  * or a `computed`. Only `enabled` and `queryKey` read a function as a getter, so `queryFn` reacts through a
@@ -219,5 +227,5 @@ declare function queryOptions<TQueryFnData = unknown, TError = DefaultError, TDa
219
227
  * ```
220
228
  */
221
229
  declare function queryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: () => UndefinedInitialQueryOptions<TQueryFnData, TError, TData, TQueryKey>): () => UndefinedInitialQueryOptionsWithDataTag<TQueryFnData, TError, TData, TQueryKey>;
222
- export { UndefinedInitialQueryOptionsWithDataTag as a, UndefinedInitialQueryOptions as i, DefinedInitialQueryOptionsWithDataTag as n, UseQueryOptions as o, QueryOptions as r, queryOptions as s, DefinedInitialQueryOptions as t };
223
- //# sourceMappingURL=queryOptions-BuZEBLtg.d.cts.map
230
+ export { UndefinedInitialQueryOptionsWithDataTag as a, queryOptions as c, UndefinedInitialQueryOptions as i, DefinedInitialQueryOptionsWithDataTag as n, UseQueryOptions as o, QueryOptions as r, VueQueryEnabledOption as s, DefinedInitialQueryOptions as t };
231
+ //# sourceMappingURL=queryOptions-B-eHjgaY.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queryOptions-B-eHjgaY.d.cts","names":[],"sources":["../../src/queryOptions.ts"],"mappings":";;;;;;;;KAuBY,sBACV,cACA,QACA,YACA,kBAAkB,YAEhB,wCACA,mBAAmB,cAAc,QAAQ,YAAY;;;;;;;;;;;;KAa7C,aACV,wBACA,SAAS,cACT,QAAQ,cACR,aAAa,cACb,kBAAkB,WAAW,eAG3B,kBAAkB,qBAChB,cACA,QACA,OACA,YACA,aAED,6BACC,sBACE,cACA,QACA,YACA,cAAc,cAEhB,8BACE,iBAAiB,aACjB,qBACE,cACA,QACA,OACA,YACA,cAAc,YACd,eACN;KAGC;;;;;;;;;;;;;;;;;;;;;;;;;;KA2BO,gBACV,wBACA,SAAS,cACT,QAAQ,cACR,aAAa,cACb,kBAAkB,WAAW,YAC3B,YAGE,kBAAkB,qBAChB,cACA,QACA,OACA,YACA,a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QAAQ,OAAO,aAClE,wCACD,cACA,QACA,OACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAoDc,aACd,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAE7B,eAAe,6BACb,cACA,QACA,OACA,mBAEK,wCACP,cACA,QACA,OACA"}
@@ -1,5 +1,12 @@
1
1
  import { a as MaybeRef, d as ShallowOption, o as MaybeRefDeep, s as MaybeRefOrGetter, t as DeepUnwrapRef } from "./types-u_Tu5Ybs.js";
2
2
  import { DefaultError, InitialDataFunction, NonUndefinedGuard, QueryBooleanOption, QueryKey, QueryKeyWithDataTag, QueryObserverOptions } from "@tanstack/query-core";
3
+ /**
4
+ * `enabled` for Vue Query. A `ref`, `computed`, or plain boolean is reactive. A zero-argument getter
5
+ * (`() => ...`) is too: it is called while tracking dependencies. query-core's `(query) => boolean` is
6
+ * kept as that callback and is not tracked by Vue — a `ref` read inside it is current when core calls it,
7
+ * and a `ref` change does not by itself call it again.
8
+ */
9
+ type VueQueryEnabledOption<TQueryFnData, TError, TQueryData, TQueryKey extends QueryKey> = MaybeRefOrGetter<boolean | undefined> | QueryBooleanOption<TQueryFnData, TError, TQueryData, TQueryKey>;
3
10
  /**
4
11
  * The plain, unwrapped options that `queryOptions` hands back, and what `useQuery`, `useQueries`, and the
5
12
  * `queryClient` methods see once `ref`s have been resolved. To pass options in, use
@@ -11,11 +18,12 @@ import { DefaultError, InitialDataFunction, NonUndefinedGuard, QueryBooleanOptio
11
18
  * `TQueryFnData` and can be configured independently of it.
12
19
  * @template TQueryKey - The type of your `queryKey`.
13
20
  */
14
- type QueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = { [Property in keyof QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>]: Property extends 'enabled' ? MaybeRefOrGetter<boolean | undefined> | (() => QueryBooleanOption<TQueryFnData, TError, TQueryData, DeepUnwrapRef<TQueryKey>>) : Property extends 'queryKey' ? MaybeRefOrGetter<TQueryKey> : QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, DeepUnwrapRef<TQueryKey>>[Property]; } & ShallowOption;
21
+ type QueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = { [Property in keyof QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>]: Property extends 'enabled' ? VueQueryEnabledOption<TQueryFnData, TError, TQueryData, DeepUnwrapRef<TQueryKey>> : Property extends 'queryKey' ? MaybeRefOrGetter<TQueryKey> : QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, DeepUnwrapRef<TQueryKey>>[Property]; } & ShallowOption;
15
22
  type SkipTokenForUseQuery = symbol;
16
23
  /**
17
24
  * The options accepted by `queryOptions`, `useQuery`, and the other query hooks. `enabled` tracks reactive
18
- * dependencies automatically as a `ref`, a plain value, or a reactive getter (`() => ...`). `queryKey` reacts
25
+ * dependencies as a `ref`, a plain boolean, or a zero-argument getter (`() => ...`). query-core's
26
+ * `(query) => boolean` callback is accepted too and is passed through untracked. `queryKey` reacts
19
27
  * through a `ref` or a reactive getter for the array itself, or `ref`s and reactive getters as individual
20
28
  * entries. Other options are read once when passed as a plain value, and stay reactive when passed as a `ref`
21
29
  * or a `computed`. Only `enabled` and `queryKey` read a function as a getter, so `queryFn` reacts through a
@@ -219,5 +227,5 @@ declare function queryOptions<TQueryFnData = unknown, TError = DefaultError, TDa
219
227
  * ```
220
228
  */
221
229
  declare function queryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: () => UndefinedInitialQueryOptions<TQueryFnData, TError, TData, TQueryKey>): () => UndefinedInitialQueryOptionsWithDataTag<TQueryFnData, TError, TData, TQueryKey>;
222
- export { UndefinedInitialQueryOptionsWithDataTag as a, UndefinedInitialQueryOptions as i, DefinedInitialQueryOptionsWithDataTag as n, UseQueryOptions as o, QueryOptions as r, queryOptions as s, DefinedInitialQueryOptions as t };
223
- //# sourceMappingURL=queryOptions-dXiBZnGk.d.ts.map
230
+ export { UndefinedInitialQueryOptionsWithDataTag as a, queryOptions as c, UndefinedInitialQueryOptions as i, DefinedInitialQueryOptionsWithDataTag as n, UseQueryOptions as o, QueryOptions as r, VueQueryEnabledOption as s, DefinedInitialQueryOptions as t };
231
+ //# sourceMappingURL=queryOptions-D1-foH1W.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queryOptions-D1-foH1W.d.ts","names":[],"sources":["../../src/queryOptions.ts"],"mappings":";;;;;;;;KAuBY,sBACV,cACA,QACA,YACA,kBAAkB,YAEhB,wCACA,mBAAmB,cAAc,QAAQ,YAAY;;;;;;;;;;;;KAa7C,aACV,wBACA,SAAS,cACT,QAAQ,cACR,aAAa,cACb,kBAAkB,WAAW,eAG3B,kBAAkB,qBAChB,cACA,QACA,OACA,YACA,aAED,6BACC,sBACE,cACA,QACA,YACA,cAAc,cAEhB,8BACE,iBAAiB,aACjB,qBACE,cACA,QACA,OACA,YACA,cAAc,YACd,eACN;KAGC;;;;;;;;;;;;;;;;;;;;;;;;;;KA2BO,gBACV,wBACA,SAAS,cACT,QAAQ,cACR,aAAa,cACb,kBAAkB,WAAW,YAC3B,YAGE,kBAAkB,qBAChB,cACA,QACA,OACA,YACA,aAED,0CACC,aACE,cACA,QACA,OACA,YACA,WACA,YACF,6BACE,aACI,aACE,cACA,QACA,OACA,YACA,WACA,YACF,wBAEJ,aACE,aACE,cACA,QACA,OACA,YACA,WACA,gBAER;KAGD,yBAAyB;;;;;;;;EAQ5B,0BAEI,oBAAoB,kBAAkB,iBACtC,kBAAkB;;KAGnB,uBAAuB;;;;;;;;EAQ1B,aACI,kBAAkB,uBACX,kBAAkB;;;;;;;;;;;KAYnB,6BACV,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,YAC3B,gBAAgB,cAAc,QAAQ,OAAO,cAAc,aAC7D,yBAAyB;;;;;;;;;KAUf,2BACV,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,YAC3B,gBAAgB,cAAc,QAAQ,OAAO,cAAc,aAC7D,uBAAuB;;;;;;KAOb,wCACV,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,YAC3B,aAAa,cAAc,QAAQ,OAAO,cAAc,aAC1D,yBAAyB,gBACzB,oBAAoB,WAAW,cAAc;;;;;KAMnC,sCACV,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,YAC3B,aAAa,cAAc,QAAQ,OAAO,cAAc,aAC1D,uBAAuB,gBACvB,oBAAoB,WAAW,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8B/B,aACd,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAE7B,SAAS,2BAA2B,cAAc,QAAQ,OAAO,aAChE,sCAAsC,cAAc,QAAQ,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA4BtD,aACd,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAE7B,eAAe,2BACb,cACA,QACA,OACA,mBAEK,sCACP,cACA,QACA,OACA;;;;;;;;;;;;;;;;;;;;;;;;;iBA2Bc,aACd,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAE7B,SAAS,6BAA6B,cAAc,QAAQ,OAAO,aAClE,wCACD,cACA,QACA,OACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAoDc,aACd,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAE7B,eAAe,6BACb,cACA,QACA,OACA,mBAEK,wCACP,cACA,QACA,OACA"}
@@ -1 +1 @@
1
- {"version":3,"file":"queryOptions.cjs","names":[],"sources":["../../src/queryOptions.ts"],"sourcesContent":["import type {\n DeepUnwrapRef,\n MaybeRef,\n MaybeRefDeep,\n MaybeRefOrGetter,\n ShallowOption,\n} from './types'\nimport type {\n DefaultError,\n InitialDataFunction,\n NonUndefinedGuard,\n QueryBooleanOption,\n QueryKey,\n QueryKeyWithDataTag,\n QueryObserverOptions,\n} from '@tanstack/query-core'\n\n/**\n * The plain, unwrapped options that `queryOptions` hands back, and what `useQuery`, `useQueries`, and the\n * `queryClient` methods see once `ref`s have been resolved. To pass options in, use\n * {@link UseQueryOptions}, which accepts the same options as `ref`s and `computed`s too.\n * @template TQueryFnData - The type your `queryFn` resolves to.\n * @template TError - The type of errors your `queryFn` may throw.\n * @template TData - The type `data` ends up as after `select` runs.\n * @template TQueryData - The type of data stored in the cache, before `select` runs. Defaults to\n * `TQueryFnData` and can be configured independently of it.\n * @template TQueryKey - The type of your `queryKey`.\n */\nexport type QueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = {\n [\n Property in keyof QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n ]: Property extends 'enabled'\n ?\n | MaybeRefOrGetter<boolean | undefined>\n | (() => QueryBooleanOption<\n TQueryFnData,\n TError,\n TQueryData,\n DeepUnwrapRef<TQueryKey>\n >)\n : Property extends 'queryKey'\n ? MaybeRefOrGetter<TQueryKey>\n : QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n DeepUnwrapRef<TQueryKey>\n >[Property]\n} & ShallowOption\n\n// Widen the type of the symbol to enable type inference even if skipToken is not immutable.\ntype SkipTokenForUseQuery = symbol\n\n/**\n * The options accepted by `queryOptions`, `useQuery`, and the other query hooks. `enabled` tracks reactive\n * dependencies automatically as a `ref`, a plain value, or a reactive getter (`() => ...`). `queryKey` reacts\n * through a `ref` or a reactive getter for the array itself, or `ref`s and reactive getters as individual\n * entries. Other options are read once when passed as a plain value, and stay reactive when passed as a `ref`\n * or a `computed`. Only `enabled` and `queryKey` read a function as a getter, so `queryFn` reacts through a\n * `computed`: a function there is the query function itself.\n *\n * If you instead pass a getter for the whole options object (`useQuery(() => ({ ... }))`), every option\n * inside it — including `staleTime`, `retry`, and `select` — is re-evaluated whenever the getter's own\n * reactive dependencies change, since the entire object is recomputed.\n *\n * `select` only re-runs when `data` changes, or when the `select` function's own reference changes. Since a\n * Vue `setup()` function runs only once per component instance, an inline `select` function passed directly\n * to `queryOptions`/`useQuery` already has a stable reference across reactive updates. An inline `select`\n * created inside a whole-options getter is recreated — and so can change reference — every time that getter\n * re-evaluates.\n * @template TQueryFnData - The type your `queryFn` resolves to.\n * @template TError - The type of errors your `queryFn` may throw.\n * @template TData - The type `data` ends up as after `select` runs.\n * @template TQueryData - The type of data stored in the cache, before `select` runs. Defaults to\n * `TQueryFnData` and can be configured independently of it.\n * @template TQueryKey - The type of your `queryKey`.\n */\nexport type UseQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = MaybeRef<\n {\n [\n Property in keyof QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n ]: Property extends 'enabled' | 'queryKey'\n ? QueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >[Property]\n : Property extends 'queryFn'\n ? MaybeRefDeep<\n | QueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >[Property]\n | SkipTokenForUseQuery\n >\n : MaybeRefDeep<\n QueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >[Property]\n >\n } & ShallowOption\n>\n\ntype WithUndefinedInitialData<TQueryFnData> = {\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. Unlike `queryKey`/`enabled`, this is not reactive — it isn't re-evaluated on `ref` changes.\n */\n initialData?:\n | undefined\n | InitialDataFunction<NonUndefinedGuard<TQueryFnData>>\n | NonUndefinedGuard<TQueryFnData>\n}\n\ntype WithDefinedInitialData<TQueryFnData> = {\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. Unlike `queryKey`/`enabled`, this is not reactive — it isn't re-evaluated on `ref` changes.\n */\n initialData:\n | NonUndefinedGuard<TQueryFnData>\n | (() => NonUndefinedGuard<TQueryFnData>)\n}\n\n/**\n * The options accepted by the `queryOptions` overload selected when `initialData` is omitted, may be\n * `undefined`, or is a function that may return `undefined` — `data` may be `undefined` while the query is\n * `pending`.\n * @template TQueryFnData - The type your `queryFn` resolves to.\n * @template TError - The type of errors your `queryFn` may throw.\n * @template TData - The type `data` ends up as after `select` runs.\n * @template TQueryKey - The type of your `queryKey`.\n */\nexport type UndefinedInitialQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = UseQueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey> &\n WithUndefinedInitialData<TQueryFnData>\n\n/**\n * The options accepted by the `queryOptions` overload selected when `initialData` is known to be defined —\n * `data` is never `undefined` (unless a `select` changes `TData` to include `undefined`).\n * @template TQueryFnData - The type your `queryFn` resolves to.\n * @template TError - The type of errors your `queryFn` may throw.\n * @template TData - The type `data` ends up as after `select` runs.\n * @template TQueryKey - The type of your `queryKey`.\n */\nexport type DefinedInitialQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = UseQueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey> &\n WithDefinedInitialData<TQueryFnData>\n\n/**\n * The options returned by the `queryOptions` overload selected when `initialData` is omitted, may be\n * `undefined`, or is a function that may return `undefined`, with the `queryKey` tagged with the query's data\n * and error types.\n */\nexport type UndefinedInitialQueryOptionsWithDataTag<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = QueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey> &\n WithUndefinedInitialData<TQueryFnData> &\n QueryKeyWithDataTag<TQueryKey, TQueryFnData, TError>\n\n/**\n * The options returned by the `queryOptions` overload selected when `initialData` is known to be defined,\n * with the `queryKey` tagged with the query's data and error types.\n */\nexport type DefinedInitialQueryOptionsWithDataTag<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = QueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey> &\n WithDefinedInitialData<TQueryFnData> &\n QueryKeyWithDataTag<TQueryKey, TQueryFnData, TError>\n\n/**\n * You can generally pass everything to `queryOptions` that you can also pass to `useQuery`. These options can\n * be shared across hooks and imperative APIs such as `queryClient.query`. `options.queryKey` is required and\n * is the query key to generate options for.\n *\n * This overload is selected when `initialData` is known to be defined, so the resulting `data` is never\n * `undefined` (unless a `select` changes `TData` to include `undefined`).\n * @param options - The {@link DefinedInitialQueryOptions} to use — everything you can pass to `useQuery`,\n * with `initialData` known to be defined.\n * @returns The same options object, typed so that `queryKey` carries the inferred data type.\n * @see {@link useQuery} to run a query with these options.\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { queryOptions, useQuery } from '@tanstack/vue-query'\n *\n * const postsOptions = queryOptions({\n * queryKey: ['posts'],\n * queryFn: fetchPosts,\n * initialData: [],\n * })\n *\n * // `data` is `Post[]`, never `undefined`, thanks to `initialData` — even if a refetch fails,\n * // so the list stays visible alongside the error.\n * const { data, isError, error } = useQuery(postsOptions)\n * </script>\n * ```\n */\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: DefinedInitialQueryOptions<TQueryFnData, TError, TData, TQueryKey>,\n): DefinedInitialQueryOptionsWithDataTag<TQueryFnData, TError, TData, TQueryKey>\n\n/**\n * Same as the plain-object overload, but for options that close over reactive state (`ref`s read inside the\n * function body). Wrap them in a getter so `queryClient` methods like `invalidateQueries`/`fetchQuery` always\n * read the current values instead of the ones captured when the options were created.\n * @param options - A function returning the {@link DefinedInitialQueryOptions} to use, re-evaluated on demand.\n * @returns A function that returns the same options object, typed so that `queryKey` carries the inferred data\n * type.\n * @see {@link useQuery} to run a query with these options.\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { ref } from 'vue'\n * import { queryOptions, useQuery } from '@tanstack/vue-query'\n *\n * const postId = ref(1)\n * const postOptions = queryOptions(() => ({\n * queryKey: ['post', postId.value],\n * queryFn: () => fetchPost(postId.value),\n * initialData: { id: postId.value, title: '' },\n * }))\n *\n * // Pass the getter itself, not `postOptions()`, so the query keeps reacting to `postId` changes.\n * const { data } = useQuery(postOptions)\n * </script>\n * ```\n */\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: () => DefinedInitialQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n >,\n): () => DefinedInitialQueryOptionsWithDataTag<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n>\n\n/**\n * You can generally pass everything to `queryOptions` that you can also pass to `useQuery`. These options can\n * be shared across hooks and imperative APIs such as `queryClient.query`. `options.queryKey` is required and\n * is the query key to generate options for.\n * @param options - The {@link UndefinedInitialQueryOptions} to use — everything you can pass to `useQuery`.\n * @returns The same options object, typed so that `queryKey` carries the inferred data type.\n * @see {@link useQuery} to run a query with these options.\n * @example\n * A parameterized factory, so the same options object can be reused per `id`:\n * ```vue\n * <script setup lang=\"ts\">\n * import { queryOptions, useQuery } from '@tanstack/vue-query'\n *\n * function postOptions(id: string) {\n * return queryOptions({\n * queryKey: ['post', id],\n * queryFn: () => fetchPost(id),\n * })\n * }\n *\n * const { data, isPending, isError, error } = useQuery(postOptions('1'))\n * </script>\n * ```\n */\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UndefinedInitialQueryOptions<TQueryFnData, TError, TData, TQueryKey>,\n): UndefinedInitialQueryOptionsWithDataTag<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n>\n\n/**\n * Same as the plain-object overload, but for options that close over reactive state (`ref`s read inside the\n * function body). Wrap them in a getter so the `queryKey` — and anything else derived from a `ref` — reacts\n * to changes, and so `queryClient` methods like `invalidateQueries`/`fetchQuery` always read the current\n * values instead of the ones captured when the options were created.\n * @param options - A function returning the {@link UndefinedInitialQueryOptions} to use, re-evaluated on\n * demand.\n * @returns A function that returns the same options object, typed so that `queryKey` carries the inferred\n * data type.\n * @see {@link useQuery} to run a query with these options.\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { ref } from 'vue'\n * import { queryOptions, useQuery, useQueryClient } from '@tanstack/vue-query'\n *\n * const postId = ref(1)\n * const postOptions = queryOptions(() => ({\n * queryKey: ['post', postId.value],\n * queryFn: () => fetchPost(postId.value),\n * }))\n *\n * // Pass the getter itself, not `postOptions()`, so the query keeps reacting to `postId` changes.\n * const { data } = useQuery(postOptions)\n * const queryClient = useQueryClient()\n * // Here, call `postOptions()` so `invalidateQueries` reads the current `queryKey` right away.\n * queryClient.invalidateQueries(postOptions())\n * </script>\n * ```\n * @example\n * A parameterized factory that disables the query, type safe, until `postId` is set. The whole-options getter\n * re-evaluates `queryFn` on every change to `postId`. `queryFn` can also be a `computed`, but never a bare\n * getter, since a function there is the query function itself:\n * ```vue\n * <script setup lang=\"ts\">\n * import { queryOptions, skipToken, useQuery } from '@tanstack/vue-query'\n *\n * function postOptions(postId: number | undefined) {\n * return queryOptions(() => ({\n * queryKey: ['post', postId],\n * queryFn: postId != null ? () => fetchPost(postId) : skipToken,\n * }))\n * }\n *\n * const props = defineProps<{ postId: number | undefined }>()\n * const { data, isLoading, isError, error } = useQuery(postOptions(props.postId))\n * </script>\n * ```\n */\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: () => UndefinedInitialQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n >,\n): () => UndefinedInitialQueryOptionsWithDataTag<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n>\n\nexport function queryOptions(options: unknown) {\n return options\n}\n"],"mappings":";;AA4ZA,SAAgB,aAAa,SAAkB;CAC7C,OAAO;AACT"}
1
+ {"version":3,"file":"queryOptions.cjs","names":[],"sources":["../../src/queryOptions.ts"],"sourcesContent":["import type {\n DeepUnwrapRef,\n MaybeRef,\n MaybeRefDeep,\n MaybeRefOrGetter,\n ShallowOption,\n} from './types'\nimport type {\n DefaultError,\n InitialDataFunction,\n NonUndefinedGuard,\n QueryBooleanOption,\n QueryKey,\n QueryKeyWithDataTag,\n QueryObserverOptions,\n} from '@tanstack/query-core'\n\n/**\n * `enabled` for Vue Query. A `ref`, `computed`, or plain boolean is reactive. A zero-argument getter\n * (`() => ...`) is too: it is called while tracking dependencies. query-core's `(query) => boolean` is\n * kept as that callback and is not tracked by Vue — a `ref` read inside it is current when core calls it,\n * and a `ref` change does not by itself call it again.\n */\nexport type VueQueryEnabledOption<\n TQueryFnData,\n TError,\n TQueryData,\n TQueryKey extends QueryKey,\n> =\n | MaybeRefOrGetter<boolean | undefined>\n | QueryBooleanOption<TQueryFnData, TError, TQueryData, TQueryKey>\n\n/**\n * The plain, unwrapped options that `queryOptions` hands back, and what `useQuery`, `useQueries`, and the\n * `queryClient` methods see once `ref`s have been resolved. To pass options in, use\n * {@link UseQueryOptions}, which accepts the same options as `ref`s and `computed`s too.\n * @template TQueryFnData - The type your `queryFn` resolves to.\n * @template TError - The type of errors your `queryFn` may throw.\n * @template TData - The type `data` ends up as after `select` runs.\n * @template TQueryData - The type of data stored in the cache, before `select` runs. Defaults to\n * `TQueryFnData` and can be configured independently of it.\n * @template TQueryKey - The type of your `queryKey`.\n */\nexport type QueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = {\n [\n Property in keyof QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n ]: Property extends 'enabled'\n ? VueQueryEnabledOption<\n TQueryFnData,\n TError,\n TQueryData,\n DeepUnwrapRef<TQueryKey>\n >\n : Property extends 'queryKey'\n ? MaybeRefOrGetter<TQueryKey>\n : QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n DeepUnwrapRef<TQueryKey>\n >[Property]\n} & ShallowOption\n\n// Widen the type of the symbol to enable type inference even if skipToken is not immutable.\ntype SkipTokenForUseQuery = symbol\n\n/**\n * The options accepted by `queryOptions`, `useQuery`, and the other query hooks. `enabled` tracks reactive\n * dependencies as a `ref`, a plain boolean, or a zero-argument getter (`() => ...`). query-core's\n * `(query) => boolean` callback is accepted too and is passed through untracked. `queryKey` reacts\n * through a `ref` or a reactive getter for the array itself, or `ref`s and reactive getters as individual\n * entries. Other options are read once when passed as a plain value, and stay reactive when passed as a `ref`\n * or a `computed`. Only `enabled` and `queryKey` read a function as a getter, so `queryFn` reacts through a\n * `computed`: a function there is the query function itself.\n *\n * If you instead pass a getter for the whole options object (`useQuery(() => ({ ... }))`), every option\n * inside it — including `staleTime`, `retry`, and `select` — is re-evaluated whenever the getter's own\n * reactive dependencies change, since the entire object is recomputed.\n *\n * `select` only re-runs when `data` changes, or when the `select` function's own reference changes. Since a\n * Vue `setup()` function runs only once per component instance, an inline `select` function passed directly\n * to `queryOptions`/`useQuery` already has a stable reference across reactive updates. An inline `select`\n * created inside a whole-options getter is recreated — and so can change reference — every time that getter\n * re-evaluates.\n * @template TQueryFnData - The type your `queryFn` resolves to.\n * @template TError - The type of errors your `queryFn` may throw.\n * @template TData - The type `data` ends up as after `select` runs.\n * @template TQueryData - The type of data stored in the cache, before `select` runs. Defaults to\n * `TQueryFnData` and can be configured independently of it.\n * @template TQueryKey - The type of your `queryKey`.\n */\nexport type UseQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = MaybeRef<\n {\n [\n Property in keyof QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n ]: Property extends 'enabled' | 'queryKey'\n ? QueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >[Property]\n : Property extends 'queryFn'\n ? MaybeRefDeep<\n | QueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >[Property]\n | SkipTokenForUseQuery\n >\n : MaybeRefDeep<\n QueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >[Property]\n >\n } & ShallowOption\n>\n\ntype WithUndefinedInitialData<TQueryFnData> = {\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. Unlike `queryKey`/`enabled`, this is not reactive — it isn't re-evaluated on `ref` changes.\n */\n initialData?:\n | undefined\n | InitialDataFunction<NonUndefinedGuard<TQueryFnData>>\n | NonUndefinedGuard<TQueryFnData>\n}\n\ntype WithDefinedInitialData<TQueryFnData> = {\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. Unlike `queryKey`/`enabled`, this is not reactive — it isn't re-evaluated on `ref` changes.\n */\n initialData:\n | NonUndefinedGuard<TQueryFnData>\n | (() => NonUndefinedGuard<TQueryFnData>)\n}\n\n/**\n * The options accepted by the `queryOptions` overload selected when `initialData` is omitted, may be\n * `undefined`, or is a function that may return `undefined` — `data` may be `undefined` while the query is\n * `pending`.\n * @template TQueryFnData - The type your `queryFn` resolves to.\n * @template TError - The type of errors your `queryFn` may throw.\n * @template TData - The type `data` ends up as after `select` runs.\n * @template TQueryKey - The type of your `queryKey`.\n */\nexport type UndefinedInitialQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = UseQueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey> &\n WithUndefinedInitialData<TQueryFnData>\n\n/**\n * The options accepted by the `queryOptions` overload selected when `initialData` is known to be defined —\n * `data` is never `undefined` (unless a `select` changes `TData` to include `undefined`).\n * @template TQueryFnData - The type your `queryFn` resolves to.\n * @template TError - The type of errors your `queryFn` may throw.\n * @template TData - The type `data` ends up as after `select` runs.\n * @template TQueryKey - The type of your `queryKey`.\n */\nexport type DefinedInitialQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = UseQueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey> &\n WithDefinedInitialData<TQueryFnData>\n\n/**\n * The options returned by the `queryOptions` overload selected when `initialData` is omitted, may be\n * `undefined`, or is a function that may return `undefined`, with the `queryKey` tagged with the query's data\n * and error types.\n */\nexport type UndefinedInitialQueryOptionsWithDataTag<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = QueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey> &\n WithUndefinedInitialData<TQueryFnData> &\n QueryKeyWithDataTag<TQueryKey, TQueryFnData, TError>\n\n/**\n * The options returned by the `queryOptions` overload selected when `initialData` is known to be defined,\n * with the `queryKey` tagged with the query's data and error types.\n */\nexport type DefinedInitialQueryOptionsWithDataTag<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = QueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey> &\n WithDefinedInitialData<TQueryFnData> &\n QueryKeyWithDataTag<TQueryKey, TQueryFnData, TError>\n\n/**\n * You can generally pass everything to `queryOptions` that you can also pass to `useQuery`. These options can\n * be shared across hooks and imperative APIs such as `queryClient.query`. `options.queryKey` is required and\n * is the query key to generate options for.\n *\n * This overload is selected when `initialData` is known to be defined, so the resulting `data` is never\n * `undefined` (unless a `select` changes `TData` to include `undefined`).\n * @param options - The {@link DefinedInitialQueryOptions} to use — everything you can pass to `useQuery`,\n * with `initialData` known to be defined.\n * @returns The same options object, typed so that `queryKey` carries the inferred data type.\n * @see {@link useQuery} to run a query with these options.\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { queryOptions, useQuery } from '@tanstack/vue-query'\n *\n * const postsOptions = queryOptions({\n * queryKey: ['posts'],\n * queryFn: fetchPosts,\n * initialData: [],\n * })\n *\n * // `data` is `Post[]`, never `undefined`, thanks to `initialData` — even if a refetch fails,\n * // so the list stays visible alongside the error.\n * const { data, isError, error } = useQuery(postsOptions)\n * </script>\n * ```\n */\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: DefinedInitialQueryOptions<TQueryFnData, TError, TData, TQueryKey>,\n): DefinedInitialQueryOptionsWithDataTag<TQueryFnData, TError, TData, TQueryKey>\n\n/**\n * Same as the plain-object overload, but for options that close over reactive state (`ref`s read inside the\n * function body). Wrap them in a getter so `queryClient` methods like `invalidateQueries`/`fetchQuery` always\n * read the current values instead of the ones captured when the options were created.\n * @param options - A function returning the {@link DefinedInitialQueryOptions} to use, re-evaluated on demand.\n * @returns A function that returns the same options object, typed so that `queryKey` carries the inferred data\n * type.\n * @see {@link useQuery} to run a query with these options.\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { ref } from 'vue'\n * import { queryOptions, useQuery } from '@tanstack/vue-query'\n *\n * const postId = ref(1)\n * const postOptions = queryOptions(() => ({\n * queryKey: ['post', postId.value],\n * queryFn: () => fetchPost(postId.value),\n * initialData: { id: postId.value, title: '' },\n * }))\n *\n * // Pass the getter itself, not `postOptions()`, so the query keeps reacting to `postId` changes.\n * const { data } = useQuery(postOptions)\n * </script>\n * ```\n */\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: () => DefinedInitialQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n >,\n): () => DefinedInitialQueryOptionsWithDataTag<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n>\n\n/**\n * You can generally pass everything to `queryOptions` that you can also pass to `useQuery`. These options can\n * be shared across hooks and imperative APIs such as `queryClient.query`. `options.queryKey` is required and\n * is the query key to generate options for.\n * @param options - The {@link UndefinedInitialQueryOptions} to use — everything you can pass to `useQuery`.\n * @returns The same options object, typed so that `queryKey` carries the inferred data type.\n * @see {@link useQuery} to run a query with these options.\n * @example\n * A parameterized factory, so the same options object can be reused per `id`:\n * ```vue\n * <script setup lang=\"ts\">\n * import { queryOptions, useQuery } from '@tanstack/vue-query'\n *\n * function postOptions(id: string) {\n * return queryOptions({\n * queryKey: ['post', id],\n * queryFn: () => fetchPost(id),\n * })\n * }\n *\n * const { data, isPending, isError, error } = useQuery(postOptions('1'))\n * </script>\n * ```\n */\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UndefinedInitialQueryOptions<TQueryFnData, TError, TData, TQueryKey>,\n): UndefinedInitialQueryOptionsWithDataTag<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n>\n\n/**\n * Same as the plain-object overload, but for options that close over reactive state (`ref`s read inside the\n * function body). Wrap them in a getter so the `queryKey` — and anything else derived from a `ref` — reacts\n * to changes, and so `queryClient` methods like `invalidateQueries`/`fetchQuery` always read the current\n * values instead of the ones captured when the options were created.\n * @param options - A function returning the {@link UndefinedInitialQueryOptions} to use, re-evaluated on\n * demand.\n * @returns A function that returns the same options object, typed so that `queryKey` carries the inferred\n * data type.\n * @see {@link useQuery} to run a query with these options.\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { ref } from 'vue'\n * import { queryOptions, useQuery, useQueryClient } from '@tanstack/vue-query'\n *\n * const postId = ref(1)\n * const postOptions = queryOptions(() => ({\n * queryKey: ['post', postId.value],\n * queryFn: () => fetchPost(postId.value),\n * }))\n *\n * // Pass the getter itself, not `postOptions()`, so the query keeps reacting to `postId` changes.\n * const { data } = useQuery(postOptions)\n * const queryClient = useQueryClient()\n * // Here, call `postOptions()` so `invalidateQueries` reads the current `queryKey` right away.\n * queryClient.invalidateQueries(postOptions())\n * </script>\n * ```\n * @example\n * A parameterized factory that disables the query, type safe, until `postId` is set. The whole-options getter\n * re-evaluates `queryFn` on every change to `postId`. `queryFn` can also be a `computed`, but never a bare\n * getter, since a function there is the query function itself:\n * ```vue\n * <script setup lang=\"ts\">\n * import { queryOptions, skipToken, useQuery } from '@tanstack/vue-query'\n *\n * function postOptions(postId: number | undefined) {\n * return queryOptions(() => ({\n * queryKey: ['post', postId],\n * queryFn: postId != null ? () => fetchPost(postId) : skipToken,\n * }))\n * }\n *\n * const props = defineProps<{ postId: number | undefined }>()\n * const { data, isLoading, isError, error } = useQuery(postOptions(props.postId))\n * </script>\n * ```\n */\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: () => UndefinedInitialQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n >,\n): () => UndefinedInitialQueryOptionsWithDataTag<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n>\n\nexport function queryOptions(options: unknown) {\n return options\n}\n"],"mappings":";;AA0aA,SAAgB,aAAa,SAAkB;CAC7C,OAAO;AACT"}
@@ -1,2 +1,2 @@
1
- import { a as UndefinedInitialQueryOptionsWithDataTag, i as UndefinedInitialQueryOptions, n as DefinedInitialQueryOptionsWithDataTag, o as UseQueryOptions, r as QueryOptions, s as queryOptions, t as DefinedInitialQueryOptions } from "./queryOptions-BuZEBLtg.cjs";
2
- export { DefinedInitialQueryOptions, DefinedInitialQueryOptionsWithDataTag, QueryOptions, UndefinedInitialQueryOptions, UndefinedInitialQueryOptionsWithDataTag, UseQueryOptions, queryOptions };
1
+ import { a as UndefinedInitialQueryOptionsWithDataTag, c as queryOptions, i as UndefinedInitialQueryOptions, n as DefinedInitialQueryOptionsWithDataTag, o as UseQueryOptions, r as QueryOptions, s as VueQueryEnabledOption, t as DefinedInitialQueryOptions } from "./queryOptions-B-eHjgaY.cjs";
2
+ export { DefinedInitialQueryOptions, DefinedInitialQueryOptionsWithDataTag, QueryOptions, UndefinedInitialQueryOptions, UndefinedInitialQueryOptionsWithDataTag, UseQueryOptions, VueQueryEnabledOption, queryOptions };