@tanstack/preact-query 5.103.2 → 5.104.0
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/README.md +2 -2
- package/build/legacy/HydrationBoundary.d.cts +2 -3
- package/build/legacy/HydrationBoundary.d.cts.map +1 -1
- package/build/legacy/HydrationBoundary.d.ts +2 -3
- package/build/legacy/HydrationBoundary.d.ts.map +1 -1
- package/build/legacy/IsRestoringProvider.d.cts +2 -3
- package/build/legacy/IsRestoringProvider.d.cts.map +1 -1
- package/build/legacy/IsRestoringProvider.d.ts +2 -3
- package/build/legacy/IsRestoringProvider.d.ts.map +1 -1
- package/build/legacy/QueryClientProvider.d.cts +4 -5
- package/build/legacy/QueryClientProvider.d.cts.map +1 -1
- package/build/legacy/QueryClientProvider.d.ts +4 -5
- package/build/legacy/QueryClientProvider.d.ts.map +1 -1
- package/build/legacy/QueryErrorResetBoundary.d.cts +8 -9
- package/build/legacy/QueryErrorResetBoundary.d.cts.map +1 -1
- package/build/legacy/QueryErrorResetBoundary.d.ts +8 -9
- package/build/legacy/QueryErrorResetBoundary.d.ts.map +1 -1
- package/build/legacy/errorBoundaryUtils.d.cts +3 -4
- package/build/legacy/errorBoundaryUtils.d.cts.map +1 -1
- package/build/legacy/errorBoundaryUtils.d.ts +3 -4
- package/build/legacy/errorBoundaryUtils.d.ts.map +1 -1
- package/build/legacy/infiniteQueryOptions.cjs.map +1 -1
- package/build/legacy/infiniteQueryOptions.d.cts +7 -8
- package/build/legacy/infiniteQueryOptions.d.cts.map +1 -1
- package/build/legacy/infiniteQueryOptions.d.ts +7 -8
- package/build/legacy/infiniteQueryOptions.d.ts.map +1 -1
- package/build/legacy/infiniteQueryOptions.js.map +1 -1
- package/build/legacy/mutationOptions.d.cts +2 -3
- package/build/legacy/mutationOptions.d.cts.map +1 -1
- package/build/legacy/mutationOptions.d.ts +2 -3
- package/build/legacy/mutationOptions.d.ts.map +1 -1
- package/build/legacy/queryOptions.cjs.map +1 -1
- package/build/legacy/queryOptions.d.cts +9 -9
- package/build/legacy/queryOptions.d.cts.map +1 -1
- package/build/legacy/queryOptions.d.ts +9 -9
- package/build/legacy/queryOptions.d.ts.map +1 -1
- package/build/legacy/queryOptions.js.map +1 -1
- package/build/legacy/suspense.cjs.map +1 -1
- package/build/legacy/suspense.d.cts +4 -5
- package/build/legacy/suspense.d.cts.map +1 -1
- package/build/legacy/suspense.d.ts +4 -5
- package/build/legacy/suspense.d.ts.map +1 -1
- package/build/legacy/suspense.js.map +1 -1
- package/build/legacy/types.cjs.map +1 -1
- package/build/legacy/types.d.cts +30 -30
- package/build/legacy/types.d.cts.map +1 -1
- package/build/legacy/types.d.ts +30 -30
- package/build/legacy/types.d.ts.map +1 -1
- package/build/legacy/types.js.map +1 -1
- package/build/legacy/useBaseQuery.cjs.map +1 -1
- package/build/legacy/useBaseQuery.d.cts +1 -2
- package/build/legacy/useBaseQuery.d.cts.map +1 -1
- package/build/legacy/useBaseQuery.d.ts +1 -2
- package/build/legacy/useBaseQuery.d.ts.map +1 -1
- package/build/legacy/useBaseQuery.js.map +1 -1
- package/build/legacy/useInfiniteQuery.d.cts +3 -4
- package/build/legacy/useInfiniteQuery.d.cts.map +1 -1
- package/build/legacy/useInfiniteQuery.d.ts +3 -4
- package/build/legacy/useInfiniteQuery.d.ts.map +1 -1
- package/build/legacy/useIsFetching.d.cts +1 -2
- package/build/legacy/useIsFetching.d.cts.map +1 -1
- package/build/legacy/useIsFetching.d.ts +1 -2
- package/build/legacy/useIsFetching.d.ts.map +1 -1
- package/build/legacy/useMutation.d.cts +1 -2
- package/build/legacy/useMutation.d.cts.map +1 -1
- package/build/legacy/useMutation.d.ts +1 -2
- package/build/legacy/useMutation.d.ts.map +1 -1
- package/build/legacy/useMutationState.d.cts +2 -3
- package/build/legacy/useMutationState.d.cts.map +1 -1
- package/build/legacy/useMutationState.d.ts +2 -3
- package/build/legacy/useMutationState.d.ts.map +1 -1
- package/build/legacy/usePrefetchInfiniteQuery.d.cts +1 -2
- package/build/legacy/usePrefetchInfiniteQuery.d.cts.map +1 -1
- package/build/legacy/usePrefetchInfiniteQuery.d.ts +1 -2
- package/build/legacy/usePrefetchInfiniteQuery.d.ts.map +1 -1
- package/build/legacy/usePrefetchQuery.d.cts +1 -2
- package/build/legacy/usePrefetchQuery.d.cts.map +1 -1
- package/build/legacy/usePrefetchQuery.d.ts +1 -2
- package/build/legacy/usePrefetchQuery.d.ts.map +1 -1
- package/build/legacy/useQueries.cjs.map +1 -1
- package/build/legacy/useQueries.d.cts +9 -6
- package/build/legacy/useQueries.d.cts.map +1 -1
- package/build/legacy/useQueries.d.ts +9 -6
- package/build/legacy/useQueries.d.ts.map +1 -1
- package/build/legacy/useQueries.js.map +1 -1
- package/build/legacy/useQuery.cjs.map +1 -1
- package/build/legacy/useQuery.d.cts +10 -6
- package/build/legacy/useQuery.d.cts.map +1 -1
- package/build/legacy/useQuery.d.ts +10 -6
- package/build/legacy/useQuery.d.ts.map +1 -1
- package/build/legacy/useQuery.js.map +1 -1
- package/build/legacy/useSuspenseInfiniteQuery.d.cts +1 -2
- package/build/legacy/useSuspenseInfiniteQuery.d.cts.map +1 -1
- package/build/legacy/useSuspenseInfiniteQuery.d.ts +1 -2
- package/build/legacy/useSuspenseInfiniteQuery.d.ts.map +1 -1
- package/build/legacy/useSuspenseQueries.cjs.map +1 -1
- package/build/legacy/useSuspenseQueries.d.cts +11 -8
- package/build/legacy/useSuspenseQueries.d.cts.map +1 -1
- package/build/legacy/useSuspenseQueries.d.ts +11 -8
- package/build/legacy/useSuspenseQueries.d.ts.map +1 -1
- package/build/legacy/useSuspenseQueries.js.map +1 -1
- package/build/legacy/useSuspenseQuery.d.cts +1 -2
- package/build/legacy/useSuspenseQuery.d.cts.map +1 -1
- package/build/legacy/useSuspenseQuery.d.ts +1 -2
- package/build/legacy/useSuspenseQuery.d.ts.map +1 -1
- package/build/legacy/utils.d.cts +2 -3
- package/build/legacy/utils.d.cts.map +1 -1
- package/build/legacy/utils.d.ts +2 -3
- package/build/legacy/utils.d.ts.map +1 -1
- package/build/modern/HydrationBoundary.d.cts +2 -3
- package/build/modern/HydrationBoundary.d.cts.map +1 -1
- package/build/modern/HydrationBoundary.d.ts +2 -3
- package/build/modern/HydrationBoundary.d.ts.map +1 -1
- package/build/modern/IsRestoringProvider.d.cts +2 -3
- package/build/modern/IsRestoringProvider.d.cts.map +1 -1
- package/build/modern/IsRestoringProvider.d.ts +2 -3
- package/build/modern/IsRestoringProvider.d.ts.map +1 -1
- package/build/modern/QueryClientProvider.d.cts +4 -5
- package/build/modern/QueryClientProvider.d.cts.map +1 -1
- package/build/modern/QueryClientProvider.d.ts +4 -5
- package/build/modern/QueryClientProvider.d.ts.map +1 -1
- package/build/modern/QueryErrorResetBoundary.d.cts +8 -9
- package/build/modern/QueryErrorResetBoundary.d.cts.map +1 -1
- package/build/modern/QueryErrorResetBoundary.d.ts +8 -9
- package/build/modern/QueryErrorResetBoundary.d.ts.map +1 -1
- package/build/modern/errorBoundaryUtils.d.cts +3 -4
- package/build/modern/errorBoundaryUtils.d.cts.map +1 -1
- package/build/modern/errorBoundaryUtils.d.ts +3 -4
- package/build/modern/errorBoundaryUtils.d.ts.map +1 -1
- package/build/modern/infiniteQueryOptions.cjs.map +1 -1
- package/build/modern/infiniteQueryOptions.d.cts +7 -8
- package/build/modern/infiniteQueryOptions.d.cts.map +1 -1
- package/build/modern/infiniteQueryOptions.d.ts +7 -8
- package/build/modern/infiniteQueryOptions.d.ts.map +1 -1
- package/build/modern/infiniteQueryOptions.js.map +1 -1
- package/build/modern/mutationOptions.d.cts +2 -3
- package/build/modern/mutationOptions.d.cts.map +1 -1
- package/build/modern/mutationOptions.d.ts +2 -3
- package/build/modern/mutationOptions.d.ts.map +1 -1
- package/build/modern/queryOptions.cjs.map +1 -1
- package/build/modern/queryOptions.d.cts +9 -9
- package/build/modern/queryOptions.d.cts.map +1 -1
- package/build/modern/queryOptions.d.ts +9 -9
- package/build/modern/queryOptions.d.ts.map +1 -1
- package/build/modern/queryOptions.js.map +1 -1
- package/build/modern/suspense.cjs.map +1 -1
- package/build/modern/suspense.d.cts +4 -5
- package/build/modern/suspense.d.cts.map +1 -1
- package/build/modern/suspense.d.ts +4 -5
- package/build/modern/suspense.d.ts.map +1 -1
- package/build/modern/suspense.js.map +1 -1
- package/build/modern/types.cjs.map +1 -1
- package/build/modern/types.d.cts +30 -30
- package/build/modern/types.d.cts.map +1 -1
- package/build/modern/types.d.ts +30 -30
- package/build/modern/types.d.ts.map +1 -1
- package/build/modern/types.js.map +1 -1
- package/build/modern/useBaseQuery.cjs.map +1 -1
- package/build/modern/useBaseQuery.d.cts +1 -2
- package/build/modern/useBaseQuery.d.cts.map +1 -1
- package/build/modern/useBaseQuery.d.ts +1 -2
- package/build/modern/useBaseQuery.d.ts.map +1 -1
- package/build/modern/useBaseQuery.js.map +1 -1
- package/build/modern/useInfiniteQuery.d.cts +3 -4
- package/build/modern/useInfiniteQuery.d.cts.map +1 -1
- package/build/modern/useInfiniteQuery.d.ts +3 -4
- package/build/modern/useInfiniteQuery.d.ts.map +1 -1
- package/build/modern/useIsFetching.d.cts +1 -2
- package/build/modern/useIsFetching.d.cts.map +1 -1
- package/build/modern/useIsFetching.d.ts +1 -2
- package/build/modern/useIsFetching.d.ts.map +1 -1
- package/build/modern/useMutation.d.cts +1 -2
- package/build/modern/useMutation.d.cts.map +1 -1
- package/build/modern/useMutation.d.ts +1 -2
- package/build/modern/useMutation.d.ts.map +1 -1
- package/build/modern/useMutationState.d.cts +2 -3
- package/build/modern/useMutationState.d.cts.map +1 -1
- package/build/modern/useMutationState.d.ts +2 -3
- package/build/modern/useMutationState.d.ts.map +1 -1
- package/build/modern/usePrefetchInfiniteQuery.d.cts +1 -2
- package/build/modern/usePrefetchInfiniteQuery.d.cts.map +1 -1
- package/build/modern/usePrefetchInfiniteQuery.d.ts +1 -2
- package/build/modern/usePrefetchInfiniteQuery.d.ts.map +1 -1
- package/build/modern/usePrefetchQuery.d.cts +1 -2
- package/build/modern/usePrefetchQuery.d.cts.map +1 -1
- package/build/modern/usePrefetchQuery.d.ts +1 -2
- package/build/modern/usePrefetchQuery.d.ts.map +1 -1
- package/build/modern/useQueries.cjs.map +1 -1
- package/build/modern/useQueries.d.cts +9 -6
- package/build/modern/useQueries.d.cts.map +1 -1
- package/build/modern/useQueries.d.ts +9 -6
- package/build/modern/useQueries.d.ts.map +1 -1
- package/build/modern/useQueries.js.map +1 -1
- package/build/modern/useQuery.cjs.map +1 -1
- package/build/modern/useQuery.d.cts +10 -6
- package/build/modern/useQuery.d.cts.map +1 -1
- package/build/modern/useQuery.d.ts +10 -6
- package/build/modern/useQuery.d.ts.map +1 -1
- package/build/modern/useQuery.js.map +1 -1
- package/build/modern/useSuspenseInfiniteQuery.d.cts +1 -2
- package/build/modern/useSuspenseInfiniteQuery.d.cts.map +1 -1
- package/build/modern/useSuspenseInfiniteQuery.d.ts +1 -2
- package/build/modern/useSuspenseInfiniteQuery.d.ts.map +1 -1
- package/build/modern/useSuspenseQueries.cjs.map +1 -1
- package/build/modern/useSuspenseQueries.d.cts +11 -8
- package/build/modern/useSuspenseQueries.d.cts.map +1 -1
- package/build/modern/useSuspenseQueries.d.ts +11 -8
- package/build/modern/useSuspenseQueries.d.ts.map +1 -1
- package/build/modern/useSuspenseQueries.js.map +1 -1
- package/build/modern/useSuspenseQuery.d.cts +1 -2
- package/build/modern/useSuspenseQuery.d.cts.map +1 -1
- package/build/modern/useSuspenseQuery.d.ts +1 -2
- package/build/modern/useSuspenseQuery.d.ts.map +1 -1
- package/build/modern/utils.d.cts +2 -3
- package/build/modern/utils.d.cts.map +1 -1
- package/build/modern/utils.d.ts +2 -3
- package/build/modern/utils.d.ts.map +1 -1
- package/package.json +9 -10
- package/src/infiniteQueryOptions.ts +1 -1
- package/src/queryOptions.ts +4 -4
- package/src/suspense.ts +1 -2
- package/src/types.ts +5 -4
- package/src/useBaseQuery.ts +3 -6
- package/src/useQueries.ts +6 -2
- package/src/useQuery.ts +7 -2
- package/src/useSuspenseQueries.ts +7 -3
- package/build/query-codemods/eslint.config.js +0 -25
- package/build/query-codemods/package.json +0 -38
- package/build/query-codemods/root.eslint.config.js +0 -113
- package/build/query-codemods/tsconfig.json +0 -8
- package/build/query-codemods/vite.config.ts +0 -30
- /package/build/codemods/{src/utils → utils}/index.cjs +0 -0
- /package/build/codemods/{src/utils → utils}/transformers/query-cache-transformer.cjs +0 -0
- /package/build/codemods/{src/utils → utils}/transformers/query-client-transformer.cjs +0 -0
- /package/build/codemods/{src/utils → utils}/transformers/use-query-like-transformer.cjs +0 -0
- /package/build/codemods/{src/v4 → v4}/key-transformation.cjs +0 -0
- /package/build/codemods/{src/v4 → v4}/replace-import-specifier.cjs +0 -0
- /package/build/codemods/{src/v4 → v4}/utils/replacers/key-replacer.cjs +0 -0
- /package/build/codemods/{src/v5 → v5}/is-loading/is-loading.cjs +0 -0
- /package/build/codemods/{src/v5 → v5}/keep-previous-data/README.md +0 -0
- /package/build/codemods/{src/v5 → v5}/keep-previous-data/keep-previous-data.cjs +0 -0
- /package/build/codemods/{src/v5 → v5}/keep-previous-data/utils/already-has-placeholder-data-property.cjs +0 -0
- /package/build/codemods/{src/v5 → v5}/remove-overloads/remove-overloads.cjs +0 -0
- /package/build/codemods/{src/v5 → v5}/remove-overloads/transformers/filter-aware-usage-transformer.cjs +0 -0
- /package/build/codemods/{src/v5 → v5}/remove-overloads/transformers/query-fn-aware-usage-transformer.cjs +0 -0
- /package/build/codemods/{src/v5 → v5}/remove-overloads/utils/index.cjs +0 -0
- /package/build/codemods/{src/v5 → v5}/remove-overloads/utils/unknown-usage-error.cjs +0 -0
- /package/build/codemods/{src/v5 → v5}/rename-hydrate/rename-hydrate.cjs +0 -0
- /package/build/codemods/{src/v5 → v5}/rename-properties/rename-properties.cjs +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryOptions.js","names":[],"sources":["../../src/queryOptions.ts"],"sourcesContent":["import type {\n DefaultError,\n InitialDataFunction,\n NonUndefinedGuard,\n OmitKeyof,\n QueryFunction,\n QueryKey,\n QueryKeyWithDataTag,\n SkipToken,\n} from '@tanstack/query-core'\n\nimport type { UseQueryOptions } from './types'\n\n/**\n * The options accepted by the `queryOptions` overload selected when no `initialData` is set — `data` may be\n * `undefined` while the query is `pending`.\n *\n * @template TQueryFnData - The type your `queryFn` resolves to.\n * @template TError - The type of errors your `queryFn` may throw.\n * @template TData - The type `data` ends up as after `select` runs.\n * @template TQueryKey - The type of your `queryKey`.\n */\nexport type UndefinedInitialDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = UseQueryOptions<TQueryFnData, TError, TData, TQueryKey> & {\n /**\n * If set, this value will be used as the initial data for the query cache (as long as the query hasn't been\n * created or cached yet). If set to a function, the function will be called **once** during the shared/root\n * query initialization, and be expected to synchronously return the initial data. Initial data is\n * considered stale by default unless a `staleTime` has been set. `initialData` **is persisted** to the\n * cache.\n */\n initialData?:\n | undefined\n | InitialDataFunction<NonUndefinedGuard<TQueryFnData>>\n | NonUndefinedGuard<TQueryFnData>\n}\n\n/**\n * The options accepted by the `queryOptions` overload selected when no `initialData` is set and `queryFn` is\n * not `skipToken` — same as {@link UndefinedInitialDataOptions}, but `queryFn` may not be `skipToken`.\n *\n * @template TQueryFnData - The type your `queryFn` resolves to.\n * @template TError - The type of errors your `queryFn` may throw.\n * @template TData - The type `data` ends up as after `select` runs.\n * @template TQueryKey - The type of your `queryKey`.\n */\nexport type UnusedSkipTokenOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = OmitKeyof<\n UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>,\n 'queryFn'\n> & {\n /**\n * `skipToken` is not allowed as a value here — this overload is selected when no `initialData` is set. If\n * you don't intend to run the query yet, set `enabled: false` — omitting `queryFn` alone still triggers a\n * fetch that fails with \"Missing queryFn\" unless `enabled` is `false` or a default query function has been\n * defined. A default query function only supplies `queryFn`; it doesn't defer the fetch on its own.\n */\n queryFn?: Exclude<\n UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>['queryFn'],\n SkipToken | undefined\n >\n}\n\n/**\n * The options accepted by the `queryOptions` overload selected when `initialData` is set — `data` is never\n * `undefined`.\n *\n * @template TQueryFnData - The type your `queryFn` resolves to.\n * @template TError - The type of errors your `queryFn` may throw.\n * @template TData - The type `data` ends up as after `select` runs.\n * @template TQueryKey - The type of your `queryKey`.\n */\nexport type DefinedInitialDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = Omit<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, 'queryFn'> & {\n /**\n * If set, this value will be used as the initial data for the query cache (as long as the query hasn't been\n * created or cached yet). If set to a function, the function will be called **once** during the shared/root\n * query initialization, and be expected to synchronously return the initial data. Initial data is\n * considered stale by default unless a `staleTime` has been set. `initialData` **is persisted** to the\n * cache.\n */\n initialData:\n | NonUndefinedGuard<TQueryFnData>\n | (() => NonUndefinedGuard<TQueryFnData>)\n /**\n * Optional here, but omitting it is only safe when no fetch will be attempted — for example with\n * `enabled: false`, or when a default query function has been defined. Otherwise, an enabled query with no\n * `queryFn` still tries to fetch and fails with a \"Missing queryFn\" error; `initialData` does not prevent this.\n */\n queryFn?: QueryFunction<TQueryFnData, TQueryKey>\n}\n\n/**\n * You can generally pass everything to `queryOptions` that you can also pass to `useQuery`. These options can\n * be shared across hooks and imperative APIs such as `queryClient.query`. `options.queryKey` is required and\n * is the query key to generate options for.\n *\n * This overload is selected when `initialData` is set, so the resulting `data` is never `undefined`.\n *\n * @see {@link useQuery} to run a query with these options.\n * @see [The Query Options API](https://tkdodo.eu/blog/the-query-options-api) for more on this pattern.\n * @param options - The {@link DefinedInitialDataOptions} to use — everything you can pass to `useQuery`, with `initialData` set.\n * @returns The same options object, typed so that `queryKey` carries the inferred data type.\n *\n * @example\n * ```tsx\n * import { queryOptions, useQuery } from '@tanstack/preact-query'\n *\n * export const postsOptions = queryOptions({\n * queryKey: ['posts'],\n * queryFn: fetchPosts,\n * initialData: [],\n * })\n *\n * function Posts() {\n * // `data` is `Post[]`, never `undefined`, thanks to `initialData` — even if a refetch fails,\n * // so the list stays visible alongside the error.\n * const { data, isError, error } = useQuery(postsOptions)\n *\n * return (\n * <div>\n * {isError ? <span>Error: {error.message}</span> : null}\n * <ul>\n * {data.map((post) => <li key={post.id}>{post.title}</li>)}\n * </ul>\n * </div>\n * )\n * }\n * ```\n */\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>,\n): DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey> &\n QueryKeyWithDataTag<TQueryKey, TQueryFnData, TError>\n\n/**\n * You can generally pass everything to `queryOptions` that you can also pass to `useQuery`. These options can\n * be shared across hooks and imperative APIs such as `queryClient.query`. `options.queryKey` is required and\n * is the query key to generate options for.\n *\n * @see {@link useQuery} to run a query with these options.\n * @see [The Query Options API](https://tkdodo.eu/blog/the-query-options-api) for more on this pattern.\n * @param options - The {@link UnusedSkipTokenOptions} to use — everything you can pass to `useQuery`.\n * @returns The same options object, typed so that `queryKey` carries the inferred data type.\n *\n * @example\n * A parameterized factory, so the same options object can be reused per `id`:\n * ```tsx\n * import { queryOptions, useQuery } from '@tanstack/preact-query'\n *\n * export const postOptions = (id: string) =>\n * queryOptions({\n * queryKey: ['post', id],\n * queryFn: () => fetchPost(id),\n * })\n *\n * function Post({ id }: { id: string }) {\n * const { data, isPending, isError, error } = useQuery(postOptions(id))\n *\n * if (isPending) return 'Loading...'\n * if (isError) return <span>Error: {error.message}</span>\n *\n * return <h1>{data.title}</h1>\n * }\n * ```\n */\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UnusedSkipTokenOptions<TQueryFnData, TError, TData, TQueryKey>,\n): UnusedSkipTokenOptions<TQueryFnData, TError, TData, TQueryKey> &\n QueryKeyWithDataTag<TQueryKey, TQueryFnData, TError>\n\n/**\n * You can generally pass everything to `queryOptions` that you can also pass to `useQuery`. These options can\n * be shared across hooks and imperative APIs such as `queryClient.query`. `options.queryKey` is required and\n * is the query key to generate options for.\n *\n * @see {@link useQuery} to run a query with these options.\n * @see [The Query Options API](https://tkdodo.eu/blog/the-query-options-api) for more on this pattern.\n * @param options - The {@link UndefinedInitialDataOptions} to use — everything you can pass to `useQuery`.\n * @returns The same options object, typed so that `queryKey` carries the inferred data type.\n * @remarks This is the only overload that accepts `queryFn: skipToken`, shown below.\n *\n * @example\n * A parameterized factory, so the same options object can be reused per `id`:\n * ```tsx\n * import { queryOptions, useQuery } from '@tanstack/preact-query'\n *\n * export const postOptions = (id: string) =>\n * queryOptions({\n * queryKey: ['post', id],\n * queryFn: () => fetchPost(id),\n * })\n *\n * function Post({ id }: { id: string }) {\n * const { data, isPending, isError, error } = useQuery(postOptions(id))\n *\n * if (isPending) return 'Loading...'\n * if (isError) return <span>Error: {error.message}</span>\n *\n * return <h1>{data.title}</h1>\n * }\n * ```\n *\n * @example\n * A factory that disables the query, type safe, until `postId` is set:\n * ```tsx\n * import { queryOptions, skipToken, useQuery } from '@tanstack/preact-query'\n *\n * export const postOptions = (postId: number | undefined) =>\n * queryOptions({\n * queryKey: ['post', postId],\n * queryFn: postId != null ? () => fetchPost(postId) : skipToken,\n * })\n *\n * function Post({ postId }: { postId: number | undefined }) {\n * const { data, isLoading, isError, error } = useQuery(postOptions(postId))\n *\n * if (postId == null) return 'Select a post'\n * if (isLoading) return 'Loading...'\n * if (isError) return <span>Error: {error.message}</span>\n *\n * return <h1>{data?.title}</h1>\n * }\n * ```\n */\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>,\n): UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey> &\n QueryKeyWithDataTag<TQueryKey, TQueryFnData, TError>\n\nexport function queryOptions(options: unknown) {\n return options\n}\n"],"mappings":";AAiQA,SAAgB,aAAa,SAAkB;CAC7C,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"queryOptions.js","names":[],"sources":["../../src/queryOptions.ts"],"sourcesContent":["import type {\n DefaultError,\n InitialDataFunction,\n NonUndefinedGuard,\n OmitKeyof,\n QueryFunction,\n QueryKey,\n QueryKeyWithDataTag,\n SkipToken,\n} from '@tanstack/query-core'\n\nimport type { UseQueryOptions } from './types'\n\n/**\n * The options accepted by the `queryOptions` overload selected when no `initialData` is set — `data` may be\n * `undefined` while the query is `pending`.\n *\n * @template TQueryFnData - The type your `queryFn` resolves to.\n * @template TError - The type of errors your `queryFn` may throw.\n * @template TData - The type `data` ends up as after `select` runs.\n * @template TQueryKey - The type of your `queryKey`.\n */\nexport type UndefinedInitialDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = UseQueryOptions<TQueryFnData, TError, TData, TQueryKey> & {\n /**\n * If set, this value will be used as the initial data for the query cache (as long as the query hasn't been\n * created or cached yet). If set to a function, the function will be called **once** during the shared/root\n * query initialization, and be expected to synchronously return the initial data. Initial data is\n * considered stale by default unless a `staleTime` has been set. `initialData` **is persisted** to the\n * cache.\n */\n initialData?:\n | undefined\n | InitialDataFunction<NonUndefinedGuard<TQueryFnData>>\n | NonUndefinedGuard<TQueryFnData>\n}\n\n/**\n * The options accepted by the `queryOptions` overload selected when no `initialData` is set and `queryFn` is\n * not `skipToken` — same as {@link UndefinedInitialDataOptions}, but `queryFn` may not be `skipToken`.\n *\n * @template TQueryFnData - The type your `queryFn` resolves to.\n * @template TError - The type of errors your `queryFn` may throw.\n * @template TData - The type `data` ends up as after `select` runs.\n * @template TQueryKey - The type of your `queryKey`.\n */\nexport type UnusedSkipTokenOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = OmitKeyof<\n UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>,\n 'queryFn'\n> & {\n /**\n * `skipToken` is not allowed as a value here — this overload is selected when no `initialData` is set. If\n * you don't intend to run the query yet, set `enabled: false` — omitting `queryFn` alone still triggers a\n * fetch that fails with \"Missing queryFn\" unless `enabled` is `false` or a default query function has been\n * defined. A default query function only supplies `queryFn`; it doesn't defer the fetch on its own.\n */\n queryFn?: Exclude<\n UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>['queryFn'],\n SkipToken | undefined\n >\n}\n\n/**\n * The options accepted by the `queryOptions` overload selected when `initialData` is set — `data` is never\n * `undefined` (unless a `select` changes `TData` to include `undefined`).\n *\n * @template TQueryFnData - The type your `queryFn` resolves to.\n * @template TError - The type of errors your `queryFn` may throw.\n * @template TData - The type `data` ends up as after `select` runs.\n * @template TQueryKey - The type of your `queryKey`.\n */\nexport type DefinedInitialDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = Omit<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, 'queryFn'> & {\n /**\n * If set, this value will be used as the initial data for the query cache (as long as the query hasn't been\n * created or cached yet). If set to a function, the function will be called **once** during the shared/root\n * query initialization, and be expected to synchronously return the initial data. Initial data is\n * considered stale by default unless a `staleTime` has been set. `initialData` **is persisted** to the\n * cache.\n */\n initialData:\n NonUndefinedGuard<TQueryFnData> | (() => NonUndefinedGuard<TQueryFnData>)\n /**\n * Optional here, but omitting it is only safe when no fetch will be attempted — for example with\n * `enabled: false`, or when a default query function has been defined. Otherwise, an enabled query with no\n * `queryFn` still tries to fetch and fails with a \"Missing queryFn\" error; `initialData` does not prevent this.\n */\n queryFn?: QueryFunction<TQueryFnData, TQueryKey>\n}\n\n/**\n * You can generally pass everything to `queryOptions` that you can also pass to `useQuery`. These options can\n * be shared across hooks and imperative APIs such as `queryClient.query`. `options.queryKey` is required and\n * is the query key to generate options for.\n *\n * This overload is selected when `initialData` is set, so the resulting `data` is never `undefined` (unless\n * a `select` changes `TData` to include `undefined`).\n *\n * @see {@link useQuery} to run a query with these options.\n * @see [The Query Options API](https://tkdodo.eu/blog/the-query-options-api) for more on this pattern.\n * @param options - The {@link DefinedInitialDataOptions} to use — everything you can pass to `useQuery`, with `initialData` set.\n * @returns The same options object, typed so that `queryKey` carries the inferred data type.\n *\n * @example\n * ```tsx\n * import { queryOptions, useQuery } from '@tanstack/preact-query'\n *\n * export const postsOptions = queryOptions({\n * queryKey: ['posts'],\n * queryFn: fetchPosts,\n * initialData: [],\n * })\n *\n * function Posts() {\n * // `data` is `Post[]`, never `undefined`, thanks to `initialData` — even if a refetch fails,\n * // so the list stays visible alongside the error.\n * const { data, isError, error } = useQuery(postsOptions)\n *\n * return (\n * <div>\n * {isError ? <span>Error: {error.message}</span> : null}\n * <ul>\n * {data.map((post) => <li key={post.id}>{post.title}</li>)}\n * </ul>\n * </div>\n * )\n * }\n * ```\n */\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>,\n): DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey> &\n QueryKeyWithDataTag<TQueryKey, TQueryFnData, TError>\n\n/**\n * You can generally pass everything to `queryOptions` that you can also pass to `useQuery`. These options can\n * be shared across hooks and imperative APIs such as `queryClient.query`. `options.queryKey` is required and\n * is the query key to generate options for.\n *\n * @see {@link useQuery} to run a query with these options.\n * @see [The Query Options API](https://tkdodo.eu/blog/the-query-options-api) for more on this pattern.\n * @param options - The {@link UnusedSkipTokenOptions} to use — everything you can pass to `useQuery`.\n * @returns The same options object, typed so that `queryKey` carries the inferred data type.\n *\n * @example\n * A parameterized factory, so the same options object can be reused per `id`:\n * ```tsx\n * import { queryOptions, useQuery } from '@tanstack/preact-query'\n *\n * export const postOptions = (id: string) =>\n * queryOptions({\n * queryKey: ['post', id],\n * queryFn: () => fetchPost(id),\n * })\n *\n * function Post({ id }: { id: string }) {\n * const { data, isPending, isError, error } = useQuery(postOptions(id))\n *\n * if (isPending) return 'Loading...'\n * if (isError) return <span>Error: {error.message}</span>\n *\n * return <h1>{data.title}</h1>\n * }\n * ```\n */\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UnusedSkipTokenOptions<TQueryFnData, TError, TData, TQueryKey>,\n): UnusedSkipTokenOptions<TQueryFnData, TError, TData, TQueryKey> &\n QueryKeyWithDataTag<TQueryKey, TQueryFnData, TError>\n\n/**\n * You can generally pass everything to `queryOptions` that you can also pass to `useQuery`. These options can\n * be shared across hooks and imperative APIs such as `queryClient.query`. `options.queryKey` is required and\n * is the query key to generate options for.\n *\n * @see {@link useQuery} to run a query with these options.\n * @see [The Query Options API](https://tkdodo.eu/blog/the-query-options-api) for more on this pattern.\n * @param options - The {@link UndefinedInitialDataOptions} to use — everything you can pass to `useQuery`.\n * @returns The same options object, typed so that `queryKey` carries the inferred data type.\n * @remarks This is the only overload that accepts `queryFn: skipToken`, shown below.\n *\n * @example\n * A parameterized factory, so the same options object can be reused per `id`:\n * ```tsx\n * import { queryOptions, useQuery } from '@tanstack/preact-query'\n *\n * export const postOptions = (id: string) =>\n * queryOptions({\n * queryKey: ['post', id],\n * queryFn: () => fetchPost(id),\n * })\n *\n * function Post({ id }: { id: string }) {\n * const { data, isPending, isError, error } = useQuery(postOptions(id))\n *\n * if (isPending) return 'Loading...'\n * if (isError) return <span>Error: {error.message}</span>\n *\n * return <h1>{data.title}</h1>\n * }\n * ```\n *\n * @example\n * A factory that disables the query, type safe, until `postId` is set:\n * ```tsx\n * import { queryOptions, skipToken, useQuery } from '@tanstack/preact-query'\n *\n * export const postOptions = (postId: number | undefined) =>\n * queryOptions({\n * queryKey: ['post', postId],\n * queryFn: postId != null ? () => fetchPost(postId) : skipToken,\n * })\n *\n * function Post({ postId }: { postId: number | undefined }) {\n * const { data, isLoading, isError, error } = useQuery(postOptions(postId))\n *\n * if (postId == null) return 'Select a post'\n * if (isLoading) return 'Loading...'\n * if (isError) return <span>Error: {error.message}</span>\n *\n * return <h1>{data?.title}</h1>\n * }\n * ```\n */\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>,\n): UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey> &\n QueryKeyWithDataTag<TQueryKey, TQueryFnData, TError>\n\nexport function queryOptions(options: unknown) {\n return options\n}\n"],"mappings":";AAiQA,SAAgB,aAAa,SAAkB;CAC7C,OAAO;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suspense.cjs","names":[],"sources":["../../src/suspense.ts"],"sourcesContent":["import type {\n DefaultError,\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserver,\n QueryObserverResult,\n} from '@tanstack/query-core'\n\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\nexport const defaultThrowOnError = <\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n _error: TError,\n query: Query<TQueryFnData, TError, TData, TQueryKey>,\n) => query.state.data === undefined\n\nexport const ensureSuspenseTimers = (\n defaultedOptions: DefaultedQueryObserverOptions<any, any, any, any, any>,\n) => {\n if (defaultedOptions.suspense) {\n // Handle staleTime to ensure minimum 1000ms in Suspense mode\n // This prevents unnecessary refetching when components remount after suspending\n const MIN_SUSPENSE_TIME_MS = 1000\n\n const clamp = (value: number | 'static' | undefined) =>\n value === 'static'\n ? value\n : Math.max(value ?? MIN_SUSPENSE_TIME_MS, MIN_SUSPENSE_TIME_MS)\n\n const originalStaleTime = defaultedOptions.staleTime\n defaultedOptions.staleTime =\n typeof originalStaleTime === 'function'\n ? (...args) => clamp(originalStaleTime(...args))\n : clamp(originalStaleTime)\n\n if (typeof defaultedOptions.gcTime === 'number') {\n defaultedOptions.gcTime = Math.max(\n defaultedOptions.gcTime,\n MIN_SUSPENSE_TIME_MS,\n )\n }\n }\n}\n\nexport const shouldSuspend = (\n defaultedOptions:\n
|
|
1
|
+
{"version":3,"file":"suspense.cjs","names":[],"sources":["../../src/suspense.ts"],"sourcesContent":["import type {\n DefaultError,\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserver,\n QueryObserverResult,\n} from '@tanstack/query-core'\n\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\nexport const defaultThrowOnError = <\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n _error: TError,\n query: Query<TQueryFnData, TError, TData, TQueryKey>,\n) => query.state.data === undefined\n\nexport const ensureSuspenseTimers = (\n defaultedOptions: DefaultedQueryObserverOptions<any, any, any, any, any>,\n) => {\n if (defaultedOptions.suspense) {\n // Handle staleTime to ensure minimum 1000ms in Suspense mode\n // This prevents unnecessary refetching when components remount after suspending\n const MIN_SUSPENSE_TIME_MS = 1000\n\n const clamp = (value: number | 'static' | undefined) =>\n value === 'static'\n ? value\n : Math.max(value ?? MIN_SUSPENSE_TIME_MS, MIN_SUSPENSE_TIME_MS)\n\n const originalStaleTime = defaultedOptions.staleTime\n defaultedOptions.staleTime =\n typeof originalStaleTime === 'function'\n ? (...args) => clamp(originalStaleTime(...args))\n : clamp(originalStaleTime)\n\n if (typeof defaultedOptions.gcTime === 'number') {\n defaultedOptions.gcTime = Math.max(\n defaultedOptions.gcTime,\n MIN_SUSPENSE_TIME_MS,\n )\n }\n }\n}\n\nexport const shouldSuspend = (\n defaultedOptions:\n DefaultedQueryObserverOptions<any, any, any, any, any> | undefined,\n result: QueryObserverResult<any, any>,\n) => defaultedOptions?.suspense && result.isPending\n\nexport const fetchOptimistic = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n defaultedOptions: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n observer: QueryObserver<TQueryFnData, TError, TData, TQueryData, TQueryKey>,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) =>\n observer.fetchOptimistic(defaultedOptions).catch(() => {\n errorResetBoundary.clearReset()\n })\n"],"mappings":";;AAWA,MAAa,uBAMX,QACA,UACG,MAAM,MAAM,SAAS,KAAA;AAE1B,MAAa,wBACX,qBACG;CACH,IAAI,iBAAiB,UAAU;EAG7B,MAAM,uBAAuB;EAE7B,MAAM,SAAS,UACb,UAAU,WACN,QACA,KAAK,IAAI,SAAS,sBAAsB,oBAAoB;EAElE,MAAM,oBAAoB,iBAAiB;EAC3C,iBAAiB,YACf,OAAO,sBAAsB,cACxB,GAAG,SAAS,MAAM,kBAAkB,GAAG,IAAI,CAAC,IAC7C,MAAM,iBAAiB;EAE7B,IAAI,OAAO,iBAAiB,WAAW,UACrC,iBAAiB,SAAS,KAAK,IAC7B,iBAAiB,QACjB,oBACF;CAEJ;AACF;AAEA,MAAa,iBACX,kBAEA,WACG,kBAAkB,YAAY,OAAO;AAE1C,MAAa,mBAOX,kBAOA,UACA,uBAEA,SAAS,gBAAgB,gBAAgB,CAAC,CAAC,YAAY;CACrD,mBAAmB,WAAW;AAChC,CAAC"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { QueryErrorResetBoundaryValue } from "./QueryErrorResetBoundary.cjs";
|
|
2
2
|
import { DefaultError, DefaultedQueryObserverOptions, Query, QueryKey, QueryObserver, QueryObserverResult } from "@tanstack/query-core";
|
|
3
3
|
//#region src/suspense.d.ts
|
|
4
|
-
declare const defaultThrowOnError: <TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(_error: TError, query: Query<TQueryFnData, TError, TData, TQueryKey>) => boolean;
|
|
5
|
-
declare const ensureSuspenseTimers: (defaultedOptions: DefaultedQueryObserverOptions<any, any, any, any, any>) => void;
|
|
6
|
-
declare const shouldSuspend: (defaultedOptions: DefaultedQueryObserverOptions<any, any, any, any, any> | undefined, result: QueryObserverResult<any, any>) => boolean | undefined;
|
|
7
|
-
declare const fetchOptimistic: <TQueryFnData, TError, TData, TQueryData, TQueryKey extends QueryKey>(defaultedOptions: DefaultedQueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>, observer: QueryObserver<TQueryFnData, TError, TData, TQueryData, TQueryKey>, errorResetBoundary: QueryErrorResetBoundaryValue) => Promise<void | QueryObserverResult<TData, TError>>;
|
|
4
|
+
export declare const defaultThrowOnError: <TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(_error: TError, query: Query<TQueryFnData, TError, TData, TQueryKey>) => boolean;
|
|
5
|
+
export declare const ensureSuspenseTimers: (defaultedOptions: DefaultedQueryObserverOptions<any, any, any, any, any>) => void;
|
|
6
|
+
export declare const shouldSuspend: (defaultedOptions: DefaultedQueryObserverOptions<any, any, any, any, any> | undefined, result: QueryObserverResult<any, any>) => boolean | undefined;
|
|
7
|
+
export declare const fetchOptimistic: <TQueryFnData, TError, TData, TQueryData, TQueryKey extends QueryKey>(defaultedOptions: DefaultedQueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>, observer: QueryObserver<TQueryFnData, TError, TData, TQueryData, TQueryKey>, errorResetBoundary: QueryErrorResetBoundaryValue) => Promise<void | QueryObserverResult<TData, TError>>;
|
|
8
8
|
//#endregion
|
|
9
|
-
export { defaultThrowOnError, ensureSuspenseTimers, fetchOptimistic, shouldSuspend };
|
|
10
9
|
//# sourceMappingURL=suspense.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suspense.d.cts","names":[],"sources":["../../src/suspense.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"suspense.d.cts","names":[],"sources":["../../src/suspense.ts"],"mappings":";;;qBAWa,sBACX,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAE7B,QAAQ,QACR,OAAO,MAAM,cAAc,QAAQ,OAAO;qBAG/B,uBACX,kBAAkB;qBA2BP,gBACX,kBACE,oEACF,QAAQ;qBAGG,kBACX,cACA,QACA,OACA,YACA,kBAAkB,UAElB,kBAAkB,8BAChB,cACA,QACA,OACA,YACA,YAEF,UAAU,cAAc,cAAc,QAAQ,OAAO,YAAY,YACjE,oBAAoB,iCAA4B,eAAA,oBAAA,OAAA"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { QueryErrorResetBoundaryValue } from "./QueryErrorResetBoundary.js";
|
|
2
2
|
import { DefaultError, DefaultedQueryObserverOptions, Query, QueryKey, QueryObserver, QueryObserverResult } from "@tanstack/query-core";
|
|
3
3
|
//#region src/suspense.d.ts
|
|
4
|
-
declare const defaultThrowOnError: <TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(_error: TError, query: Query<TQueryFnData, TError, TData, TQueryKey>) => boolean;
|
|
5
|
-
declare const ensureSuspenseTimers: (defaultedOptions: DefaultedQueryObserverOptions<any, any, any, any, any>) => void;
|
|
6
|
-
declare const shouldSuspend: (defaultedOptions: DefaultedQueryObserverOptions<any, any, any, any, any> | undefined, result: QueryObserverResult<any, any>) => boolean | undefined;
|
|
7
|
-
declare const fetchOptimistic: <TQueryFnData, TError, TData, TQueryData, TQueryKey extends QueryKey>(defaultedOptions: DefaultedQueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>, observer: QueryObserver<TQueryFnData, TError, TData, TQueryData, TQueryKey>, errorResetBoundary: QueryErrorResetBoundaryValue) => Promise<void | QueryObserverResult<TData, TError>>;
|
|
4
|
+
export declare const defaultThrowOnError: <TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(_error: TError, query: Query<TQueryFnData, TError, TData, TQueryKey>) => boolean;
|
|
5
|
+
export declare const ensureSuspenseTimers: (defaultedOptions: DefaultedQueryObserverOptions<any, any, any, any, any>) => void;
|
|
6
|
+
export declare const shouldSuspend: (defaultedOptions: DefaultedQueryObserverOptions<any, any, any, any, any> | undefined, result: QueryObserverResult<any, any>) => boolean | undefined;
|
|
7
|
+
export declare const fetchOptimistic: <TQueryFnData, TError, TData, TQueryData, TQueryKey extends QueryKey>(defaultedOptions: DefaultedQueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>, observer: QueryObserver<TQueryFnData, TError, TData, TQueryData, TQueryKey>, errorResetBoundary: QueryErrorResetBoundaryValue) => Promise<void | QueryObserverResult<TData, TError>>;
|
|
8
8
|
//#endregion
|
|
9
|
-
export { defaultThrowOnError, ensureSuspenseTimers, fetchOptimistic, shouldSuspend };
|
|
10
9
|
//# sourceMappingURL=suspense.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suspense.d.ts","names":[],"sources":["../../src/suspense.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"suspense.d.ts","names":[],"sources":["../../src/suspense.ts"],"mappings":";;;qBAWa,sBACX,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAE7B,QAAQ,QACR,OAAO,MAAM,cAAc,QAAQ,OAAO;qBAG/B,uBACX,kBAAkB;qBA2BP,gBACX,kBACE,oEACF,QAAQ;qBAGG,kBACX,cACA,QACA,OACA,YACA,kBAAkB,UAElB,kBAAkB,8BAChB,cACA,QACA,OACA,YACA,YAEF,UAAU,cAAc,cAAc,QAAQ,OAAO,YAAY,YACjE,oBAAoB,iCAA4B,eAAA,oBAAA,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suspense.js","names":[],"sources":["../../src/suspense.ts"],"sourcesContent":["import type {\n DefaultError,\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserver,\n QueryObserverResult,\n} from '@tanstack/query-core'\n\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\nexport const defaultThrowOnError = <\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n _error: TError,\n query: Query<TQueryFnData, TError, TData, TQueryKey>,\n) => query.state.data === undefined\n\nexport const ensureSuspenseTimers = (\n defaultedOptions: DefaultedQueryObserverOptions<any, any, any, any, any>,\n) => {\n if (defaultedOptions.suspense) {\n // Handle staleTime to ensure minimum 1000ms in Suspense mode\n // This prevents unnecessary refetching when components remount after suspending\n const MIN_SUSPENSE_TIME_MS = 1000\n\n const clamp = (value: number | 'static' | undefined) =>\n value === 'static'\n ? value\n : Math.max(value ?? MIN_SUSPENSE_TIME_MS, MIN_SUSPENSE_TIME_MS)\n\n const originalStaleTime = defaultedOptions.staleTime\n defaultedOptions.staleTime =\n typeof originalStaleTime === 'function'\n ? (...args) => clamp(originalStaleTime(...args))\n : clamp(originalStaleTime)\n\n if (typeof defaultedOptions.gcTime === 'number') {\n defaultedOptions.gcTime = Math.max(\n defaultedOptions.gcTime,\n MIN_SUSPENSE_TIME_MS,\n )\n }\n }\n}\n\nexport const shouldSuspend = (\n defaultedOptions:\n
|
|
1
|
+
{"version":3,"file":"suspense.js","names":[],"sources":["../../src/suspense.ts"],"sourcesContent":["import type {\n DefaultError,\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserver,\n QueryObserverResult,\n} from '@tanstack/query-core'\n\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\nexport const defaultThrowOnError = <\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n _error: TError,\n query: Query<TQueryFnData, TError, TData, TQueryKey>,\n) => query.state.data === undefined\n\nexport const ensureSuspenseTimers = (\n defaultedOptions: DefaultedQueryObserverOptions<any, any, any, any, any>,\n) => {\n if (defaultedOptions.suspense) {\n // Handle staleTime to ensure minimum 1000ms in Suspense mode\n // This prevents unnecessary refetching when components remount after suspending\n const MIN_SUSPENSE_TIME_MS = 1000\n\n const clamp = (value: number | 'static' | undefined) =>\n value === 'static'\n ? value\n : Math.max(value ?? MIN_SUSPENSE_TIME_MS, MIN_SUSPENSE_TIME_MS)\n\n const originalStaleTime = defaultedOptions.staleTime\n defaultedOptions.staleTime =\n typeof originalStaleTime === 'function'\n ? (...args) => clamp(originalStaleTime(...args))\n : clamp(originalStaleTime)\n\n if (typeof defaultedOptions.gcTime === 'number') {\n defaultedOptions.gcTime = Math.max(\n defaultedOptions.gcTime,\n MIN_SUSPENSE_TIME_MS,\n )\n }\n }\n}\n\nexport const shouldSuspend = (\n defaultedOptions:\n DefaultedQueryObserverOptions<any, any, any, any, any> | undefined,\n result: QueryObserverResult<any, any>,\n) => defaultedOptions?.suspense && result.isPending\n\nexport const fetchOptimistic = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n defaultedOptions: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n observer: QueryObserver<TQueryFnData, TError, TData, TQueryData, TQueryKey>,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) =>\n observer.fetchOptimistic(defaultedOptions).catch(() => {\n errorResetBoundary.clearReset()\n })\n"],"mappings":";AAWA,MAAa,uBAMX,QACA,UACG,MAAM,MAAM,SAAS,KAAA;AAE1B,MAAa,wBACX,qBACG;CACH,IAAI,iBAAiB,UAAU;EAG7B,MAAM,uBAAuB;EAE7B,MAAM,SAAS,UACb,UAAU,WACN,QACA,KAAK,IAAI,SAAS,sBAAsB,oBAAoB;EAElE,MAAM,oBAAoB,iBAAiB;EAC3C,iBAAiB,YACf,OAAO,sBAAsB,cACxB,GAAG,SAAS,MAAM,kBAAkB,GAAG,IAAI,CAAC,IAC7C,MAAM,iBAAiB;EAE7B,IAAI,OAAO,iBAAiB,WAAW,UACrC,iBAAiB,SAAS,KAAK,IAC7B,iBAAiB,QACjB,oBACF;CAEJ;AACF;AAEA,MAAa,iBACX,kBAEA,WACG,kBAAkB,YAAY,OAAO;AAE1C,MAAa,mBAOX,kBAOA,UACA,uBAEA,SAAS,gBAAgB,gBAAgB,CAAC,CAAC,YAAY;CACrD,mBAAmB,WAAW;AAChC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.cjs","names":[],"sources":["../../src/types.ts"],"sourcesContent":["/* istanbul ignore file */\nimport type {\n DefaultError,\n DefinedInfiniteQueryObserverResult,\n DefinedQueryObserverResult,\n DistributiveOmit,\n InfiniteData,\n InfiniteQueryExecuteOptions,\n InfiniteQueryObserverOptions,\n InfiniteQueryObserverResult,\n MutateFunction,\n MutationObserverOptions,\n MutationObserverResult,\n OmitKeyof,\n Override,\n QueryExecuteOptions,\n QueryKey,\n QueryObserverOptions,\n QueryObserverResult,\n SkipToken,\n} from '@tanstack/query-core'\n\n/**\n * {@link UseBaseQueryOptions} with all type parameters set to `any`, useful when the specific types aren't\n * relevant, e.g. when accepting options for any query in a helper function.\n */\nexport type AnyUseBaseQueryOptions = UseBaseQueryOptions<\n any,\n any,\n any,\n any,\n any\n>\n/**\n * The options shared by `useQuery` and `useSuspenseQuery`. Extends {@link QueryObserverOptions} from\n * `@tanstack/query-core` with the `preact-query`-specific `subscribed` option.\n *\n * @template TQueryFnData - The type your `queryFn` resolves to.\n * @template TError - The type of errors your `queryFn` may throw.\n * @template TData - The type `data` ends up as after `select` runs. Defaults to `TQueryFnData` when no\n * `select` is used.\n * @template TQueryData - The type of the data actually held in the query cache — the input to `select` and\n * `placeholderData`. Defaults to, and is usually the same as, `TQueryFnData`.\n * @template TQueryKey - The type of your `queryKey`.\n */\nexport interface UseBaseQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n> {\n /**\n * Set this to `false` to unsubscribe this observer from updates to the query cache.\n *\n * @defaultValue true\n */\n subscribed?: boolean\n}\n\n/**\n * The options accepted by `usePrefetchQuery` — everything you can pass to `queryClient.query`, except `queryFn`\n * is required unless a default query function has been defined.\n *\n * @template TQueryFnData - The type your `queryFn` resolves to.\n * @template TError - The type of errors your `queryFn` may throw.\n * @template TData - The type `data` ends up as after `select` runs. Defaults to `TQueryFnData` when no\n * `select` is used.\n * @template TQueryData - The type of the data actually held in the query cache — the input to `select` and\n * `placeholderData`. Defaults to, and is usually the same as, `TQueryFnData`.\n * @template TQueryKey - The type of your `queryKey`.\n */\nexport type UsePrefetchQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = DistributiveOmit<\n QueryExecuteOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>,\n 'queryFn'\n> & {\n /**\n * `skipToken` is not allowed as a value here — a prefetch always needs a query function to actually run,\n * unless a default query function has been defined.\n */\n queryFn?: Exclude<\n QueryExecuteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey\n >['queryFn'],\n SkipToken\n >\n}\n\n/**\n * The options accepted by `usePrefetchInfiniteQuery` — everything you can pass to `queryClient.infiniteQuery`,\n * except `queryFn` is required unless a default query function has been defined.\n *\n * @template TQueryFnData - The type of a single page, as your `queryFn` resolves it.\n * @template TError - The type of errors your `queryFn` may throw.\n * @template TData - The type `data` ends up as after `select` runs. Defaults to `TQueryFnData` (a single page)\n * here, since a prefetch never reads `data` back out — this parameter only matters if you reuse these options\n * elsewhere with `select` applied.\n * @template TQueryKey - The type of your `queryKey`.\n * @template TPageParam - The type of the parameter passed to `queryFn` to fetch a given page.\n */\nexport type UsePrefetchInfiniteQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = DistributiveOmit<\n InfiniteQueryExecuteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n 'queryFn'\n> & {\n /**\n * `skipToken` is not allowed as a value here — a prefetch always needs a query function to actually run,\n * unless a default query function has been defined.\n */\n queryFn?: Exclude<\n InfiniteQueryExecuteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >['queryFn'],\n SkipToken\n >\n}\n\n/**\n * {@link UseQueryOptions} with all type parameters set to `any`, useful when the specific types aren't\n * relevant, e.g. when accepting options for any query in a helper function.\n */\nexport type AnyUseQueryOptions = UseQueryOptions<any, any, any, any>\n/**\n * The options accepted by `useQuery`. Same as {@link UseBaseQueryOptions}, minus `suspense` (which\n * `preact-query` derives from which hook you call rather than exposing as an option).\n *\n * @template TQueryFnData - The type your `queryFn` resolves to.\n * @template TError - The type of errors your `queryFn` may throw.\n * @template TData - The type `data` ends up as after `select` runs. Defaults to `TQueryFnData` when no\n * `select` is used.\n * @template TQueryKey - The type of your `queryKey`.\n */\nexport interface UseQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends OmitKeyof<\n UseBaseQueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey>,\n 'suspense'\n> {}\n\n/**\n * {@link UseSuspenseQueryOptions} with all type parameters set to `any`, useful when the specific types aren't\n * relevant, e.g. when accepting options for any query in a helper function.\n */\nexport type AnyUseSuspenseQueryOptions = UseSuspenseQueryOptions<\n any,\n any,\n any,\n any\n>\n/**\n * The options accepted by `useSuspenseQuery`. Same as {@link UseQueryOptions}, minus `enabled`, `throwOnError`,\n * and `placeholderData` — Suspense hooks cannot render a \"disabled\" or \"placeholder\" state, so those options\n * don't apply.\n *\n * @template TQueryFnData - The type your `queryFn` resolves to.\n * @template TError - The type of errors your `queryFn` may throw.\n * @template TData - The type `data` ends up as after `select` runs. Defaults to `TQueryFnData` when no\n * `select` is used.\n * @template TQueryKey - The type of your `queryKey`.\n */\nexport interface UseSuspenseQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends OmitKeyof<\n UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>,\n 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'\n> {\n /**\n * `skipToken` is not allowed here — Suspense hooks cannot render a \"disabled\" state, so a query function\n * must always be provided, unless a default query function has been defined.\n */\n queryFn?: Exclude<\n UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>['queryFn'],\n SkipToken\n >\n}\n\n/**\n * {@link UseInfiniteQueryOptions} with all type parameters set to `any`, useful when the specific types aren't\n * relevant, e.g. when accepting options for any query in a helper function.\n */\nexport type AnyUseInfiniteQueryOptions = UseInfiniteQueryOptions<\n any,\n any,\n any,\n any,\n any\n>\n/**\n * The options accepted by `useInfiniteQuery`. Extends {@link InfiniteQueryObserverOptions} from\n * `@tanstack/query-core` with the `preact-query`-specific `subscribed` option, minus `suspense` (which\n * `preact-query` derives from which hook you call rather than exposing as an option).\n *\n * @template TQueryFnData - The type of a single page, as your `queryFn` resolves it.\n * @template TError - The type of errors your `queryFn` may throw.\n * @template TData - The type `data` ends up as after `select` runs — defaults to `InfiniteData<TQueryFnData>`,\n * the shape of all fetched pages plus their page params.\n * @template TQueryKey - The type of your `queryKey`.\n * @template TPageParam - The type of the parameter passed to `queryFn` to fetch a given page.\n */\nexport interface UseInfiniteQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> extends OmitKeyof<\n InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n 'suspense'\n> {\n /**\n * Set this to `false` to unsubscribe this observer from updates to the query cache.\n *\n * @defaultValue true\n */\n subscribed?: boolean\n}\n\n/**\n * {@link UseSuspenseInfiniteQueryOptions} with all type parameters set to `any`, useful when the specific types\n * aren't relevant, e.g. when accepting options for any query in a helper function.\n */\nexport type AnyUseSuspenseInfiniteQueryOptions =\n UseSuspenseInfiniteQueryOptions<any, any, any, any, any>\n/**\n * The options accepted by `useSuspenseInfiniteQuery`. Same as {@link UseInfiniteQueryOptions}, minus `enabled`,\n * `throwOnError`, and `placeholderData` — Suspense hooks cannot render a \"disabled\" or \"placeholder\" state, so\n * those options don't apply.\n *\n * @template TQueryFnData - The type of a single page, as your `queryFn` resolves it.\n * @template TError - The type of errors your `queryFn` may throw.\n * @template TData - The type `data` ends up as after `select` runs — defaults to `InfiniteData<TQueryFnData>`,\n * the shape of all fetched pages plus their page params.\n * @template TQueryKey - The type of your `queryKey`.\n * @template TPageParam - The type of the parameter passed to `queryFn` to fetch a given page.\n */\nexport interface UseSuspenseInfiniteQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> extends OmitKeyof<\n UseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>,\n 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'\n> {\n /**\n * `skipToken` is not allowed here — Suspense hooks cannot render a \"disabled\" state, so a query function\n * must always be provided, unless a default query function has been defined.\n */\n queryFn?: Exclude<\n UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >['queryFn'],\n SkipToken\n >\n}\n\n/**\n * The result of `useQuery` when `initialData` isn't set — `data` may be `undefined` while the query is\n * `pending`. Re-exports {@link QueryObserverResult} from `@tanstack/query-core`. `useInfiniteQuery` returns\n * {@link UseInfiniteQueryResult} instead.\n *\n * @template TData - The type `data` ends up as after `select` runs.\n * @template TError - The type of errors your `queryFn` may throw.\n */\nexport type UseBaseQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = QueryObserverResult<TData, TError>\n\n/**\n * The result of `useQuery`. Same as {@link UseBaseQueryResult}.\n *\n * @template TData - The type `data` ends up as after `select` runs.\n * @template TError - The type of errors your `queryFn` may throw.\n */\nexport type UseQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = UseBaseQueryResult<TData, TError>\n\n/**\n * The result of `useSuspenseQuery`. Same as {@link DefinedUseQueryResult}, minus `isPlaceholderData` — always\n * `false` on that type, so this drops the dead field rather than an active state.\n *\n * @template TData - The type `data` ends up as after `select` runs.\n * @template TError - The type of errors your `queryFn` may throw.\n */\nexport type UseSuspenseQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = DistributiveOmit<\n DefinedQueryObserverResult<TData, TError>,\n 'isPlaceholderData'\n>\n\n/**\n * The result of `useQuery` when `initialData` is set, or of `useSuspenseQuery` before the `isPlaceholderData`\n * omission — `data` is never `undefined`. Re-exports {@link DefinedQueryObserverResult} from\n * `@tanstack/query-core`.\n *\n * @template TData - The type `data` ends up as after `select` runs.\n * @template TError - The type of errors your `queryFn` may throw.\n */\nexport type DefinedUseQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = DefinedQueryObserverResult<TData, TError>\n\n/**\n * The result of `useInfiniteQuery` when `initialData` isn't set — `data` may be `undefined` while the query is\n * `pending`. Re-exports {@link InfiniteQueryObserverResult} from `@tanstack/query-core`.\n *\n * @template TData - The type `data` ends up as after `select` runs.\n * @template TError - The type of errors your `queryFn` may throw.\n */\nexport type UseInfiniteQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = InfiniteQueryObserverResult<TData, TError>\n\n/**\n * The result of `useInfiniteQuery` when `initialData` is set — `data` is never `undefined`. Re-exports\n * {@link DefinedInfiniteQueryObserverResult} from `@tanstack/query-core`.\n *\n * @template TData - The type `data` ends up as after `select` runs.\n * @template TError - The type of errors your `queryFn` may throw.\n */\nexport type DefinedUseInfiniteQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = DefinedInfiniteQueryObserverResult<TData, TError>\n\n/**\n * The result of `useSuspenseInfiniteQuery`. Same as {@link DefinedUseInfiniteQueryResult}, minus\n * `isPlaceholderData` — Suspense hooks never render placeholder data.\n *\n * @template TData - The type `data` ends up as after `select` runs.\n * @template TError - The type of errors your `queryFn` may throw.\n */\nexport type UseSuspenseInfiniteQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = OmitKeyof<\n DefinedInfiniteQueryObserverResult<TData, TError>,\n 'isPlaceholderData'\n>\n\n/**\n * {@link UseMutationOptions} with all type parameters set to `any`, useful when the specific types aren't\n * relevant, e.g. when accepting options for any mutation in a helper function.\n */\nexport type AnyUseMutationOptions = UseMutationOptions<any, any, any, any>\n/**\n * The options accepted by `useMutation`. Same as {@link MutationObserverOptions} from `@tanstack/query-core`,\n * minus the internal `_defaulted` flag.\n *\n * @template TData - The type your mutation function resolves to.\n * @template TError - The type of errors your mutation function may throw.\n * @template TVariables - The type of the variable passed to `mutate`/`mutateAsync`.\n * @template TOnMutateResult - The type returned by `onMutate`, passed to `onSuccess`/`onError`/`onSettled` as\n * their `onMutateResult` parameter — useful for optimistic-update rollback data.\n */\nexport interface UseMutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends OmitKeyof<\n MutationObserverOptions<TData, TError, TVariables, TOnMutateResult>,\n '_defaulted'\n> {}\n\n/**\n * The type of `mutate`, as returned by `useMutation`. Forwards the variables (and an optional per-call\n * `onSuccess`/`onError`/`onSettled`) to the underlying `mutate` call. Fire-and-forget — errors are surfaced\n * through the mutation result, not thrown.\n *\n * @template TData - The type your mutation function resolves to.\n * @template TError - The type of errors your mutation function may throw.\n * @template TVariables - The type of the variable passed to `mutate`.\n * @template TOnMutateResult - The type returned by `onMutate`, passed to `onSuccess`/`onError`/`onSettled` as\n * their `onMutateResult` parameter — useful for optimistic-update rollback data.\n */\nexport type UseMutateFunction<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> = (\n ...args: Parameters<\n MutateFunction<TData, TError, TVariables, TOnMutateResult>\n >\n) => void\n\n/**\n * The type of `mutateAsync`, as returned by `useMutation`. Similar to {@link UseMutateFunction}, but returns a\n * promise which can be awaited.\n *\n * @template TData - The type your mutation function resolves to.\n * @template TError - The type of errors your mutation function may throw.\n * @template TVariables - The type of the variable passed to `mutateAsync`.\n * @template TOnMutateResult - The type returned by `onMutate`, passed to `onSuccess`/`onError`/`onSettled` as\n * their `onMutateResult` parameter — useful for optimistic-update rollback data.\n */\nexport type UseMutateAsyncFunction<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> = MutateFunction<TData, TError, TVariables, TOnMutateResult>\n\n/**\n * The result of `useMutation`. Same as {@link MutationObserverResult} from `@tanstack/query-core`, with\n * `mutate` narrowed to the fire-and-forget {@link UseMutateFunction} signature, plus the added `mutateAsync`.\n *\n * @template TData - The type your mutation function resolves to.\n * @template TError - The type of errors your mutation function may throw.\n * @template TVariables - The type of the variable passed to `mutate`/`mutateAsync`.\n * @template TOnMutateResult - The type returned by `onMutate`, passed to `onSuccess`/`onError`/`onSettled` as\n * their `onMutateResult` parameter — useful for optimistic-update rollback data.\n */\nexport type UseBaseMutationResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> = Override<\n MutationObserverResult<TData, TError, TVariables, TOnMutateResult>,\n { mutate: UseMutateFunction<TData, TError, TVariables, TOnMutateResult> }\n> & {\n /**\n * Similar to `mutate`, but returns a promise which can be awaited.\n */\n mutateAsync: UseMutateAsyncFunction<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n >\n}\n\n/**\n * The result of `useMutation`. Same as {@link UseBaseMutationResult}.\n *\n * @template TData - The type your mutation function resolves to.\n * @template TError - The type of errors your mutation function may throw.\n * @template TVariables - The type of the variable passed to `mutate`/`mutateAsync`.\n * @template TOnMutateResult - The type returned by `onMutate`, passed to `onSuccess`/`onError`/`onSettled` as\n * their `onMutateResult` parameter — useful for optimistic-update rollback data.\n */\nexport type UseMutationResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> = UseBaseMutationResult<TData, TError, TVariables, TOnMutateResult>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.cjs","names":[],"sources":["../../src/types.ts"],"sourcesContent":["/* istanbul ignore file */\nimport type {\n DefaultError,\n DefinedInfiniteQueryObserverResult,\n DefinedQueryObserverResult,\n DistributiveOmit,\n InfiniteData,\n InfiniteQueryExecuteOptions,\n InfiniteQueryObserverOptions,\n InfiniteQueryObserverResult,\n MutateFunction,\n MutationObserverOptions,\n MutationObserverResult,\n OmitKeyof,\n Override,\n QueryExecuteOptions,\n QueryKey,\n QueryObserverOptions,\n QueryObserverResult,\n SkipToken,\n} from '@tanstack/query-core'\n\n/**\n * {@link UseBaseQueryOptions} with all type parameters set to `any`, useful when the specific types aren't\n * relevant, e.g. when accepting options for any query in a helper function.\n */\nexport type AnyUseBaseQueryOptions = UseBaseQueryOptions<\n any,\n any,\n any,\n any,\n any\n>\n/**\n * The options shared by `useQuery` and `useSuspenseQuery`. Extends {@link QueryObserverOptions} from\n * `@tanstack/query-core` with the `preact-query`-specific `subscribed` option.\n *\n * @template TQueryFnData - The type your `queryFn` resolves to.\n * @template TError - The type of errors your `queryFn` may throw.\n * @template TData - The type `data` ends up as after `select` runs. Defaults to `TQueryFnData` when no\n * `select` is used.\n * @template TQueryData - The type of the data actually held in the query cache — the input to `select` and\n * `placeholderData`. Defaults to, and is usually the same as, `TQueryFnData`.\n * @template TQueryKey - The type of your `queryKey`.\n */\nexport interface UseBaseQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n> {\n /**\n * Set this to `false` to unsubscribe this observer from updates to the query cache.\n *\n * @defaultValue true\n */\n subscribed?: boolean\n}\n\n/**\n * The options accepted by `usePrefetchQuery` — everything you can pass to `queryClient.query`, except `queryFn`\n * is required unless a default query function has been defined.\n *\n * @template TQueryFnData - The type your `queryFn` resolves to.\n * @template TError - The type of errors your `queryFn` may throw.\n * @template TData - The type `data` ends up as after `select` runs. Defaults to `TQueryFnData` when no\n * `select` is used.\n * @template TQueryData - The type of the data actually held in the query cache — the input to `select` and\n * `placeholderData`. Defaults to, and is usually the same as, `TQueryFnData`.\n * @template TQueryKey - The type of your `queryKey`.\n */\nexport type UsePrefetchQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = DistributiveOmit<\n QueryExecuteOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>,\n 'queryFn'\n> & {\n /**\n * `skipToken` is not allowed as a value here — a prefetch always needs a query function to actually run,\n * unless a default query function has been defined.\n */\n queryFn?: Exclude<\n QueryExecuteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey\n >['queryFn'],\n SkipToken\n >\n}\n\n/**\n * The options accepted by `usePrefetchInfiniteQuery` — everything you can pass to `queryClient.infiniteQuery`,\n * except `queryFn` is required unless a default query function has been defined.\n *\n * @template TQueryFnData - The type of a single page, as your `queryFn` resolves it.\n * @template TError - The type of errors your `queryFn` may throw.\n * @template TData - The type `data` ends up as after `select` runs. Defaults to `TQueryFnData` (a single page)\n * here, since a prefetch never reads `data` back out — this parameter only matters if you reuse these options\n * elsewhere with `select` applied.\n * @template TQueryKey - The type of your `queryKey`.\n * @template TPageParam - The type of the parameter passed to `queryFn` to fetch a given page.\n */\nexport type UsePrefetchInfiniteQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = DistributiveOmit<\n InfiniteQueryExecuteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n 'queryFn'\n> & {\n /**\n * `skipToken` is not allowed as a value here — a prefetch always needs a query function to actually run,\n * unless a default query function has been defined.\n */\n queryFn?: Exclude<\n InfiniteQueryExecuteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >['queryFn'],\n SkipToken\n >\n}\n\n/**\n * {@link UseQueryOptions} with all type parameters set to `any`, useful when the specific types aren't\n * relevant, e.g. when accepting options for any query in a helper function.\n */\nexport type AnyUseQueryOptions = UseQueryOptions<any, any, any, any>\n/**\n * The options accepted by `useQuery`. Same as {@link UseBaseQueryOptions}, minus `suspense` (which\n * `preact-query` derives from which hook you call rather than exposing as an option).\n *\n * @template TQueryFnData - The type your `queryFn` resolves to.\n * @template TError - The type of errors your `queryFn` may throw.\n * @template TData - The type `data` ends up as after `select` runs. Defaults to `TQueryFnData` when no\n * `select` is used.\n * @template TQueryKey - The type of your `queryKey`.\n */\nexport interface UseQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends OmitKeyof<\n UseBaseQueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey>,\n 'suspense'\n> {}\n\n/**\n * {@link UseSuspenseQueryOptions} with all type parameters set to `any`, useful when the specific types aren't\n * relevant, e.g. when accepting options for any query in a helper function.\n */\nexport type AnyUseSuspenseQueryOptions = UseSuspenseQueryOptions<\n any,\n any,\n any,\n any\n>\n/**\n * The options accepted by `useSuspenseQuery`. Same as {@link UseQueryOptions}, minus `enabled`, `throwOnError`,\n * and `placeholderData` — Suspense hooks cannot render a \"disabled\" or \"placeholder\" state, so those options\n * don't apply.\n *\n * @template TQueryFnData - The type your `queryFn` resolves to.\n * @template TError - The type of errors your `queryFn` may throw.\n * @template TData - The type `data` ends up as after `select` runs. Defaults to `TQueryFnData` when no\n * `select` is used.\n * @template TQueryKey - The type of your `queryKey`.\n */\nexport interface UseSuspenseQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends OmitKeyof<\n UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>,\n 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'\n> {\n /**\n * `skipToken` is not allowed here — Suspense hooks cannot render a \"disabled\" state, so a query function\n * must always be provided, unless a default query function has been defined.\n */\n queryFn?: Exclude<\n UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>['queryFn'],\n SkipToken\n >\n}\n\n/**\n * {@link UseInfiniteQueryOptions} with all type parameters set to `any`, useful when the specific types aren't\n * relevant, e.g. when accepting options for any query in a helper function.\n */\nexport type AnyUseInfiniteQueryOptions = UseInfiniteQueryOptions<\n any,\n any,\n any,\n any,\n any\n>\n/**\n * The options accepted by `useInfiniteQuery`. Extends {@link InfiniteQueryObserverOptions} from\n * `@tanstack/query-core` with the `preact-query`-specific `subscribed` option, minus `suspense` (which\n * `preact-query` derives from which hook you call rather than exposing as an option).\n *\n * @template TQueryFnData - The type of a single page, as your `queryFn` resolves it.\n * @template TError - The type of errors your `queryFn` may throw.\n * @template TData - The type `data` ends up as after `select` runs — defaults to `InfiniteData<TQueryFnData>`,\n * the shape of all fetched pages plus their page params.\n * @template TQueryKey - The type of your `queryKey`.\n * @template TPageParam - The type of the parameter passed to `queryFn` to fetch a given page.\n */\nexport interface UseInfiniteQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> extends OmitKeyof<\n InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n 'suspense'\n> {\n /**\n * Set this to `false` to unsubscribe this observer from updates to the query cache.\n *\n * @defaultValue true\n */\n subscribed?: boolean\n}\n\n/**\n * {@link UseSuspenseInfiniteQueryOptions} with all type parameters set to `any`, useful when the specific types\n * aren't relevant, e.g. when accepting options for any query in a helper function.\n */\nexport type AnyUseSuspenseInfiniteQueryOptions =\n UseSuspenseInfiniteQueryOptions<any, any, any, any, any>\n/**\n * The options accepted by `useSuspenseInfiniteQuery`. Same as {@link UseInfiniteQueryOptions}, minus `enabled`,\n * `throwOnError`, and `placeholderData` — Suspense hooks cannot render a \"disabled\" or \"placeholder\" state, so\n * those options don't apply.\n *\n * @template TQueryFnData - The type of a single page, as your `queryFn` resolves it.\n * @template TError - The type of errors your `queryFn` may throw.\n * @template TData - The type `data` ends up as after `select` runs — defaults to `InfiniteData<TQueryFnData>`,\n * the shape of all fetched pages plus their page params.\n * @template TQueryKey - The type of your `queryKey`.\n * @template TPageParam - The type of the parameter passed to `queryFn` to fetch a given page.\n */\nexport interface UseSuspenseInfiniteQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> extends OmitKeyof<\n UseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>,\n 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'\n> {\n /**\n * `skipToken` is not allowed here — Suspense hooks cannot render a \"disabled\" state, so a query function\n * must always be provided, unless a default query function has been defined.\n */\n queryFn?: Exclude<\n UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >['queryFn'],\n SkipToken\n >\n}\n\n/**\n * The result of `useQuery` when `initialData` isn't set — `data` may be `undefined` while the query is\n * `pending`. Re-exports {@link QueryObserverResult} from `@tanstack/query-core`. `useInfiniteQuery` returns\n * {@link UseInfiniteQueryResult} instead.\n *\n * @template TData - The type `data` ends up as after `select` runs.\n * @template TError - The type of errors your `queryFn` may throw.\n */\nexport type UseBaseQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = QueryObserverResult<TData, TError>\n\n/**\n * The result of `useQuery`. Same as {@link UseBaseQueryResult}.\n *\n * @template TData - The type `data` ends up as after `select` runs.\n * @template TError - The type of errors your `queryFn` may throw.\n */\nexport type UseQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = UseBaseQueryResult<TData, TError>\n\n/**\n * The result of `useSuspenseQuery`. Same as {@link DefinedUseQueryResult}, minus `isPlaceholderData` — always\n * `false` on that type, so this drops the dead field rather than an active state.\n *\n * @template TData - The type `data` ends up as after `select` runs.\n * @template TError - The type of errors your `queryFn` may throw.\n */\nexport type UseSuspenseQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = DistributiveOmit<\n DefinedQueryObserverResult<TData, TError>,\n 'isPlaceholderData'\n>\n\n/**\n * The result of `useQuery` when `initialData` is set, or of `useSuspenseQuery` before the `isPlaceholderData`\n * omission — `data` is never `undefined` (unless a `select` changes `TData` to include `undefined`).\n * Re-exports {@link DefinedQueryObserverResult} from `@tanstack/query-core`.\n *\n * @template TData - The type `data` ends up as after `select` runs.\n * @template TError - The type of errors your `queryFn` may throw.\n */\nexport type DefinedUseQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = DefinedQueryObserverResult<TData, TError>\n\n/**\n * The result of `useInfiniteQuery` when `initialData` isn't set — `data` may be `undefined` while the query is\n * `pending`. Re-exports {@link InfiniteQueryObserverResult} from `@tanstack/query-core`.\n *\n * @template TData - The type `data` ends up as after `select` runs.\n * @template TError - The type of errors your `queryFn` may throw.\n */\nexport type UseInfiniteQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = InfiniteQueryObserverResult<TData, TError>\n\n/**\n * The result of `useInfiniteQuery` when `initialData` is set — `data` is never `undefined` (unless a\n * `select` changes `TData` to include `undefined`). Re-exports {@link DefinedInfiniteQueryObserverResult}\n * from `@tanstack/query-core`.\n *\n * @template TData - The type `data` ends up as after `select` runs.\n * @template TError - The type of errors your `queryFn` may throw.\n */\nexport type DefinedUseInfiniteQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = DefinedInfiniteQueryObserverResult<TData, TError>\n\n/**\n * The result of `useSuspenseInfiniteQuery`. Same as {@link DefinedUseInfiniteQueryResult}, minus\n * `isPlaceholderData` — Suspense hooks never render placeholder data.\n *\n * @template TData - The type `data` ends up as after `select` runs.\n * @template TError - The type of errors your `queryFn` may throw.\n */\nexport type UseSuspenseInfiniteQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = OmitKeyof<\n DefinedInfiniteQueryObserverResult<TData, TError>,\n 'isPlaceholderData'\n>\n\n/**\n * {@link UseMutationOptions} with all type parameters set to `any`, useful when the specific types aren't\n * relevant, e.g. when accepting options for any mutation in a helper function.\n */\nexport type AnyUseMutationOptions = UseMutationOptions<any, any, any, any>\n/**\n * The options accepted by `useMutation`. Same as {@link MutationObserverOptions} from `@tanstack/query-core`,\n * minus the internal `_defaulted` flag.\n *\n * @template TData - The type your mutation function resolves to.\n * @template TError - The type of errors your mutation function may throw.\n * @template TVariables - The type of the variable passed to `mutate`/`mutateAsync`.\n * @template TOnMutateResult - The type returned by `onMutate`, passed to `onSuccess`/`onError`/`onSettled` as\n * their `onMutateResult` parameter — useful for optimistic-update rollback data.\n */\nexport interface UseMutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends OmitKeyof<\n MutationObserverOptions<TData, TError, TVariables, TOnMutateResult>,\n '_defaulted'\n> {}\n\n/**\n * The type of `mutate`, as returned by `useMutation`. Forwards the variables (and an optional per-call\n * `onSuccess`/`onError`/`onSettled`) to the underlying `mutate` call. Fire-and-forget — errors are surfaced\n * through the mutation result, not thrown.\n *\n * @template TData - The type your mutation function resolves to.\n * @template TError - The type of errors your mutation function may throw.\n * @template TVariables - The type of the variable passed to `mutate`.\n * @template TOnMutateResult - The type returned by `onMutate`, passed to `onSuccess`/`onError`/`onSettled` as\n * their `onMutateResult` parameter — useful for optimistic-update rollback data.\n */\nexport type UseMutateFunction<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> = (\n ...args: Parameters<\n MutateFunction<TData, TError, TVariables, TOnMutateResult>\n >\n) => void\n\n/**\n * The type of `mutateAsync`, as returned by `useMutation`. Similar to {@link UseMutateFunction}, but returns a\n * promise which can be awaited.\n *\n * @template TData - The type your mutation function resolves to.\n * @template TError - The type of errors your mutation function may throw.\n * @template TVariables - The type of the variable passed to `mutateAsync`.\n * @template TOnMutateResult - The type returned by `onMutate`, passed to `onSuccess`/`onError`/`onSettled` as\n * their `onMutateResult` parameter — useful for optimistic-update rollback data.\n */\nexport type UseMutateAsyncFunction<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> = MutateFunction<TData, TError, TVariables, TOnMutateResult>\n\n/**\n * The result of `useMutation`. Same as {@link MutationObserverResult} from `@tanstack/query-core`, with\n * `mutate` narrowed to the fire-and-forget {@link UseMutateFunction} signature, plus the added `mutateAsync`.\n *\n * @template TData - The type your mutation function resolves to.\n * @template TError - The type of errors your mutation function may throw.\n * @template TVariables - The type of the variable passed to `mutate`/`mutateAsync`.\n * @template TOnMutateResult - The type returned by `onMutate`, passed to `onSuccess`/`onError`/`onSettled` as\n * their `onMutateResult` parameter — useful for optimistic-update rollback data.\n */\nexport type UseBaseMutationResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> = Override<\n MutationObserverResult<TData, TError, TVariables, TOnMutateResult>,\n { mutate: UseMutateFunction<TData, TError, TVariables, TOnMutateResult> }\n> & {\n /**\n * Similar to `mutate`, but returns a promise which can be awaited.\n */\n mutateAsync: UseMutateAsyncFunction<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n >\n}\n\n/**\n * The result of `useMutation`. Same as {@link UseBaseMutationResult}.\n *\n * @template TData - The type your mutation function resolves to.\n * @template TError - The type of errors your mutation function may throw.\n * @template TVariables - The type of the variable passed to `mutate`/`mutateAsync`.\n * @template TOnMutateResult - The type returned by `onMutate`, passed to `onSuccess`/`onError`/`onSettled` as\n * their `onMutateResult` parameter — useful for optimistic-update rollback data.\n */\nexport type UseMutationResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> = UseBaseMutationResult<TData, TError, TVariables, TOnMutateResult>\n"],"mappings":""}
|
package/build/modern/types.d.cts
CHANGED
|
@@ -4,7 +4,7 @@ import { DefaultError, DefinedInfiniteQueryObserverResult, DefinedQueryObserverR
|
|
|
4
4
|
* {@link UseBaseQueryOptions} with all type parameters set to `any`, useful when the specific types aren't
|
|
5
5
|
* relevant, e.g. when accepting options for any query in a helper function.
|
|
6
6
|
*/
|
|
7
|
-
type AnyUseBaseQueryOptions = UseBaseQueryOptions<any, any, any, any, any>;
|
|
7
|
+
export type AnyUseBaseQueryOptions = UseBaseQueryOptions<any, any, any, any, any>;
|
|
8
8
|
/**
|
|
9
9
|
* The options shared by `useQuery` and `useSuspenseQuery`. Extends {@link QueryObserverOptions} from
|
|
10
10
|
* `@tanstack/query-core` with the `preact-query`-specific `subscribed` option.
|
|
@@ -17,7 +17,7 @@ type AnyUseBaseQueryOptions = UseBaseQueryOptions<any, any, any, any, any>;
|
|
|
17
17
|
* `placeholderData`. Defaults to, and is usually the same as, `TQueryFnData`.
|
|
18
18
|
* @template TQueryKey - The type of your `queryKey`.
|
|
19
19
|
*/
|
|
20
|
-
interface UseBaseQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> extends QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey> {
|
|
20
|
+
export interface UseBaseQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> extends QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey> {
|
|
21
21
|
/**
|
|
22
22
|
* Set this to `false` to unsubscribe this observer from updates to the query cache.
|
|
23
23
|
*
|
|
@@ -37,7 +37,7 @@ interface UseBaseQueryOptions<TQueryFnData = unknown, TError = DefaultError, TDa
|
|
|
37
37
|
* `placeholderData`. Defaults to, and is usually the same as, `TQueryFnData`.
|
|
38
38
|
* @template TQueryKey - The type of your `queryKey`.
|
|
39
39
|
*/
|
|
40
|
-
type UsePrefetchQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = DistributiveOmit<QueryExecuteOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>, 'queryFn'> & {
|
|
40
|
+
export type UsePrefetchQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = DistributiveOmit<QueryExecuteOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>, 'queryFn'> & {
|
|
41
41
|
/**
|
|
42
42
|
* `skipToken` is not allowed as a value here — a prefetch always needs a query function to actually run,
|
|
43
43
|
* unless a default query function has been defined.
|
|
@@ -56,7 +56,7 @@ type UsePrefetchQueryOptions<TQueryFnData = unknown, TError = DefaultError, TDat
|
|
|
56
56
|
* @template TQueryKey - The type of your `queryKey`.
|
|
57
57
|
* @template TPageParam - The type of the parameter passed to `queryFn` to fetch a given page.
|
|
58
58
|
*/
|
|
59
|
-
type UsePrefetchInfiniteQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = DistributiveOmit<InfiniteQueryExecuteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>, 'queryFn'> & {
|
|
59
|
+
export type UsePrefetchInfiniteQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = DistributiveOmit<InfiniteQueryExecuteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>, 'queryFn'> & {
|
|
60
60
|
/**
|
|
61
61
|
* `skipToken` is not allowed as a value here — a prefetch always needs a query function to actually run,
|
|
62
62
|
* unless a default query function has been defined.
|
|
@@ -67,7 +67,7 @@ type UsePrefetchInfiniteQueryOptions<TQueryFnData = unknown, TError = DefaultErr
|
|
|
67
67
|
* {@link UseQueryOptions} with all type parameters set to `any`, useful when the specific types aren't
|
|
68
68
|
* relevant, e.g. when accepting options for any query in a helper function.
|
|
69
69
|
*/
|
|
70
|
-
type AnyUseQueryOptions = UseQueryOptions<any, any, any, any>;
|
|
70
|
+
export type AnyUseQueryOptions = UseQueryOptions<any, any, any, any>;
|
|
71
71
|
/**
|
|
72
72
|
* The options accepted by `useQuery`. Same as {@link UseBaseQueryOptions}, minus `suspense` (which
|
|
73
73
|
* `preact-query` derives from which hook you call rather than exposing as an option).
|
|
@@ -78,12 +78,12 @@ type AnyUseQueryOptions = UseQueryOptions<any, any, any, any>;
|
|
|
78
78
|
* `select` is used.
|
|
79
79
|
* @template TQueryKey - The type of your `queryKey`.
|
|
80
80
|
*/
|
|
81
|
-
interface UseQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> extends OmitKeyof<UseBaseQueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey>, 'suspense'> {}
|
|
81
|
+
export interface UseQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> extends OmitKeyof<UseBaseQueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey>, 'suspense'> {}
|
|
82
82
|
/**
|
|
83
83
|
* {@link UseSuspenseQueryOptions} with all type parameters set to `any`, useful when the specific types aren't
|
|
84
84
|
* relevant, e.g. when accepting options for any query in a helper function.
|
|
85
85
|
*/
|
|
86
|
-
type AnyUseSuspenseQueryOptions = UseSuspenseQueryOptions<any, any, any, any>;
|
|
86
|
+
export type AnyUseSuspenseQueryOptions = UseSuspenseQueryOptions<any, any, any, any>;
|
|
87
87
|
/**
|
|
88
88
|
* The options accepted by `useSuspenseQuery`. Same as {@link UseQueryOptions}, minus `enabled`, `throwOnError`,
|
|
89
89
|
* and `placeholderData` — Suspense hooks cannot render a "disabled" or "placeholder" state, so those options
|
|
@@ -95,7 +95,7 @@ type AnyUseSuspenseQueryOptions = UseSuspenseQueryOptions<any, any, any, any>;
|
|
|
95
95
|
* `select` is used.
|
|
96
96
|
* @template TQueryKey - The type of your `queryKey`.
|
|
97
97
|
*/
|
|
98
|
-
interface UseSuspenseQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> extends OmitKeyof<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'> {
|
|
98
|
+
export interface UseSuspenseQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> extends OmitKeyof<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'> {
|
|
99
99
|
/**
|
|
100
100
|
* `skipToken` is not allowed here — Suspense hooks cannot render a "disabled" state, so a query function
|
|
101
101
|
* must always be provided, unless a default query function has been defined.
|
|
@@ -106,7 +106,7 @@ interface UseSuspenseQueryOptions<TQueryFnData = unknown, TError = DefaultError,
|
|
|
106
106
|
* {@link UseInfiniteQueryOptions} with all type parameters set to `any`, useful when the specific types aren't
|
|
107
107
|
* relevant, e.g. when accepting options for any query in a helper function.
|
|
108
108
|
*/
|
|
109
|
-
type AnyUseInfiniteQueryOptions = UseInfiniteQueryOptions<any, any, any, any, any>;
|
|
109
|
+
export type AnyUseInfiniteQueryOptions = UseInfiniteQueryOptions<any, any, any, any, any>;
|
|
110
110
|
/**
|
|
111
111
|
* The options accepted by `useInfiniteQuery`. Extends {@link InfiniteQueryObserverOptions} from
|
|
112
112
|
* `@tanstack/query-core` with the `preact-query`-specific `subscribed` option, minus `suspense` (which
|
|
@@ -119,7 +119,7 @@ type AnyUseInfiniteQueryOptions = UseInfiniteQueryOptions<any, any, any, any, an
|
|
|
119
119
|
* @template TQueryKey - The type of your `queryKey`.
|
|
120
120
|
* @template TPageParam - The type of the parameter passed to `queryFn` to fetch a given page.
|
|
121
121
|
*/
|
|
122
|
-
interface UseInfiniteQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> extends OmitKeyof<InfiniteQueryObserverOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>, 'suspense'> {
|
|
122
|
+
export interface UseInfiniteQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> extends OmitKeyof<InfiniteQueryObserverOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>, 'suspense'> {
|
|
123
123
|
/**
|
|
124
124
|
* Set this to `false` to unsubscribe this observer from updates to the query cache.
|
|
125
125
|
*
|
|
@@ -131,7 +131,7 @@ interface UseInfiniteQueryOptions<TQueryFnData = unknown, TError = DefaultError,
|
|
|
131
131
|
* {@link UseSuspenseInfiniteQueryOptions} with all type parameters set to `any`, useful when the specific types
|
|
132
132
|
* aren't relevant, e.g. when accepting options for any query in a helper function.
|
|
133
133
|
*/
|
|
134
|
-
type AnyUseSuspenseInfiniteQueryOptions = UseSuspenseInfiniteQueryOptions<any, any, any, any, any>;
|
|
134
|
+
export type AnyUseSuspenseInfiniteQueryOptions = UseSuspenseInfiniteQueryOptions<any, any, any, any, any>;
|
|
135
135
|
/**
|
|
136
136
|
* The options accepted by `useSuspenseInfiniteQuery`. Same as {@link UseInfiniteQueryOptions}, minus `enabled`,
|
|
137
137
|
* `throwOnError`, and `placeholderData` — Suspense hooks cannot render a "disabled" or "placeholder" state, so
|
|
@@ -144,7 +144,7 @@ type AnyUseSuspenseInfiniteQueryOptions = UseSuspenseInfiniteQueryOptions<any, a
|
|
|
144
144
|
* @template TQueryKey - The type of your `queryKey`.
|
|
145
145
|
* @template TPageParam - The type of the parameter passed to `queryFn` to fetch a given page.
|
|
146
146
|
*/
|
|
147
|
-
interface UseSuspenseInfiniteQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> extends OmitKeyof<UseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>, 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'> {
|
|
147
|
+
export interface UseSuspenseInfiniteQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> extends OmitKeyof<UseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>, 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'> {
|
|
148
148
|
/**
|
|
149
149
|
* `skipToken` is not allowed here — Suspense hooks cannot render a "disabled" state, so a query function
|
|
150
150
|
* must always be provided, unless a default query function has been defined.
|
|
@@ -159,14 +159,14 @@ interface UseSuspenseInfiniteQueryOptions<TQueryFnData = unknown, TError = Defau
|
|
|
159
159
|
* @template TData - The type `data` ends up as after `select` runs.
|
|
160
160
|
* @template TError - The type of errors your `queryFn` may throw.
|
|
161
161
|
*/
|
|
162
|
-
type UseBaseQueryResult<TData = unknown, TError = DefaultError> = QueryObserverResult<TData, TError>;
|
|
162
|
+
export type UseBaseQueryResult<TData = unknown, TError = DefaultError> = QueryObserverResult<TData, TError>;
|
|
163
163
|
/**
|
|
164
164
|
* The result of `useQuery`. Same as {@link UseBaseQueryResult}.
|
|
165
165
|
*
|
|
166
166
|
* @template TData - The type `data` ends up as after `select` runs.
|
|
167
167
|
* @template TError - The type of errors your `queryFn` may throw.
|
|
168
168
|
*/
|
|
169
|
-
type UseQueryResult<TData = unknown, TError = DefaultError> = UseBaseQueryResult<TData, TError>;
|
|
169
|
+
export type UseQueryResult<TData = unknown, TError = DefaultError> = UseBaseQueryResult<TData, TError>;
|
|
170
170
|
/**
|
|
171
171
|
* The result of `useSuspenseQuery`. Same as {@link DefinedUseQueryResult}, minus `isPlaceholderData` — always
|
|
172
172
|
* `false` on that type, so this drops the dead field rather than an active state.
|
|
@@ -174,16 +174,16 @@ type UseQueryResult<TData = unknown, TError = DefaultError> = UseBaseQueryResult
|
|
|
174
174
|
* @template TData - The type `data` ends up as after `select` runs.
|
|
175
175
|
* @template TError - The type of errors your `queryFn` may throw.
|
|
176
176
|
*/
|
|
177
|
-
type UseSuspenseQueryResult<TData = unknown, TError = DefaultError> = DistributiveOmit<DefinedQueryObserverResult<TData, TError>, 'isPlaceholderData'>;
|
|
177
|
+
export type UseSuspenseQueryResult<TData = unknown, TError = DefaultError> = DistributiveOmit<DefinedQueryObserverResult<TData, TError>, 'isPlaceholderData'>;
|
|
178
178
|
/**
|
|
179
179
|
* The result of `useQuery` when `initialData` is set, or of `useSuspenseQuery` before the `isPlaceholderData`
|
|
180
|
-
* omission — `data` is never `undefined
|
|
181
|
-
* `@tanstack/query-core`.
|
|
180
|
+
* omission — `data` is never `undefined` (unless a `select` changes `TData` to include `undefined`).
|
|
181
|
+
* Re-exports {@link DefinedQueryObserverResult} from `@tanstack/query-core`.
|
|
182
182
|
*
|
|
183
183
|
* @template TData - The type `data` ends up as after `select` runs.
|
|
184
184
|
* @template TError - The type of errors your `queryFn` may throw.
|
|
185
185
|
*/
|
|
186
|
-
type DefinedUseQueryResult<TData = unknown, TError = DefaultError> = DefinedQueryObserverResult<TData, TError>;
|
|
186
|
+
export type DefinedUseQueryResult<TData = unknown, TError = DefaultError> = DefinedQueryObserverResult<TData, TError>;
|
|
187
187
|
/**
|
|
188
188
|
* The result of `useInfiniteQuery` when `initialData` isn't set — `data` may be `undefined` while the query is
|
|
189
189
|
* `pending`. Re-exports {@link InfiniteQueryObserverResult} from `@tanstack/query-core`.
|
|
@@ -191,15 +191,16 @@ type DefinedUseQueryResult<TData = unknown, TError = DefaultError> = DefinedQuer
|
|
|
191
191
|
* @template TData - The type `data` ends up as after `select` runs.
|
|
192
192
|
* @template TError - The type of errors your `queryFn` may throw.
|
|
193
193
|
*/
|
|
194
|
-
type UseInfiniteQueryResult<TData = unknown, TError = DefaultError> = InfiniteQueryObserverResult<TData, TError>;
|
|
194
|
+
export type UseInfiniteQueryResult<TData = unknown, TError = DefaultError> = InfiniteQueryObserverResult<TData, TError>;
|
|
195
195
|
/**
|
|
196
|
-
* The result of `useInfiniteQuery` when `initialData` is set — `data` is never `undefined
|
|
197
|
-
* {@link DefinedInfiniteQueryObserverResult}
|
|
196
|
+
* The result of `useInfiniteQuery` when `initialData` is set — `data` is never `undefined` (unless a
|
|
197
|
+
* `select` changes `TData` to include `undefined`). Re-exports {@link DefinedInfiniteQueryObserverResult}
|
|
198
|
+
* from `@tanstack/query-core`.
|
|
198
199
|
*
|
|
199
200
|
* @template TData - The type `data` ends up as after `select` runs.
|
|
200
201
|
* @template TError - The type of errors your `queryFn` may throw.
|
|
201
202
|
*/
|
|
202
|
-
type DefinedUseInfiniteQueryResult<TData = unknown, TError = DefaultError> = DefinedInfiniteQueryObserverResult<TData, TError>;
|
|
203
|
+
export type DefinedUseInfiniteQueryResult<TData = unknown, TError = DefaultError> = DefinedInfiniteQueryObserverResult<TData, TError>;
|
|
203
204
|
/**
|
|
204
205
|
* The result of `useSuspenseInfiniteQuery`. Same as {@link DefinedUseInfiniteQueryResult}, minus
|
|
205
206
|
* `isPlaceholderData` — Suspense hooks never render placeholder data.
|
|
@@ -207,12 +208,12 @@ type DefinedUseInfiniteQueryResult<TData = unknown, TError = DefaultError> = Def
|
|
|
207
208
|
* @template TData - The type `data` ends up as after `select` runs.
|
|
208
209
|
* @template TError - The type of errors your `queryFn` may throw.
|
|
209
210
|
*/
|
|
210
|
-
type UseSuspenseInfiniteQueryResult<TData = unknown, TError = DefaultError> = OmitKeyof<DefinedInfiniteQueryObserverResult<TData, TError>, 'isPlaceholderData'>;
|
|
211
|
+
export type UseSuspenseInfiniteQueryResult<TData = unknown, TError = DefaultError> = OmitKeyof<DefinedInfiniteQueryObserverResult<TData, TError>, 'isPlaceholderData'>;
|
|
211
212
|
/**
|
|
212
213
|
* {@link UseMutationOptions} with all type parameters set to `any`, useful when the specific types aren't
|
|
213
214
|
* relevant, e.g. when accepting options for any mutation in a helper function.
|
|
214
215
|
*/
|
|
215
|
-
type AnyUseMutationOptions = UseMutationOptions<any, any, any, any>;
|
|
216
|
+
export type AnyUseMutationOptions = UseMutationOptions<any, any, any, any>;
|
|
216
217
|
/**
|
|
217
218
|
* The options accepted by `useMutation`. Same as {@link MutationObserverOptions} from `@tanstack/query-core`,
|
|
218
219
|
* minus the internal `_defaulted` flag.
|
|
@@ -223,7 +224,7 @@ type AnyUseMutationOptions = UseMutationOptions<any, any, any, any>;
|
|
|
223
224
|
* @template TOnMutateResult - The type returned by `onMutate`, passed to `onSuccess`/`onError`/`onSettled` as
|
|
224
225
|
* their `onMutateResult` parameter — useful for optimistic-update rollback data.
|
|
225
226
|
*/
|
|
226
|
-
interface UseMutationOptions<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown> extends OmitKeyof<MutationObserverOptions<TData, TError, TVariables, TOnMutateResult>, '_defaulted'> {}
|
|
227
|
+
export interface UseMutationOptions<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown> extends OmitKeyof<MutationObserverOptions<TData, TError, TVariables, TOnMutateResult>, '_defaulted'> {}
|
|
227
228
|
/**
|
|
228
229
|
* The type of `mutate`, as returned by `useMutation`. Forwards the variables (and an optional per-call
|
|
229
230
|
* `onSuccess`/`onError`/`onSettled`) to the underlying `mutate` call. Fire-and-forget — errors are surfaced
|
|
@@ -235,7 +236,7 @@ interface UseMutationOptions<TData = unknown, TError = DefaultError, TVariables
|
|
|
235
236
|
* @template TOnMutateResult - The type returned by `onMutate`, passed to `onSuccess`/`onError`/`onSettled` as
|
|
236
237
|
* their `onMutateResult` parameter — useful for optimistic-update rollback data.
|
|
237
238
|
*/
|
|
238
|
-
type UseMutateFunction<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown> = (...args: Parameters<MutateFunction<TData, TError, TVariables, TOnMutateResult>>) => void;
|
|
239
|
+
export type UseMutateFunction<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown> = (...args: Parameters<MutateFunction<TData, TError, TVariables, TOnMutateResult>>) => void;
|
|
239
240
|
/**
|
|
240
241
|
* The type of `mutateAsync`, as returned by `useMutation`. Similar to {@link UseMutateFunction}, but returns a
|
|
241
242
|
* promise which can be awaited.
|
|
@@ -246,7 +247,7 @@ type UseMutateFunction<TData = unknown, TError = DefaultError, TVariables = void
|
|
|
246
247
|
* @template TOnMutateResult - The type returned by `onMutate`, passed to `onSuccess`/`onError`/`onSettled` as
|
|
247
248
|
* their `onMutateResult` parameter — useful for optimistic-update rollback data.
|
|
248
249
|
*/
|
|
249
|
-
type UseMutateAsyncFunction<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown> = MutateFunction<TData, TError, TVariables, TOnMutateResult>;
|
|
250
|
+
export type UseMutateAsyncFunction<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown> = MutateFunction<TData, TError, TVariables, TOnMutateResult>;
|
|
250
251
|
/**
|
|
251
252
|
* The result of `useMutation`. Same as {@link MutationObserverResult} from `@tanstack/query-core`, with
|
|
252
253
|
* `mutate` narrowed to the fire-and-forget {@link UseMutateFunction} signature, plus the added `mutateAsync`.
|
|
@@ -257,7 +258,7 @@ type UseMutateAsyncFunction<TData = unknown, TError = DefaultError, TVariables =
|
|
|
257
258
|
* @template TOnMutateResult - The type returned by `onMutate`, passed to `onSuccess`/`onError`/`onSettled` as
|
|
258
259
|
* their `onMutateResult` parameter — useful for optimistic-update rollback data.
|
|
259
260
|
*/
|
|
260
|
-
type UseBaseMutationResult<TData = unknown, TError = DefaultError, TVariables = unknown, TOnMutateResult = unknown> = Override<MutationObserverResult<TData, TError, TVariables, TOnMutateResult>, {
|
|
261
|
+
export type UseBaseMutationResult<TData = unknown, TError = DefaultError, TVariables = unknown, TOnMutateResult = unknown> = Override<MutationObserverResult<TData, TError, TVariables, TOnMutateResult>, {
|
|
261
262
|
mutate: UseMutateFunction<TData, TError, TVariables, TOnMutateResult>;
|
|
262
263
|
}> & {
|
|
263
264
|
/**
|
|
@@ -274,7 +275,6 @@ type UseBaseMutationResult<TData = unknown, TError = DefaultError, TVariables =
|
|
|
274
275
|
* @template TOnMutateResult - The type returned by `onMutate`, passed to `onSuccess`/`onError`/`onSettled` as
|
|
275
276
|
* their `onMutateResult` parameter — useful for optimistic-update rollback data.
|
|
276
277
|
*/
|
|
277
|
-
type UseMutationResult<TData = unknown, TError = DefaultError, TVariables = unknown, TOnMutateResult = unknown> = UseBaseMutationResult<TData, TError, TVariables, TOnMutateResult>;
|
|
278
|
+
export type UseMutationResult<TData = unknown, TError = DefaultError, TVariables = unknown, TOnMutateResult = unknown> = UseBaseMutationResult<TData, TError, TVariables, TOnMutateResult>;
|
|
278
279
|
//#endregion
|
|
279
|
-
export { AnyUseBaseQueryOptions, AnyUseInfiniteQueryOptions, AnyUseMutationOptions, AnyUseQueryOptions, AnyUseSuspenseInfiniteQueryOptions, AnyUseSuspenseQueryOptions, DefinedUseInfiniteQueryResult, DefinedUseQueryResult, UseBaseMutationResult, UseBaseQueryOptions, UseBaseQueryResult, UseInfiniteQueryOptions, UseInfiniteQueryResult, UseMutateAsyncFunction, UseMutateFunction, UseMutationOptions, UseMutationResult, UsePrefetchInfiniteQueryOptions, UsePrefetchQueryOptions, UseQueryOptions, UseQueryResult, UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult };
|
|
280
280
|
//# sourceMappingURL=types.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","names":[],"sources":["../../src/types.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"types.d.cts","names":[],"sources":["../../src/types.ts"],"mappings":";;;;;;YA0BY,yBAAyB;;;;;;;;;;;;;iBAmBpB,oBACf,wBACA,SAAS,cACT,QAAQ,cACR,aAAa,cACb,kBAAkB,WAAW,kBACrB,qBACR,cACA,QACA,OACA,YACA;;;;;;EAOA;;;;;;;;;;;;;;YAeU,wBACV,wBACA,SAAS,cACT,QAAQ,cACR,aAAa,cACb,kBAAkB,WAAW,YAC3B,iBACF,oBAAoB,cAAc,QAAQ,OAAO,YAAY;;;;;EAO7D,UAAU,QACR,oBACE,cACA,QACA,OACA,cACA,uBAEF;;;;;;;;;;;;;;YAgBQ,gCACV,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAC7B,wBACE,iBACF,4BACE,cACA,QACA,OACA,WACA;;;;;EAQF,UAAU,QACR,4BACE,cACA,QACA,OACA,WACA,wBAEF;;;;;;YAQQ,qBAAqB;;;;;;;;;;;iBAWhB,gBACf,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,kBACrB,UACR,oBAAoB,cAAc,QAAQ,OAAO,cAAc;;;;;YAQrD,6BAA6B;;;;;;;;;;;;iBAiBxB,wBACf,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,kBACrB,UACR,gBAAgB,cAAc,QAAQ,OAAO;;;;;EAO7C,UAAU,QACR,gBAAgB,cAAc,QAAQ,OAAO,uBAC7C;;;;;;YAQQ,6BAA6B;;;;;;;;;;;;;iBAmBxB,wBACf,wBACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,8BACQ,UACR,6BACE,cACA,QACA,OACA,WACA;;;;;;EASF;;;;;;YAOU,qCACV;;;;;;;;;;;;;iBAae,gCACf,wBACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,8BACQ,UACR,wBAAwB,cAAc,QAAQ,OAAO,WAAW;;;;;EAOhE,UAAU,QACR,wBACE,cACA,QACA,OACA,WACA,wBAEF;;;;;;;;;;YAYQ,mBACV,iBACA,SAAS,gBACP,oBAAoB,OAAO;;;;;;;YAQnB,eACV,iBACA,SAAS,gBACP,mBAAmB,OAAO;;;;;;;;YASlB,uBACV,iBACA,SAAS,gBACP,iBACF,2BAA2B,OAAO;;;;;;;;;YAYxB,sBACV,iBACA,SAAS,gBACP,2BAA2B,OAAO;;;;;;;;YAS1B,uBACV,iBACA,SAAS,gBACP,4BAA4B,OAAO;;;;;;;;;YAU3B,8BACV,iBACA,SAAS,gBACP,mCAAmC,OAAO;;;;;;;;YASlC,+BACV,iBACA,SAAS,gBACP,UACF,mCAAmC,OAAO;;;;;YAQhC,wBAAwB;;;;;;;;;;;iBAWnB,mBACf,iBACA,SAAS,cACT,mBACA,mCACQ,UACR,wBAAwB,OAAO,QAAQ,YAAY;;;;;;;;;;;;YAezC,kBACV,iBACA,SAAS,cACT,mBACA,iCAEG,MAAM,WACP,eAAe,OAAO,QAAQ,YAAY;;;;;;;;;;;YAclC,uBACV,iBACA,SAAS,cACT,mBACA,6BACE,eAAe,OAAO,QAAQ,YAAY;;;;;;;;;;;YAYlC,sBACV,iBACA,SAAS,cACT,sBACA,6BACE,SACF,uBAAuB,OAAO,QAAQ,YAAY;EAChD,QAAQ,kBAAkB,OAAO,QAAQ,YAAY;;;;;EAKvD,aAAa,uBACX,OACA,QACA,YACA;;;;;;;;;;;YAaQ,kBACV,iBACA,SAAS,cACT,sBACA,6BACE,sBAAsB,OAAO,QAAQ,YAAY"}
|