Skip to content

Commit 26b3954

Browse files
fix(types): export QueryClientConfig interface (TanStack#3203)
1 parent e328ca0 commit 26b3954

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/core/queryClient.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
MutationFilters,
1111
} from './utils'
1212
import type {
13+
QueryClientConfig,
1314
DefaultOptions,
1415
FetchInfiniteQueryOptions,
1516
FetchQueryOptions,
@@ -40,12 +41,6 @@ import { CancelOptions } from './types'
4041

4142
// TYPES
4243

43-
interface QueryClientConfig {
44-
queryCache?: QueryCache
45-
mutationCache?: MutationCache
46-
defaultOptions?: DefaultOptions
47-
}
48-
4944
interface QueryDefaults {
5045
queryKey: QueryKey
5146
defaultOptions: QueryOptions<any, any, any>

src/core/types.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import type { MutationState } from './mutation'
22
import type { QueryBehavior, Query } from './query'
33
import type { RetryValue, RetryDelayValue } from './retryer'
44
import type { QueryFilters } from './utils'
5+
import type { QueryCache } from './queryCache'
6+
import type { MutationCache } from './mutationCache'
57

68
export type QueryKey = string | readonly unknown[]
79
export type EnsuredQueryKey<T extends QueryKey> = T extends string
@@ -669,6 +671,12 @@ export type MutationObserverResult<
669671
| MutationObserverErrorResult<TData, TError, TVariables, TContext>
670672
| MutationObserverSuccessResult<TData, TError, TVariables, TContext>
671673

674+
export interface QueryClientConfig {
675+
queryCache?: QueryCache
676+
mutationCache?: MutationCache
677+
defaultOptions?: DefaultOptions
678+
}
679+
672680
export interface DefaultOptions<TError = unknown> {
673681
queries?: QueryObserverOptions<unknown, TError>
674682
mutations?: MutationObserverOptions<unknown, TError, unknown, unknown>

0 commit comments

Comments
 (0)