diff --git a/types/index.d.ts b/types/index.d.ts index 81ee104f52..6a03e8cad4 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -566,12 +566,23 @@ export type MutationResult = | ErrorMutationResult | SuccessMutationResult -export interface CachedQuery { +export interface CachedQueryState { + data?: T + error?: unknown | null + failureCount: number + isFetching: boolean + canFetchMore?: boolean + isStale: boolean + status: 'loading' | 'error' | 'success' + updatedAt: number +} + +export interface CachedQuery { queryKey: AnyQueryKey queryVariables: AnyVariables queryFn: (...args: any[]) => unknown config: QueryOptions - state: unknown + state: CachedQueryState setData( dataOrUpdater: unknown | ((oldData: unknown | undefined) => unknown) ): void