UNPKG

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