import { QueryFunctionContext, UseMutationOptions, UseQueryOptions } from 'react-query'; export declare type QueryFunctionArgs any> = QueryFunctionContext>; export declare type QueryConfig = { /** * The time in milliseconds that unused/inactive cache data remains in memory. * If set to Infinity, will disable garbage collection. */ cacheTime?: UseQueryOptions['cacheTime']; /** Set this to `false` to disable this query from automatically running */ enabled?: UseQueryOptions['enabled']; /** * The time in milliseconds after data is considered stale. * If set to Infinity, the data will never be considered stale. */ staleTime?: UseQueryOptions['staleTime']; /** * If set to `true`, the query will suspend when `status === 'loading'` * and throw errors when `status === 'error'`. */ suspense?: UseQueryOptions['suspense']; /** Function to invoke when an error is thrown while fetching new data. */ onError?: UseQueryOptions['onError']; /** Function to invoke when fetching is settled (either successfully fetched, or an error has thrown). */ onSettled?: UseQueryOptions['onSettled']; /** Function to invoke when fetching new data is successful. */ onSuccess?: UseQueryOptions['onSuccess']; }; export declare type MutationConfig = { /** Function fires if mutation encounters error */ onError?: UseMutationOptions['onError']; /** * Function fires before mutation function and is passed same variables mutation function would receive. * Value returned from this function will be passed to both onError and onSettled functions in event of a mutation failure. */ onMutate?: UseMutationOptions['onMutate']; /** Function fires when mutation is either successfully fetched or encounters error */ onSettled?: UseMutationOptions['onSettled']; /** Function fires when mutation is successful and will be passed the mutation's result */ onSuccess?: UseMutationOptions['onSuccess']; };