1 | import type { QueryKey, QueryObserverOptions } from '@tanstack/query-core';
|
2 | import type { WritableAtom } from 'jotai';
|
3 | import type { CreateQueryOptions, GetQueryClient } from './types';
|
4 | type AtomWithQueryAction = {
|
5 | type: 'refetch';
|
6 | };
|
7 | export interface AtomWithQueryOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey extends QueryKey> extends QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey> {
|
8 | queryKey: TQueryKey;
|
9 | }
|
10 | export interface AtomWithQueryOptionsWithEnabled<TQueryFnData, TError, TData, TQueryData, TQueryKey extends QueryKey> extends Omit<AtomWithQueryOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>, 'enabled'> {
|
11 | enabled: boolean;
|
12 | }
|
13 | export declare function atomWithQuery<TQueryFnData, TError, TData = TQueryFnData, TQueryData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(createQuery: CreateQueryOptions<AtomWithQueryOptionsWithEnabled<TQueryFnData, TError, TData, TQueryData, TQueryKey>>, getQueryClient?: GetQueryClient): WritableAtom<TData | undefined, AtomWithQueryAction>;
|
14 | export declare function atomWithQuery<TQueryFnData, TError, TData = TQueryFnData, TQueryData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(createQuery: CreateQueryOptions<AtomWithQueryOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>>, getQueryClient?: GetQueryClient): WritableAtom<TData, AtomWithQueryAction>;
|
15 | export {};
|