import { RefetchQueryFilters } from './types'; import type { QueryKey, QueryObserverOptions, QueryObserverResult, RefetchOptions, ResultOptions } from './types'; import type { Query, Action, FetchOptions } from './query'; import type { QueryClient } from './queryClient'; import { Subscribable } from './subscribable'; declare type QueryObserverListener = (result: QueryObserverResult) => void; export interface NotifyOptions { cache?: boolean; listeners?: boolean; onError?: boolean; onSuccess?: boolean; } export interface ObserverFetchOptions extends FetchOptions { throwOnError?: boolean; } export declare class QueryObserver extends Subscribable> { options: QueryObserverOptions; private client; private currentQuery; private currentQueryInitialState; private currentResult; private currentResultState?; private currentResultOptions?; private previousQueryResult?; private previousSelectError; private previousSelect?; private staleTimeoutId?; private refetchIntervalId?; private currentRefetchInterval?; private trackedProps; constructor(client: QueryClient, options: QueryObserverOptions); protected bindMethods(): void; protected onSubscribe(): void; protected onUnsubscribe(): void; shouldFetchOnReconnect(): boolean; shouldFetchOnWindowFocus(): boolean; destroy(): void; setOptions(options?: QueryObserverOptions, notifyOptions?: NotifyOptions): void; updateOptions(options?: Partial>, notifyOptions?: NotifyOptions): void; getOptimisticResult(options: QueryObserverOptions): QueryObserverResult; getCurrentResult(): QueryObserverResult; trackResult(result: QueryObserverResult, defaultedOptions: QueryObserverOptions): QueryObserverResult; getNextResult(options?: ResultOptions): Promise>; getCurrentQuery(): Query; remove(): void; refetch(options?: RefetchOptions & RefetchQueryFilters): Promise>; fetchOptimistic(options: QueryObserverOptions): Promise>; protected fetch(fetchOptions?: ObserverFetchOptions): Promise>; private executeFetch; private updateStaleTimeout; private computeRefetchInterval; private updateRefetchInterval; private updateTimers; private clearTimers; private clearStaleTimeout; private clearRefetchInterval; protected createResult(query: Query, options: QueryObserverOptions): QueryObserverResult; private shouldNotifyListeners; updateResult(notifyOptions?: NotifyOptions): void; private updateQuery; onQueryUpdate(action: Action): void; private notify; } export {};