@tanstack/query-core 5.107.1 → 5.107.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/legacy/{hydration-BIRJt69T.d.cts → hydration-24GwbSaU.d.cts} +3178 -3178
- package/build/legacy/hydration-24GwbSaU.d.cts.map +1 -0
- package/build/legacy/{hydration-9_kOYxJM.d.ts → hydration-Cbq_heQS.d.ts} +3178 -3178
- package/build/legacy/hydration-Cbq_heQS.d.ts.map +1 -0
- package/build/legacy/hydration.cjs.map +1 -1
- package/build/legacy/hydration.d.cts +1 -1
- package/build/legacy/hydration.d.ts +1 -1
- package/build/legacy/hydration.js.map +1 -1
- package/build/legacy/index.cjs.map +1 -1
- package/build/legacy/index.d.cts +2 -2
- package/build/legacy/index.d.ts +2 -2
- package/build/legacy/index.js.map +1 -1
- package/build/legacy/infiniteQueryBehavior.cjs.map +1 -1
- package/build/legacy/infiniteQueryBehavior.d.cts +1 -1
- package/build/legacy/infiniteQueryBehavior.d.ts +1 -1
- package/build/legacy/infiniteQueryBehavior.js.map +1 -1
- package/build/legacy/infiniteQueryObserver.cjs.map +1 -1
- package/build/legacy/infiniteQueryObserver.d.cts +1 -1
- package/build/legacy/infiniteQueryObserver.d.ts +1 -1
- package/build/legacy/infiniteQueryObserver.js.map +1 -1
- package/build/legacy/mutation.cjs +1 -1
- package/build/legacy/mutation.cjs.map +1 -1
- package/build/legacy/mutation.d.cts +1 -1
- package/build/legacy/mutation.d.ts +1 -1
- package/build/legacy/mutation.js +1 -1
- package/build/legacy/mutation.js.map +1 -1
- package/build/legacy/mutationCache.cjs.map +1 -1
- package/build/legacy/mutationCache.d.cts +1 -1
- package/build/legacy/mutationCache.d.ts +1 -1
- package/build/legacy/mutationCache.js.map +1 -1
- package/build/legacy/mutationObserver.cjs.map +1 -1
- package/build/legacy/mutationObserver.d.cts +1 -1
- package/build/legacy/mutationObserver.d.ts +1 -1
- package/build/legacy/mutationObserver.js.map +1 -1
- package/build/legacy/queriesObserver.cjs.map +1 -1
- package/build/legacy/queriesObserver.d.cts +1 -1
- package/build/legacy/queriesObserver.d.ts +1 -1
- package/build/legacy/queriesObserver.js.map +1 -1
- package/build/legacy/query.cjs +6 -4
- package/build/legacy/query.cjs.map +1 -1
- package/build/legacy/query.d.cts +1 -1
- package/build/legacy/query.d.ts +1 -1
- package/build/legacy/query.js +6 -4
- package/build/legacy/query.js.map +1 -1
- package/build/legacy/queryCache.cjs.map +1 -1
- package/build/legacy/queryCache.d.cts +1 -1
- package/build/legacy/queryCache.d.ts +1 -1
- package/build/legacy/queryCache.js.map +1 -1
- package/build/legacy/queryClient.cjs.map +1 -1
- package/build/legacy/queryClient.d.cts +1 -1
- package/build/legacy/queryClient.d.ts +1 -1
- package/build/legacy/queryClient.js.map +1 -1
- package/build/legacy/queryObserver.cjs.map +1 -1
- package/build/legacy/queryObserver.d.cts +1 -1
- package/build/legacy/queryObserver.d.ts +1 -1
- package/build/legacy/queryObserver.js.map +1 -1
- package/build/legacy/removable.cjs.map +1 -1
- package/build/legacy/removable.js.map +1 -1
- package/build/legacy/retryer.cjs.map +1 -1
- package/build/legacy/retryer.d.cts +1 -1
- package/build/legacy/retryer.d.ts +1 -1
- package/build/legacy/retryer.js.map +1 -1
- package/build/legacy/streamedQuery.cjs.map +1 -1
- package/build/legacy/streamedQuery.d.cts +1 -1
- package/build/legacy/streamedQuery.d.ts +1 -1
- package/build/legacy/streamedQuery.js.map +1 -1
- package/build/legacy/subscribable-D2lAzdDi.d.cts.map +1 -1
- package/build/legacy/subscribable-D2lAzdDi.d.ts.map +1 -1
- package/build/legacy/subscribable.cjs.map +1 -1
- package/build/legacy/subscribable.js.map +1 -1
- package/build/legacy/types.cjs.map +1 -1
- package/build/legacy/types.d.cts +1 -1
- package/build/legacy/types.d.ts +1 -1
- package/build/legacy/types.js.map +1 -1
- package/build/legacy/utils.cjs.map +1 -1
- package/build/legacy/utils.d.cts +1 -1
- package/build/legacy/utils.d.ts +1 -1
- package/build/legacy/utils.js.map +1 -1
- package/build/modern/{hydration-BIRJt69T.d.cts → hydration-24GwbSaU.d.cts} +3178 -3178
- package/build/modern/hydration-24GwbSaU.d.cts.map +1 -0
- package/build/modern/{hydration-9_kOYxJM.d.ts → hydration-Cbq_heQS.d.ts} +3178 -3178
- package/build/modern/hydration-Cbq_heQS.d.ts.map +1 -0
- package/build/modern/hydration.cjs.map +1 -1
- package/build/modern/hydration.d.cts +1 -1
- package/build/modern/hydration.d.ts +1 -1
- package/build/modern/hydration.js.map +1 -1
- package/build/modern/index.cjs.map +1 -1
- package/build/modern/index.d.cts +2 -2
- package/build/modern/index.d.ts +2 -2
- package/build/modern/index.js.map +1 -1
- package/build/modern/infiniteQueryBehavior.cjs.map +1 -1
- package/build/modern/infiniteQueryBehavior.d.cts +1 -1
- package/build/modern/infiniteQueryBehavior.d.ts +1 -1
- package/build/modern/infiniteQueryBehavior.js.map +1 -1
- package/build/modern/infiniteQueryObserver.cjs.map +1 -1
- package/build/modern/infiniteQueryObserver.d.cts +1 -1
- package/build/modern/infiniteQueryObserver.d.ts +1 -1
- package/build/modern/infiniteQueryObserver.js.map +1 -1
- package/build/modern/mutation.cjs +1 -1
- package/build/modern/mutation.cjs.map +1 -1
- package/build/modern/mutation.d.cts +1 -1
- package/build/modern/mutation.d.ts +1 -1
- package/build/modern/mutation.js +1 -1
- package/build/modern/mutation.js.map +1 -1
- package/build/modern/mutationCache.cjs.map +1 -1
- package/build/modern/mutationCache.d.cts +1 -1
- package/build/modern/mutationCache.d.ts +1 -1
- package/build/modern/mutationCache.js.map +1 -1
- package/build/modern/mutationObserver.cjs.map +1 -1
- package/build/modern/mutationObserver.d.cts +1 -1
- package/build/modern/mutationObserver.d.ts +1 -1
- package/build/modern/mutationObserver.js.map +1 -1
- package/build/modern/queriesObserver.cjs.map +1 -1
- package/build/modern/queriesObserver.d.cts +1 -1
- package/build/modern/queriesObserver.d.ts +1 -1
- package/build/modern/queriesObserver.js.map +1 -1
- package/build/modern/query.cjs +6 -4
- package/build/modern/query.cjs.map +1 -1
- package/build/modern/query.d.cts +1 -1
- package/build/modern/query.d.ts +1 -1
- package/build/modern/query.js +6 -4
- package/build/modern/query.js.map +1 -1
- package/build/modern/queryCache.cjs.map +1 -1
- package/build/modern/queryCache.d.cts +1 -1
- package/build/modern/queryCache.d.ts +1 -1
- package/build/modern/queryCache.js.map +1 -1
- package/build/modern/queryClient.cjs.map +1 -1
- package/build/modern/queryClient.d.cts +1 -1
- package/build/modern/queryClient.d.ts +1 -1
- package/build/modern/queryClient.js.map +1 -1
- package/build/modern/queryObserver.cjs.map +1 -1
- package/build/modern/queryObserver.d.cts +1 -1
- package/build/modern/queryObserver.d.ts +1 -1
- package/build/modern/queryObserver.js.map +1 -1
- package/build/modern/removable.cjs.map +1 -1
- package/build/modern/removable.js.map +1 -1
- package/build/modern/retryer.cjs.map +1 -1
- package/build/modern/retryer.d.cts +1 -1
- package/build/modern/retryer.d.ts +1 -1
- package/build/modern/retryer.js.map +1 -1
- package/build/modern/streamedQuery.cjs.map +1 -1
- package/build/modern/streamedQuery.d.cts +1 -1
- package/build/modern/streamedQuery.d.ts +1 -1
- package/build/modern/streamedQuery.js.map +1 -1
- package/build/modern/subscribable-D2lAzdDi.d.cts.map +1 -1
- package/build/modern/subscribable-D2lAzdDi.d.ts.map +1 -1
- package/build/modern/subscribable.cjs.map +1 -1
- package/build/modern/subscribable.js.map +1 -1
- package/build/modern/types.cjs.map +1 -1
- package/build/modern/types.d.cts +1 -1
- package/build/modern/types.d.ts +1 -1
- package/build/modern/types.js.map +1 -1
- package/build/modern/utils.cjs.map +1 -1
- package/build/modern/utils.d.cts +1 -1
- package/build/modern/utils.d.ts +1 -1
- package/build/modern/utils.js.map +1 -1
- package/package.json +1 -1
- package/src/hydration.ts +3 -3
- package/src/index.ts +98 -1
- package/src/infiniteQueryBehavior.ts +1 -1
- package/src/infiniteQueryObserver.ts +3 -3
- package/src/mutation.ts +4 -4
- package/src/mutationCache.ts +4 -4
- package/src/mutationObserver.ts +1 -1
- package/src/queriesObserver.ts +1 -1
- package/src/query.ts +10 -8
- package/src/queryCache.ts +5 -5
- package/src/queryClient.ts +6 -6
- package/src/queryObserver.ts +3 -3
- package/src/removable.ts +1 -1
- package/src/retryer.ts +1 -1
- package/src/streamedQuery.ts +1 -1
- package/src/subscribable.ts +4 -1
- package/src/types.ts +57 -56
- package/src/utils.ts +2 -2
- package/build/legacy/hydration-9_kOYxJM.d.ts.map +0 -1
- package/build/legacy/hydration-BIRJt69T.d.cts.map +0 -1
- package/build/modern/hydration-9_kOYxJM.d.ts.map +0 -1
- package/build/modern/hydration-BIRJt69T.d.cts.map +0 -1
package/build/legacy/types.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as InfiniteData, $t as QueryObserverOptions, At as MutationScope, B as DefinedQueryObserverResult, Bt as QueriesPlaceholderDataFunction, Ct as MutationObserverErrorResult, Dt as MutationObserverResult, Et as MutationObserverOptions, F as DefaultError, Ft as NotifyEventType, G as FetchNextPageOptions, Gt as QueryFunctionContext, H as EnsureInfiniteQueryDataOptions, Ht as QueryClientConfig, I as DefaultOptions, It as NotifyOnChangeProps, J as FetchStatus, Jt as QueryKeyWithDataTag, K as FetchPreviousPageOptions, Kt as QueryKey, L as DefaultedInfiniteQueryObserverOptions, Lt as OmitKeyof, M as AnyDataTag, Mt as NetworkMode, N as CancelOptions, Nt as NonUndefinedGuard, Ot as MutationObserverSuccessResult, P as DataTag, Pt as NotifyEvent, Q as InferErrorFromTag, Qt as QueryObserverLoadingResult, R as DefaultedQueryObserverOptions, Rt as Override, St as MutationObserverBaseResult, Tt as MutationObserverLoadingResult, U as EnsureQueryDataOptions, Ut as QueryExecuteOptions, V as DistributiveOmit, Vt as QueryBooleanOption, W as FetchInfiniteQueryOptions, Wt as QueryFunction, X as GetPreviousPageParamFunction, Xt as QueryObserverBaseResult, Y as GetNextPageParamFunction, Yt as QueryMeta, Z as InferDataFromTag, Zt as QueryObserverLoadingErrorResult, _n as UnsetMarker, _t as MutateOptions, an as QueryOptions, at as InfiniteQueryObserverPendingResult, bn as dataTagSymbol, bt as MutationKey, cn as RefetchOptions, ct as InfiniteQueryObserverResult, dn as ResetOptions, dt as InitialDataFunction, en as QueryObserverPendingResult, et as InfiniteQueryExecuteOptions, fn as ResultOptions, ft as InitialPageParam, gn as ThrowOnError, gt as MutateFunctionRest, hn as StaleTimeFunction, ht as MutateFunction, in as QueryObserverSuccessResult, it as InfiniteQueryObserverOptions, jt as MutationStatus, kt as MutationOptions, ln as RefetchQueryFilters, lt as InfiniteQueryObserverSuccessResult, mn as StaleTime, mt as InvalidateQueryFilters, nn as QueryObserverRefetchErrorResult, nt as InfiniteQueryObserverLoadingErrorResult, on as QueryPersister, ot as InfiniteQueryObserverPlaceholderResult, pn as SetDataOptions, pt as InvalidateOptions, q as FetchQueryOptions, qt as QueryKeyHashFunction, rn as QueryObserverResult, rt as InfiniteQueryObserverLoadingResult, sn as QueryStatus, st as InfiniteQueryObserverRefetchErrorResult, tn as QueryObserverPlaceholderResult, tt as InfiniteQueryObserverBaseResult, un as Register, ut as InfiniteQueryPageParamsOptions, vn as WithRequired, vt as MutationFunction, wt as MutationObserverIdleResult, xn as unsetMarker, xt as MutationMeta, yn as dataTagErrorSymbol, yt as MutationFunctionContext, z as DefinedInfiniteQueryObserverResult, zt as PlaceholderDataFunction } from "./hydration-24GwbSaU.cjs";
|
|
2
2
|
export { AnyDataTag, CancelOptions, DataTag, DefaultError, DefaultOptions, DefaultedInfiniteQueryObserverOptions, DefaultedQueryObserverOptions, DefinedInfiniteQueryObserverResult, DefinedQueryObserverResult, DistributiveOmit, EnsureInfiniteQueryDataOptions, EnsureQueryDataOptions, FetchInfiniteQueryOptions, FetchNextPageOptions, FetchPreviousPageOptions, FetchQueryOptions, FetchStatus, GetNextPageParamFunction, GetPreviousPageParamFunction, InferDataFromTag, InferErrorFromTag, InfiniteData, InfiniteQueryExecuteOptions, InfiniteQueryObserverBaseResult, InfiniteQueryObserverLoadingErrorResult, InfiniteQueryObserverLoadingResult, InfiniteQueryObserverOptions, InfiniteQueryObserverPendingResult, InfiniteQueryObserverPlaceholderResult, InfiniteQueryObserverRefetchErrorResult, InfiniteQueryObserverResult, InfiniteQueryObserverSuccessResult, InfiniteQueryPageParamsOptions, InitialDataFunction, InitialPageParam, InvalidateOptions, InvalidateQueryFilters, MutateFunction, MutateFunctionRest, MutateOptions, MutationFunction, MutationFunctionContext, MutationKey, MutationMeta, MutationObserverBaseResult, MutationObserverErrorResult, MutationObserverIdleResult, MutationObserverLoadingResult, MutationObserverOptions, MutationObserverResult, MutationObserverSuccessResult, MutationOptions, MutationScope, MutationStatus, NetworkMode, NonUndefinedGuard, NotifyEvent, NotifyEventType, NotifyOnChangeProps, OmitKeyof, Override, PlaceholderDataFunction, QueriesPlaceholderDataFunction, QueryBooleanOption, QueryClientConfig, QueryExecuteOptions, QueryFunction, QueryFunctionContext, QueryKey, QueryKeyHashFunction, QueryKeyWithDataTag, QueryMeta, QueryObserverBaseResult, QueryObserverLoadingErrorResult, QueryObserverLoadingResult, QueryObserverOptions, QueryObserverPendingResult, QueryObserverPlaceholderResult, QueryObserverRefetchErrorResult, QueryObserverResult, QueryObserverSuccessResult, QueryOptions, QueryPersister, QueryStatus, RefetchOptions, RefetchQueryFilters, Register, ResetOptions, ResultOptions, SetDataOptions, StaleTime, StaleTimeFunction, ThrowOnError, UnsetMarker, WithRequired, dataTagErrorSymbol, dataTagSymbol, unsetMarker };
|
package/build/legacy/types.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as InfiniteData, $t as QueryObserverOptions, At as MutationScope, B as DefinedQueryObserverResult, Bt as QueriesPlaceholderDataFunction, Ct as MutationObserverErrorResult, Dt as MutationObserverResult, Et as MutationObserverOptions, F as DefaultError, Ft as NotifyEventType, G as FetchNextPageOptions, Gt as QueryFunctionContext, H as EnsureInfiniteQueryDataOptions, Ht as QueryClientConfig, I as DefaultOptions, It as NotifyOnChangeProps, J as FetchStatus, Jt as QueryKeyWithDataTag, K as FetchPreviousPageOptions, Kt as QueryKey, L as DefaultedInfiniteQueryObserverOptions, Lt as OmitKeyof, M as AnyDataTag, Mt as NetworkMode, N as CancelOptions, Nt as NonUndefinedGuard, Ot as MutationObserverSuccessResult, P as DataTag, Pt as NotifyEvent, Q as InferErrorFromTag, Qt as QueryObserverLoadingResult, R as DefaultedQueryObserverOptions, Rt as Override, St as MutationObserverBaseResult, Tt as MutationObserverLoadingResult, U as EnsureQueryDataOptions, Ut as QueryExecuteOptions, V as DistributiveOmit, Vt as QueryBooleanOption, W as FetchInfiniteQueryOptions, Wt as QueryFunction, X as GetPreviousPageParamFunction, Xt as QueryObserverBaseResult, Y as GetNextPageParamFunction, Yt as QueryMeta, Z as InferDataFromTag, Zt as QueryObserverLoadingErrorResult, _n as UnsetMarker, _t as MutateOptions, an as QueryOptions, at as InfiniteQueryObserverPendingResult, bn as dataTagSymbol, bt as MutationKey, cn as RefetchOptions, ct as InfiniteQueryObserverResult, dn as ResetOptions, dt as InitialDataFunction, en as QueryObserverPendingResult, et as InfiniteQueryExecuteOptions, fn as ResultOptions, ft as InitialPageParam, gn as ThrowOnError, gt as MutateFunctionRest, hn as StaleTimeFunction, ht as MutateFunction, in as QueryObserverSuccessResult, it as InfiniteQueryObserverOptions, jt as MutationStatus, kt as MutationOptions, ln as RefetchQueryFilters, lt as InfiniteQueryObserverSuccessResult, mn as StaleTime, mt as InvalidateQueryFilters, nn as QueryObserverRefetchErrorResult, nt as InfiniteQueryObserverLoadingErrorResult, on as QueryPersister, ot as InfiniteQueryObserverPlaceholderResult, pn as SetDataOptions, pt as InvalidateOptions, q as FetchQueryOptions, qt as QueryKeyHashFunction, rn as QueryObserverResult, rt as InfiniteQueryObserverLoadingResult, sn as QueryStatus, st as InfiniteQueryObserverRefetchErrorResult, tn as QueryObserverPlaceholderResult, tt as InfiniteQueryObserverBaseResult, un as Register, ut as InfiniteQueryPageParamsOptions, vn as WithRequired, vt as MutationFunction, wt as MutationObserverIdleResult, xn as unsetMarker, xt as MutationMeta, yn as dataTagErrorSymbol, yt as MutationFunctionContext, z as DefinedInfiniteQueryObserverResult, zt as PlaceholderDataFunction } from "./hydration-Cbq_heQS.js";
|
|
2
2
|
export { AnyDataTag, CancelOptions, DataTag, DefaultError, DefaultOptions, DefaultedInfiniteQueryObserverOptions, DefaultedQueryObserverOptions, DefinedInfiniteQueryObserverResult, DefinedQueryObserverResult, DistributiveOmit, EnsureInfiniteQueryDataOptions, EnsureQueryDataOptions, FetchInfiniteQueryOptions, FetchNextPageOptions, FetchPreviousPageOptions, FetchQueryOptions, FetchStatus, GetNextPageParamFunction, GetPreviousPageParamFunction, InferDataFromTag, InferErrorFromTag, InfiniteData, InfiniteQueryExecuteOptions, InfiniteQueryObserverBaseResult, InfiniteQueryObserverLoadingErrorResult, InfiniteQueryObserverLoadingResult, InfiniteQueryObserverOptions, InfiniteQueryObserverPendingResult, InfiniteQueryObserverPlaceholderResult, InfiniteQueryObserverRefetchErrorResult, InfiniteQueryObserverResult, InfiniteQueryObserverSuccessResult, InfiniteQueryPageParamsOptions, InitialDataFunction, InitialPageParam, InvalidateOptions, InvalidateQueryFilters, MutateFunction, MutateFunctionRest, MutateOptions, MutationFunction, MutationFunctionContext, MutationKey, MutationMeta, MutationObserverBaseResult, MutationObserverErrorResult, MutationObserverIdleResult, MutationObserverLoadingResult, MutationObserverOptions, MutationObserverResult, MutationObserverSuccessResult, MutationOptions, MutationScope, MutationStatus, NetworkMode, NonUndefinedGuard, NotifyEvent, NotifyEventType, NotifyOnChangeProps, OmitKeyof, Override, PlaceholderDataFunction, QueriesPlaceholderDataFunction, QueryBooleanOption, QueryClientConfig, QueryExecuteOptions, QueryFunction, QueryFunctionContext, QueryKey, QueryKeyHashFunction, QueryKeyWithDataTag, QueryMeta, QueryObserverBaseResult, QueryObserverLoadingErrorResult, QueryObserverLoadingResult, QueryObserverOptions, QueryObserverPendingResult, QueryObserverPlaceholderResult, QueryObserverRefetchErrorResult, QueryObserverResult, QueryObserverSuccessResult, QueryOptions, QueryPersister, QueryStatus, RefetchOptions, RefetchQueryFilters, Register, ResetOptions, ResultOptions, SetDataOptions, StaleTime, StaleTimeFunction, ThrowOnError, UnsetMarker, WithRequired, dataTagErrorSymbol, dataTagSymbol, unsetMarker };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../src/types.ts"],"sourcesContent":["/* istanbul ignore file */\n\nimport type { QueryClient } from './queryClient'\nimport type { DehydrateOptions, HydrateOptions } from './hydration'\nimport type { MutationState } from './mutation'\nimport type { FetchDirection, Query, QueryBehavior } from './query'\nimport type { RetryDelayValue, RetryValue } from './retryer'\nimport type { QueryFilters, QueryTypeFilter, SkipToken } from './utils'\nimport type { QueryCache } from './queryCache'\nimport type { MutationCache } from './mutationCache'\n\n/**\n * Excludes `undefined` from `T`. Used where a value must be defined, such as the data type that a\n * defined `initialData` resolves to.\n */\nexport type NonUndefinedGuard<T> = T extends undefined ? never : T\n\n/**\n * Like `Omit`, but applied to each member of a union separately, so each member keeps its own keys.\n */\nexport type DistributiveOmit<\n TObject,\n TKey extends keyof TObject,\n> = TObject extends any ? Omit<TObject, TKey> : never\n\n/**\n * Like `Omit`, but by default (`'strictly'`) `TKey` must be a key of `TObject`, so omitting a key\n * that doesn't exist is a type error. Pass `'safely'` to allow other keys too.\n */\nexport type OmitKeyof<\n TObject,\n TKey extends (TStrictly extends 'safely'\n ?\n | keyof TObject\n | (string & Record<never, never>)\n | (number & Record<never, never>)\n | (symbol & Record<never, never>)\n : keyof TObject),\n TStrictly extends 'strictly' | 'safely' = 'strictly',\n> = Omit<TObject, TKey>\n\n/**\n * Replaces the types of the properties of `TTargetA` that also exist in `TTargetB` with their types\n * in `TTargetB`. Properties that only exist in `TTargetB` are not added.\n */\nexport type Override<TTargetA, TTargetB> = {\n [AKey in keyof TTargetA]: AKey extends keyof TTargetB\n ? TTargetB[AKey]\n : TTargetA[AKey]\n}\n\n/**\n * The interface to augment via declaration merging to override Query's default types repository-wide.\n * Each field it declares replaces the default of the matching type: `defaultError` for {@link DefaultError},\n * `queryKey` for {@link QueryKey}, `mutationKey` for {@link MutationKey}, `queryMeta` for {@link QueryMeta} and\n * `mutationMeta` for {@link MutationMeta}. Leave a field out to keep that type's default.\n * Augment the module you install — `@tanstack/react-query`, `@tanstack/vue-query`,\n * `@tanstack/solid-query`, `@tanstack/svelte-query`, `@tanstack/preact-query`,\n * `@tanstack/angular-query-experimental` or `@tanstack/lit-query`. Augmenting `@tanstack/query-core`\n * works too and covers every adapter at once.\n * @example\n * ```ts\n * // Use the module you installed — here, the React adapter.\n * declare module '@tanstack/react-query' {\n * interface Register {\n * defaultError: AxiosError\n * }\n * }\n * ```\n */\nexport interface Register {\n // defaultError: Error\n // queryMeta: Record<string, unknown>\n // mutationMeta: Record<string, unknown>\n // queryKey: ReadonlyArray<unknown>\n // mutationKey: ReadonlyArray<unknown>\n}\n\n/**\n * The error type used wherever an error is not given an explicit type parameter.\n * Defaults to `Error`; declare `defaultError` on {@link Register} to change it everywhere at once.\n */\nexport type DefaultError = Register extends {\n defaultError: infer TError\n}\n ? TError\n : Error\n\n/**\n * The type of a query key — the serializable array that identifies a query in the cache.\n * Defaults to `ReadonlyArray<unknown>`; declare `queryKey` on {@link Register} to narrow it repository-wide.\n */\nexport type QueryKey = Register extends {\n queryKey: infer TQueryKey\n}\n ? TQueryKey extends ReadonlyArray<unknown>\n ? TQueryKey\n : TQueryKey extends Array<unknown>\n ? TQueryKey\n : ReadonlyArray<unknown>\n : ReadonlyArray<unknown>\n\nexport const dataTagSymbol = Symbol()\n/**\n * The type of the `dataTagSymbol` key, under which a {@link DataTag} stores its data type.\n */\nexport type dataTagSymbol = typeof dataTagSymbol\nexport const dataTagErrorSymbol = Symbol()\n/**\n * The type of the `dataTagErrorSymbol` key, under which a {@link DataTag} stores its error type.\n */\nexport type dataTagErrorSymbol = typeof dataTagErrorSymbol\nexport const unsetMarker = Symbol()\n/**\n * The type of `unsetMarker`, the default error type of a {@link DataTag}. It marks that no error\n * type was tagged.\n */\nexport type UnsetMarker = typeof unsetMarker\n/**\n * Matches any type that has been tagged with {@link DataTag}, whatever its data and error types.\n */\nexport type AnyDataTag = {\n /**\n * The data type the key was tagged with.\n */\n [dataTagSymbol]: any\n /**\n * The error type the key was tagged with.\n */\n [dataTagErrorSymbol]: any\n}\n/**\n * Tags `TType` (usually a query key) with a data type and an optional error type, so that APIs that\n * receive it, like `queryClient.getQueryData`, can infer them. A type that is already tagged is\n * returned as is.\n */\nexport type DataTag<\n TType,\n TValue,\n TError = UnsetMarker,\n> = TType extends AnyDataTag\n ? TType\n : TType & {\n [dataTagSymbol]: TValue\n [dataTagErrorSymbol]: TError\n }\n\n/**\n * An object whose `queryKey` is tagged with {@link DataTag}, like the options returned by\n * `queryOptions`.\n */\nexport type QueryKeyWithDataTag<\n TQueryKey extends QueryKey = QueryKey,\n TQueryFnData = unknown,\n TError = DefaultError,\n> = {\n /**\n * The query key, tagged with the query's data and error types.\n */\n queryKey: DataTag<TQueryKey, TQueryFnData, TError>\n}\n\n/**\n * The data type tagged on a query key by {@link DataTag}, or `TQueryFnData` if the key is not\n * tagged.\n */\nexport type InferDataFromTag<TQueryFnData, TTaggedQueryKey extends QueryKey> =\n TTaggedQueryKey extends DataTag<unknown, infer TaggedValue, unknown>\n ? TaggedValue\n : TQueryFnData\n\n/**\n * The error type tagged on a query key by {@link DataTag}, or `TError` if the key is not tagged or\n * was tagged without an error type.\n */\nexport type InferErrorFromTag<TError, TTaggedQueryKey extends QueryKey> =\n TTaggedQueryKey extends DataTag<unknown, unknown, infer TaggedError>\n ? TaggedError extends UnsetMarker\n ? TError\n : TaggedError\n : TError\n\n/** @inline */\nexport type QueryFunction<\n T = unknown,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> = (context: QueryFunctionContext<TQueryKey, TPageParam>) => T | Promise<T>\n\n/** @inline */\nexport type StaleTime = number | 'static'\n\n/** @inline */\nexport type StaleTimeFunction<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> =\n | StaleTime\n | ((query: Query<TQueryFnData, TError, TData, TQueryKey>) => StaleTime)\n\n/** @inline */\nexport type QueryBooleanOption<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> =\n | boolean\n | ((query: Query<TQueryFnData, TError, TData, TQueryKey>) => boolean)\n\n/** @inline */\nexport type QueryPersister<\n T = unknown,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> = [TPageParam] extends [never]\n ? (\n queryFn: QueryFunction<T, TQueryKey, never>,\n context: QueryFunctionContext<TQueryKey>,\n query: Query,\n ) => T | Promise<T>\n : (\n queryFn: QueryFunction<T, TQueryKey, TPageParam>,\n context: QueryFunctionContext<TQueryKey>,\n query: Query,\n ) => T | Promise<T>\n\n/**\n * The object passed to `queryFn`: the `QueryClient`, the `queryKey`, an `AbortSignal` that aborts\n * when the query is cancelled, the query's `meta`, and for infinite queries the `pageParam` of the\n * page being fetched.\n */\nexport type QueryFunctionContext<\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> = [TPageParam] extends [never]\n ? {\n client: QueryClient\n queryKey: TQueryKey\n signal: AbortSignal\n meta: QueryMeta | undefined\n pageParam?: unknown\n /**\n * @deprecated\n * if you want access to the direction, you can add it to the pageParam\n */\n direction?: unknown\n }\n : {\n client: QueryClient\n queryKey: TQueryKey\n signal: AbortSignal\n pageParam: TPageParam\n /**\n * @deprecated\n * if you want access to the direction, you can add it to the pageParam\n */\n direction: FetchDirection\n meta: QueryMeta | undefined\n }\n\n/** @inline */\nexport type InitialDataFunction<T> = () => T | undefined\n\ntype NonFunctionGuard<T> = T extends Function ? never : T\n\n/** @inline */\nexport type PlaceholderDataFunction<\n TQueryFnData = unknown,\n TError = DefaultError,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = (\n previousData: TQueryData | undefined,\n previousQuery: Query<TQueryFnData, TError, TQueryData, TQueryKey> | undefined,\n) => TQueryData | undefined\n\n/**\n * The `placeholderData` function of a query in `useQueries` and its counterparts. Unlike\n * {@link PlaceholderDataFunction}, it receives no previous data or query, because the number of\n * queries can differ between renders.\n */\nexport type QueriesPlaceholderDataFunction<TQueryData> = (\n previousData: undefined,\n previousQuery: undefined,\n) => TQueryData | undefined\n\n/** @inline */\nexport type QueryKeyHashFunction<TQueryKey extends QueryKey> = (\n queryKey: TQueryKey,\n) => string\n\n/** @inline */\nexport type GetPreviousPageParamFunction<TPageParam, TQueryFnData = unknown> = (\n firstPage: TQueryFnData,\n allPages: Array<TQueryFnData>,\n firstPageParam: TPageParam,\n allPageParams: Array<TPageParam>,\n) => TPageParam | undefined | null\n\n/** @inline */\nexport type GetNextPageParamFunction<TPageParam, TQueryFnData = unknown> = (\n lastPage: TQueryFnData,\n allPages: Array<TQueryFnData>,\n lastPageParam: TPageParam,\n allPageParams: Array<TPageParam>,\n) => TPageParam | undefined | null\n\n/**\n * The data shape of an infinite query: every page fetched so far, plus the page param each one was fetched with.\n * `pages` and `pageParams` are index-aligned — `pageParams[i]` is the param that produced `pages[i]`.\n */\nexport interface InfiniteData<TData, TPageParam = unknown> {\n /**\n * The data of every page fetched so far, in order.\n */\n pages: Array<TData>\n /**\n * The page param each page was fetched with, aligned by index with `pages`.\n */\n pageParams: Array<TPageParam>\n}\n\n/**\n * The type of the `meta` object that can be attached to a query and read back from `queryFn`, callbacks and\n * cache-level handlers. Defaults to `Record<string, unknown>`; declare `queryMeta` on {@link Register} to narrow it.\n */\nexport type QueryMeta = Register extends {\n queryMeta: infer TQueryMeta\n}\n ? TQueryMeta extends Record<string, unknown>\n ? TQueryMeta\n : Record<string, unknown>\n : Record<string, unknown>\n\n/** @inline */\nexport type NetworkMode = 'online' | 'always' | 'offlineFirst'\n\n/** @inline */\nexport type NotifyOnChangeProps =\n | Array<keyof InfiniteQueryObserverResult>\n | 'all'\n | undefined\n | (() => Array<keyof InfiniteQueryObserverResult> | 'all' | undefined)\n\n/**\n * The options of a query itself — its `queryKey`, `queryFn`, retries, `gcTime`, `initialData`,\n * `meta`, and so on — shared by observers and the `QueryClient` methods that fetch queries.\n */\nexport interface QueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> {\n /**\n * If `false`, failed queries will not retry by default.\n * If `true`, failed queries will retry infinitely.\n * If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number.\n * If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false.\n *\n * Defaults to `3` on the client and `0` on the server.\n */\n retry?: RetryValue<TError>\n /**\n * This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the\n * next attempt in milliseconds.\n *\n * A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential\n * backoff.\n *\n * A function like `attempt => attempt * 1000` applies linear backoff.\n *\n * Defaults to a function that applies exponential backoff, capped at 30 seconds.\n */\n retryDelay?: RetryDelayValue<TError>\n /**\n * Controls whether a query is allowed to run based on the current network connectivity.\n * @defaultValue 'online'\n * @see [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information.\n */\n networkMode?: NetworkMode\n /**\n * The time in milliseconds that unused/inactive cache data remains in memory.\n * When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration.\n * When different garbage collection times are specified, the longest one will be used.\n * Setting it to `Infinity` will disable garbage collection.\n *\n * Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR.\n *\n * Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see\n * `timeoutManager.setTimeoutProvider` for a workaround.\n */\n gcTime?: number\n /**\n * The function that the query will use to request data.\n * Required, unless a default query function has been set via `queryClient.setQueryDefaults` or\n * `queryClient.setDefaultOptions`.\n * Receives a {@link QueryFunctionContext}.\n * Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`.\n */\n queryFn?: QueryFunction<TQueryFnData, TQueryKey, TPageParam> | SkipToken\n /**\n * This option can be used to persist the result of a query to an external storage, bypassing the need to actually\n * call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries.\n */\n persister?: QueryPersister<TQueryFnData, NoInfer<TQueryKey>, TPageParam>\n /**\n * The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used\n * as the actual cache key internally.\n */\n queryHash?: string\n /**\n * The query key to use for this query.\n *\n * The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys)\n * for more information.\n *\n * The query will automatically update when this key changes (as long as `enabled` is not set to `false`).\n */\n queryKey?: TQueryKey\n /**\n * If specified, this function is used to hash the `queryKey` to a string.\n */\n queryKeyHashFn?: QueryKeyHashFunction<TQueryKey>\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).\n * If set to a function, the function will be called **once** during the shared/root query initialization, and be\n * expected to synchronously return the initial data.\n * Initial data is considered stale by default unless a `staleTime` has been set.\n * `initialData` **is persisted** to the cache.\n */\n initialData?: TData | InitialDataFunction<TData>\n /**\n * If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated.\n */\n initialDataUpdatedAt?: number | (() => number | undefined)\n /** @internal */\n behavior?: QueryBehavior<TQueryFnData, TError, TData, TQueryKey>\n /**\n * Set this to `false` to disable structural sharing between query results.\n * Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic.\n * @defaultValue true\n */\n structuralSharing?:\n | boolean\n | ((oldData: unknown | undefined, newData: unknown) => unknown)\n /** @internal */\n _defaulted?: boolean\n /** @internal */\n _type?: 'infinite'\n /**\n * Additional payload to be stored on each query.\n * Use this property to pass information that can be used in other places.\n */\n meta?: QueryMeta\n /**\n * Maximum number of pages to store in the data of an infinite query.\n */\n maxPages?: number\n}\n\n/**\n * Holds the `initialPageParam` option that every infinite query requires.\n */\nexport interface InitialPageParam<TPageParam = unknown> {\n /**\n * The page param to start from when an infinite query has no pages yet.\n * It is passed to `queryFn` as `pageParam` for the first page; every page after that gets the\n * value returned by `getNextPageParam` or `getPreviousPageParam`.\n * It only applies while the query has no pages: once a first page exists, refetching starts from\n * that page's own param instead.\n */\n initialPageParam: TPageParam\n}\n\n/**\n * The page param options of an infinite query: `initialPageParam`, and the `getNextPageParam` and\n * `getPreviousPageParam` functions that compute the params of the pages around it.\n */\nexport interface InfiniteQueryPageParamsOptions<\n TQueryFnData = unknown,\n TPageParam = unknown,\n> extends InitialPageParam<TPageParam> {\n /**\n * This function can be set to automatically get the previous cursor for infinite queries.\n * The result will also be used to determine the value of `hasPreviousPage`.\n */\n getPreviousPageParam?: GetPreviousPageParamFunction<TPageParam, TQueryFnData>\n /**\n * This function can be set to automatically get the next cursor for infinite queries.\n * The result will also be used to determine the value of `hasNextPage`.\n */\n getNextPageParam: GetNextPageParamFunction<TPageParam, TQueryFnData>\n}\n\n/** @inline */\nexport type ThrowOnError<\n TQueryFnData,\n TError,\n TQueryData,\n TQueryKey extends QueryKey,\n> =\n | boolean\n | ((\n error: TError,\n query: Query<TQueryFnData, TError, TQueryData, TQueryKey>,\n ) => boolean)\n\n/**\n * The options of a `QueryObserver`, and of the hooks built on it like `useQuery`: the\n * {@link QueryOptions} of the query, plus options that control the observer, such as `enabled`,\n * `staleTime`, `refetchInterval`, `select`, and `placeholderData`.\n */\nexport interface QueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> extends WithRequired<\n QueryOptions<TQueryFnData, TError, TQueryData, TQueryKey, TPageParam>,\n 'queryKey'\n> {\n /**\n * Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys.\n * To refetch the query, use the `refetch` method returned from the `useQuery` instance.\n * Accepts a boolean or function that returns a boolean.\n * @defaultValue true\n */\n enabled?: QueryBooleanOption<TQueryFnData, TError, TQueryData, TQueryKey>\n /**\n * The time in milliseconds after data is considered stale.\n * If set to `Infinity`, the data will never be considered stale.\n * If set to `'static'`, the data will never be considered stale.\n * If set to a function, the function will be executed with the query to compute a `staleTime`.\n * @defaultValue 0\n */\n staleTime?: StaleTimeFunction<TQueryFnData, TError, TQueryData, TQueryKey>\n /**\n * If set to a number, the query will continuously refetch at this frequency in milliseconds.\n * If set to a function, the function will be executed with the latest data and query to compute a frequency\n * @defaultValue false\n */\n refetchInterval?:\n | number\n | false\n | ((\n query: Query<TQueryFnData, TError, TQueryData, TQueryKey>,\n ) => number | false | undefined)\n /**\n * If set to `true`, the query will continue to refetch while their tab/window is in the background.\n * @defaultValue false\n */\n refetchIntervalInBackground?: boolean\n /**\n * If set to `true`, the query will refetch on window focus if the data is stale.\n * If set to `false`, the query will not refetch on window focus.\n * If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used).\n * If set to a function, the function will be executed with the latest data and query to compute the value.\n * @defaultValue true\n */\n refetchOnWindowFocus?:\n | boolean\n | 'always'\n | ((\n query: Query<TQueryFnData, TError, TQueryData, TQueryKey>,\n ) => boolean | 'always')\n /**\n * If set to `true`, the query will refetch on reconnect if the data is stale.\n * If set to `false`, the query will not refetch on reconnect.\n * If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used).\n * If set to a function, the function will be executed with the latest data and query to compute the value.\n *\n * Defaults to `true` unless `networkMode` is `'always'`.\n */\n refetchOnReconnect?:\n | boolean\n | 'always'\n | ((\n query: Query<TQueryFnData, TError, TQueryData, TQueryKey>,\n ) => boolean | 'always')\n /**\n * If set to `true`, the query will refetch on mount if the data is stale.\n * If set to `false`, will disable additional instances of a query to trigger background refetch.\n * If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used).\n * If set to a function, the function will be executed with the latest data and query to compute the value\n * @defaultValue true\n */\n refetchOnMount?:\n | boolean\n | 'always'\n | ((\n query: Query<TQueryFnData, TError, TQueryData, TQueryKey>,\n ) => boolean | 'always')\n /**\n * If set to `false`, the query will not be retried on mount if it contains an error.\n * If set to a function, the function will be executed with the query to compute the value.\n * @defaultValue true\n */\n retryOnMount?: QueryBooleanOption<TQueryFnData, TError, TQueryData, TQueryKey>\n /**\n * If set, the component will only re-render if any of the listed properties change.\n * When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change.\n * When set to `'all'`, the component will re-render whenever a query is updated.\n * When set to a function, the function will be executed to compute the list of properties.\n *\n * Defaults to `undefined`, in which case property access is tracked automatically, and the\n * component only re-renders when one of the tracked properties changes.\n */\n notifyOnChangeProps?: NotifyOnChangeProps\n /**\n * Whether errors should be thrown instead of setting the `error` property.\n * If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary.\n * If set to `false` and `suspense` is `false`, errors are returned as state.\n * If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`).\n * @defaultValue false\n */\n throwOnError?: ThrowOnError<TQueryFnData, TError, TQueryData, TQueryKey>\n /**\n * This option can be used to transform or select a part of the data returned by the query function. It affects\n * the returned `data` value, but does not affect what gets stored in the query cache.\n * The `select` function will only run if `data` changed, or if the reference to the `select` function itself\n * changes. To optimize, memoize the function so its reference stays stable across calls.\n */\n select?: (data: TQueryData) => TData\n /**\n * If set to `true`, the query will suspend when `status === 'pending'`\n * and throw errors when `status === 'error'`.\n * @defaultValue false\n */\n suspense?: boolean\n /**\n * If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided.\n */\n placeholderData?:\n | NonFunctionGuard<TQueryData>\n | PlaceholderDataFunction<\n NonFunctionGuard<TQueryData>,\n TError,\n NonFunctionGuard<TQueryData>,\n TQueryKey\n >\n\n /** @internal */\n _optimisticResults?: 'optimistic' | 'isRestoring'\n}\n\n/**\n * Makes the `TKey` properties of `TTarget` required and non-nullable.\n */\nexport type WithRequired<TTarget, TKey extends keyof TTarget> = TTarget & {\n [_ in TKey]: {}\n}\n\n/**\n * The {@link QueryObserverOptions} after `QueryClient#defaultQueryOptions` has applied the\n * defaults, so `throwOnError`, `refetchOnReconnect`, and `queryHash` are always set.\n */\nexport type DefaultedQueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = WithRequired<\n QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>,\n 'throwOnError' | 'refetchOnReconnect' | 'queryHash'\n>\n\n/**\n * The options of an `InfiniteQueryObserver`: {@link QueryObserverOptions} whose query data is\n * {@link InfiniteData}, plus the page param options.\n */\nexport interface InfiniteQueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>\n extends\n QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n InfiniteData<TQueryFnData, TPageParam>,\n TQueryKey,\n TPageParam\n >,\n InfiniteQueryPageParamsOptions<TQueryFnData, TPageParam> {}\n\n/**\n * The {@link InfiniteQueryObserverOptions} after `QueryClient#defaultQueryOptions` has applied the\n * defaults, so `throwOnError`, `refetchOnReconnect`, and `queryHash` are always set.\n */\nexport type DefaultedInfiniteQueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = WithRequired<\n InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n 'throwOnError' | 'refetchOnReconnect' | 'queryHash'\n>\n\n/**\n * The options of `queryClient.query`: the {@link QueryOptions} of the query, plus a `staleTime`\n * that decides whether cached data is returned instead of fetching, and a `select` that only\n * transforms the value the call resolves with.\n */\nexport interface QueryExecuteOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> extends WithRequired<\n QueryOptions<TQueryFnData, TError, TQueryData, TQueryKey, TPageParam>,\n 'queryKey'\n> {\n /**\n * Not allowed here, since `initialPageParam` only applies to infinite queries.\n */\n initialPageParam?: never\n /**\n * This option can be used to transform or select a part of the data returned by the query function. It affects\n * the value this call resolves with, but does not affect what gets stored in the query cache.\n */\n select?: (data: TQueryData) => TData\n /**\n * The time in milliseconds after data is considered stale.\n * If the data is fresh it will be returned from the cache.\n */\n staleTime?: StaleTimeFunction<TQueryFnData, TError, TQueryData, TQueryKey>\n}\n\n/** @deprecated */\nexport interface FetchQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> extends WithRequired<\n QueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>,\n 'queryKey'\n> {\n /**\n * Not allowed here, since `initialPageParam` only applies to infinite queries.\n */\n initialPageParam?: never\n /**\n * The time in milliseconds after data is considered stale.\n * If the data is fresh it will be returned from the cache.\n */\n staleTime?: StaleTimeFunction<TQueryFnData, TError, TData, TQueryKey>\n}\n\n/** @deprecated */\nexport interface EnsureQueryDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> extends FetchQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> {\n /**\n * If `true`, stale cached data is returned and also refetched in the background.\n */\n revalidateIfStale?: boolean\n}\n\n/** @deprecated */\nexport type EnsureInfiniteQueryDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n revalidateIfStale?: boolean\n}\n\ntype InfiniteQueryPages<TQueryFnData = unknown, TPageParam = unknown> =\n | { pages?: never }\n | {\n pages: number\n getNextPageParam: GetNextPageParamFunction<TPageParam, TQueryFnData>\n }\n\n/**\n * The options of `queryClient.infiniteQuery`: like {@link QueryExecuteOptions}, with the\n * `initialPageParam`, and optionally `pages` together with `getNextPageParam` to fetch that many\n * pages at once.\n */\nexport type InfiniteQueryExecuteOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = Omit<\n QueryExecuteOptions<\n TQueryFnData,\n TError,\n TData,\n InfiniteData<TQueryFnData, TPageParam>,\n TQueryKey,\n TPageParam\n >,\n 'initialPageParam'\n> &\n InitialPageParam<TPageParam> &\n InfiniteQueryPages<TQueryFnData, TPageParam>\n\n/** @deprecated */\nexport type FetchInfiniteQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = Omit<\n FetchQueryOptions<\n TQueryFnData,\n TError,\n InfiniteData<TData, TPageParam>,\n TQueryKey,\n TPageParam\n >,\n 'initialPageParam'\n> &\n InitialPageParam<TPageParam> &\n InfiniteQueryPages<TQueryFnData, TPageParam>\n\n/**\n * Options shared by the `QueryClient` and observer methods that refetch queries, controlling\n * whether a failed refetch makes the returned promise reject.\n */\nexport interface ResultOptions {\n /**\n * If set to `true`, the method throws if any of the underlying query refetch tasks fail.\n * If set to `false`, failed refetches are swallowed and not surfaced to the caller.\n * @defaultValue false\n */\n throwOnError?: boolean\n}\n\n/**\n * Options of the methods that refetch queries, like `refetch` and `queryClient.refetchQueries`.\n */\nexport interface RefetchOptions extends ResultOptions {\n /**\n * If set to `true`, a currently running request will be cancelled before a new request is made\n *\n * If set to `false`, no refetch will be made if there is already a request running.\n * @defaultValue true\n */\n cancelRefetch?: boolean\n}\n\n/**\n * The filters of `queryClient.invalidateQueries`: the {@link QueryFilters} that select the queries\n * to invalidate, plus `refetchType` to choose which of them are refetched.\n */\nexport interface InvalidateQueryFilters<\n TQueryKey extends QueryKey = QueryKey,\n> extends QueryFilters<TQueryKey> {\n /**\n * Controls which of the matched (now-invalidated) queries are refetched in the background.\n *\n * - `'active'`: only queries with at least one active observer are refetched.\n * - `'inactive'`: only queries with no active observer are refetched.\n * - `'all'`: every matched query is refetched, active or not.\n * - `'none'`: no query is refetched; matched queries are only marked as invalidated.\n * @defaultValue 'active'\n */\n refetchType?: QueryTypeFilter | 'none'\n}\n\n/**\n * The filters of `queryClient.refetchQueries`, which select the queries to refetch.\n */\nexport interface RefetchQueryFilters<\n TQueryKey extends QueryKey = QueryKey,\n> extends QueryFilters<TQueryKey> {}\n\n/**\n * Options of `queryClient.invalidateQueries`, applied to the refetch that follows the invalidation.\n */\nexport interface InvalidateOptions extends RefetchOptions {}\n/**\n * Options of `queryClient.resetQueries`, applied to the refetch of the active queries after the\n * reset.\n */\nexport interface ResetOptions extends RefetchOptions {}\n\n/**\n * Options of `fetchNextPage` on an infinite query result.\n */\nexport interface FetchNextPageOptions extends ResultOptions {\n /**\n * If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time,\n * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored.\n *\n * If set to `false`, calling `fetchNextPage` repeatedly won't have any effect until the first invocation has resolved.\n * @defaultValue true\n */\n cancelRefetch?: boolean\n}\n\n/**\n * Options of `fetchPreviousPage` on an infinite query result.\n */\nexport interface FetchPreviousPageOptions extends ResultOptions {\n /**\n * If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time,\n * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored.\n *\n * If set to `false`, calling `fetchPreviousPage` repeatedly won't have any effect until the first invocation has resolved.\n * @defaultValue true\n */\n cancelRefetch?: boolean\n}\n\n/** @inline */\nexport type QueryStatus = 'pending' | 'error' | 'success'\n/** @inline */\nexport type FetchStatus = 'fetching' | 'paused' | 'idle'\n\n/**\n * The properties shared by every state of a query result, like `data`, `error`, `status`, the\n * `is*` flags, and `refetch`. Each `QueryObserver*Result` narrows them for one state.\n */\nexport interface QueryObserverBaseResult<\n TData = unknown,\n TError = DefaultError,\n> {\n /**\n * The last successfully resolved data for the query.\n */\n data: TData | undefined\n /**\n * The timestamp for when the query most recently returned the `status` as `\"success\"`.\n */\n dataUpdatedAt: number\n /**\n * The error object for the query, if an error was thrown.\n * - Defaults to `null`.\n */\n error: TError | null\n /**\n * The timestamp for when the query most recently returned the `status` as `\"error\"`.\n */\n errorUpdatedAt: number\n /**\n * The failure count for the query.\n * - Incremented every time the query fails.\n * - Reset to `0` when the query succeeds.\n */\n failureCount: number\n /**\n * The failure reason for the query retry.\n * - Reset to `null` when the query succeeds.\n */\n failureReason: TError | null\n /**\n * The sum of all errors.\n */\n errorUpdateCount: number\n /**\n * A derived boolean from the `status` variable, provided for convenience.\n * - `true` if the query attempt resulted in an error.\n */\n isError: boolean\n /**\n * Will be `true` if the query has been fetched.\n */\n isFetched: boolean\n /**\n * Will be `true` if the query has been fetched after the component mounted.\n * - This property can be used to not show any previously cached data.\n */\n isFetchedAfterMount: boolean\n /**\n * A derived boolean from the `fetchStatus` variable, provided for convenience.\n * - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch.\n */\n isFetching: boolean\n /**\n * Is `true` whenever the first fetch for a query is in-flight.\n * - Is the same as `isFetching && isPending`.\n */\n isLoading: boolean\n /**\n * Will be `pending` if there's no cached data and no query attempt was finished yet.\n */\n isPending: boolean\n /**\n * Will be `true` if the query failed while fetching for the first time.\n */\n isLoadingError: boolean\n /**\n * @deprecated `isInitialLoading` is being deprecated in favor of `isLoading`\n * and will be removed in the next major version.\n */\n isInitialLoading: boolean\n /**\n * A derived boolean from the `fetchStatus` variable, provided for convenience.\n * - The query wanted to fetch, but has been `paused`.\n */\n isPaused: boolean\n /**\n * Will be `true` if the data shown is the placeholder data.\n */\n isPlaceholderData: boolean\n /**\n * Will be `true` if the query failed while refetching.\n */\n isRefetchError: boolean\n /**\n * Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`.\n * - Is the same as `isFetching && !isPending`.\n */\n isRefetching: boolean\n /**\n * Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`.\n */\n isStale: boolean\n /**\n * A derived boolean from the `status` variable, provided for convenience.\n * - `true` if the query has received a response with no errors and is ready to display its data.\n */\n isSuccess: boolean\n /**\n * `true` if this observer is enabled, `false` otherwise.\n */\n isEnabled: boolean\n /**\n * A function to manually refetch the query.\n */\n refetch: (\n options?: RefetchOptions,\n ) => Promise<QueryObserverResult<TData, TError>>\n /**\n * The status of the query.\n * - Will be:\n * - `pending` if there's no cached data and no query attempt was finished yet.\n * - `error` if the query attempt resulted in an error.\n * - `success` if the query has received a response with no errors and is ready to display its data.\n */\n status: QueryStatus\n /**\n * The fetch status of the query.\n * - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch.\n * - `paused`: The query wanted to fetch, but has been `paused`.\n * - `idle`: The query is not fetching.\n * - See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information.\n */\n fetchStatus: FetchStatus\n}\n\n/**\n * A query result in the `pending` state: the query has no data yet.\n */\nexport interface QueryObserverPendingResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult<TData, TError> {\n /**\n * `undefined`, since the query has no data yet.\n */\n data: undefined\n /**\n * `null`, since the query isn't in the `error` state.\n */\n error: null\n /**\n * `false`, since the query isn't in the `error` state.\n */\n isError: false\n /**\n * `true`, since there's no cached data and no query attempt has finished yet.\n */\n isPending: true\n /**\n * `false`, since the query didn't fail while fetching for the first time.\n */\n isLoadingError: false\n /**\n * `false`, since the query didn't fail while refetching.\n */\n isRefetchError: false\n /**\n * `false`, since the query isn't in the `success` state.\n */\n isSuccess: false\n /**\n * `false`, since the data shown isn't the `placeholderData`.\n */\n isPlaceholderData: false\n /**\n * `'pending'`, since there's no cached data and no query attempt has finished yet.\n */\n status: 'pending'\n}\n\n/**\n * A query result in the `pending` state while the first fetch is in flight, so `isLoading` is\n * `true`.\n */\nexport interface QueryObserverLoadingResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult<TData, TError> {\n /**\n * `undefined`, since the query has no data yet.\n */\n data: undefined\n /**\n * `null`, since the query isn't in the `error` state.\n */\n error: null\n /**\n * `false`, since the query isn't in the `error` state.\n */\n isError: false\n /**\n * `true`, since there's no cached data and no query attempt has finished yet.\n */\n isPending: true\n /**\n * `true`, since the first fetch is in flight.\n */\n isLoading: true\n /**\n * `false`, since the query didn't fail while fetching for the first time.\n */\n isLoadingError: false\n /**\n * `false`, since the query didn't fail while refetching.\n */\n isRefetchError: false\n /**\n * `false`, since the query isn't in the `success` state.\n */\n isSuccess: false\n /**\n * `false`, since the data shown isn't the `placeholderData`.\n */\n isPlaceholderData: false\n /**\n * `'pending'`, since there's no cached data and no query attempt has finished yet.\n */\n status: 'pending'\n}\n\n/**\n * A query result in the `error` state when the first fetch failed, so there is no data.\n */\nexport interface QueryObserverLoadingErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult<TData, TError> {\n /**\n * `undefined`, since the first fetch failed before any data was cached.\n */\n data: undefined\n /**\n * The error the first fetch failed with.\n */\n error: TError\n /**\n * `true`, since the query is in the `error` state.\n */\n isError: true\n /**\n * `false`, since the query has data or a query attempt has finished.\n */\n isPending: false\n /**\n * `false`, since the first fetch isn't in flight.\n */\n isLoading: false\n /**\n * `true`, since the query failed while fetching for the first time.\n */\n isLoadingError: true\n /**\n * `false`, since the query didn't fail while refetching.\n */\n isRefetchError: false\n /**\n * `false`, since the query isn't in the `success` state.\n */\n isSuccess: false\n /**\n * `false`, since the data shown isn't the `placeholderData`.\n */\n isPlaceholderData: false\n /**\n * `'error'`, since the query attempt resulted in an error.\n */\n status: 'error'\n}\n\n/**\n * A query result in the `error` state when a refetch failed, so the data from before is kept.\n */\nexport interface QueryObserverRefetchErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult<TData, TError> {\n /**\n * The data from before the failed refetch, which is kept.\n */\n data: TData\n /**\n * The error the refetch failed with.\n */\n error: TError\n /**\n * `true`, since the query is in the `error` state.\n */\n isError: true\n /**\n * `false`, since the query has data or a query attempt has finished.\n */\n isPending: false\n /**\n * `false`, since the first fetch isn't in flight.\n */\n isLoading: false\n /**\n * `false`, since the query didn't fail while fetching for the first time.\n */\n isLoadingError: false\n /**\n * `true`, since the query failed while refetching.\n */\n isRefetchError: true\n /**\n * `false`, since the query isn't in the `success` state.\n */\n isSuccess: false\n /**\n * `false`, since the data shown isn't the `placeholderData`.\n */\n isPlaceholderData: false\n /**\n * `'error'`, since the query attempt resulted in an error.\n */\n status: 'error'\n}\n\n/**\n * A query result in the `success` state with data from the cache.\n */\nexport interface QueryObserverSuccessResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult<TData, TError> {\n /**\n * The last successfully resolved data for the query.\n */\n data: TData\n /**\n * `null`, since the query isn't in the `error` state.\n */\n error: null\n /**\n * `false`, since the query isn't in the `error` state.\n */\n isError: false\n /**\n * `false`, since the query has data or a query attempt has finished.\n */\n isPending: false\n /**\n * `false`, since the first fetch isn't in flight.\n */\n isLoading: false\n /**\n * `false`, since the query didn't fail while fetching for the first time.\n */\n isLoadingError: false\n /**\n * `false`, since the query didn't fail while refetching.\n */\n isRefetchError: false\n /**\n * `true`, since the query is in the `success` state.\n */\n isSuccess: true\n /**\n * `false`, since the data shown isn't the `placeholderData`.\n */\n isPlaceholderData: false\n /**\n * `'success'`, since the query has received a response with no errors and is ready to display its\n * data.\n */\n status: 'success'\n}\n\n/**\n * A query result in the `success` state that shows `placeholderData` while the query has no data\n * yet.\n */\nexport interface QueryObserverPlaceholderResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult<TData, TError> {\n /**\n * The `placeholderData` shown while the query has no data yet.\n */\n data: TData\n /**\n * `false`, since the query isn't in the `error` state.\n */\n isError: false\n /**\n * `null`, since the query isn't in the `error` state.\n */\n error: null\n /**\n * `false`, since the query has data or a query attempt has finished.\n */\n isPending: false\n /**\n * `false`, since the first fetch isn't in flight.\n */\n isLoading: false\n /**\n * `false`, since the query didn't fail while fetching for the first time.\n */\n isLoadingError: false\n /**\n * `false`, since the query didn't fail while refetching.\n */\n isRefetchError: false\n /**\n * `true`, since the query is in the `success` state.\n */\n isSuccess: true\n /**\n * `true`, since the data shown is the `placeholderData`.\n */\n isPlaceholderData: true\n /**\n * `'success'`, since the query has received a response with no errors and is ready to display its\n * data.\n */\n status: 'success'\n}\n\n/**\n * A query result that always has `data`: the success and refetch error states.\n */\nexport type DefinedQueryObserverResult<\n TData = unknown,\n TError = DefaultError,\n> =\n | QueryObserverRefetchErrorResult<TData, TError>\n | QueryObserverSuccessResult<TData, TError>\n\n/**\n * The result of a `QueryObserver`, and of the hooks built on it like `useQuery`. Narrow it by\n * `status` or the `is*` flags to get the type of each state.\n */\nexport type QueryObserverResult<TData = unknown, TError = DefaultError> =\n | DefinedQueryObserverResult<TData, TError>\n | QueryObserverLoadingErrorResult<TData, TError>\n | QueryObserverLoadingResult<TData, TError>\n | QueryObserverPendingResult<TData, TError>\n | QueryObserverPlaceholderResult<TData, TError>\n\n/**\n * The properties shared by every state of an infinite query result: those of\n * {@link QueryObserverBaseResult}, plus `fetchNextPage`, `fetchPreviousPage`, and the flags about\n * them, like `hasNextPage` and `isFetchingNextPage`.\n */\nexport interface InfiniteQueryObserverBaseResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult<TData, TError> {\n /**\n * This function allows you to fetch the next \"page\" of results.\n */\n fetchNextPage: (\n options?: FetchNextPageOptions,\n ) => Promise<InfiniteQueryObserverResult<TData, TError>>\n /**\n * This function allows you to fetch the previous \"page\" of results.\n */\n fetchPreviousPage: (\n options?: FetchPreviousPageOptions,\n ) => Promise<InfiniteQueryObserverResult<TData, TError>>\n /**\n * Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option).\n */\n hasNextPage: boolean\n /**\n * Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option).\n */\n hasPreviousPage: boolean\n /**\n * Will be `true` if the query failed while fetching the next page.\n */\n isFetchNextPageError: boolean\n /**\n * Will be `true` while fetching the next page with `fetchNextPage`.\n */\n isFetchingNextPage: boolean\n /**\n * Will be `true` if the query failed while fetching the previous page.\n */\n isFetchPreviousPageError: boolean\n /**\n * Will be `true` while fetching the previous page with `fetchPreviousPage`.\n */\n isFetchingPreviousPage: boolean\n}\n\n/**\n * An infinite query result in the `pending` state: the query has no data yet.\n */\nexport interface InfiniteQueryObserverPendingResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult<TData, TError> {\n /**\n * `undefined`, since the query has no data yet.\n */\n data: undefined\n /**\n * `null`, since the query isn't in the `error` state.\n */\n error: null\n /**\n * `false`, since the query isn't in the `error` state.\n */\n isError: false\n /**\n * `true`, since there's no cached data and no query attempt has finished yet.\n */\n isPending: true\n /**\n * `false`, since the query didn't fail while fetching for the first time.\n */\n isLoadingError: false\n /**\n * `false`, since the query didn't fail while refetching.\n */\n isRefetchError: false\n /**\n * `false`, since fetching the next page didn't fail.\n */\n isFetchNextPageError: false\n /**\n * `false`, since fetching the previous page didn't fail.\n */\n isFetchPreviousPageError: false\n /**\n * `false`, since the query isn't in the `success` state.\n */\n isSuccess: false\n /**\n * `false`, since the data shown isn't the `placeholderData`.\n */\n isPlaceholderData: false\n /**\n * `'pending'`, since there's no cached data and no query attempt has finished yet.\n */\n status: 'pending'\n}\n\n/**\n * An infinite query result in the `pending` state while the first fetch is in flight, so\n * `isLoading` is `true`.\n */\nexport interface InfiniteQueryObserverLoadingResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult<TData, TError> {\n /**\n * `undefined`, since the query has no data yet.\n */\n data: undefined\n /**\n * `null`, since the query isn't in the `error` state.\n */\n error: null\n /**\n * `false`, since the query isn't in the `error` state.\n */\n isError: false\n /**\n * `true`, since there's no cached data and no query attempt has finished yet.\n */\n isPending: true\n /**\n * `true`, since the first fetch is in flight.\n */\n isLoading: true\n /**\n * `false`, since the query didn't fail while fetching for the first time.\n */\n isLoadingError: false\n /**\n * `false`, since the query didn't fail while refetching.\n */\n isRefetchError: false\n /**\n * `false`, since fetching the next page didn't fail.\n */\n isFetchNextPageError: false\n /**\n * `false`, since fetching the previous page didn't fail.\n */\n isFetchPreviousPageError: false\n /**\n * `false`, since the query isn't in the `success` state.\n */\n isSuccess: false\n /**\n * `false`, since the data shown isn't the `placeholderData`.\n */\n isPlaceholderData: false\n /**\n * `'pending'`, since there's no cached data and no query attempt has finished yet.\n */\n status: 'pending'\n}\n\n/**\n * An infinite query result in the `error` state when the first fetch failed, so there is no data.\n */\nexport interface InfiniteQueryObserverLoadingErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult<TData, TError> {\n /**\n * `undefined`, since the first fetch failed before any data was cached.\n */\n data: undefined\n /**\n * The error the first fetch failed with.\n */\n error: TError\n /**\n * `true`, since the query is in the `error` state.\n */\n isError: true\n /**\n * `false`, since the query has data or a query attempt has finished.\n */\n isPending: false\n /**\n * `false`, since the first fetch isn't in flight.\n */\n isLoading: false\n /**\n * `true`, since the query failed while fetching for the first time.\n */\n isLoadingError: true\n /**\n * `false`, since the query didn't fail while refetching.\n */\n isRefetchError: false\n /**\n * `false`, since fetching the next page didn't fail.\n */\n isFetchNextPageError: false\n /**\n * `false`, since fetching the previous page didn't fail.\n */\n isFetchPreviousPageError: false\n /**\n * `false`, since the query isn't in the `success` state.\n */\n isSuccess: false\n /**\n * `false`, since the data shown isn't the `placeholderData`.\n */\n isPlaceholderData: false\n /**\n * `'error'`, since the query attempt resulted in an error.\n */\n status: 'error'\n}\n\n/**\n * An infinite query result in the `error` state when a refetch failed, so the data from before is\n * kept.\n */\nexport interface InfiniteQueryObserverRefetchErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult<TData, TError> {\n /**\n * The data from before the failed refetch, which is kept.\n */\n data: TData\n /**\n * The error the refetch failed with.\n */\n error: TError\n /**\n * `true`, since the query is in the `error` state.\n */\n isError: true\n /**\n * `false`, since the query has data or a query attempt has finished.\n */\n isPending: false\n /**\n * `false`, since the first fetch isn't in flight.\n */\n isLoading: false\n /**\n * `false`, since the query didn't fail while fetching for the first time.\n */\n isLoadingError: false\n /**\n * `true`, since the query failed while refetching.\n */\n isRefetchError: true\n /**\n * `false`, since the query isn't in the `success` state.\n */\n isSuccess: false\n /**\n * `false`, since the data shown isn't the `placeholderData`.\n */\n isPlaceholderData: false\n /**\n * `'error'`, since the query attempt resulted in an error.\n */\n status: 'error'\n}\n\n/**\n * An infinite query result in the `success` state with data from the cache.\n */\nexport interface InfiniteQueryObserverSuccessResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult<TData, TError> {\n /**\n * The last successfully resolved data for the query.\n */\n data: TData\n /**\n * `null`, since the query isn't in the `error` state.\n */\n error: null\n /**\n * `false`, since the query isn't in the `error` state.\n */\n isError: false\n /**\n * `false`, since the query has data or a query attempt has finished.\n */\n isPending: false\n /**\n * `false`, since the first fetch isn't in flight.\n */\n isLoading: false\n /**\n * `false`, since the query didn't fail while fetching for the first time.\n */\n isLoadingError: false\n /**\n * `false`, since the query didn't fail while refetching.\n */\n isRefetchError: false\n /**\n * `false`, since fetching the next page didn't fail.\n */\n isFetchNextPageError: false\n /**\n * `false`, since fetching the previous page didn't fail.\n */\n isFetchPreviousPageError: false\n /**\n * `true`, since the query is in the `success` state.\n */\n isSuccess: true\n /**\n * `false`, since the data shown isn't the `placeholderData`.\n */\n isPlaceholderData: false\n /**\n * `'success'`, since the query has received a response with no errors and is ready to display its\n * data.\n */\n status: 'success'\n}\n\n/**\n * An infinite query result in the `success` state that shows `placeholderData` while the query has\n * no data yet.\n */\nexport interface InfiniteQueryObserverPlaceholderResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult<TData, TError> {\n /**\n * The `placeholderData` shown while the query has no data yet.\n */\n data: TData\n /**\n * `false`, since the query isn't in the `error` state.\n */\n isError: false\n /**\n * `null`, since the query isn't in the `error` state.\n */\n error: null\n /**\n * `false`, since the query has data or a query attempt has finished.\n */\n isPending: false\n /**\n * `false`, since the first fetch isn't in flight.\n */\n isLoading: false\n /**\n * `false`, since the query didn't fail while fetching for the first time.\n */\n isLoadingError: false\n /**\n * `false`, since the query didn't fail while refetching.\n */\n isRefetchError: false\n /**\n * `true`, since the query is in the `success` state.\n */\n isSuccess: true\n /**\n * `true`, since the data shown is the `placeholderData`.\n */\n isPlaceholderData: true\n /**\n * `false`, since fetching the next page didn't fail.\n */\n isFetchNextPageError: false\n /**\n * `false`, since fetching the previous page didn't fail.\n */\n isFetchPreviousPageError: false\n /**\n * `'success'`, since the query has received a response with no errors and is ready to display its\n * data.\n */\n status: 'success'\n}\n\n/**\n * An infinite query result that always has `data`: the success and refetch error states.\n */\nexport type DefinedInfiniteQueryObserverResult<\n TData = unknown,\n TError = DefaultError,\n> =\n | InfiniteQueryObserverRefetchErrorResult<TData, TError>\n | InfiniteQueryObserverSuccessResult<TData, TError>\n\n/**\n * The result of an `InfiniteQueryObserver`, and of the hooks built on it like `useInfiniteQuery`.\n * Narrow it by `status` or the `is*` flags to get the type of each state.\n */\nexport type InfiniteQueryObserverResult<\n TData = unknown,\n TError = DefaultError,\n> =\n | DefinedInfiniteQueryObserverResult<TData, TError>\n | InfiniteQueryObserverLoadingErrorResult<TData, TError>\n | InfiniteQueryObserverLoadingResult<TData, TError>\n | InfiniteQueryObserverPendingResult<TData, TError>\n | InfiniteQueryObserverPlaceholderResult<TData, TError>\n\n/**\n * The type of a mutation key — the serializable array used to identify and filter mutations.\n * Defaults to `ReadonlyArray<unknown>`; declare `mutationKey` on {@link Register} to narrow it repository-wide.\n */\nexport type MutationKey = Register extends {\n mutationKey: infer TMutationKey\n}\n ? TMutationKey extends ReadonlyArray<unknown>\n ? TMutationKey\n : TMutationKey extends Array<unknown>\n ? TMutationKey\n : ReadonlyArray<unknown>\n : ReadonlyArray<unknown>\n\n/** @inline */\nexport type MutationStatus = 'idle' | 'pending' | 'success' | 'error'\n\n/**\n * Groups mutations so they run one after another instead of in parallel.\n * Mutations that share the same `id` form a queue: while one is running, the others wait in `isPaused: true`\n * state and resume automatically when their turn comes. Mutations with no scope always run in parallel.\n */\nexport type MutationScope = {\n /**\n * The scope's identifier. Mutations with the same `id` run one after another.\n */\n id: string\n}\n\n/**\n * The type of the `meta` object that can be attached to a mutation and read back from `mutationFn`, callbacks and\n * cache-level handlers. Defaults to `Record<string, unknown>`; declare `mutationMeta` on {@link Register} to narrow it.\n */\nexport type MutationMeta = Register extends {\n mutationMeta: infer TMutationMeta\n}\n ? TMutationMeta extends Record<string, unknown>\n ? TMutationMeta\n : Record<string, unknown>\n : Record<string, unknown>\n\n/**\n * The object passed to `mutationFn` and the mutation callbacks: the `QueryClient`, the mutation's\n * `meta`, and its `mutationKey`.\n */\nexport type MutationFunctionContext = {\n /**\n * The `QueryClient` the mutation runs in.\n */\n client: QueryClient\n /**\n * The `meta` of the mutation options.\n */\n meta: MutationMeta | undefined\n /**\n * The `mutationKey` of the mutation options, if set.\n */\n mutationKey?: MutationKey\n}\n\n/** @inline */\nexport type MutationFunction<TData = unknown, TVariables = unknown> = (\n variables: TVariables,\n context: MutationFunctionContext,\n) => Promise<TData>\n\n/**\n * The options of a mutation: its `mutationFn`, `mutationKey`, callbacks, retries, `scope`, and so\n * on.\n */\nexport interface MutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> {\n /**\n * The function that performs the asynchronous task this mutation runs.\n * Required, unless a default mutation function has been set for the matching `mutationKey` via\n * `queryClient.setMutationDefaults`.\n * Receives the `variables` passed to `mutate`, and a {@link MutationFunctionContext} holding the\n * `QueryClient`, the `mutationKey` and `meta`.\n * Must return a promise that resolves the mutation's data.\n */\n mutationFn?: MutationFunction<TData, TVariables>\n /**\n * The key to use for this mutation. Optional, but required to inherit defaults registered with\n * `queryClient.setMutationDefaults`, and to match this mutation with `useMutationState` or\n * `queryClient.isMutating`.\n */\n mutationKey?: MutationKey\n /**\n * This function fires before the mutation function runs, and receives the same variables.\n * Useful for optimistic updates applied in the hope that the mutation succeeds.\n * The value it returns is passed to `onSuccess`, `onError` and `onSettled` as `onMutateResult`,\n * which is where an optimistic update is usually rolled back.\n * If a promise is returned, it is awaited before the mutation function runs.\n */\n onMutate?: (\n variables: TVariables,\n context: MutationFunctionContext,\n ) => Promise<TOnMutateResult> | TOnMutateResult\n /**\n * This function fires when the mutation succeeds, and is passed the mutation's result.\n * If a promise is returned, it is awaited before `onSettled` runs.\n */\n onSuccess?: (\n data: TData,\n variables: TVariables,\n onMutateResult: TOnMutateResult,\n context: MutationFunctionContext,\n ) => Promise<unknown> | unknown\n /**\n * This function fires when the mutation encounters an error, and is passed the error.\n * If a promise is returned, it is awaited before `onSettled` runs.\n */\n onError?: (\n error: TError,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => Promise<unknown> | unknown\n /**\n * This function fires when the mutation either succeeds or errors, and is passed either the data\n * or the error.\n * If a promise is returned, it is awaited before the mutation settles.\n */\n onSettled?: (\n data: TData | undefined,\n error: TError | null,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => Promise<unknown> | unknown\n /**\n * If `false`, failed mutations will not retry by default.\n * If `true`, failed mutations will retry infinitely.\n * If set to an integer number, e.g. 3, failed mutations will retry until the failed mutation count meets that number.\n * If set to a function `(failureCount, error) => boolean` failed mutations will retry until the function returns false.\n * @defaultValue 0\n */\n retry?: RetryValue<TError>\n /**\n * This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the\n * next attempt in milliseconds.\n *\n * Defaults to a function that applies exponential backoff, capped at 30 seconds.\n */\n retryDelay?: RetryDelayValue<TError>\n /**\n * Controls whether a mutation is allowed to run based on the current network connectivity.\n * @defaultValue 'online'\n * @see [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information.\n */\n networkMode?: NetworkMode\n /**\n * The time in milliseconds that an unused/inactive mutation remains in memory before it is\n * garbage collected.\n *\n * Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR.\n */\n gcTime?: number\n /** @internal */\n _defaulted?: boolean\n /**\n * Additional payload to be stored on the mutation cache entry.\n * Use it to pass information that can be read wherever the `mutation` is available, such as the\n * `onError` and `onSuccess` callbacks of the `MutationCache`.\n */\n meta?: MutationMeta\n /**\n * Controls whether this mutation runs alongside others or waits its turn.\n * Mutations sharing the same `scope.id` run serially, in the order they were started.\n * Without a scope, a mutation runs as soon as it is triggered.\n */\n scope?: MutationScope\n}\n\n/**\n * The options of a `MutationObserver`, and of the hooks built on it like `useMutation`: the\n * {@link MutationOptions}, plus `throwOnError`.\n */\nexport interface MutationObserverOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationOptions<TData, TError, TVariables, TOnMutateResult> {\n /**\n * Whether errors should be thrown instead of setting the `error` property.\n * If set to `true`, all errors will be thrown to the nearest error boundary.\n * If set to a function, it will be passed the error and should return a boolean indicating whether to throw the\n * error (`true`) or return it as state (`false`).\n * @defaultValue false\n */\n throwOnError?: boolean | ((error: TError) => boolean)\n}\n\n/**\n * The callbacks that can be passed to `mutate` for a single call. They run after the callbacks of\n * the mutation options.\n */\nexport interface MutateOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> {\n /**\n * Called when the mutation of this call succeeds, after the `onSuccess` of the mutation options.\n */\n onSuccess?: (\n data: TData,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => void\n /**\n * Called when the mutation of this call fails, after the `onError` of the mutation options.\n */\n onError?: (\n error: TError,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => void\n /**\n * Called when the mutation of this call succeeds or fails, after the `onSettled` of the mutation\n * options.\n */\n onSettled?: (\n data: TData | undefined,\n error: TError | null,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => void\n}\n\n/**\n * The parameters of {@link MutateFunction}: `variables`, optional when `TVariables` accepts\n * `undefined`, and the {@link MutateOptions} for that call.\n */\nexport type MutateFunctionRest<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> = undefined extends TVariables\n ? [\n variables?: TVariables,\n options?: MutateOptions<TData, TError, TVariables, TOnMutateResult>,\n ]\n : [\n variables: TVariables,\n options?: MutateOptions<TData, TError, TVariables, TOnMutateResult>,\n ]\n\n/**\n * The `mutate` function of a `MutationObserver`: runs the mutation with the given variables and\n * resolves with its data.\n */\nexport type MutateFunction<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> = (\n ...rest: MutateFunctionRest<TData, TError, TVariables, TOnMutateResult>\n) => Promise<TData>\n\n/**\n * The properties shared by every state of a mutation result, like `data`, `error`, `variables`,\n * `status`, the `is*` flags, `mutate`, and `reset`.\n */\nexport interface MutationObserverBaseResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationState<TData, TError, TVariables, TOnMutateResult> {\n /**\n * The last successfully resolved data for the mutation.\n */\n data: TData | undefined\n /**\n * The variables object passed to the `mutationFn`.\n */\n variables: TVariables | undefined\n /**\n * The error object for the mutation, if an error was encountered.\n * - Defaults to `null`.\n */\n error: TError | null\n /**\n * A boolean variable derived from `status`.\n * - `true` if the last mutation attempt resulted in an error.\n */\n isError: boolean\n /**\n * A boolean variable derived from `status`.\n * - `true` if the mutation is in its initial state prior to executing.\n */\n isIdle: boolean\n /**\n * A boolean variable derived from `status`.\n * - `true` if the mutation is currently executing.\n */\n isPending: boolean\n /**\n * A boolean variable derived from `status`.\n * - `true` if the last mutation attempt was successful.\n */\n isSuccess: boolean\n /**\n * The status of the mutation.\n * - Will be:\n * - `idle` initial status prior to the mutation function executing.\n * - `pending` if the mutation is currently executing.\n * - `error` if the last mutation attempt resulted in an error.\n * - `success` if the last mutation attempt was successful.\n */\n status: MutationStatus\n /**\n * The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options.\n * @param variables - The variables object to pass to the `mutationFn`.\n * @param options.onSuccess - This function will fire when the mutation is successful and will be passed the mutation's result.\n * @param options.onError - This function will fire if the mutation encounters an error and will be passed the error.\n * @param options.onSettled - This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error.\n * @remarks\n * - If you make multiple requests, `onSuccess` will fire only after the latest call you've made.\n * - All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored.\n */\n mutate: MutateFunction<TData, TError, TVariables, TOnMutateResult>\n /**\n * A function to clean the mutation internal state (i.e., it resets the mutation to its initial state).\n */\n reset: () => void\n}\n\n/**\n * A mutation result in the `idle` state: the mutation hasn't run yet, or was reset.\n */\nexport interface MutationObserverIdleResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n /**\n * `undefined`, since the mutation hasn't run.\n */\n data: undefined\n /**\n * `undefined`, since the mutation hasn't run.\n */\n variables: undefined\n /**\n * `null`, since the mutation hasn't failed.\n */\n error: null\n /**\n * `false`, since the mutation hasn't failed.\n */\n isError: false\n /**\n * `true`, since the mutation hasn't run yet or was reset.\n */\n isIdle: true\n /**\n * `false`, since the mutation isn't running.\n */\n isPending: false\n /**\n * `false`, since the mutation hasn't succeeded.\n */\n isSuccess: false\n /**\n * `'idle'`, since the mutation hasn't run yet or was reset.\n */\n status: 'idle'\n}\n\n/**\n * A mutation result in the `pending` state while the mutation runs.\n */\nexport interface MutationObserverLoadingResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n /**\n * `undefined`, since the mutation hasn't succeeded.\n */\n data: undefined\n /**\n * The variables passed to `mutate` for this mutation.\n */\n variables: TVariables\n /**\n * `null`, since the mutation hasn't failed.\n */\n error: null\n /**\n * `false`, since the mutation hasn't failed.\n */\n isError: false\n /**\n * `false`, since the mutation has run.\n */\n isIdle: false\n /**\n * `true`, since the mutation is running.\n */\n isPending: true\n /**\n * `false`, since the mutation hasn't succeeded.\n */\n isSuccess: false\n /**\n * `'pending'`, since the mutation is running.\n */\n status: 'pending'\n}\n\n/**\n * A mutation result in the `error` state after the mutation failed.\n */\nexport interface MutationObserverErrorResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n /**\n * `undefined`, since the mutation hasn't succeeded.\n */\n data: undefined\n /**\n * The error the mutation failed with.\n */\n error: TError\n /**\n * The variables passed to `mutate` for this mutation.\n */\n variables: TVariables\n /**\n * `true`, since the mutation failed.\n */\n isError: true\n /**\n * `false`, since the mutation has run.\n */\n isIdle: false\n /**\n * `false`, since the mutation isn't running.\n */\n isPending: false\n /**\n * `false`, since the mutation hasn't succeeded.\n */\n isSuccess: false\n /**\n * `'error'`, since the mutation failed.\n */\n status: 'error'\n}\n\n/**\n * A mutation result in the `success` state after the mutation succeeded.\n */\nexport interface MutationObserverSuccessResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n /**\n * The data the mutation resolved with.\n */\n data: TData\n /**\n * `null`, since the mutation hasn't failed.\n */\n error: null\n /**\n * The variables passed to `mutate` for this mutation.\n */\n variables: TVariables\n /**\n * `false`, since the mutation hasn't failed.\n */\n isError: false\n /**\n * `false`, since the mutation has run.\n */\n isIdle: false\n /**\n * `false`, since the mutation isn't running.\n */\n isPending: false\n /**\n * `true`, since the mutation succeeded.\n */\n isSuccess: true\n /**\n * `'success'`, since the mutation succeeded.\n */\n status: 'success'\n}\n\n/**\n * The result of a `MutationObserver`, and of the hooks built on it like `useMutation`. Narrow it by\n * `status` or the `is*` flags to get the type of each state.\n */\nexport type MutationObserverResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> =\n | MutationObserverIdleResult<TData, TError, TVariables, TOnMutateResult>\n | MutationObserverLoadingResult<TData, TError, TVariables, TOnMutateResult>\n | MutationObserverErrorResult<TData, TError, TVariables, TOnMutateResult>\n | MutationObserverSuccessResult<TData, TError, TVariables, TOnMutateResult>\n\n/**\n * The options of `new QueryClient()`: the `queryCache` and `mutationCache` to use, and the\n * `defaultOptions` for its queries and mutations.\n */\nexport interface QueryClientConfig {\n /** The query cache this client is connected to. A new `QueryCache` is created if not provided. */\n queryCache?: QueryCache\n /**\n * The mutation cache this client is connected to. A new `MutationCache` is created if not\n * provided.\n */\n mutationCache?: MutationCache\n /** Default options for all queries and mutations created through this client. */\n defaultOptions?: DefaultOptions\n}\n\n/**\n * The default options of a `QueryClient`, applied to every query (`queries`), mutation\n * (`mutations`), `hydrate`, and `dehydrate` call unless overridden.\n */\nexport interface DefaultOptions<TError = DefaultError> {\n /** Default options applied to every query, unless overridden per-query. */\n queries?: OmitKeyof<\n QueryObserverOptions<unknown, TError>,\n 'suspense' | 'queryKey'\n >\n /** Default options applied to every mutation, unless overridden per-mutation. */\n mutations?: MutationObserverOptions<unknown, TError, unknown, unknown>\n /** Default options used when hydrating queries and mutations; see {@link HydrateOptions}. */\n hydrate?: HydrateOptions['defaultOptions']\n /** Default options used when dehydrating the client's caches; see {@link DehydrateOptions}. */\n dehydrate?: DehydrateOptions\n}\n\n/**\n * Options for cancelling an in-flight fetch, e.g. via `query.cancel()`.\n * They are carried on the {@link CancelledError} that the cancelled fetch rejects with.\n */\nexport interface CancelOptions {\n /**\n * If `true`, the query goes back to the state it had before the fetch started, instead of getting\n * the cancellation error.\n */\n revert?: boolean\n /**\n * If `true`, the cancellation error isn't surfaced, e.g. because another fetch replaces the\n * cancelled one.\n */\n silent?: boolean\n}\n\n/**\n * Options for writing data into the cache, e.g. via `queryClient.setQueryData()`.\n * `updatedAt` overrides the timestamp the data is recorded with, which is what staleness is measured from;\n * omit it to use the current time.\n */\nexport interface SetDataOptions {\n /**\n * The timestamp to record the data with, instead of the current time. Staleness is measured from\n * it.\n */\n updatedAt?: number\n}\n\n/** @inline */\nexport type NotifyEventType =\n | 'added'\n | 'removed'\n | 'updated'\n | 'observerAdded'\n | 'observerRemoved'\n | 'observerResultsUpdated'\n | 'observerOptionsUpdated'\n\n/**\n * The base shape of the events that the query and mutation caches send to their listeners.\n */\nexport interface NotifyEvent {\n /**\n * The kind of event, e.g. `'added'`, `'removed'`, or `'updated'`.\n */\n type: NotifyEventType\n}\n"],"mappings":";;AAsGA,MAAa,gBAAgB,OAAO;AAKpC,MAAa,qBAAqB,OAAO;AAKzC,MAAa,cAAc,OAAO"}
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../src/types.ts"],"sourcesContent":["/* istanbul ignore file */\n\nimport type { DehydrateOptions, HydrateOptions } from './hydration'\nimport type { MutationState } from './mutation'\nimport type { MutationCache } from './mutationCache'\nimport type { FetchDirection, Query, QueryBehavior } from './query'\nimport type { QueryCache } from './queryCache'\nimport type { QueryClient } from './queryClient'\nimport type { RetryDelayValue, RetryValue } from './retryer'\nimport type { QueryFilters, QueryTypeFilter, SkipToken } from './utils'\n\n/**\n * Excludes `undefined` from `T`. Used where a value must be defined, such as the data type that a\n * defined `initialData` resolves to.\n */\nexport type NonUndefinedGuard<T> = T extends undefined ? never : T\n\n/**\n * Like `Omit`, but applied to each member of a union separately, so each member keeps its own keys.\n */\nexport type DistributiveOmit<\n TObject,\n TKey extends keyof TObject,\n> = TObject extends any ? Omit<TObject, TKey> : never\n\n/**\n * Like `Omit`, but by default (`'strictly'`) `TKey` must be a key of `TObject`, so omitting a key\n * that doesn't exist is a type error. Pass `'safely'` to allow other keys too.\n */\nexport type OmitKeyof<\n TObject,\n TKey extends (TStrictly extends 'safely'\n ?\n | keyof TObject\n | (string & Record<never, never>)\n | (number & Record<never, never>)\n | (symbol & Record<never, never>)\n : keyof TObject),\n TStrictly extends 'strictly' | 'safely' = 'strictly',\n> = Omit<TObject, TKey>\n\n/**\n * Replaces the types of the properties of `TTargetA` that also exist in `TTargetB` with their types\n * in `TTargetB`. Properties that only exist in `TTargetB` are not added.\n */\nexport type Override<TTargetA, TTargetB> = {\n [AKey in keyof TTargetA]: AKey extends keyof TTargetB\n ? TTargetB[AKey]\n : TTargetA[AKey]\n}\n\n/**\n * The interface to augment via declaration merging to override Query's default types repository-wide.\n * Each field it declares replaces the default of the matching type: `defaultError` for {@link DefaultError},\n * `queryKey` for {@link QueryKey}, `mutationKey` for {@link MutationKey}, `queryMeta` for {@link QueryMeta} and\n * `mutationMeta` for {@link MutationMeta}. Leave a field out to keep that type's default.\n * Augment the module you install — `@tanstack/react-query`, `@tanstack/vue-query`,\n * `@tanstack/solid-query`, `@tanstack/svelte-query`, `@tanstack/preact-query`,\n * `@tanstack/angular-query-experimental` or `@tanstack/lit-query`. Augmenting `@tanstack/query-core`\n * works too and covers every adapter at once.\n * @example\n * ```ts\n * // Use the module you installed — here, the React adapter.\n * declare module '@tanstack/react-query' {\n * interface Register {\n * defaultError: AxiosError\n * }\n * }\n * ```\n */\nexport interface Register {\n // defaultError: Error\n // queryMeta: Record<string, unknown>\n // mutationMeta: Record<string, unknown>\n // queryKey: ReadonlyArray<unknown>\n // mutationKey: ReadonlyArray<unknown>\n}\n\n/**\n * The error type used wherever an error is not given an explicit type parameter.\n * Defaults to `Error`; declare `defaultError` on {@link Register} to change it everywhere at once.\n */\nexport type DefaultError = Register extends {\n defaultError: infer TError\n}\n ? TError\n : Error\n\n/**\n * The type of a query key — the serializable array that identifies a query in the cache.\n * Defaults to `ReadonlyArray<unknown>`; declare `queryKey` on {@link Register} to narrow it repository-wide.\n */\nexport type QueryKey = Register extends {\n queryKey: infer TQueryKey\n}\n ? TQueryKey extends ReadonlyArray<unknown>\n ? TQueryKey\n : TQueryKey extends Array<unknown>\n ? TQueryKey\n : ReadonlyArray<unknown>\n : ReadonlyArray<unknown>\n\nexport const dataTagSymbol = Symbol()\n/**\n * The type of the `dataTagSymbol` key, under which a {@link DataTag} stores its data type.\n */\nexport type dataTagSymbol = typeof dataTagSymbol\nexport const dataTagErrorSymbol = Symbol()\n/**\n * The type of the `dataTagErrorSymbol` key, under which a {@link DataTag} stores its error type.\n */\nexport type dataTagErrorSymbol = typeof dataTagErrorSymbol\nexport const unsetMarker = Symbol()\n/**\n * The type of `unsetMarker`, the default error type of a {@link DataTag}. It marks that no error\n * type was tagged.\n */\nexport type UnsetMarker = typeof unsetMarker\n/**\n * Matches any type that has been tagged with {@link DataTag}, whatever its data and error types.\n */\nexport type AnyDataTag = {\n /**\n * The data type the key was tagged with.\n */\n [dataTagSymbol]: any\n /**\n * The error type the key was tagged with.\n */\n [dataTagErrorSymbol]: any\n}\n/**\n * Tags `TType` (usually a query key) with a data type and an optional error type, so that APIs that\n * receive it, like `queryClient.getQueryData`, can infer them. A type that is already tagged is\n * returned as is.\n */\nexport type DataTag<\n TType,\n TValue,\n TError = UnsetMarker,\n> = TType extends AnyDataTag\n ? TType\n : TType & {\n [dataTagSymbol]: TValue\n [dataTagErrorSymbol]: TError\n }\n\n/**\n * An object whose `queryKey` is tagged with {@link DataTag}, like the options returned by\n * `queryOptions`.\n */\nexport type QueryKeyWithDataTag<\n TQueryKey extends QueryKey = QueryKey,\n TQueryFnData = unknown,\n TError = DefaultError,\n> = {\n /**\n * The query key, tagged with the query's data and error types.\n */\n queryKey: DataTag<TQueryKey, TQueryFnData, TError>\n}\n\n/**\n * The data type tagged on a query key by {@link DataTag}, or `TQueryFnData` if the key is not\n * tagged.\n */\nexport type InferDataFromTag<TQueryFnData, TTaggedQueryKey extends QueryKey> =\n TTaggedQueryKey extends DataTag<unknown, infer TaggedValue, unknown>\n ? TaggedValue\n : TQueryFnData\n\n/**\n * The error type tagged on a query key by {@link DataTag}, or `TError` if the key is not tagged or\n * was tagged without an error type.\n */\nexport type InferErrorFromTag<TError, TTaggedQueryKey extends QueryKey> =\n TTaggedQueryKey extends DataTag<unknown, unknown, infer TaggedError>\n ? TaggedError extends UnsetMarker\n ? TError\n : TaggedError\n : TError\n\n/** @inline */\nexport type QueryFunction<\n T = unknown,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> = (context: QueryFunctionContext<TQueryKey, TPageParam>) => T | Promise<T>\n\n/** @inline */\nexport type StaleTime = number | 'static'\n\n/** @inline */\nexport type StaleTimeFunction<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> =\n | StaleTime\n | ((query: Query<TQueryFnData, TError, TData, TQueryKey>) => StaleTime)\n\n/** @inline */\nexport type QueryBooleanOption<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> =\n | boolean\n | ((query: Query<TQueryFnData, TError, TData, TQueryKey>) => boolean)\n\n/** @inline */\nexport type QueryPersister<\n T = unknown,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> = [TPageParam] extends [never]\n ? (\n queryFn: QueryFunction<T, TQueryKey, never>,\n context: QueryFunctionContext<TQueryKey>,\n query: Query,\n ) => T | Promise<T>\n : (\n queryFn: QueryFunction<T, TQueryKey, TPageParam>,\n context: QueryFunctionContext<TQueryKey>,\n query: Query,\n ) => T | Promise<T>\n\n/**\n * The object passed to `queryFn`: the `QueryClient`, the `queryKey`, an `AbortSignal` that aborts\n * when the query is cancelled, the query's `meta`, and for infinite queries the `pageParam` of the\n * page being fetched.\n */\nexport type QueryFunctionContext<\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> = [TPageParam] extends [never]\n ? {\n client: QueryClient\n queryKey: TQueryKey\n signal: AbortSignal\n meta: QueryMeta | undefined\n pageParam?: unknown\n /**\n * @deprecated\n * if you want access to the direction, you can add it to the pageParam\n */\n direction?: unknown\n }\n : {\n client: QueryClient\n queryKey: TQueryKey\n signal: AbortSignal\n pageParam: TPageParam\n /**\n * @deprecated\n * if you want access to the direction, you can add it to the pageParam\n */\n direction: FetchDirection\n meta: QueryMeta | undefined\n }\n\n/** @inline */\nexport type InitialDataFunction<T> = () => T | undefined\n\n// oxlint-disable-next-line typescript/no-unsafe-function-type -- excludes every function-like value, including constructors, from the value branch\ntype NonFunctionGuard<T> = T extends Function ? never : T\n\n/** @inline */\nexport type PlaceholderDataFunction<\n TQueryFnData = unknown,\n TError = DefaultError,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = (\n previousData: TQueryData | undefined,\n previousQuery: Query<TQueryFnData, TError, TQueryData, TQueryKey> | undefined,\n) => TQueryData | undefined\n\n/**\n * The `placeholderData` function of a query in `useQueries` and its counterparts. Unlike\n * {@link PlaceholderDataFunction}, it receives no previous data or query, because the number of\n * queries can differ between renders.\n */\nexport type QueriesPlaceholderDataFunction<TQueryData> = (\n previousData: undefined,\n previousQuery: undefined,\n) => TQueryData | undefined\n\n/** @inline */\nexport type QueryKeyHashFunction<TQueryKey extends QueryKey> = (\n queryKey: TQueryKey,\n) => string\n\n/** @inline */\nexport type GetPreviousPageParamFunction<TPageParam, TQueryFnData = unknown> = (\n firstPage: TQueryFnData,\n allPages: Array<TQueryFnData>,\n firstPageParam: TPageParam,\n allPageParams: Array<TPageParam>,\n) => TPageParam | undefined | null\n\n/** @inline */\nexport type GetNextPageParamFunction<TPageParam, TQueryFnData = unknown> = (\n lastPage: TQueryFnData,\n allPages: Array<TQueryFnData>,\n lastPageParam: TPageParam,\n allPageParams: Array<TPageParam>,\n) => TPageParam | undefined | null\n\n/**\n * The data shape of an infinite query: every page fetched so far, plus the page param each one was fetched with.\n * `pages` and `pageParams` are index-aligned — `pageParams[i]` is the param that produced `pages[i]`.\n */\nexport interface InfiniteData<TData, TPageParam = unknown> {\n /**\n * The data of every page fetched so far, in order.\n */\n pages: Array<TData>\n /**\n * The page param each page was fetched with, aligned by index with `pages`.\n */\n pageParams: Array<TPageParam>\n}\n\n/**\n * The type of the `meta` object that can be attached to a query and read back from `queryFn`, callbacks and\n * cache-level handlers. Defaults to `Record<string, unknown>`; declare `queryMeta` on {@link Register} to narrow it.\n */\nexport type QueryMeta = Register extends {\n queryMeta: infer TQueryMeta\n}\n ? TQueryMeta extends Record<string, unknown>\n ? TQueryMeta\n : Record<string, unknown>\n : Record<string, unknown>\n\n/** @inline */\nexport type NetworkMode = 'online' | 'always' | 'offlineFirst'\n\n/** @inline */\nexport type NotifyOnChangeProps =\n | Array<keyof InfiniteQueryObserverResult>\n | 'all'\n | undefined\n | (() => Array<keyof InfiniteQueryObserverResult> | 'all' | undefined)\n\n/**\n * The options of a query itself — its `queryKey`, `queryFn`, retries, `gcTime`, `initialData`,\n * `meta`, and so on — shared by observers and the `QueryClient` methods that fetch queries.\n */\nexport interface QueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> {\n /**\n * If `false`, failed queries will not retry by default.\n * If `true`, failed queries will retry infinitely.\n * If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number.\n * If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false.\n *\n * Defaults to `3` on the client and `0` on the server.\n */\n retry?: RetryValue<TError>\n /**\n * This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the\n * next attempt in milliseconds.\n *\n * A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential\n * backoff.\n *\n * A function like `attempt => attempt * 1000` applies linear backoff.\n *\n * Defaults to a function that applies exponential backoff, capped at 30 seconds.\n */\n retryDelay?: RetryDelayValue<TError>\n /**\n * Controls whether a query is allowed to run based on the current network connectivity.\n * @defaultValue 'online'\n * @see [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information.\n */\n networkMode?: NetworkMode\n /**\n * The time in milliseconds that unused/inactive cache data remains in memory.\n * When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration.\n * When different garbage collection times are specified, the longest one will be used.\n * Setting it to `Infinity` will disable garbage collection.\n *\n * Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR.\n *\n * Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay — see\n * `timeoutManager.setTimeoutProvider` for a workaround.\n */\n gcTime?: number\n /**\n * The function that the query will use to request data.\n * Required, unless a default query function has been set via `queryClient.setQueryDefaults` or\n * `queryClient.setDefaultOptions`.\n * Receives a {@link QueryFunctionContext}.\n * Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`.\n */\n queryFn?: QueryFunction<TQueryFnData, TQueryKey, TPageParam> | SkipToken\n /**\n * This option can be used to persist the result of a query to an external storage, bypassing the need to actually\n * call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries.\n */\n persister?: QueryPersister<TQueryFnData, NoInfer<TQueryKey>, TPageParam>\n /**\n * The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used\n * as the actual cache key internally.\n */\n queryHash?: string\n /**\n * The query key to use for this query.\n *\n * The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys)\n * for more information.\n *\n * The query will automatically update when this key changes (as long as `enabled` is not set to `false`).\n */\n queryKey?: TQueryKey\n /**\n * If specified, this function is used to hash the `queryKey` to a string.\n */\n queryKeyHashFn?: QueryKeyHashFunction<TQueryKey>\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).\n * If set to a function, the function will be called **once** during the shared/root query initialization, and be\n * expected to synchronously return the initial data.\n * Initial data is considered stale by default unless a `staleTime` has been set.\n * `initialData` **is persisted** to the cache.\n */\n initialData?: TData | InitialDataFunction<TData>\n /**\n * If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated.\n */\n initialDataUpdatedAt?: number | (() => number | undefined)\n /** @internal */\n behavior?: QueryBehavior<TQueryFnData, TError, TData, TQueryKey>\n /**\n * Set this to `false` to disable structural sharing between query results.\n * Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic.\n * @defaultValue true\n */\n structuralSharing?:\n | boolean\n | ((oldData: unknown | undefined, newData: unknown) => unknown)\n /** @internal */\n _defaulted?: boolean\n /** @internal */\n _type?: 'infinite'\n /**\n * Additional payload to be stored on each query.\n * Use this property to pass information that can be used in other places.\n */\n meta?: QueryMeta\n /**\n * Maximum number of pages to store in the data of an infinite query.\n */\n maxPages?: number\n}\n\n/**\n * Holds the `initialPageParam` option that every infinite query requires.\n */\nexport interface InitialPageParam<TPageParam = unknown> {\n /**\n * The page param to start from when an infinite query has no pages yet.\n * It is passed to `queryFn` as `pageParam` for the first page; every page after that gets the\n * value returned by `getNextPageParam` or `getPreviousPageParam`.\n * It only applies while the query has no pages: once a first page exists, refetching starts from\n * that page's own param instead.\n */\n initialPageParam: TPageParam\n}\n\n/**\n * The page param options of an infinite query: `initialPageParam`, and the `getNextPageParam` and\n * `getPreviousPageParam` functions that compute the params of the pages around it.\n */\nexport interface InfiniteQueryPageParamsOptions<\n TQueryFnData = unknown,\n TPageParam = unknown,\n> extends InitialPageParam<TPageParam> {\n /**\n * This function can be set to automatically get the previous cursor for infinite queries.\n * The result will also be used to determine the value of `hasPreviousPage`.\n */\n getPreviousPageParam?: GetPreviousPageParamFunction<TPageParam, TQueryFnData>\n /**\n * This function can be set to automatically get the next cursor for infinite queries.\n * The result will also be used to determine the value of `hasNextPage`.\n */\n getNextPageParam: GetNextPageParamFunction<TPageParam, TQueryFnData>\n}\n\n/** @inline */\nexport type ThrowOnError<\n TQueryFnData,\n TError,\n TQueryData,\n TQueryKey extends QueryKey,\n> =\n | boolean\n | ((\n error: TError,\n query: Query<TQueryFnData, TError, TQueryData, TQueryKey>,\n ) => boolean)\n\n/**\n * The options of a `QueryObserver`, and of the hooks built on it like `useQuery`: the\n * {@link QueryOptions} of the query, plus options that control the observer, such as `enabled`,\n * `staleTime`, `refetchInterval`, `select`, and `placeholderData`.\n */\nexport interface QueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> extends WithRequired<\n QueryOptions<TQueryFnData, TError, TQueryData, TQueryKey, TPageParam>,\n 'queryKey'\n> {\n /**\n * Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys.\n * To refetch the query, use the `refetch` method returned from the `useQuery` instance.\n * Accepts a boolean or function that returns a boolean.\n * @defaultValue true\n */\n enabled?: QueryBooleanOption<TQueryFnData, TError, TQueryData, TQueryKey>\n /**\n * The time in milliseconds after data is considered stale.\n * If set to `Infinity`, the data will never be considered stale.\n * If set to `'static'`, the data will never be considered stale.\n * If set to a function, the function will be executed with the query to compute a `staleTime`.\n * @defaultValue 0\n */\n staleTime?: StaleTimeFunction<TQueryFnData, TError, TQueryData, TQueryKey>\n /**\n * If set to a number, the query will continuously refetch at this frequency in milliseconds.\n * If set to a function, the function will be executed with the latest data and query to compute a frequency\n * @defaultValue false\n */\n refetchInterval?:\n | number\n | false\n | ((\n query: Query<TQueryFnData, TError, TQueryData, TQueryKey>,\n ) => number | false | undefined)\n /**\n * If set to `true`, the query will continue to refetch while their tab/window is in the background.\n * @defaultValue false\n */\n refetchIntervalInBackground?: boolean\n /**\n * If set to `true`, the query will refetch on window focus if the data is stale.\n * If set to `false`, the query will not refetch on window focus.\n * If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used).\n * If set to a function, the function will be executed with the latest data and query to compute the value.\n * @defaultValue true\n */\n refetchOnWindowFocus?:\n | boolean\n | 'always'\n | ((\n query: Query<TQueryFnData, TError, TQueryData, TQueryKey>,\n ) => boolean | 'always')\n /**\n * If set to `true`, the query will refetch on reconnect if the data is stale.\n * If set to `false`, the query will not refetch on reconnect.\n * If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used).\n * If set to a function, the function will be executed with the latest data and query to compute the value.\n *\n * Defaults to `true` unless `networkMode` is `'always'`.\n */\n refetchOnReconnect?:\n | boolean\n | 'always'\n | ((\n query: Query<TQueryFnData, TError, TQueryData, TQueryKey>,\n ) => boolean | 'always')\n /**\n * If set to `true`, the query will refetch on mount if the data is stale.\n * If set to `false`, will disable additional instances of a query to trigger background refetch.\n * If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used).\n * If set to a function, the function will be executed with the latest data and query to compute the value\n * @defaultValue true\n */\n refetchOnMount?:\n | boolean\n | 'always'\n | ((\n query: Query<TQueryFnData, TError, TQueryData, TQueryKey>,\n ) => boolean | 'always')\n /**\n * If set to `false`, the query will not be retried on mount if it contains an error.\n * If set to a function, the function will be executed with the query to compute the value.\n * @defaultValue true\n */\n retryOnMount?: QueryBooleanOption<TQueryFnData, TError, TQueryData, TQueryKey>\n /**\n * If set, the component will only re-render if any of the listed properties change.\n * When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change.\n * When set to `'all'`, the component will re-render whenever a query is updated.\n * When set to a function, the function will be executed to compute the list of properties.\n *\n * Defaults to `undefined`, in which case property access is tracked automatically, and the\n * component only re-renders when one of the tracked properties changes.\n */\n notifyOnChangeProps?: NotifyOnChangeProps\n /**\n * Whether errors should be thrown instead of setting the `error` property.\n * If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary.\n * If set to `false` and `suspense` is `false`, errors are returned as state.\n * If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`).\n * @defaultValue false\n */\n throwOnError?: ThrowOnError<TQueryFnData, TError, TQueryData, TQueryKey>\n /**\n * This option can be used to transform or select a part of the data returned by the query function. It affects\n * the returned `data` value, but does not affect what gets stored in the query cache.\n * The `select` function will only run if `data` changed, or if the reference to the `select` function itself\n * changes. To optimize, memoize the function so its reference stays stable across calls.\n */\n select?: (data: TQueryData) => TData\n /**\n * If set to `true`, the query will suspend when `status === 'pending'`\n * and throw errors when `status === 'error'`.\n * @defaultValue false\n */\n suspense?: boolean\n /**\n * If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided.\n */\n placeholderData?:\n | NonFunctionGuard<TQueryData>\n | PlaceholderDataFunction<\n NonFunctionGuard<TQueryData>,\n TError,\n NonFunctionGuard<TQueryData>,\n TQueryKey\n >\n\n /** @internal */\n _optimisticResults?: 'optimistic' | 'isRestoring'\n}\n\n/**\n * Makes the `TKey` properties of `TTarget` required and non-nullable.\n */\nexport type WithRequired<TTarget, TKey extends keyof TTarget> = TTarget & {\n [_ in TKey]: {}\n}\n\n/**\n * The {@link QueryObserverOptions} after `QueryClient#defaultQueryOptions` has applied the\n * defaults, so `throwOnError`, `refetchOnReconnect`, and `queryHash` are always set.\n */\nexport type DefaultedQueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = WithRequired<\n QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>,\n 'throwOnError' | 'refetchOnReconnect' | 'queryHash'\n>\n\n/**\n * The options of an `InfiniteQueryObserver`: {@link QueryObserverOptions} whose query data is\n * {@link InfiniteData}, plus the page param options.\n */\nexport interface InfiniteQueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>\n extends\n QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n InfiniteData<TQueryFnData, TPageParam>,\n TQueryKey,\n TPageParam\n >,\n InfiniteQueryPageParamsOptions<TQueryFnData, TPageParam> {}\n\n/**\n * The {@link InfiniteQueryObserverOptions} after `QueryClient#defaultQueryOptions` has applied the\n * defaults, so `throwOnError`, `refetchOnReconnect`, and `queryHash` are always set.\n */\nexport type DefaultedInfiniteQueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = WithRequired<\n InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n 'throwOnError' | 'refetchOnReconnect' | 'queryHash'\n>\n\n/**\n * The options of `queryClient.query`: the {@link QueryOptions} of the query, plus a `staleTime`\n * that decides whether cached data is returned instead of fetching, and a `select` that only\n * transforms the value the call resolves with.\n */\nexport interface QueryExecuteOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> extends WithRequired<\n QueryOptions<TQueryFnData, TError, TQueryData, TQueryKey, TPageParam>,\n 'queryKey'\n> {\n /**\n * Not allowed here, since `initialPageParam` only applies to infinite queries.\n */\n initialPageParam?: never\n /**\n * This option can be used to transform or select a part of the data returned by the query function. It affects\n * the value this call resolves with, but does not affect what gets stored in the query cache.\n */\n select?: (data: TQueryData) => TData\n /**\n * The time in milliseconds after data is considered stale.\n * If the data is fresh it will be returned from the cache.\n */\n staleTime?: StaleTimeFunction<TQueryFnData, TError, TQueryData, TQueryKey>\n}\n\n/** @deprecated */\nexport interface FetchQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> extends WithRequired<\n QueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>,\n 'queryKey'\n> {\n /**\n * Not allowed here, since `initialPageParam` only applies to infinite queries.\n */\n initialPageParam?: never\n /**\n * The time in milliseconds after data is considered stale.\n * If the data is fresh it will be returned from the cache.\n */\n staleTime?: StaleTimeFunction<TQueryFnData, TError, TData, TQueryKey>\n}\n\n/** @deprecated */\nexport interface EnsureQueryDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> extends FetchQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> {\n /**\n * If `true`, stale cached data is returned and also refetched in the background.\n */\n revalidateIfStale?: boolean\n}\n\n/** @deprecated */\nexport type EnsureInfiniteQueryDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n revalidateIfStale?: boolean\n}\n\ntype InfiniteQueryPages<TQueryFnData = unknown, TPageParam = unknown> =\n | { pages?: never }\n | {\n pages: number\n getNextPageParam: GetNextPageParamFunction<TPageParam, TQueryFnData>\n }\n\n/**\n * The options of `queryClient.infiniteQuery`: like {@link QueryExecuteOptions}, with the\n * `initialPageParam`, and optionally `pages` together with `getNextPageParam` to fetch that many\n * pages at once.\n */\nexport type InfiniteQueryExecuteOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = Omit<\n QueryExecuteOptions<\n TQueryFnData,\n TError,\n TData,\n InfiniteData<TQueryFnData, TPageParam>,\n TQueryKey,\n TPageParam\n >,\n 'initialPageParam'\n> &\n InitialPageParam<TPageParam> &\n InfiniteQueryPages<TQueryFnData, TPageParam>\n\n/** @deprecated */\nexport type FetchInfiniteQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = Omit<\n FetchQueryOptions<\n TQueryFnData,\n TError,\n InfiniteData<TData, TPageParam>,\n TQueryKey,\n TPageParam\n >,\n 'initialPageParam'\n> &\n InitialPageParam<TPageParam> &\n InfiniteQueryPages<TQueryFnData, TPageParam>\n\n/**\n * Options shared by the `QueryClient` and observer methods that refetch queries, controlling\n * whether a failed refetch makes the returned promise reject.\n */\nexport interface ResultOptions {\n /**\n * If set to `true`, the method throws if any of the underlying query refetch tasks fail.\n * If set to `false`, failed refetches are swallowed and not surfaced to the caller.\n * @defaultValue false\n */\n throwOnError?: boolean\n}\n\n/**\n * Options of the methods that refetch queries, like `refetch` and `queryClient.refetchQueries`.\n */\nexport interface RefetchOptions extends ResultOptions {\n /**\n * If set to `true`, a currently running request will be cancelled before a new request is made\n *\n * If set to `false`, no refetch will be made if there is already a request running.\n * @defaultValue true\n */\n cancelRefetch?: boolean\n}\n\n/**\n * The filters of `queryClient.invalidateQueries`: the {@link QueryFilters} that select the queries\n * to invalidate, plus `refetchType` to choose which of them are refetched.\n */\nexport interface InvalidateQueryFilters<\n TQueryKey extends QueryKey = QueryKey,\n> extends QueryFilters<TQueryKey> {\n /**\n * Controls which of the matched (now-invalidated) queries are refetched in the background.\n *\n * - `'active'`: only queries with at least one active observer are refetched.\n * - `'inactive'`: only queries with no active observer are refetched.\n * - `'all'`: every matched query is refetched, active or not.\n * - `'none'`: no query is refetched; matched queries are only marked as invalidated.\n * @defaultValue 'active'\n */\n refetchType?: QueryTypeFilter | 'none'\n}\n\n/**\n * The filters of `queryClient.refetchQueries`, which select the queries to refetch.\n */\nexport interface RefetchQueryFilters<\n TQueryKey extends QueryKey = QueryKey,\n> extends QueryFilters<TQueryKey> {}\n\n/**\n * Options of `queryClient.invalidateQueries`, applied to the refetch that follows the invalidation.\n */\nexport interface InvalidateOptions extends RefetchOptions {}\n/**\n * Options of `queryClient.resetQueries`, applied to the refetch of the active queries after the\n * reset.\n */\nexport interface ResetOptions extends RefetchOptions {}\n\n/**\n * Options of `fetchNextPage` on an infinite query result.\n */\nexport interface FetchNextPageOptions extends ResultOptions {\n /**\n * If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time,\n * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored.\n *\n * If set to `false`, calling `fetchNextPage` repeatedly won't have any effect until the first invocation has resolved.\n * @defaultValue true\n */\n cancelRefetch?: boolean\n}\n\n/**\n * Options of `fetchPreviousPage` on an infinite query result.\n */\nexport interface FetchPreviousPageOptions extends ResultOptions {\n /**\n * If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time,\n * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored.\n *\n * If set to `false`, calling `fetchPreviousPage` repeatedly won't have any effect until the first invocation has resolved.\n * @defaultValue true\n */\n cancelRefetch?: boolean\n}\n\n/** @inline */\nexport type QueryStatus = 'pending' | 'error' | 'success'\n/** @inline */\nexport type FetchStatus = 'fetching' | 'paused' | 'idle'\n\n/**\n * The properties shared by every state of a query result, like `data`, `error`, `status`, the\n * `is*` flags, and `refetch`. Each `QueryObserver*Result` narrows them for one state.\n */\nexport interface QueryObserverBaseResult<\n TData = unknown,\n TError = DefaultError,\n> {\n /**\n * The last successfully resolved data for the query.\n */\n data: TData | undefined\n /**\n * The timestamp for when the query most recently returned the `status` as `\"success\"`.\n */\n dataUpdatedAt: number\n /**\n * The error object for the query, if an error was thrown.\n * - Defaults to `null`.\n */\n error: TError | null\n /**\n * The timestamp for when the query most recently returned the `status` as `\"error\"`.\n */\n errorUpdatedAt: number\n /**\n * The failure count for the query.\n * - Incremented every time the query fails.\n * - Reset to `0` when the query succeeds.\n */\n failureCount: number\n /**\n * The failure reason for the query retry.\n * - Reset to `null` when the query succeeds.\n */\n failureReason: TError | null\n /**\n * The sum of all errors.\n */\n errorUpdateCount: number\n /**\n * A derived boolean from the `status` variable, provided for convenience.\n * - `true` if the query has an error from a fetch that failed after its retries, or if `select` threw.\n */\n isError: boolean\n /**\n * Will be `true` if the query has been fetched.\n */\n isFetched: boolean\n /**\n * Will be `true` if the query has been fetched after the component mounted.\n * - This property can be used to not show any previously cached data.\n */\n isFetchedAfterMount: boolean\n /**\n * A derived boolean from the `fetchStatus` variable, provided for convenience.\n * - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch.\n */\n isFetching: boolean\n /**\n * Is `true` whenever the first fetch for a query is in-flight.\n * - Is the same as `isFetching && isPending`.\n */\n isLoading: boolean\n /**\n * Will be `true` if the query has no cached data, no data from `placeholderData` and no error.\n */\n isPending: boolean\n /**\n * Will be `true` if the query has an error and no data to display.\n */\n isLoadingError: boolean\n /**\n * @deprecated `isInitialLoading` is being deprecated in favor of `isLoading`\n * and will be removed in the next major version.\n */\n isInitialLoading: boolean\n /**\n * A derived boolean from the `fetchStatus` variable, provided for convenience.\n * - The query wanted to fetch, but has been `paused`.\n */\n isPaused: boolean\n /**\n * Will be `true` if the data shown is the placeholder data.\n */\n isPlaceholderData: boolean\n /**\n * Will be `true` if the query has an error and still has data to display (for infinite queries, not after a failed page fetch).\n */\n isRefetchError: boolean\n /**\n * Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`.\n * - Is the same as `isFetching && !isPending`.\n */\n isRefetching: boolean\n /**\n * Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`.\n */\n isStale: boolean\n /**\n * A derived boolean from the `status` variable, provided for convenience.\n * - `true` if the query has cached data or data from `placeholderData`, and no error.\n */\n isSuccess: boolean\n /**\n * `true` if this observer is enabled, `false` otherwise.\n */\n isEnabled: boolean\n /**\n * A function to manually refetch the query.\n */\n refetch: (\n options?: RefetchOptions,\n ) => Promise<QueryObserverResult<TData, TError>>\n /**\n * The status of the query.\n * - Will be:\n * - `error` if the query has an error from a fetch that failed after its retries, or if `select` threw.\n * - `success` if the query has cached data (even if `select` returns `undefined`) or data from `placeholderData`, and no error.\n * - `pending` otherwise, since the query has no cached data, no data from `placeholderData` and no error.\n */\n status: QueryStatus\n /**\n * The fetch status of the query.\n * - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch.\n * - `paused`: The query wanted to fetch, but has been `paused`.\n * - `idle`: The query is not fetching.\n * - See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information.\n */\n fetchStatus: FetchStatus\n}\n\n/**\n * A query result in the `pending` state: the query has no data yet.\n */\nexport interface QueryObserverPendingResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult<TData, TError> {\n /**\n * `undefined`, since the query has no data yet.\n */\n data: undefined\n /**\n * `null`, since the query isn't in the `error` state.\n */\n error: null\n /**\n * `false`, since the query isn't in the `error` state.\n */\n isError: false\n /**\n * `true`, since the query has no cached data, no data from `placeholderData` and no error.\n */\n isPending: true\n /**\n * `false`, since the query didn't fail while fetching for the first time.\n */\n isLoadingError: false\n /**\n * `false`, since the query didn't fail while refetching.\n */\n isRefetchError: false\n /**\n * `false`, since the query isn't in the `success` state.\n */\n isSuccess: false\n /**\n * `false`, since the data shown isn't the `placeholderData`.\n */\n isPlaceholderData: false\n /**\n * `'pending'`, since the query has no cached data, no data from `placeholderData` and no error.\n */\n status: 'pending'\n}\n\n/**\n * A query result in the `pending` state while the first fetch is in flight, so `isLoading` is\n * `true`.\n */\nexport interface QueryObserverLoadingResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult<TData, TError> {\n /**\n * `undefined`, since the query has no data yet.\n */\n data: undefined\n /**\n * `null`, since the query isn't in the `error` state.\n */\n error: null\n /**\n * `false`, since the query isn't in the `error` state.\n */\n isError: false\n /**\n * `true`, since the query has no cached data, no data from `placeholderData` and no error.\n */\n isPending: true\n /**\n * `true`, since the first fetch is in flight.\n */\n isLoading: true\n /**\n * `false`, since the query didn't fail while fetching for the first time.\n */\n isLoadingError: false\n /**\n * `false`, since the query didn't fail while refetching.\n */\n isRefetchError: false\n /**\n * `false`, since the query isn't in the `success` state.\n */\n isSuccess: false\n /**\n * `false`, since the data shown isn't the `placeholderData`.\n */\n isPlaceholderData: false\n /**\n * `'pending'`, since the query has no cached data, no data from `placeholderData` and no error.\n */\n status: 'pending'\n}\n\n/**\n * A query result in the `error` state with no data to display, since a fetch or `select` failed.\n */\nexport interface QueryObserverLoadingErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult<TData, TError> {\n /**\n * `undefined`, since there was no data to display when a fetch or `select` failed.\n */\n data: undefined\n /**\n * The error the fetch or `select` failed with.\n */\n error: TError\n /**\n * `true`, since the query is in the `error` state.\n */\n isError: true\n /**\n * `false`, since the query has cached data, data from `placeholderData` or an error.\n */\n isPending: false\n /**\n * `false`, since the first fetch isn't in flight.\n */\n isLoading: false\n /**\n * `true`, since the query has an error and no data to display.\n */\n isLoadingError: true\n /**\n * `false`, since the query didn't fail while refetching.\n */\n isRefetchError: false\n /**\n * `false`, since the query isn't in the `success` state.\n */\n isSuccess: false\n /**\n * `false`, since the data shown isn't the `placeholderData`.\n */\n isPlaceholderData: false\n /**\n * `'error'`, since a fetch failed after its retries or `select` threw.\n */\n status: 'error'\n}\n\n/**\n * A query result in the `error` state that keeps the data from before a fetch or `select` failed.\n */\nexport interface QueryObserverRefetchErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult<TData, TError> {\n /**\n * The data from before the fetch or `select` failed, which is kept.\n */\n data: TData\n /**\n * The error the fetch or `select` failed with.\n */\n error: TError\n /**\n * `true`, since the query is in the `error` state.\n */\n isError: true\n /**\n * `false`, since the query has cached data, data from `placeholderData` or an error.\n */\n isPending: false\n /**\n * `false`, since the first fetch isn't in flight.\n */\n isLoading: false\n /**\n * `false`, since the query didn't fail while fetching for the first time.\n */\n isLoadingError: false\n /**\n * `true`, since the query has an error and still has data to display.\n */\n isRefetchError: true\n /**\n * `false`, since the query isn't in the `success` state.\n */\n isSuccess: false\n /**\n * `false`, since the data shown isn't the `placeholderData`.\n */\n isPlaceholderData: false\n /**\n * `'error'`, since a fetch failed after its retries or `select` threw.\n */\n status: 'error'\n}\n\n/**\n * A query result in the `success` state with data from the cache.\n */\nexport interface QueryObserverSuccessResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult<TData, TError> {\n /**\n * The last successfully resolved data for the query.\n */\n data: TData\n /**\n * `null`, since the query isn't in the `error` state.\n */\n error: null\n /**\n * `false`, since the query isn't in the `error` state.\n */\n isError: false\n /**\n * `false`, since the query has cached data, data from `placeholderData` or an error.\n */\n isPending: false\n /**\n * `false`, since the first fetch isn't in flight.\n */\n isLoading: false\n /**\n * `false`, since the query didn't fail while fetching for the first time.\n */\n isLoadingError: false\n /**\n * `false`, since the query didn't fail while refetching.\n */\n isRefetchError: false\n /**\n * `true`, since the query is in the `success` state.\n */\n isSuccess: true\n /**\n * `false`, since the data shown isn't the `placeholderData`.\n */\n isPlaceholderData: false\n /**\n * `'success'`, since the query has cached data and no error from a fetch or from\n * `select`.\n */\n status: 'success'\n}\n\n/**\n * A query result in the `success` state that shows `placeholderData` while the query has no data\n * yet.\n */\nexport interface QueryObserverPlaceholderResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult<TData, TError> {\n /**\n * The `placeholderData` shown while the query has no data yet.\n */\n data: TData\n /**\n * `false`, since the query isn't in the `error` state.\n */\n isError: false\n /**\n * `null`, since the query isn't in the `error` state.\n */\n error: null\n /**\n * `false`, since the query has cached data, data from `placeholderData` or an error.\n */\n isPending: false\n /**\n * `false`, since the first fetch isn't in flight.\n */\n isLoading: false\n /**\n * `false`, since the query didn't fail while fetching for the first time.\n */\n isLoadingError: false\n /**\n * `false`, since the query didn't fail while refetching.\n */\n isRefetchError: false\n /**\n * `true`, since the query is in the `success` state.\n */\n isSuccess: true\n /**\n * `true`, since the data shown is the `placeholderData`.\n */\n isPlaceholderData: true\n /**\n * `'success'`, since the query shows `placeholderData` and has no error from a fetch or\n * from `select`.\n */\n status: 'success'\n}\n\n/**\n * A query result that always has `data`: the success and refetch error states.\n */\nexport type DefinedQueryObserverResult<\n TData = unknown,\n TError = DefaultError,\n> =\n | QueryObserverRefetchErrorResult<TData, TError>\n | QueryObserverSuccessResult<TData, TError>\n\n/**\n * The result of a `QueryObserver`, and of the hooks built on it like `useQuery`. Narrow it by\n * `status` or the `is*` flags to get the type of each state.\n */\nexport type QueryObserverResult<TData = unknown, TError = DefaultError> =\n | DefinedQueryObserverResult<TData, TError>\n | QueryObserverLoadingErrorResult<TData, TError>\n | QueryObserverLoadingResult<TData, TError>\n | QueryObserverPendingResult<TData, TError>\n | QueryObserverPlaceholderResult<TData, TError>\n\n/**\n * The properties shared by every state of an infinite query result: those of\n * {@link QueryObserverBaseResult}, plus `fetchNextPage`, `fetchPreviousPage`, and the flags about\n * them, like `hasNextPage` and `isFetchingNextPage`.\n */\nexport interface InfiniteQueryObserverBaseResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult<TData, TError> {\n /**\n * This function allows you to fetch the next \"page\" of results.\n */\n fetchNextPage: (\n options?: FetchNextPageOptions,\n ) => Promise<InfiniteQueryObserverResult<TData, TError>>\n /**\n * This function allows you to fetch the previous \"page\" of results.\n */\n fetchPreviousPage: (\n options?: FetchPreviousPageOptions,\n ) => Promise<InfiniteQueryObserverResult<TData, TError>>\n /**\n * Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option).\n */\n hasNextPage: boolean\n /**\n * Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option).\n */\n hasPreviousPage: boolean\n /**\n * Will be `true` if the query failed while fetching the next page.\n */\n isFetchNextPageError: boolean\n /**\n * Will be `true` while fetching the next page with `fetchNextPage`.\n */\n isFetchingNextPage: boolean\n /**\n * Will be `true` if the query failed while fetching the previous page.\n */\n isFetchPreviousPageError: boolean\n /**\n * Will be `true` while fetching the previous page with `fetchPreviousPage`.\n */\n isFetchingPreviousPage: boolean\n}\n\n/**\n * An infinite query result in the `pending` state: the query has no data yet.\n */\nexport interface InfiniteQueryObserverPendingResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult<TData, TError> {\n /**\n * `undefined`, since the query has no data yet.\n */\n data: undefined\n /**\n * `null`, since the query isn't in the `error` state.\n */\n error: null\n /**\n * `false`, since the query isn't in the `error` state.\n */\n isError: false\n /**\n * `true`, since the query has no cached data, no data from `placeholderData` and no error.\n */\n isPending: true\n /**\n * `false`, since the query didn't fail while fetching for the first time.\n */\n isLoadingError: false\n /**\n * `false`, since the query didn't fail while refetching.\n */\n isRefetchError: false\n /**\n * `false`, since fetching the next page didn't fail.\n */\n isFetchNextPageError: false\n /**\n * `false`, since fetching the previous page didn't fail.\n */\n isFetchPreviousPageError: false\n /**\n * `false`, since the query isn't in the `success` state.\n */\n isSuccess: false\n /**\n * `false`, since the data shown isn't the `placeholderData`.\n */\n isPlaceholderData: false\n /**\n * `'pending'`, since the query has no cached data, no data from `placeholderData` and no error.\n */\n status: 'pending'\n}\n\n/**\n * An infinite query result in the `pending` state while the first fetch is in flight, so\n * `isLoading` is `true`.\n */\nexport interface InfiniteQueryObserverLoadingResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult<TData, TError> {\n /**\n * `undefined`, since the query has no data yet.\n */\n data: undefined\n /**\n * `null`, since the query isn't in the `error` state.\n */\n error: null\n /**\n * `false`, since the query isn't in the `error` state.\n */\n isError: false\n /**\n * `true`, since the query has no cached data, no data from `placeholderData` and no error.\n */\n isPending: true\n /**\n * `true`, since the first fetch is in flight.\n */\n isLoading: true\n /**\n * `false`, since the query didn't fail while fetching for the first time.\n */\n isLoadingError: false\n /**\n * `false`, since the query didn't fail while refetching.\n */\n isRefetchError: false\n /**\n * `false`, since fetching the next page didn't fail.\n */\n isFetchNextPageError: false\n /**\n * `false`, since fetching the previous page didn't fail.\n */\n isFetchPreviousPageError: false\n /**\n * `false`, since the query isn't in the `success` state.\n */\n isSuccess: false\n /**\n * `false`, since the data shown isn't the `placeholderData`.\n */\n isPlaceholderData: false\n /**\n * `'pending'`, since the query has no cached data, no data from `placeholderData` and no error.\n */\n status: 'pending'\n}\n\n/**\n * An infinite query result in the `error` state with no data to display, since a fetch or `select` failed.\n */\nexport interface InfiniteQueryObserverLoadingErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult<TData, TError> {\n /**\n * `undefined`, since there was no data to display when a fetch or `select` failed.\n */\n data: undefined\n /**\n * The error the fetch or `select` failed with.\n */\n error: TError\n /**\n * `true`, since the query is in the `error` state.\n */\n isError: true\n /**\n * `false`, since the query has cached data, data from `placeholderData` or an error.\n */\n isPending: false\n /**\n * `false`, since the first fetch isn't in flight.\n */\n isLoading: false\n /**\n * `true`, since the query has an error and no data to display.\n */\n isLoadingError: true\n /**\n * `false`, since the query didn't fail while refetching.\n */\n isRefetchError: false\n /**\n * `false`, since fetching the next page didn't fail.\n */\n isFetchNextPageError: false\n /**\n * `false`, since fetching the previous page didn't fail.\n */\n isFetchPreviousPageError: false\n /**\n * `false`, since the query isn't in the `success` state.\n */\n isSuccess: false\n /**\n * `false`, since the data shown isn't the `placeholderData`.\n */\n isPlaceholderData: false\n /**\n * `'error'`, since a fetch failed after its retries or `select` threw.\n */\n status: 'error'\n}\n\n/**\n * An infinite query result in the `error` state that keeps the data from before a fetch or `select`\n * failed.\n */\nexport interface InfiniteQueryObserverRefetchErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult<TData, TError> {\n /**\n * The data from before the fetch or `select` failed, which is kept.\n */\n data: TData\n /**\n * The error the fetch or `select` failed with.\n */\n error: TError\n /**\n * `true`, since the query is in the `error` state.\n */\n isError: true\n /**\n * `false`, since the query has cached data, data from `placeholderData` or an error.\n */\n isPending: false\n /**\n * `false`, since the first fetch isn't in flight.\n */\n isLoading: false\n /**\n * `false`, since the query didn't fail while fetching for the first time.\n */\n isLoadingError: false\n /**\n * `true`, since the query has an error, still has data to display, and didn't fail fetching a page.\n */\n isRefetchError: true\n /**\n * `false`, since the query isn't in the `success` state.\n */\n isSuccess: false\n /**\n * `false`, since the data shown isn't the `placeholderData`.\n */\n isPlaceholderData: false\n /**\n * `'error'`, since a fetch failed after its retries or `select` threw.\n */\n status: 'error'\n}\n\n/**\n * An infinite query result in the `success` state with data from the cache.\n */\nexport interface InfiniteQueryObserverSuccessResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult<TData, TError> {\n /**\n * The last successfully resolved data for the query.\n */\n data: TData\n /**\n * `null`, since the query isn't in the `error` state.\n */\n error: null\n /**\n * `false`, since the query isn't in the `error` state.\n */\n isError: false\n /**\n * `false`, since the query has cached data, data from `placeholderData` or an error.\n */\n isPending: false\n /**\n * `false`, since the first fetch isn't in flight.\n */\n isLoading: false\n /**\n * `false`, since the query didn't fail while fetching for the first time.\n */\n isLoadingError: false\n /**\n * `false`, since the query didn't fail while refetching.\n */\n isRefetchError: false\n /**\n * `false`, since fetching the next page didn't fail.\n */\n isFetchNextPageError: false\n /**\n * `false`, since fetching the previous page didn't fail.\n */\n isFetchPreviousPageError: false\n /**\n * `true`, since the query is in the `success` state.\n */\n isSuccess: true\n /**\n * `false`, since the data shown isn't the `placeholderData`.\n */\n isPlaceholderData: false\n /**\n * `'success'`, since the query has cached data and no error from a fetch or from\n * `select`.\n */\n status: 'success'\n}\n\n/**\n * An infinite query result in the `success` state that shows `placeholderData` while the query has\n * no data yet.\n */\nexport interface InfiniteQueryObserverPlaceholderResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult<TData, TError> {\n /**\n * The `placeholderData` shown while the query has no data yet.\n */\n data: TData\n /**\n * `false`, since the query isn't in the `error` state.\n */\n isError: false\n /**\n * `null`, since the query isn't in the `error` state.\n */\n error: null\n /**\n * `false`, since the query has cached data, data from `placeholderData` or an error.\n */\n isPending: false\n /**\n * `false`, since the first fetch isn't in flight.\n */\n isLoading: false\n /**\n * `false`, since the query didn't fail while fetching for the first time.\n */\n isLoadingError: false\n /**\n * `false`, since the query didn't fail while refetching.\n */\n isRefetchError: false\n /**\n * `true`, since the query is in the `success` state.\n */\n isSuccess: true\n /**\n * `true`, since the data shown is the `placeholderData`.\n */\n isPlaceholderData: true\n /**\n * `false`, since fetching the next page didn't fail.\n */\n isFetchNextPageError: false\n /**\n * `false`, since fetching the previous page didn't fail.\n */\n isFetchPreviousPageError: false\n /**\n * `'success'`, since the query shows `placeholderData` and has no error from a fetch or\n * from `select`.\n */\n status: 'success'\n}\n\n/**\n * An infinite query result that always has `data`: the success and refetch error states.\n */\nexport type DefinedInfiniteQueryObserverResult<\n TData = unknown,\n TError = DefaultError,\n> =\n | InfiniteQueryObserverRefetchErrorResult<TData, TError>\n | InfiniteQueryObserverSuccessResult<TData, TError>\n\n/**\n * The result of an `InfiniteQueryObserver`, and of the hooks built on it like `useInfiniteQuery`.\n * Narrow it by `status` or the `is*` flags to get the type of each state.\n */\nexport type InfiniteQueryObserverResult<\n TData = unknown,\n TError = DefaultError,\n> =\n | DefinedInfiniteQueryObserverResult<TData, TError>\n | InfiniteQueryObserverLoadingErrorResult<TData, TError>\n | InfiniteQueryObserverLoadingResult<TData, TError>\n | InfiniteQueryObserverPendingResult<TData, TError>\n | InfiniteQueryObserverPlaceholderResult<TData, TError>\n\n/**\n * The type of a mutation key — the serializable array used to identify and filter mutations.\n * Defaults to `ReadonlyArray<unknown>`; declare `mutationKey` on {@link Register} to narrow it repository-wide.\n */\nexport type MutationKey = Register extends {\n mutationKey: infer TMutationKey\n}\n ? TMutationKey extends ReadonlyArray<unknown>\n ? TMutationKey\n : TMutationKey extends Array<unknown>\n ? TMutationKey\n : ReadonlyArray<unknown>\n : ReadonlyArray<unknown>\n\n/** @inline */\nexport type MutationStatus = 'idle' | 'pending' | 'success' | 'error'\n\n/**\n * Groups mutations so they run one after another instead of in parallel.\n * Mutations that share the same `id` form a queue: while one is running, the others wait in `isPaused: true`\n * state and resume automatically when their turn comes. Mutations with no scope always run in parallel.\n */\nexport type MutationScope = {\n /**\n * The scope's identifier. Mutations with the same `id` run one after another.\n */\n id: string\n}\n\n/**\n * The type of the `meta` object that can be attached to a mutation and read back from `mutationFn`, callbacks and\n * cache-level handlers. Defaults to `Record<string, unknown>`; declare `mutationMeta` on {@link Register} to narrow it.\n */\nexport type MutationMeta = Register extends {\n mutationMeta: infer TMutationMeta\n}\n ? TMutationMeta extends Record<string, unknown>\n ? TMutationMeta\n : Record<string, unknown>\n : Record<string, unknown>\n\n/**\n * The object passed to `mutationFn` and the mutation callbacks: the `QueryClient`, the mutation's\n * `meta`, and its `mutationKey`.\n */\nexport type MutationFunctionContext = {\n /**\n * The `QueryClient` the mutation runs in.\n */\n client: QueryClient\n /**\n * The `meta` of the mutation options.\n */\n meta: MutationMeta | undefined\n /**\n * The `mutationKey` of the mutation options, if set.\n */\n mutationKey?: MutationKey\n}\n\n/** @inline */\nexport type MutationFunction<TData = unknown, TVariables = unknown> = (\n variables: TVariables,\n context: MutationFunctionContext,\n) => Promise<TData>\n\n/**\n * The options of a mutation: its `mutationFn`, `mutationKey`, callbacks, retries, `scope`, and so\n * on.\n */\nexport interface MutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> {\n /**\n * The function that performs the asynchronous task this mutation runs.\n * Required, unless a default mutation function has been set for the matching `mutationKey` via\n * `queryClient.setMutationDefaults`.\n * Receives the `variables` passed to `mutate`, and a {@link MutationFunctionContext} holding the\n * `QueryClient`, the `mutationKey` and `meta`.\n * Must return a promise that resolves the mutation's data.\n */\n mutationFn?: MutationFunction<TData, TVariables>\n /**\n * The key to use for this mutation. Optional, but required to inherit defaults registered with\n * `queryClient.setMutationDefaults`, and to match this mutation with `useMutationState` or\n * `queryClient.isMutating`.\n */\n mutationKey?: MutationKey\n /**\n * This function fires before the mutation function runs, and receives the same variables.\n * Useful for optimistic updates applied in the hope that the mutation succeeds.\n * The value it returns is passed to `onSuccess`, `onError` and `onSettled` as `onMutateResult`,\n * which is where an optimistic update is usually rolled back.\n * If a promise is returned, it is awaited before the mutation function runs.\n */\n onMutate?: (\n variables: TVariables,\n context: MutationFunctionContext,\n ) => Promise<TOnMutateResult> | TOnMutateResult\n /**\n * This function fires when the mutation succeeds, and is passed the mutation's result.\n * If a promise is returned, it is awaited before `onSettled` runs.\n */\n onSuccess?: (\n data: TData,\n variables: TVariables,\n onMutateResult: TOnMutateResult,\n context: MutationFunctionContext,\n ) => Promise<unknown> | unknown\n /**\n * This function fires when the mutation encounters an error, and is passed the error.\n * If a promise is returned, it is awaited before `onSettled` runs.\n */\n onError?: (\n error: TError,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => Promise<unknown> | unknown\n /**\n * This function fires when the mutation either succeeds or errors, and is passed either the data\n * or the error.\n * If a promise is returned, it is awaited before the mutation settles.\n */\n onSettled?: (\n data: TData | undefined,\n error: TError | null,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => Promise<unknown> | unknown\n /**\n * If `false`, failed mutations will not retry by default.\n * If `true`, failed mutations will retry infinitely.\n * If set to an integer number, e.g. 3, failed mutations will retry until the failed mutation count meets that number.\n * If set to a function `(failureCount, error) => boolean` failed mutations will retry until the function returns false.\n * @defaultValue 0\n */\n retry?: RetryValue<TError>\n /**\n * This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the\n * next attempt in milliseconds.\n *\n * Defaults to a function that applies exponential backoff, capped at 30 seconds.\n */\n retryDelay?: RetryDelayValue<TError>\n /**\n * Controls whether a mutation is allowed to run based on the current network connectivity.\n * @defaultValue 'online'\n * @see [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information.\n */\n networkMode?: NetworkMode\n /**\n * The time in milliseconds that an unused/inactive mutation remains in memory before it is\n * garbage collected.\n *\n * Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR.\n */\n gcTime?: number\n /** @internal */\n _defaulted?: boolean\n /**\n * Additional payload to be stored on the mutation cache entry.\n * Use it to pass information that can be read wherever the `mutation` is available, such as the\n * `onError` and `onSuccess` callbacks of the `MutationCache`.\n */\n meta?: MutationMeta\n /**\n * Controls whether this mutation runs alongside others or waits its turn.\n * Mutations sharing the same `scope.id` run serially, in the order they were started.\n * Without a scope, a mutation runs as soon as it is triggered.\n */\n scope?: MutationScope\n}\n\n/**\n * The options of a `MutationObserver`, and of the hooks built on it like `useMutation`: the\n * {@link MutationOptions}, plus `throwOnError`.\n */\nexport interface MutationObserverOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationOptions<TData, TError, TVariables, TOnMutateResult> {\n /**\n * Whether errors should be thrown instead of setting the `error` property.\n * If set to `true`, all errors will be thrown to the nearest error boundary.\n * If set to a function, it will be passed the error and should return a boolean indicating whether to throw the\n * error (`true`) or return it as state (`false`).\n * @defaultValue false\n */\n throwOnError?: boolean | ((error: TError) => boolean)\n}\n\n/**\n * The callbacks that can be passed to `mutate` for a single call. They run after the callbacks of\n * the mutation options.\n */\nexport interface MutateOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> {\n /**\n * Called when the mutation of this call succeeds, after the `onSuccess` of the mutation options.\n */\n onSuccess?: (\n data: TData,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => void\n /**\n * Called when the mutation of this call fails, after the `onError` of the mutation options.\n */\n onError?: (\n error: TError,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => void\n /**\n * Called when the mutation of this call succeeds or fails, after the `onSettled` of the mutation\n * options.\n */\n onSettled?: (\n data: TData | undefined,\n error: TError | null,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => void\n}\n\n/**\n * The parameters of {@link MutateFunction}: `variables`, optional when `TVariables` accepts\n * `undefined`, and the {@link MutateOptions} for that call.\n */\nexport type MutateFunctionRest<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> = undefined extends TVariables\n ? [\n variables?: TVariables,\n options?: MutateOptions<TData, TError, TVariables, TOnMutateResult>,\n ]\n : [\n variables: TVariables,\n options?: MutateOptions<TData, TError, TVariables, TOnMutateResult>,\n ]\n\n/**\n * The `mutate` function of a `MutationObserver`: runs the mutation with the given variables and\n * resolves with its data.\n */\nexport type MutateFunction<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> = (\n ...rest: MutateFunctionRest<TData, TError, TVariables, TOnMutateResult>\n) => Promise<TData>\n\n/**\n * The properties shared by every state of a mutation result, like `data`, `error`, `variables`,\n * `status`, the `is*` flags, `mutate`, and `reset`.\n */\nexport interface MutationObserverBaseResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationState<TData, TError, TVariables, TOnMutateResult> {\n /**\n * The last successfully resolved data for the mutation.\n */\n data: TData | undefined\n /**\n * The variables object passed to the `mutationFn`.\n */\n variables: TVariables | undefined\n /**\n * The error object for the mutation, if an error was encountered.\n * - Defaults to `null`.\n */\n error: TError | null\n /**\n * A boolean variable derived from `status`.\n * - `true` if the last mutation attempt resulted in an error.\n */\n isError: boolean\n /**\n * A boolean variable derived from `status`.\n * - `true` if the mutation is in its initial state prior to executing.\n */\n isIdle: boolean\n /**\n * A boolean variable derived from `status`.\n * - `true` if the mutation is currently executing.\n */\n isPending: boolean\n /**\n * A boolean variable derived from `status`.\n * - `true` if the last mutation attempt was successful.\n */\n isSuccess: boolean\n /**\n * The status of the mutation.\n * - Will be:\n * - `idle` initial status prior to the mutation function executing.\n * - `pending` if the mutation is currently executing.\n * - `error` if the last mutation attempt resulted in an error.\n * - `success` if the last mutation attempt was successful.\n */\n status: MutationStatus\n /**\n * The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options.\n * @param variables - The variables object to pass to the `mutationFn`.\n * @param options.onSuccess - This function will fire when the mutation is successful and will be passed the mutation's result.\n * @param options.onError - This function will fire if the mutation encounters an error and will be passed the error.\n * @param options.onSettled - This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error.\n * @remarks\n * - If you make multiple requests, `onSuccess` will fire only after the latest call you've made.\n * - All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored.\n */\n mutate: MutateFunction<TData, TError, TVariables, TOnMutateResult>\n /**\n * A function to clean the mutation internal state (i.e., it resets the mutation to its initial state).\n */\n reset: () => void\n}\n\n/**\n * A mutation result in the `idle` state: the mutation hasn't run yet, or was reset.\n */\nexport interface MutationObserverIdleResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n /**\n * `undefined`, since the mutation hasn't run.\n */\n data: undefined\n /**\n * `undefined`, since the mutation hasn't run.\n */\n variables: undefined\n /**\n * `null`, since the mutation hasn't failed.\n */\n error: null\n /**\n * `false`, since the mutation hasn't failed.\n */\n isError: false\n /**\n * `true`, since the mutation hasn't run yet or was reset.\n */\n isIdle: true\n /**\n * `false`, since the mutation isn't running.\n */\n isPending: false\n /**\n * `false`, since the mutation hasn't succeeded.\n */\n isSuccess: false\n /**\n * `'idle'`, since the mutation hasn't run yet or was reset.\n */\n status: 'idle'\n}\n\n/**\n * A mutation result in the `pending` state while the mutation runs.\n */\nexport interface MutationObserverLoadingResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n /**\n * `undefined`, since the mutation hasn't succeeded.\n */\n data: undefined\n /**\n * The variables passed to `mutate` for this mutation.\n */\n variables: TVariables\n /**\n * `null`, since the mutation hasn't failed.\n */\n error: null\n /**\n * `false`, since the mutation hasn't failed.\n */\n isError: false\n /**\n * `false`, since the mutation has run.\n */\n isIdle: false\n /**\n * `true`, since the mutation is running.\n */\n isPending: true\n /**\n * `false`, since the mutation hasn't succeeded.\n */\n isSuccess: false\n /**\n * `'pending'`, since the mutation is running.\n */\n status: 'pending'\n}\n\n/**\n * A mutation result in the `error` state after the mutation failed.\n */\nexport interface MutationObserverErrorResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n /**\n * `undefined`, since the mutation hasn't succeeded.\n */\n data: undefined\n /**\n * The error the mutation failed with.\n */\n error: TError\n /**\n * The variables passed to `mutate` for this mutation.\n */\n variables: TVariables\n /**\n * `true`, since the mutation failed.\n */\n isError: true\n /**\n * `false`, since the mutation has run.\n */\n isIdle: false\n /**\n * `false`, since the mutation isn't running.\n */\n isPending: false\n /**\n * `false`, since the mutation hasn't succeeded.\n */\n isSuccess: false\n /**\n * `'error'`, since the mutation failed.\n */\n status: 'error'\n}\n\n/**\n * A mutation result in the `success` state after the mutation succeeded.\n */\nexport interface MutationObserverSuccessResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n /**\n * The data the mutation resolved with.\n */\n data: TData\n /**\n * `null`, since the mutation hasn't failed.\n */\n error: null\n /**\n * The variables passed to `mutate` for this mutation.\n */\n variables: TVariables\n /**\n * `false`, since the mutation hasn't failed.\n */\n isError: false\n /**\n * `false`, since the mutation has run.\n */\n isIdle: false\n /**\n * `false`, since the mutation isn't running.\n */\n isPending: false\n /**\n * `true`, since the mutation succeeded.\n */\n isSuccess: true\n /**\n * `'success'`, since the mutation succeeded.\n */\n status: 'success'\n}\n\n/**\n * The result of a `MutationObserver`, and of the hooks built on it like `useMutation`. Narrow it by\n * `status` or the `is*` flags to get the type of each state.\n */\nexport type MutationObserverResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> =\n | MutationObserverIdleResult<TData, TError, TVariables, TOnMutateResult>\n | MutationObserverLoadingResult<TData, TError, TVariables, TOnMutateResult>\n | MutationObserverErrorResult<TData, TError, TVariables, TOnMutateResult>\n | MutationObserverSuccessResult<TData, TError, TVariables, TOnMutateResult>\n\n/**\n * The options of `new QueryClient()`: the `queryCache` and `mutationCache` to use, and the\n * `defaultOptions` for its queries and mutations.\n */\nexport interface QueryClientConfig {\n /** The query cache this client is connected to. A new `QueryCache` is created if not provided. */\n queryCache?: QueryCache\n /**\n * The mutation cache this client is connected to. A new `MutationCache` is created if not\n * provided.\n */\n mutationCache?: MutationCache\n /** Default options for all queries and mutations created through this client. */\n defaultOptions?: DefaultOptions\n}\n\n/**\n * The default options of a `QueryClient`, applied to every query (`queries`), mutation\n * (`mutations`), `hydrate`, and `dehydrate` call unless overridden.\n */\nexport interface DefaultOptions<TError = DefaultError> {\n /** Default options applied to every query, unless overridden per-query. */\n queries?: OmitKeyof<\n QueryObserverOptions<unknown, TError>,\n 'suspense' | 'queryKey'\n >\n /** Default options applied to every mutation, unless overridden per-mutation. */\n mutations?: MutationObserverOptions<unknown, TError, unknown, unknown>\n /** Default options used when hydrating queries and mutations; see {@link HydrateOptions}. */\n hydrate?: HydrateOptions['defaultOptions']\n /** Default options used when dehydrating the client's caches; see {@link DehydrateOptions}. */\n dehydrate?: DehydrateOptions\n}\n\n/**\n * Options for cancelling an in-flight fetch, e.g. via `query.cancel()`.\n * They are carried on the {@link CancelledError} that the cancelled fetch rejects with.\n */\nexport interface CancelOptions {\n /**\n * If `true`, the query goes back to the state it had before the fetch started, instead of getting\n * the cancellation error.\n */\n revert?: boolean\n /**\n * If `true`, the cancellation error isn't surfaced, e.g. because another fetch replaces the\n * cancelled one.\n */\n silent?: boolean\n}\n\n/**\n * Options for writing data into the cache, e.g. via `queryClient.setQueryData()`.\n * `updatedAt` overrides the timestamp the data is recorded with, which is what staleness is measured from;\n * omit it to use the current time.\n */\nexport interface SetDataOptions {\n /**\n * The timestamp to record the data with, instead of the current time. Staleness is measured from\n * it.\n */\n updatedAt?: number\n}\n\n/** @inline */\nexport type NotifyEventType =\n | 'added'\n | 'removed'\n | 'updated'\n | 'observerAdded'\n | 'observerRemoved'\n | 'observerResultsUpdated'\n | 'observerOptionsUpdated'\n\n/**\n * The base shape of the events that the query and mutation caches send to their listeners.\n */\nexport interface NotifyEvent {\n /**\n * The kind of event, e.g. `'added'`, `'removed'`, or `'updated'`.\n */\n type: NotifyEventType\n}\n"],"mappings":";;AAsGA,MAAa,gBAAgB,OAAO;AAKpC,MAAa,qBAAqB,OAAO;AAKzC,MAAa,cAAc,OAAO"}
|