@tanstack/query-core 5.77.1 → 5.77.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-B3ndIyL6.d.ts → hydration-17eepgNg.d.ts} +2 -1
- package/build/legacy/{hydration-GTiXepW_.d.cts → hydration-TwHKRJLE.d.cts} +2 -1
- package/build/legacy/hydration.d.cts +1 -1
- package/build/legacy/hydration.d.ts +1 -1
- package/build/legacy/index.d.cts +1 -1
- package/build/legacy/index.d.ts +1 -1
- package/build/legacy/infiniteQueryBehavior.d.cts +1 -1
- package/build/legacy/infiniteQueryBehavior.d.ts +1 -1
- package/build/legacy/infiniteQueryObserver.d.cts +1 -1
- package/build/legacy/infiniteQueryObserver.d.ts +1 -1
- package/build/legacy/mutation.d.cts +1 -1
- package/build/legacy/mutation.d.ts +1 -1
- package/build/legacy/mutationCache.d.cts +1 -1
- package/build/legacy/mutationCache.d.ts +1 -1
- package/build/legacy/mutationObserver.d.cts +1 -1
- package/build/legacy/mutationObserver.d.ts +1 -1
- package/build/legacy/queriesObserver.d.cts +1 -1
- package/build/legacy/queriesObserver.d.ts +1 -1
- package/build/legacy/query.d.cts +1 -1
- package/build/legacy/query.d.ts +1 -1
- package/build/legacy/queryCache.d.cts +1 -1
- package/build/legacy/queryCache.d.ts +1 -1
- package/build/legacy/queryClient.d.cts +1 -1
- package/build/legacy/queryClient.d.ts +1 -1
- package/build/legacy/queryObserver.d.cts +1 -1
- package/build/legacy/queryObserver.d.ts +1 -1
- package/build/legacy/retryer.d.cts +1 -1
- package/build/legacy/retryer.d.ts +1 -1
- package/build/legacy/streamedQuery.d.cts +1 -1
- package/build/legacy/streamedQuery.d.ts +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.d.cts +1 -1
- package/build/legacy/utils.d.ts +1 -1
- package/build/modern/{hydration-B3ndIyL6.d.ts → hydration-17eepgNg.d.ts} +2 -1
- package/build/modern/{hydration-GTiXepW_.d.cts → hydration-TwHKRJLE.d.cts} +2 -1
- package/build/modern/hydration.d.cts +1 -1
- package/build/modern/hydration.d.ts +1 -1
- package/build/modern/index.d.cts +1 -1
- package/build/modern/index.d.ts +1 -1
- package/build/modern/infiniteQueryBehavior.d.cts +1 -1
- package/build/modern/infiniteQueryBehavior.d.ts +1 -1
- package/build/modern/infiniteQueryObserver.d.cts +1 -1
- package/build/modern/infiniteQueryObserver.d.ts +1 -1
- package/build/modern/mutation.d.cts +1 -1
- package/build/modern/mutation.d.ts +1 -1
- package/build/modern/mutationCache.d.cts +1 -1
- package/build/modern/mutationCache.d.ts +1 -1
- package/build/modern/mutationObserver.d.cts +1 -1
- package/build/modern/mutationObserver.d.ts +1 -1
- package/build/modern/queriesObserver.d.cts +1 -1
- package/build/modern/queriesObserver.d.ts +1 -1
- package/build/modern/query.d.cts +1 -1
- package/build/modern/query.d.ts +1 -1
- package/build/modern/queryCache.d.cts +1 -1
- package/build/modern/queryCache.d.ts +1 -1
- package/build/modern/queryClient.d.cts +1 -1
- package/build/modern/queryClient.d.ts +1 -1
- package/build/modern/queryObserver.d.cts +1 -1
- package/build/modern/queryObserver.d.ts +1 -1
- package/build/modern/retryer.d.cts +1 -1
- package/build/modern/retryer.d.ts +1 -1
- package/build/modern/streamedQuery.d.cts +1 -1
- package/build/modern/streamedQuery.d.ts +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.d.cts +1 -1
- package/build/modern/utils.d.ts +1 -1
- package/package.json +1 -1
- package/src/types.ts +2 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"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\nexport type DistributiveOmit<\n TObject,\n TKey extends keyof TObject,\n> = TObject extends any ? Omit<TObject, TKey> : never\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\nexport type Override<TTargetA, TTargetB> = {\n [AKey in keyof TTargetA]: AKey extends keyof TTargetB\n ? TTargetB[AKey]\n : TTargetA[AKey]\n}\n\nexport type NoInfer<T> = [T][T extends any ? 0 : never]\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\nexport type DefaultError = Register extends {\n defaultError: infer TError\n}\n ? TError\n : Error\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('dataTagSymbol')\nexport type dataTagSymbol = typeof dataTagSymbol\nexport const dataTagErrorSymbol = Symbol('dataTagErrorSymbol')\nexport type dataTagErrorSymbol = typeof dataTagErrorSymbol\nexport const unsetMarker = Symbol('unsetMarker')\nexport type UnsetMarker = typeof unsetMarker\nexport type AnyDataTag = {\n [dataTagSymbol]: any\n [dataTagErrorSymbol]: any\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\nexport type InferDataFromTag<TQueryFnData, TTaggedQueryKey extends QueryKey> =\n TTaggedQueryKey extends DataTag<unknown, infer TaggedValue, unknown>\n ? TaggedValue\n : TQueryFnData\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\nexport type QueryFunction<\n T = unknown,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> = (context: QueryFunctionContext<TQueryKey, TPageParam>) => T | Promise<T>\n\nexport type StaleTime<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = number | ((query: Query<TQueryFnData, TError, TData, TQueryKey>) => number)\n\nexport type Enabled<\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\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\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\nexport type InitialDataFunction<T> = () => T | undefined\n\ntype NonFunctionGuard<T> = T extends Function ? never : T\n\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\nexport type QueriesPlaceholderDataFunction<TQueryData> = (\n previousData: undefined,\n previousQuery: undefined,\n) => TQueryData | undefined\n\nexport type QueryKeyHashFunction<TQueryKey extends QueryKey> = (\n queryKey: TQueryKey,\n) => string\n\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\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\nexport interface InfiniteData<TData, TPageParam = unknown> {\n pages: Array<TData>\n pageParams: Array<TPageParam>\n}\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\nexport type NetworkMode = 'online' | 'always' | 'offlineFirst'\n\nexport type NotifyOnChangeProps =\n | Array<keyof InfiniteQueryObserverResult>\n | 'all'\n | undefined\n | (() => Array<keyof InfiniteQueryObserverResult> | 'all' | undefined)\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., failureCount: num\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 retry?: RetryValue<TError>\n retryDelay?: RetryDelayValue<TError>\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 gcTime?: number\n queryFn?: QueryFunction<TQueryFnData, TQueryKey, TPageParam> | SkipToken\n persister?: QueryPersister<\n NoInfer<TQueryFnData>,\n NoInfer<TQueryKey>,\n NoInfer<TPageParam>\n >\n queryHash?: string\n queryKey?: TQueryKey\n queryKeyHashFn?: QueryKeyHashFunction<TQueryKey>\n initialData?: TData | InitialDataFunction<TData>\n initialDataUpdatedAt?: number | (() => number | undefined)\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 * Defaults to `true`.\n */\n structuralSharing?:\n | boolean\n | ((oldData: unknown | undefined, newData: unknown) => unknown)\n _defaulted?: boolean\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\nexport interface InitialPageParam<TPageParam = unknown> {\n initialPageParam: TPageParam\n}\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\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\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 * Defaults to `true`.\n */\n enabled?: Enabled<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 a function, the function will be executed with the query to compute a `staleTime`.\n * Defaults to `0`.\n */\n staleTime?: StaleTime<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 * Defaults to `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 * Defaults to `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.\n * If set to a function, the function will be executed with the latest data and query to compute the value.\n * Defaults to `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.\n * If set to a function, the function will be executed with the latest data and query to compute the value.\n * Defaults to the value of `networkOnline` (`true`)\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.\n * If set to a function, the function will be executed with the latest data and query to compute the value\n * Defaults to `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 * Defaults to `true`.\n */\n retryOnMount?: boolean\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 * By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change.\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 * Defaults to `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.\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 * Defaults to `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 _optimisticResults?: 'optimistic' | 'isRestoring'\n\n /**\n * Enable prefetching during rendering\n */\n experimental_prefetchInRender?: boolean\n}\n\nexport type WithRequired<TTarget, TKey extends keyof TTarget> = TTarget & {\n [_ in TKey]: {}\n}\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\nexport interface InfiniteQueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> extends QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n InfiniteData<TQueryData, TPageParam>,\n TQueryKey,\n TPageParam\n >,\n InfiniteQueryPageParamsOptions<TQueryFnData, TPageParam> {}\n\nexport type DefaultedInfiniteQueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = WithRequired<\n InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n >,\n 'throwOnError' | 'refetchOnReconnect' | 'queryHash'\n>\n\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 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?: StaleTime<TQueryFnData, TError, TData, TQueryKey>\n}\n\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 revalidateIfStale?: boolean\n}\n\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 FetchInfiniteQueryPages<TQueryFnData = unknown, TPageParam = unknown> =\n | { pages?: never }\n | {\n pages: number\n getNextPageParam: GetNextPageParamFunction<TPageParam, TQueryFnData>\n }\n\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 FetchInfiniteQueryPages<TQueryFnData, TPageParam>\n\nexport interface ResultOptions {\n throwOnError?: boolean\n}\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 *\n * Defaults to `true`.\n */\n cancelRefetch?: boolean\n}\n\nexport interface InvalidateQueryFilters<TQueryKey extends QueryKey = QueryKey>\n extends QueryFilters<TQueryKey> {\n refetchType?: QueryTypeFilter | 'none'\n}\n\nexport interface RefetchQueryFilters<TQueryKey extends QueryKey = QueryKey>\n extends QueryFilters<TQueryKey> {}\n\nexport interface InvalidateOptions extends RefetchOptions {}\nexport interface ResetOptions extends RefetchOptions {}\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 *\n * Defaults to `true`.\n */\n cancelRefetch?: boolean\n}\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 *\n * Defaults to `true`.\n */\n cancelRefetch?: boolean\n}\n\nexport type QueryStatus = 'pending' | 'error' | 'success'\nexport type FetchStatus = 'fetching' | 'paused' | 'idle'\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 * 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 * A stable promise that will be resolved with the data of the query.\n * Requires the `experimental_prefetchInRender` feature flag to be enabled.\n * @example\n *\n * ### Enabling the feature flag\n * ```ts\n * const client = new QueryClient({\n * defaultOptions: {\n * queries: {\n * experimental_prefetchInRender: true,\n * },\n * },\n * })\n * ```\n *\n * ### Usage\n * ```tsx\n * import { useQuery } from '@tanstack/react-query'\n * import React from 'react'\n * import { fetchTodos, type Todo } from './api'\n *\n * function TodoList({ query }: { query: UseQueryResult<Todo[], Error> }) {\n * const data = React.use(query.promise)\n *\n * return (\n * <ul>\n * {data.map(todo => (\n * <li key={todo.id}>{todo.title}</li>\n * ))}\n * </ul>\n * )\n * }\n *\n * export function App() {\n * const query = useQuery({ queryKey: ['todos'], queryFn: fetchTodos })\n *\n * return (\n * <>\n * <h1>Todos</h1>\n * <React.Suspense fallback={<div>Loading...</div>}>\n * <TodoList query={query} />\n * </React.Suspense>\n * </>\n * )\n * }\n * ```\n */\n promise: Promise<TData>\n}\n\nexport interface QueryObserverPendingResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult<TData, TError> {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoadingError: false\n isRefetchError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface QueryObserverLoadingResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult<TData, TError> {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoading: true\n isLoadingError: false\n isRefetchError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface QueryObserverLoadingErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult<TData, TError> {\n data: undefined\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: true\n isRefetchError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface QueryObserverRefetchErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult<TData, TError> {\n data: TData\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: true\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface QueryObserverSuccessResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult<TData, TError> {\n data: TData\n error: null\n isError: false\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isSuccess: true\n isPlaceholderData: false\n status: 'success'\n}\n\nexport interface QueryObserverPlaceholderResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult<TData, TError> {\n data: TData\n isError: false\n error: null\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isSuccess: true\n isPlaceholderData: true\n status: 'success'\n}\n\nexport type DefinedQueryObserverResult<\n TData = unknown,\n TError = DefaultError,\n> =\n | QueryObserverRefetchErrorResult<TData, TError>\n | QueryObserverSuccessResult<TData, TError>\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\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\nexport interface InfiniteQueryObserverPendingResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult<TData, TError> {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoadingError: false\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface InfiniteQueryObserverLoadingResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult<TData, TError> {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoading: true\n isLoadingError: false\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface InfiniteQueryObserverLoadingErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult<TData, TError> {\n data: undefined\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: true\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface InfiniteQueryObserverRefetchErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult<TData, TError> {\n data: TData\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: true\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface InfiniteQueryObserverSuccessResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult<TData, TError> {\n data: TData\n error: null\n isError: false\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: true\n isPlaceholderData: false\n status: 'success'\n}\n\nexport interface InfiniteQueryObserverPlaceholderResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult<TData, TError> {\n data: TData\n isError: false\n error: null\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isSuccess: true\n isPlaceholderData: true\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n status: 'success'\n}\n\nexport type DefinedInfiniteQueryObserverResult<\n TData = unknown,\n TError = DefaultError,\n> =\n | InfiniteQueryObserverRefetchErrorResult<TData, TError>\n | InfiniteQueryObserverSuccessResult<TData, TError>\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\nexport type MutationKey = Register extends {\n mutationKey: infer TMutationKey\n}\n ? TMutationKey extends Array<unknown>\n ? TMutationKey\n : TMutationKey extends Array<unknown>\n ? TMutationKey\n : ReadonlyArray<unknown>\n : ReadonlyArray<unknown>\n\nexport type MutationStatus = 'idle' | 'pending' | 'success' | 'error'\n\nexport type MutationScope = {\n id: string\n}\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\nexport type MutationFunction<TData = unknown, TVariables = unknown> = (\n variables: TVariables,\n) => Promise<TData>\n\nexport interface MutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TContext = unknown,\n> {\n mutationFn?: MutationFunction<TData, TVariables>\n mutationKey?: MutationKey\n onMutate?: (\n variables: TVariables,\n ) => Promise<TContext | undefined> | TContext | undefined\n onSuccess?: (\n data: TData,\n variables: TVariables,\n context: TContext,\n ) => Promise<unknown> | unknown\n onError?: (\n error: TError,\n variables: TVariables,\n context: TContext | undefined,\n ) => Promise<unknown> | unknown\n onSettled?: (\n data: TData | undefined,\n error: TError | null,\n variables: TVariables,\n context: TContext | undefined,\n ) => Promise<unknown> | unknown\n retry?: RetryValue<TError>\n retryDelay?: RetryDelayValue<TError>\n networkMode?: NetworkMode\n gcTime?: number\n _defaulted?: boolean\n meta?: MutationMeta\n scope?: MutationScope\n}\n\nexport interface MutationObserverOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TContext = unknown,\n> extends MutationOptions<TData, TError, TVariables, TContext> {\n throwOnError?: boolean | ((error: TError) => boolean)\n}\n\nexport interface MutateOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TContext = unknown,\n> {\n onSuccess?: (data: TData, variables: TVariables, context: TContext) => void\n onError?: (\n error: TError,\n variables: TVariables,\n context: TContext | undefined,\n ) => void\n onSettled?: (\n data: TData | undefined,\n error: TError | null,\n variables: TVariables,\n context: TContext | undefined,\n ) => void\n}\n\nexport type MutateFunction<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TContext = unknown,\n> = (\n variables: TVariables,\n options?: MutateOptions<TData, TError, TVariables, TContext>,\n) => Promise<TData>\n\nexport interface MutationObserverBaseResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TContext = unknown,\n> extends MutationState<TData, TError, TVariables, TContext> {\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, TContext>\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\nexport interface MutationObserverIdleResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TContext = unknown,\n> extends MutationObserverBaseResult<TData, TError, TVariables, TContext> {\n data: undefined\n variables: undefined\n error: null\n isError: false\n isIdle: true\n isPending: false\n isSuccess: false\n status: 'idle'\n}\n\nexport interface MutationObserverLoadingResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TContext = unknown,\n> extends MutationObserverBaseResult<TData, TError, TVariables, TContext> {\n data: undefined\n variables: TVariables\n error: null\n isError: false\n isIdle: false\n isPending: true\n isSuccess: false\n status: 'pending'\n}\n\nexport interface MutationObserverErrorResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TContext = unknown,\n> extends MutationObserverBaseResult<TData, TError, TVariables, TContext> {\n data: undefined\n error: TError\n variables: TVariables\n isError: true\n isIdle: false\n isPending: false\n isSuccess: false\n status: 'error'\n}\n\nexport interface MutationObserverSuccessResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TContext = unknown,\n> extends MutationObserverBaseResult<TData, TError, TVariables, TContext> {\n data: TData\n error: null\n variables: TVariables\n isError: false\n isIdle: false\n isPending: false\n isSuccess: true\n status: 'success'\n}\n\nexport type MutationObserverResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TContext = unknown,\n> =\n | MutationObserverIdleResult<TData, TError, TVariables, TContext>\n | MutationObserverLoadingResult<TData, TError, TVariables, TContext>\n | MutationObserverErrorResult<TData, TError, TVariables, TContext>\n | MutationObserverSuccessResult<TData, TError, TVariables, TContext>\n\nexport interface QueryClientConfig {\n queryCache?: QueryCache\n mutationCache?: MutationCache\n defaultOptions?: DefaultOptions\n}\n\nexport interface DefaultOptions<TError = DefaultError> {\n queries?: OmitKeyof<\n QueryObserverOptions<unknown, TError>,\n 'suspense' | 'queryKey'\n >\n mutations?: MutationObserverOptions<unknown, TError, unknown, unknown>\n hydrate?: HydrateOptions['defaultOptions']\n dehydrate?: DehydrateOptions\n}\n\nexport interface CancelOptions {\n revert?: boolean\n silent?: boolean\n}\n\nexport interface SetDataOptions {\n updatedAt?: number\n}\n\nexport type NotifyEventType =\n | 'added'\n | 'removed'\n | 'updated'\n | 'observerAdded'\n | 'observerRemoved'\n | 'observerResultsUpdated'\n | 'observerOptionsUpdated'\n\nexport interface NotifyEvent {\n type: NotifyEventType\n}\n"],"mappings":";;;AA4DO,IAAM,gBAAgB,OAAO,eAAe;AAE5C,IAAM,qBAAqB,OAAO,oBAAoB;AAEtD,IAAM,cAAc,OAAO,aAAa;","names":[]}
|
|
1
|
+
{"version":3,"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\nexport type NonUndefinedGuard<T> = T extends undefined ? never : T\n\nexport type DistributiveOmit<\n TObject,\n TKey extends keyof TObject,\n> = TObject extends any ? Omit<TObject, TKey> : never\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\nexport type Override<TTargetA, TTargetB> = {\n [AKey in keyof TTargetA]: AKey extends keyof TTargetB\n ? TTargetB[AKey]\n : TTargetA[AKey]\n}\n\nexport type NoInfer<T> = [T][T extends any ? 0 : never]\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\nexport type DefaultError = Register extends {\n defaultError: infer TError\n}\n ? TError\n : Error\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('dataTagSymbol')\nexport type dataTagSymbol = typeof dataTagSymbol\nexport const dataTagErrorSymbol = Symbol('dataTagErrorSymbol')\nexport type dataTagErrorSymbol = typeof dataTagErrorSymbol\nexport const unsetMarker = Symbol('unsetMarker')\nexport type UnsetMarker = typeof unsetMarker\nexport type AnyDataTag = {\n [dataTagSymbol]: any\n [dataTagErrorSymbol]: any\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\nexport type InferDataFromTag<TQueryFnData, TTaggedQueryKey extends QueryKey> =\n TTaggedQueryKey extends DataTag<unknown, infer TaggedValue, unknown>\n ? TaggedValue\n : TQueryFnData\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\nexport type QueryFunction<\n T = unknown,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> = (context: QueryFunctionContext<TQueryKey, TPageParam>) => T | Promise<T>\n\nexport type StaleTime<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = number | ((query: Query<TQueryFnData, TError, TData, TQueryKey>) => number)\n\nexport type Enabled<\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\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\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\nexport type InitialDataFunction<T> = () => T | undefined\n\ntype NonFunctionGuard<T> = T extends Function ? never : T\n\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\nexport type QueriesPlaceholderDataFunction<TQueryData> = (\n previousData: undefined,\n previousQuery: undefined,\n) => TQueryData | undefined\n\nexport type QueryKeyHashFunction<TQueryKey extends QueryKey> = (\n queryKey: TQueryKey,\n) => string\n\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\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\nexport interface InfiniteData<TData, TPageParam = unknown> {\n pages: Array<TData>\n pageParams: Array<TPageParam>\n}\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\nexport type NetworkMode = 'online' | 'always' | 'offlineFirst'\n\nexport type NotifyOnChangeProps =\n | Array<keyof InfiniteQueryObserverResult>\n | 'all'\n | undefined\n | (() => Array<keyof InfiniteQueryObserverResult> | 'all' | undefined)\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., failureCount: num\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 retry?: RetryValue<TError>\n retryDelay?: RetryDelayValue<TError>\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 gcTime?: number\n queryFn?: QueryFunction<TQueryFnData, TQueryKey, TPageParam> | SkipToken\n persister?: QueryPersister<\n NoInfer<TQueryFnData>,\n NoInfer<TQueryKey>,\n NoInfer<TPageParam>\n >\n queryHash?: string\n queryKey?: TQueryKey\n queryKeyHashFn?: QueryKeyHashFunction<TQueryKey>\n initialData?: TData | InitialDataFunction<TData>\n initialDataUpdatedAt?: number | (() => number | undefined)\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 * Defaults to `true`.\n */\n structuralSharing?:\n | boolean\n | ((oldData: unknown | undefined, newData: unknown) => unknown)\n _defaulted?: boolean\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\nexport interface InitialPageParam<TPageParam = unknown> {\n initialPageParam: TPageParam\n}\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\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\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 * Defaults to `true`.\n */\n enabled?: Enabled<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 a function, the function will be executed with the query to compute a `staleTime`.\n * Defaults to `0`.\n */\n staleTime?: StaleTime<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 * Defaults to `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 * Defaults to `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.\n * If set to a function, the function will be executed with the latest data and query to compute the value.\n * Defaults to `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.\n * If set to a function, the function will be executed with the latest data and query to compute the value.\n * Defaults to the value of `networkOnline` (`true`)\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.\n * If set to a function, the function will be executed with the latest data and query to compute the value\n * Defaults to `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 * Defaults to `true`.\n */\n retryOnMount?: boolean\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 * By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change.\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 * Defaults to `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.\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 * Defaults to `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 _optimisticResults?: 'optimistic' | 'isRestoring'\n\n /**\n * Enable prefetching during rendering\n */\n experimental_prefetchInRender?: boolean\n}\n\nexport type WithRequired<TTarget, TKey extends keyof TTarget> = TTarget & {\n [_ in TKey]: {}\n}\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\nexport interface InfiniteQueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> extends QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n InfiniteData<TQueryData, TPageParam>,\n TQueryKey,\n TPageParam\n >,\n InfiniteQueryPageParamsOptions<TQueryFnData, TPageParam> {}\n\nexport type DefaultedInfiniteQueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = WithRequired<\n InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n >,\n 'throwOnError' | 'refetchOnReconnect' | 'queryHash'\n>\n\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 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?: StaleTime<TQueryFnData, TError, TData, TQueryKey>\n}\n\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 revalidateIfStale?: boolean\n}\n\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 FetchInfiniteQueryPages<TQueryFnData = unknown, TPageParam = unknown> =\n | { pages?: never }\n | {\n pages: number\n getNextPageParam: GetNextPageParamFunction<TPageParam, TQueryFnData>\n }\n\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 FetchInfiniteQueryPages<TQueryFnData, TPageParam>\n\nexport interface ResultOptions {\n throwOnError?: boolean\n}\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 *\n * Defaults to `true`.\n */\n cancelRefetch?: boolean\n}\n\nexport interface InvalidateQueryFilters<TQueryKey extends QueryKey = QueryKey>\n extends QueryFilters<TQueryKey> {\n refetchType?: QueryTypeFilter | 'none'\n}\n\nexport interface RefetchQueryFilters<TQueryKey extends QueryKey = QueryKey>\n extends QueryFilters<TQueryKey> {}\n\nexport interface InvalidateOptions extends RefetchOptions {}\nexport interface ResetOptions extends RefetchOptions {}\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 *\n * Defaults to `true`.\n */\n cancelRefetch?: boolean\n}\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 *\n * Defaults to `true`.\n */\n cancelRefetch?: boolean\n}\n\nexport type QueryStatus = 'pending' | 'error' | 'success'\nexport type FetchStatus = 'fetching' | 'paused' | 'idle'\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 * 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 * A stable promise that will be resolved with the data of the query.\n * Requires the `experimental_prefetchInRender` feature flag to be enabled.\n * @example\n *\n * ### Enabling the feature flag\n * ```ts\n * const client = new QueryClient({\n * defaultOptions: {\n * queries: {\n * experimental_prefetchInRender: true,\n * },\n * },\n * })\n * ```\n *\n * ### Usage\n * ```tsx\n * import { useQuery } from '@tanstack/react-query'\n * import React from 'react'\n * import { fetchTodos, type Todo } from './api'\n *\n * function TodoList({ query }: { query: UseQueryResult<Todo[], Error> }) {\n * const data = React.use(query.promise)\n *\n * return (\n * <ul>\n * {data.map(todo => (\n * <li key={todo.id}>{todo.title}</li>\n * ))}\n * </ul>\n * )\n * }\n *\n * export function App() {\n * const query = useQuery({ queryKey: ['todos'], queryFn: fetchTodos })\n *\n * return (\n * <>\n * <h1>Todos</h1>\n * <React.Suspense fallback={<div>Loading...</div>}>\n * <TodoList query={query} />\n * </React.Suspense>\n * </>\n * )\n * }\n * ```\n */\n promise: Promise<TData>\n}\n\nexport interface QueryObserverPendingResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult<TData, TError> {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoadingError: false\n isRefetchError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface QueryObserverLoadingResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult<TData, TError> {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoading: true\n isLoadingError: false\n isRefetchError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface QueryObserverLoadingErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult<TData, TError> {\n data: undefined\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: true\n isRefetchError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface QueryObserverRefetchErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult<TData, TError> {\n data: TData\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: true\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface QueryObserverSuccessResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult<TData, TError> {\n data: TData\n error: null\n isError: false\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isSuccess: true\n isPlaceholderData: false\n status: 'success'\n}\n\nexport interface QueryObserverPlaceholderResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult<TData, TError> {\n data: TData\n isError: false\n error: null\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isSuccess: true\n isPlaceholderData: true\n status: 'success'\n}\n\nexport type DefinedQueryObserverResult<\n TData = unknown,\n TError = DefaultError,\n> =\n | QueryObserverRefetchErrorResult<TData, TError>\n | QueryObserverSuccessResult<TData, TError>\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\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\nexport interface InfiniteQueryObserverPendingResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult<TData, TError> {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoadingError: false\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface InfiniteQueryObserverLoadingResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult<TData, TError> {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoading: true\n isLoadingError: false\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface InfiniteQueryObserverLoadingErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult<TData, TError> {\n data: undefined\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: true\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface InfiniteQueryObserverRefetchErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult<TData, TError> {\n data: TData\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: true\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface InfiniteQueryObserverSuccessResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult<TData, TError> {\n data: TData\n error: null\n isError: false\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: true\n isPlaceholderData: false\n status: 'success'\n}\n\nexport interface InfiniteQueryObserverPlaceholderResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult<TData, TError> {\n data: TData\n isError: false\n error: null\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isSuccess: true\n isPlaceholderData: true\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n status: 'success'\n}\n\nexport type DefinedInfiniteQueryObserverResult<\n TData = unknown,\n TError = DefaultError,\n> =\n | InfiniteQueryObserverRefetchErrorResult<TData, TError>\n | InfiniteQueryObserverSuccessResult<TData, TError>\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\nexport type MutationKey = Register extends {\n mutationKey: infer TMutationKey\n}\n ? TMutationKey extends Array<unknown>\n ? TMutationKey\n : TMutationKey extends Array<unknown>\n ? TMutationKey\n : ReadonlyArray<unknown>\n : ReadonlyArray<unknown>\n\nexport type MutationStatus = 'idle' | 'pending' | 'success' | 'error'\n\nexport type MutationScope = {\n id: string\n}\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\nexport type MutationFunction<TData = unknown, TVariables = unknown> = (\n variables: TVariables,\n) => Promise<TData>\n\nexport interface MutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TContext = unknown,\n> {\n mutationFn?: MutationFunction<TData, TVariables>\n mutationKey?: MutationKey\n onMutate?: (\n variables: TVariables,\n ) => Promise<TContext | undefined> | TContext | undefined\n onSuccess?: (\n data: TData,\n variables: TVariables,\n context: TContext,\n ) => Promise<unknown> | unknown\n onError?: (\n error: TError,\n variables: TVariables,\n context: TContext | undefined,\n ) => Promise<unknown> | unknown\n onSettled?: (\n data: TData | undefined,\n error: TError | null,\n variables: TVariables,\n context: TContext | undefined,\n ) => Promise<unknown> | unknown\n retry?: RetryValue<TError>\n retryDelay?: RetryDelayValue<TError>\n networkMode?: NetworkMode\n gcTime?: number\n _defaulted?: boolean\n meta?: MutationMeta\n scope?: MutationScope\n}\n\nexport interface MutationObserverOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TContext = unknown,\n> extends MutationOptions<TData, TError, TVariables, TContext> {\n throwOnError?: boolean | ((error: TError) => boolean)\n}\n\nexport interface MutateOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TContext = unknown,\n> {\n onSuccess?: (data: TData, variables: TVariables, context: TContext) => void\n onError?: (\n error: TError,\n variables: TVariables,\n context: TContext | undefined,\n ) => void\n onSettled?: (\n data: TData | undefined,\n error: TError | null,\n variables: TVariables,\n context: TContext | undefined,\n ) => void\n}\n\nexport type MutateFunction<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TContext = unknown,\n> = (\n variables: TVariables,\n options?: MutateOptions<TData, TError, TVariables, TContext>,\n) => Promise<TData>\n\nexport interface MutationObserverBaseResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TContext = unknown,\n> extends MutationState<TData, TError, TVariables, TContext> {\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, TContext>\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\nexport interface MutationObserverIdleResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TContext = unknown,\n> extends MutationObserverBaseResult<TData, TError, TVariables, TContext> {\n data: undefined\n variables: undefined\n error: null\n isError: false\n isIdle: true\n isPending: false\n isSuccess: false\n status: 'idle'\n}\n\nexport interface MutationObserverLoadingResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TContext = unknown,\n> extends MutationObserverBaseResult<TData, TError, TVariables, TContext> {\n data: undefined\n variables: TVariables\n error: null\n isError: false\n isIdle: false\n isPending: true\n isSuccess: false\n status: 'pending'\n}\n\nexport interface MutationObserverErrorResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TContext = unknown,\n> extends MutationObserverBaseResult<TData, TError, TVariables, TContext> {\n data: undefined\n error: TError\n variables: TVariables\n isError: true\n isIdle: false\n isPending: false\n isSuccess: false\n status: 'error'\n}\n\nexport interface MutationObserverSuccessResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TContext = unknown,\n> extends MutationObserverBaseResult<TData, TError, TVariables, TContext> {\n data: TData\n error: null\n variables: TVariables\n isError: false\n isIdle: false\n isPending: false\n isSuccess: true\n status: 'success'\n}\n\nexport type MutationObserverResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TContext = unknown,\n> =\n | MutationObserverIdleResult<TData, TError, TVariables, TContext>\n | MutationObserverLoadingResult<TData, TError, TVariables, TContext>\n | MutationObserverErrorResult<TData, TError, TVariables, TContext>\n | MutationObserverSuccessResult<TData, TError, TVariables, TContext>\n\nexport interface QueryClientConfig {\n queryCache?: QueryCache\n mutationCache?: MutationCache\n defaultOptions?: DefaultOptions\n}\n\nexport interface DefaultOptions<TError = DefaultError> {\n queries?: OmitKeyof<\n QueryObserverOptions<unknown, TError>,\n 'suspense' | 'queryKey'\n >\n mutations?: MutationObserverOptions<unknown, TError, unknown, unknown>\n hydrate?: HydrateOptions['defaultOptions']\n dehydrate?: DehydrateOptions\n}\n\nexport interface CancelOptions {\n revert?: boolean\n silent?: boolean\n}\n\nexport interface SetDataOptions {\n updatedAt?: number\n}\n\nexport type NotifyEventType =\n | 'added'\n | 'removed'\n | 'updated'\n | 'observerAdded'\n | 'observerRemoved'\n | 'observerResultsUpdated'\n | 'observerOptionsUpdated'\n\nexport interface NotifyEvent {\n type: NotifyEventType\n}\n"],"mappings":";;;AA8DO,IAAM,gBAAgB,OAAO,eAAe;AAE5C,IAAM,qBAAqB,OAAO,oBAAoB;AAEtD,IAAM,cAAc,OAAO,aAAa;","names":[]}
|
package/build/legacy/utils.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { j as MutationFilters, l as QueryFilters,
|
|
1
|
+
export { j as MutationFilters, l as QueryFilters, bi as QueryTypeFilter, S as SkipToken, U as Updater, bv as addToEnd, bw as addToStart, bx as ensureQueryFn, bj as functionalUpdate, h as hashKey, bo as hashQueryKeyByOptions, br as isPlainArray, bs as isPlainObject, i as isServer, bk as isValidTimeout, k as keepPreviousData, f as matchMutation, m as matchQuery, n as noop, bp as partialMatchKey, bu as replaceData, r as replaceEqualDeep, bn as resolveEnabled, bm as resolveStaleTime, bq as shallowEqualObjects, g as shouldThrowError, s as skipToken, bt as sleep, bl as timeUntilStale } from './hydration-TwHKRJLE.cjs';
|
|
2
2
|
import './removable.cjs';
|
|
3
3
|
import './subscribable.cjs';
|
package/build/legacy/utils.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { j as MutationFilters, l as QueryFilters,
|
|
1
|
+
export { j as MutationFilters, l as QueryFilters, bi as QueryTypeFilter, S as SkipToken, U as Updater, bv as addToEnd, bw as addToStart, bx as ensureQueryFn, bj as functionalUpdate, h as hashKey, bo as hashQueryKeyByOptions, br as isPlainArray, bs as isPlainObject, i as isServer, bk as isValidTimeout, k as keepPreviousData, f as matchMutation, m as matchQuery, n as noop, bp as partialMatchKey, bu as replaceData, r as replaceEqualDeep, bn as resolveEnabled, bm as resolveStaleTime, bq as shallowEqualObjects, g as shouldThrowError, s as skipToken, bt as sleep, bl as timeUntilStale } from './hydration-17eepgNg.js';
|
|
2
2
|
import './removable.js';
|
|
3
3
|
import './subscribable.js';
|
|
@@ -510,6 +510,7 @@ declare class CancelledError extends Error {
|
|
|
510
510
|
declare function isCancelledError(value: any): value is CancelledError;
|
|
511
511
|
declare function createRetryer<TData = unknown, TError = DefaultError>(config: RetryerConfig<TData, TError>): Retryer<TData>;
|
|
512
512
|
|
|
513
|
+
type NonUndefinedGuard<T> = T extends undefined ? never : T;
|
|
513
514
|
type DistributiveOmit<TObject, TKey extends keyof TObject> = TObject extends any ? Omit<TObject, TKey> : never;
|
|
514
515
|
type OmitKeyof<TObject, TKey extends TStrictly extends 'safely' ? keyof TObject | (string & Record<never, never>) | (number & Record<never, never>) | (symbol & Record<never, never>) : keyof TObject, TStrictly extends 'strictly' | 'safely' = 'strictly'> = Omit<TObject, TKey>;
|
|
515
516
|
type Override<TTargetA, TTargetB> = {
|
|
@@ -1358,4 +1359,4 @@ declare function defaultShouldDehydrateQuery(query: Query): boolean;
|
|
|
1358
1359
|
declare function dehydrate(client: QueryClient, options?: DehydrateOptions): DehydratedState;
|
|
1359
1360
|
declare function hydrate(client: QueryClient, dehydratedState: unknown, options?: HydrateOptions): void;
|
|
1360
1361
|
|
|
1361
|
-
export { type
|
|
1362
|
+
export { type QueryFunctionContext as $, type DistributiveOmit as A, type Override as B, CancelledError as C, type DehydrateOptions as D, type NoInfer as E, type DefaultError as F, type QueryKey as G, type HydrateOptions as H, dataTagSymbol as I, dataTagErrorSymbol as J, unsetMarker as K, type UnsetMarker as L, MutationCache as M, type NonUndefinedGuard as N, type OmitKeyof as O, type AnyDataTag as P, QueryCache as Q, type Register as R, type SkipToken as S, type DataTag as T, type Updater as U, type InferDataFromTag as V, type InferErrorFromTag as W, type QueryFunction as X, type StaleTime as Y, type Enabled as Z, type QueryPersister as _, type QueryCacheNotifyEvent as a, type MutationObserverErrorResult as a$, type InitialDataFunction as a0, type PlaceholderDataFunction as a1, type QueriesPlaceholderDataFunction as a2, type QueryKeyHashFunction as a3, type GetPreviousPageParamFunction as a4, type GetNextPageParamFunction as a5, type InfiniteData as a6, type QueryMeta as a7, type NetworkMode as a8, type NotifyOnChangeProps as a9, type QueryObserverLoadingErrorResult as aA, type QueryObserverRefetchErrorResult as aB, type QueryObserverSuccessResult as aC, type QueryObserverPlaceholderResult as aD, type DefinedQueryObserverResult as aE, type QueryObserverResult as aF, type InfiniteQueryObserverBaseResult as aG, type InfiniteQueryObserverPendingResult as aH, type InfiniteQueryObserverLoadingResult as aI, type InfiniteQueryObserverLoadingErrorResult as aJ, type InfiniteQueryObserverRefetchErrorResult as aK, type InfiniteQueryObserverSuccessResult as aL, type InfiniteQueryObserverPlaceholderResult as aM, type DefinedInfiniteQueryObserverResult as aN, type InfiniteQueryObserverResult as aO, type MutationKey as aP, type MutationStatus as aQ, type MutationScope as aR, type MutationMeta as aS, type MutationFunction as aT, type MutationOptions as aU, type MutationObserverOptions as aV, type MutateOptions as aW, type MutateFunction as aX, type MutationObserverBaseResult as aY, type MutationObserverIdleResult as aZ, type MutationObserverLoadingResult as a_, type QueryOptions as aa, type InitialPageParam as ab, type InfiniteQueryPageParamsOptions as ac, type ThrowOnError as ad, type QueryObserverOptions as ae, type WithRequired as af, type DefaultedQueryObserverOptions as ag, type InfiniteQueryObserverOptions as ah, type DefaultedInfiniteQueryObserverOptions as ai, type FetchQueryOptions as aj, type EnsureQueryDataOptions as ak, type EnsureInfiniteQueryDataOptions as al, type FetchInfiniteQueryOptions as am, type ResultOptions as an, type RefetchOptions as ao, type InvalidateQueryFilters as ap, type RefetchQueryFilters as aq, type InvalidateOptions as ar, type ResetOptions as as, type FetchNextPageOptions as at, type FetchPreviousPageOptions as au, type QueryStatus as av, type FetchStatus as aw, type QueryObserverBaseResult as ax, type QueryObserverPendingResult as ay, type QueryObserverLoadingResult as az, QueryClient as b, type MutationObserverSuccessResult as b0, type MutationObserverResult as b1, type QueryClientConfig as b2, type DefaultOptions as b3, type CancelOptions as b4, type SetDataOptions as b5, type NotifyEventType as b6, type NotifyEvent as b7, type QueryBehavior as b8, type FetchContext as b9, type RetryValue as bA, type RetryDelayValue as bB, canFetch as bC, createRetryer as bD, type FetchDirection as ba, type FetchMeta as bb, type FetchOptions as bc, type Action$1 as bd, type SetStateOptions as be, fetchState as bf, type Action as bg, getDefaultState as bh, type QueryTypeFilter as bi, functionalUpdate as bj, isValidTimeout as bk, timeUntilStale as bl, resolveStaleTime as bm, resolveEnabled as bn, hashQueryKeyByOptions as bo, partialMatchKey as bp, shallowEqualObjects as bq, isPlainArray as br, isPlainObject as bs, sleep as bt, replaceData as bu, addToEnd as bv, addToStart as bw, ensureQueryFn as bx, type QueryStore as by, type Retryer as bz, QueryObserver as c, type MutationCacheNotifyEvent as d, MutationObserver as e, matchMutation as f, shouldThrowError as g, hashKey as h, isServer as i, type MutationFilters as j, keepPreviousData as k, type QueryFilters as l, matchQuery as m, noop as n, isCancelledError as o, dehydrate as p, hydrate as q, replaceEqualDeep as r, skipToken as s, defaultShouldDehydrateQuery as t, defaultShouldDehydrateMutation as u, type QueryState as v, Query as w, type MutationState as x, Mutation as y, type DehydratedState as z };
|
|
@@ -510,6 +510,7 @@ declare class CancelledError extends Error {
|
|
|
510
510
|
declare function isCancelledError(value: any): value is CancelledError;
|
|
511
511
|
declare function createRetryer<TData = unknown, TError = DefaultError>(config: RetryerConfig<TData, TError>): Retryer<TData>;
|
|
512
512
|
|
|
513
|
+
type NonUndefinedGuard<T> = T extends undefined ? never : T;
|
|
513
514
|
type DistributiveOmit<TObject, TKey extends keyof TObject> = TObject extends any ? Omit<TObject, TKey> : never;
|
|
514
515
|
type OmitKeyof<TObject, TKey extends TStrictly extends 'safely' ? keyof TObject | (string & Record<never, never>) | (number & Record<never, never>) | (symbol & Record<never, never>) : keyof TObject, TStrictly extends 'strictly' | 'safely' = 'strictly'> = Omit<TObject, TKey>;
|
|
515
516
|
type Override<TTargetA, TTargetB> = {
|
|
@@ -1358,4 +1359,4 @@ declare function defaultShouldDehydrateQuery(query: Query): boolean;
|
|
|
1358
1359
|
declare function dehydrate(client: QueryClient, options?: DehydrateOptions): DehydratedState;
|
|
1359
1360
|
declare function hydrate(client: QueryClient, dehydratedState: unknown, options?: HydrateOptions): void;
|
|
1360
1361
|
|
|
1361
|
-
export { type
|
|
1362
|
+
export { type QueryFunctionContext as $, type DistributiveOmit as A, type Override as B, CancelledError as C, type DehydrateOptions as D, type NoInfer as E, type DefaultError as F, type QueryKey as G, type HydrateOptions as H, dataTagSymbol as I, dataTagErrorSymbol as J, unsetMarker as K, type UnsetMarker as L, MutationCache as M, type NonUndefinedGuard as N, type OmitKeyof as O, type AnyDataTag as P, QueryCache as Q, type Register as R, type SkipToken as S, type DataTag as T, type Updater as U, type InferDataFromTag as V, type InferErrorFromTag as W, type QueryFunction as X, type StaleTime as Y, type Enabled as Z, type QueryPersister as _, type QueryCacheNotifyEvent as a, type MutationObserverErrorResult as a$, type InitialDataFunction as a0, type PlaceholderDataFunction as a1, type QueriesPlaceholderDataFunction as a2, type QueryKeyHashFunction as a3, type GetPreviousPageParamFunction as a4, type GetNextPageParamFunction as a5, type InfiniteData as a6, type QueryMeta as a7, type NetworkMode as a8, type NotifyOnChangeProps as a9, type QueryObserverLoadingErrorResult as aA, type QueryObserverRefetchErrorResult as aB, type QueryObserverSuccessResult as aC, type QueryObserverPlaceholderResult as aD, type DefinedQueryObserverResult as aE, type QueryObserverResult as aF, type InfiniteQueryObserverBaseResult as aG, type InfiniteQueryObserverPendingResult as aH, type InfiniteQueryObserverLoadingResult as aI, type InfiniteQueryObserverLoadingErrorResult as aJ, type InfiniteQueryObserverRefetchErrorResult as aK, type InfiniteQueryObserverSuccessResult as aL, type InfiniteQueryObserverPlaceholderResult as aM, type DefinedInfiniteQueryObserverResult as aN, type InfiniteQueryObserverResult as aO, type MutationKey as aP, type MutationStatus as aQ, type MutationScope as aR, type MutationMeta as aS, type MutationFunction as aT, type MutationOptions as aU, type MutationObserverOptions as aV, type MutateOptions as aW, type MutateFunction as aX, type MutationObserverBaseResult as aY, type MutationObserverIdleResult as aZ, type MutationObserverLoadingResult as a_, type QueryOptions as aa, type InitialPageParam as ab, type InfiniteQueryPageParamsOptions as ac, type ThrowOnError as ad, type QueryObserverOptions as ae, type WithRequired as af, type DefaultedQueryObserverOptions as ag, type InfiniteQueryObserverOptions as ah, type DefaultedInfiniteQueryObserverOptions as ai, type FetchQueryOptions as aj, type EnsureQueryDataOptions as ak, type EnsureInfiniteQueryDataOptions as al, type FetchInfiniteQueryOptions as am, type ResultOptions as an, type RefetchOptions as ao, type InvalidateQueryFilters as ap, type RefetchQueryFilters as aq, type InvalidateOptions as ar, type ResetOptions as as, type FetchNextPageOptions as at, type FetchPreviousPageOptions as au, type QueryStatus as av, type FetchStatus as aw, type QueryObserverBaseResult as ax, type QueryObserverPendingResult as ay, type QueryObserverLoadingResult as az, QueryClient as b, type MutationObserverSuccessResult as b0, type MutationObserverResult as b1, type QueryClientConfig as b2, type DefaultOptions as b3, type CancelOptions as b4, type SetDataOptions as b5, type NotifyEventType as b6, type NotifyEvent as b7, type QueryBehavior as b8, type FetchContext as b9, type RetryValue as bA, type RetryDelayValue as bB, canFetch as bC, createRetryer as bD, type FetchDirection as ba, type FetchMeta as bb, type FetchOptions as bc, type Action$1 as bd, type SetStateOptions as be, fetchState as bf, type Action as bg, getDefaultState as bh, type QueryTypeFilter as bi, functionalUpdate as bj, isValidTimeout as bk, timeUntilStale as bl, resolveStaleTime as bm, resolveEnabled as bn, hashQueryKeyByOptions as bo, partialMatchKey as bp, shallowEqualObjects as bq, isPlainArray as br, isPlainObject as bs, sleep as bt, replaceData as bu, addToEnd as bv, addToStart as bw, ensureQueryFn as bx, type QueryStore as by, type Retryer as bz, QueryObserver as c, type MutationCacheNotifyEvent as d, MutationObserver as e, matchMutation as f, shouldThrowError as g, hashKey as h, isServer as i, type MutationFilters as j, keepPreviousData as k, type QueryFilters as l, matchQuery as m, noop as n, isCancelledError as o, dehydrate as p, hydrate as q, replaceEqualDeep as r, skipToken as s, defaultShouldDehydrateQuery as t, defaultShouldDehydrateMutation as u, type QueryState as v, Query as w, type MutationState as x, Mutation as y, type DehydratedState as z };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { D as DehydrateOptions, z as DehydratedState, H as HydrateOptions, u as defaultShouldDehydrateMutation, t as defaultShouldDehydrateQuery, p as dehydrate, q as hydrate } from './hydration-
|
|
1
|
+
export { D as DehydrateOptions, z as DehydratedState, H as HydrateOptions, u as defaultShouldDehydrateMutation, t as defaultShouldDehydrateQuery, p as dehydrate, q as hydrate } from './hydration-TwHKRJLE.cjs';
|
|
2
2
|
import './removable.cjs';
|
|
3
3
|
import './subscribable.cjs';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { D as DehydrateOptions, z as DehydratedState, H as HydrateOptions, u as defaultShouldDehydrateMutation, t as defaultShouldDehydrateQuery, p as dehydrate, q as hydrate } from './hydration-
|
|
1
|
+
export { D as DehydrateOptions, z as DehydratedState, H as HydrateOptions, u as defaultShouldDehydrateMutation, t as defaultShouldDehydrateQuery, p as dehydrate, q as hydrate } from './hydration-17eepgNg.js';
|
|
2
2
|
import './removable.js';
|
|
3
3
|
import './subscribable.js';
|
package/build/modern/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { P as AnyDataTag, b4 as CancelOptions, C as CancelledError, T as DataTag, F as DefaultError, b3 as DefaultOptions, ai as DefaultedInfiniteQueryObserverOptions, ag as DefaultedQueryObserverOptions, aN as DefinedInfiniteQueryObserverResult, aE as DefinedQueryObserverResult, D as DehydrateOptions, z as DehydratedState, A as DistributiveOmit, Z as Enabled, al as EnsureInfiniteQueryDataOptions, ak as EnsureQueryDataOptions, am as FetchInfiniteQueryOptions, at as FetchNextPageOptions, au as FetchPreviousPageOptions, aj as FetchQueryOptions, aw as FetchStatus, a5 as GetNextPageParamFunction, a4 as GetPreviousPageParamFunction, H as HydrateOptions, V as InferDataFromTag, W as InferErrorFromTag, a6 as InfiniteData, aG as InfiniteQueryObserverBaseResult, aJ as InfiniteQueryObserverLoadingErrorResult, aI as InfiniteQueryObserverLoadingResult, ah as InfiniteQueryObserverOptions, aH as InfiniteQueryObserverPendingResult, aM as InfiniteQueryObserverPlaceholderResult, aK as InfiniteQueryObserverRefetchErrorResult, aO as InfiniteQueryObserverResult, aL as InfiniteQueryObserverSuccessResult, ac as InfiniteQueryPageParamsOptions, a0 as InitialDataFunction, ab as InitialPageParam, ar as InvalidateOptions, ap as InvalidateQueryFilters, aX as MutateFunction, aW as MutateOptions, y as Mutation, M as MutationCache, d as MutationCacheNotifyEvent, j as MutationFilters, aT as MutationFunction, aP as MutationKey, aS as MutationMeta, e as MutationObserver, aY as MutationObserverBaseResult, a$ as MutationObserverErrorResult, aZ as MutationObserverIdleResult, a_ as MutationObserverLoadingResult, aV as MutationObserverOptions, b1 as MutationObserverResult, b0 as MutationObserverSuccessResult, aU as MutationOptions, aR as MutationScope, x as MutationState, aQ as MutationStatus, a8 as NetworkMode, E as NoInfer, N as NonUndefinedGuard, b7 as NotifyEvent, b6 as NotifyEventType, a9 as NotifyOnChangeProps, O as OmitKeyof, B as Override, a1 as PlaceholderDataFunction, a2 as QueriesPlaceholderDataFunction, w as Query, Q as QueryCache, a as QueryCacheNotifyEvent, b as QueryClient, b2 as QueryClientConfig, l as QueryFilters, X as QueryFunction, $ as QueryFunctionContext, G as QueryKey, a3 as QueryKeyHashFunction, a7 as QueryMeta, c as QueryObserver, ax as QueryObserverBaseResult, aA as QueryObserverLoadingErrorResult, az as QueryObserverLoadingResult, ae as QueryObserverOptions, ay as QueryObserverPendingResult, aD as QueryObserverPlaceholderResult, aB as QueryObserverRefetchErrorResult, aF as QueryObserverResult, aC as QueryObserverSuccessResult, aa as QueryOptions, _ as QueryPersister, v as QueryState, av as QueryStatus, ao as RefetchOptions, aq as RefetchQueryFilters, R as Register, as as ResetOptions, an as ResultOptions, b5 as SetDataOptions, S as SkipToken, Y as StaleTime, ad as ThrowOnError, L as UnsetMarker, U as Updater, af as WithRequired, J as dataTagErrorSymbol, I as dataTagSymbol, u as defaultShouldDehydrateMutation, t as defaultShouldDehydrateQuery, p as dehydrate, h as hashKey, q as hydrate, o as isCancelledError, i as isServer, k as keepPreviousData, f as matchMutation, m as matchQuery, n as noop, r as replaceEqualDeep, g as shouldThrowError, s as skipToken, K as unsetMarker } from './hydration-TwHKRJLE.cjs';
|
|
2
2
|
export { QueriesObserver, QueriesObserverOptions } from './queriesObserver.cjs';
|
|
3
3
|
export { InfiniteQueryObserver } from './infiniteQueryObserver.cjs';
|
|
4
4
|
export { defaultScheduler, notifyManager } from './notifyManager.cjs';
|
package/build/modern/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { P as AnyDataTag, b4 as CancelOptions, C as CancelledError, T as DataTag, F as DefaultError, b3 as DefaultOptions, ai as DefaultedInfiniteQueryObserverOptions, ag as DefaultedQueryObserverOptions, aN as DefinedInfiniteQueryObserverResult, aE as DefinedQueryObserverResult, D as DehydrateOptions, z as DehydratedState, A as DistributiveOmit, Z as Enabled, al as EnsureInfiniteQueryDataOptions, ak as EnsureQueryDataOptions, am as FetchInfiniteQueryOptions, at as FetchNextPageOptions, au as FetchPreviousPageOptions, aj as FetchQueryOptions, aw as FetchStatus, a5 as GetNextPageParamFunction, a4 as GetPreviousPageParamFunction, H as HydrateOptions, V as InferDataFromTag, W as InferErrorFromTag, a6 as InfiniteData, aG as InfiniteQueryObserverBaseResult, aJ as InfiniteQueryObserverLoadingErrorResult, aI as InfiniteQueryObserverLoadingResult, ah as InfiniteQueryObserverOptions, aH as InfiniteQueryObserverPendingResult, aM as InfiniteQueryObserverPlaceholderResult, aK as InfiniteQueryObserverRefetchErrorResult, aO as InfiniteQueryObserverResult, aL as InfiniteQueryObserverSuccessResult, ac as InfiniteQueryPageParamsOptions, a0 as InitialDataFunction, ab as InitialPageParam, ar as InvalidateOptions, ap as InvalidateQueryFilters, aX as MutateFunction, aW as MutateOptions, y as Mutation, M as MutationCache, d as MutationCacheNotifyEvent, j as MutationFilters, aT as MutationFunction, aP as MutationKey, aS as MutationMeta, e as MutationObserver, aY as MutationObserverBaseResult, a$ as MutationObserverErrorResult, aZ as MutationObserverIdleResult, a_ as MutationObserverLoadingResult, aV as MutationObserverOptions, b1 as MutationObserverResult, b0 as MutationObserverSuccessResult, aU as MutationOptions, aR as MutationScope, x as MutationState, aQ as MutationStatus, a8 as NetworkMode, E as NoInfer, N as NonUndefinedGuard, b7 as NotifyEvent, b6 as NotifyEventType, a9 as NotifyOnChangeProps, O as OmitKeyof, B as Override, a1 as PlaceholderDataFunction, a2 as QueriesPlaceholderDataFunction, w as Query, Q as QueryCache, a as QueryCacheNotifyEvent, b as QueryClient, b2 as QueryClientConfig, l as QueryFilters, X as QueryFunction, $ as QueryFunctionContext, G as QueryKey, a3 as QueryKeyHashFunction, a7 as QueryMeta, c as QueryObserver, ax as QueryObserverBaseResult, aA as QueryObserverLoadingErrorResult, az as QueryObserverLoadingResult, ae as QueryObserverOptions, ay as QueryObserverPendingResult, aD as QueryObserverPlaceholderResult, aB as QueryObserverRefetchErrorResult, aF as QueryObserverResult, aC as QueryObserverSuccessResult, aa as QueryOptions, _ as QueryPersister, v as QueryState, av as QueryStatus, ao as RefetchOptions, aq as RefetchQueryFilters, R as Register, as as ResetOptions, an as ResultOptions, b5 as SetDataOptions, S as SkipToken, Y as StaleTime, ad as ThrowOnError, L as UnsetMarker, U as Updater, af as WithRequired, J as dataTagErrorSymbol, I as dataTagSymbol, u as defaultShouldDehydrateMutation, t as defaultShouldDehydrateQuery, p as dehydrate, h as hashKey, q as hydrate, o as isCancelledError, i as isServer, k as keepPreviousData, f as matchMutation, m as matchQuery, n as noop, r as replaceEqualDeep, g as shouldThrowError, s as skipToken, K as unsetMarker } from './hydration-17eepgNg.js';
|
|
2
2
|
export { QueriesObserver, QueriesObserverOptions } from './queriesObserver.js';
|
|
3
3
|
export { InfiniteQueryObserver } from './infiniteQueryObserver.js';
|
|
4
4
|
export { defaultScheduler, notifyManager } from './notifyManager.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b8 as QueryBehavior, a6 as InfiniteData, ac as InfiniteQueryPageParamsOptions } from './hydration-TwHKRJLE.cjs';
|
|
2
2
|
import './removable.cjs';
|
|
3
3
|
import './subscribable.cjs';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b8 as QueryBehavior, a6 as InfiniteData, ac as InfiniteQueryPageParamsOptions } from './hydration-17eepgNg.js';
|
|
2
2
|
import './removable.js';
|
|
3
3
|
import './subscribable.js';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { F as DefaultError, a6 as InfiniteData, G as QueryKey, c as QueryObserver, aO as InfiniteQueryObserverResult, b as QueryClient, ah as InfiniteQueryObserverOptions, ai as DefaultedInfiniteQueryObserverOptions, at as FetchNextPageOptions, au as FetchPreviousPageOptions, w as Query } from './hydration-TwHKRJLE.cjs';
|
|
2
2
|
import { Subscribable } from './subscribable.cjs';
|
|
3
3
|
import './removable.cjs';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { F as DefaultError, a6 as InfiniteData, G as QueryKey, c as QueryObserver, aO as InfiniteQueryObserverResult, b as QueryClient, ah as InfiniteQueryObserverOptions, ai as DefaultedInfiniteQueryObserverOptions, at as FetchNextPageOptions, au as FetchPreviousPageOptions, w as Query } from './hydration-17eepgNg.js';
|
|
2
2
|
import { Subscribable } from './subscribable.js';
|
|
3
3
|
import './removable.js';
|
|
4
4
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import './removable.cjs';
|
|
2
|
-
export {
|
|
2
|
+
export { bg as Action, y as Mutation, x as MutationState, bh as getDefaultState } from './hydration-TwHKRJLE.cjs';
|
|
3
3
|
import './subscribable.cjs';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import './removable.js';
|
|
2
|
-
export {
|
|
2
|
+
export { bg as Action, y as Mutation, x as MutationState, bh as getDefaultState } from './hydration-17eepgNg.js';
|
|
3
3
|
import './subscribable.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aF as QueryObserverResult, b as QueryClient, ae as QueryObserverOptions, w as Query, c as QueryObserver } from './hydration-TwHKRJLE.cjs';
|
|
2
2
|
import { Subscribable } from './subscribable.cjs';
|
|
3
3
|
import './removable.cjs';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aF as QueryObserverResult, b as QueryClient, ae as QueryObserverOptions, w as Query, c as QueryObserver } from './hydration-17eepgNg.js';
|
|
2
2
|
import { Subscribable } from './subscribable.js';
|
|
3
3
|
import './removable.js';
|
|
4
4
|
|
package/build/modern/query.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import './removable.cjs';
|
|
2
|
-
export {
|
|
2
|
+
export { bd as Action, b9 as FetchContext, ba as FetchDirection, bb as FetchMeta, bc as FetchOptions, w as Query, b8 as QueryBehavior, v as QueryState, be as SetStateOptions, bf as fetchState } from './hydration-TwHKRJLE.cjs';
|
|
3
3
|
import './subscribable.cjs';
|
package/build/modern/query.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import './removable.js';
|
|
2
|
-
export {
|
|
2
|
+
export { bd as Action, b9 as FetchContext, ba as FetchDirection, bb as FetchMeta, bc as FetchOptions, w as Query, b8 as QueryBehavior, v as QueryState, be as SetStateOptions, bf as fetchState } from './hydration-17eepgNg.js';
|
|
3
3
|
import './subscribable.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { C as CancelledError,
|
|
1
|
+
export { C as CancelledError, bB as RetryDelayValue, bA as RetryValue, bz as Retryer, bC as canFetch, bD as createRetryer, o as isCancelledError } from './hydration-TwHKRJLE.cjs';
|
|
2
2
|
import './removable.cjs';
|
|
3
3
|
import './subscribable.cjs';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { C as CancelledError,
|
|
1
|
+
export { C as CancelledError, bB as RetryDelayValue, bA as RetryValue, bz as Retryer, bC as canFetch, bD as createRetryer, o as isCancelledError } from './hydration-17eepgNg.js';
|
|
2
2
|
import './removable.js';
|
|
3
3
|
import './subscribable.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { G as QueryKey, $ as QueryFunctionContext, X as QueryFunction } from './hydration-TwHKRJLE.cjs';
|
|
2
2
|
import './removable.cjs';
|
|
3
3
|
import './subscribable.cjs';
|
|
4
4
|
|