Skip to content

Commit 1de4ca9

Browse files
committed
fix: remove excess exports
1 parent 4e2827c commit 1de4ca9

File tree

8 files changed

+14
-42
lines changed

8 files changed

+14
-42
lines changed

.eslintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
}
2929
],
3030
"no-shadow": "error",
31-
"import/no-cycle": "error"
31+
"import/no-cycle": "error",
32+
"import/no-unused-modules": ["off", { "unusedExports": true }]
3233
}
3334
}

src/core/index.ts

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,13 @@
1-
export { Query } from './query'
21
export { QueryCache } from './queryCache'
32
export { QueryClient } from './queryClient'
4-
export {
5-
getBatchUpdatesFn,
6-
getUpdateFn,
7-
setBatchUpdatesFn,
8-
setUpdateFn,
9-
} from './notifyManager'
3+
export { setBatchUpdatesFn, setUpdateFn } from './notifyManager'
104
export { setLogger } from './logger'
115
export { setFocusHandler } from './focusHandler'
126
export { setOnlineHandler } from './onlineHandler'
13-
export {
14-
CancelledError,
15-
hashQueryKey,
16-
isCancelledError,
17-
isError,
18-
} from './utils'
7+
export { hashQueryKey, isCancelledError, isError } from './utils'
198

209
// Types
2110
export * from './types'
11+
export type { CancelledError } from './utils'
12+
export type { Query } from './query'
2213
export type { Logger } from './logger'

src/core/notifyManager.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ export function setUpdateFn(fn: UpdateFunction) {
2828
updateFn = fn
2929
}
3030

31-
export function getUpdateFn(): UpdateFunction {
32-
return updateFn
33-
}
34-
3531
/**
3632
* Use this function to set a custom batch function to batch updates together into a single render pass.
3733
* By default React Query will use the batch function provided by ReactDOM or React Native.
@@ -40,13 +36,9 @@ export function setBatchUpdatesFn(fn: BatchUpdatesFunction) {
4036
batchUpdatesFn = fn
4137
}
4238

43-
export function getBatchUpdatesFn(): BatchUpdatesFunction {
44-
return batchUpdatesFn
45-
}
46-
4739
// CLASS
4840

49-
export class NotifyManager {
41+
class NotifyManager {
5042
private queue: NotifyCallback[]
5143
private transactions: number
5244

src/core/queriesObserver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { QueryObserverOptions, QueryObserverResult } from './types'
44
import type { QueryClient } from './queryClient'
55
import type { QueryObserver } from './queryObserver'
66

7-
export interface QueriesObserverConfig {
7+
interface QueriesObserverConfig {
88
client: QueryClient
99
queries?: QueryObserverOptions[]
1010
}

src/core/query.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import { getLogger } from './logger'
3030

3131
// TYPES
3232

33-
export interface QueryConfig<TData, TError, TQueryFnData> {
33+
interface QueryConfig<TData, TError, TQueryFnData> {
3434
cache: QueryCache
3535
queryKey: QueryKey
3636
queryHash: string
@@ -701,7 +701,7 @@ function getDefaultState<TData, TError, TQueryFnData>(
701701
}
702702
}
703703

704-
export function queryReducer<TData, TError>(
704+
function queryReducer<TData, TError>(
705705
state: QueryState<TData, TError>,
706706
action: Action<TData, TError>
707707
): QueryState<TData, TError> {

src/core/queryObserver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import type {
2121
import type { Query, QueryState, Action, FetchOptions } from './query'
2222
import type { QueryClient } from './queryClient'
2323

24-
export interface QueryObserverConfig<
24+
interface QueryObserverConfig<
2525
TData = unknown,
2626
TError = unknown,
2727
TQueryFnData = TData,

src/hydration/hydration.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import { Query, QueryCache, QueryKey } from '../core'
1+
import { Query } from '../core/query'
2+
import { QueryCache } from '../core/queryCache'
3+
import { QueryKey } from '../core/types'
24

35
export interface DehydratedQueryConfig {
46
cacheTime: number

src/react/tests/utils.tsx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,6 @@ export function setActTimeout(fn: () => void, ms?: number) {
4747
}, ms)
4848
}
4949

50-
/**
51-
* Checks that `T` is of type `U`.
52-
*/
53-
export type TypeOf<T, U> = Exclude<U, T> extends never ? true : false
54-
55-
/**
56-
* Checks that `T` is equal to `U`.
57-
*/
58-
export type TypeEqual<T, U> = Exclude<T, U> extends never
59-
? Exclude<U, T> extends never
60-
? true
61-
: false
62-
: false
63-
6450
/**
6551
* Assert the parameter is of a specific type.
6652
*/

0 commit comments

Comments
 (0)