/** * Helper function to update useQueries cache optimistically. * In the current implementation it only resets the state for one specified query. * @internal * * @param queryKey - affected query. * @param updateCacheFn - function that updates the cache to the expected outcome. * @returns previous state, in case the mutation needs to be rolled back. */ export declare function runOptimisticMutation(queryKey: string, updateCacheFn: (prevState: T) => T, cancelKeys?: string[]): Promise<{ previousState?: T; }>; /** * Helper function to react to errors of an optimistically run mutation. * @internal * * @param queryKey - affected query. * @param error - API response error. * @param context - object containing the previousState. It is usually derived from `runOptimisticMutation`s return type. */ export declare function handleFailedOptimisticMutation(queryKey: string, error: Error, context?: { previousState?: T; }): Promise; /** * Helper function to react to a successful optimistical mutation. * @internal * * @param invalidQueryKeys - queries that have been optimistically updated and can now be refetched. * @param mutationKeys - mutation keys modifiying the same data, to prevent overwrites. */ export declare function handleSettledOptimisticMutation(invalidQueryKeys: string[], mutationKeys: string[]): Promise;