1 | import type { InfiniteData, InfiniteQueryObserverOptions, QueryKey, RefetchOptions, RefetchQueryFilters } from '@tanstack/query-core';
|
2 | import type { WritableAtom } from 'jotai';
|
3 | import { CreateQueryOptions, GetQueryClient } from './types';
|
4 | type AtomWithInfiniteQueryAction<TQueryFnData> = {
|
5 | type: 'refetch';
|
6 | payload: Partial<RefetchOptions & RefetchQueryFilters<TQueryFnData>>;
|
7 | } | {
|
8 | type: 'fetchNextPage';
|
9 | } | {
|
10 | type: 'fetchPreviousPage';
|
11 | };
|
12 | export interface AtomWithInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey extends QueryKey> extends InfiniteQueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey> {
|
13 | queryKey: TQueryKey;
|
14 | }
|
15 | export interface AtomWithInfiniteQueryOptionsWithEnabled<TQueryFnData, TError, TData, TQueryData, TQueryKey extends QueryKey> extends Omit<AtomWithInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>, 'enabled'> {
|
16 | enabled: boolean;
|
17 | }
|
18 | export declare function atomWithInfiniteQuery<TQueryFnData, TError, TData = TQueryFnData, TQueryData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(createQuery: CreateQueryOptions<AtomWithInfiniteQueryOptionsWithEnabled<TQueryFnData, TError, TData, TQueryData, TQueryKey>>, getQueryClient?: GetQueryClient): WritableAtom<InfiniteData<TData> | undefined, AtomWithInfiniteQueryAction<TQueryFnData>>;
|
19 | export declare function atomWithInfiniteQuery<TQueryFnData, TError, TData = TQueryFnData, TQueryData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(createQuery: CreateQueryOptions<AtomWithInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>>, getQueryClient?: GetQueryClient): WritableAtom<InfiniteData<TData>, AtomWithInfiniteQueryAction<TQueryFnData>>;
|
20 | export {};
|