1
1
'use client'
2
2
import { InfiniteQueryObserver } from '@tanstack/query-core'
3
3
import { useBaseQuery } from './useBaseQuery'
4
- import type { QueryObserver } from '@tanstack/query-core'
4
+ import type {
5
+ InfiniteQueryObserverSuccessResult ,
6
+ QueryObserver ,
7
+ } from '@tanstack/query-core'
5
8
import type {
6
9
DefaultError ,
7
10
InfiniteData ,
8
11
QueryClient ,
9
12
QueryKey ,
10
13
} from '@tanstack/query-core'
11
- import type { DefinedUseInfiniteQueryResult } from './types'
12
- import type { UseInfiniteQueryOptions } from './types'
14
+ import type {
15
+ UseSuspenseInfiniteQueryOptions ,
16
+ UseSuspenseInfiniteQueryResult ,
17
+ } from './types'
13
18
14
19
export function useSuspenseInfiniteQuery <
15
20
TQueryFnData ,
@@ -18,19 +23,16 @@ export function useSuspenseInfiniteQuery<
18
23
TQueryKey extends QueryKey = QueryKey ,
19
24
TPageParam = unknown ,
20
25
> (
21
- options : Omit <
22
- UseInfiniteQueryOptions <
23
- TQueryFnData ,
24
- TError ,
25
- TData ,
26
- TQueryFnData ,
27
- TQueryKey ,
28
- TPageParam
29
- > ,
30
- 'enabled' | 'suspense' | 'throwOnError' | 'placeholderData'
26
+ options : UseSuspenseInfiniteQueryOptions <
27
+ TQueryFnData ,
28
+ TError ,
29
+ TData ,
30
+ TQueryFnData ,
31
+ TQueryKey ,
32
+ TPageParam
31
33
> ,
32
34
queryClient ?: QueryClient ,
33
- ) : Omit < DefinedUseInfiniteQueryResult < TData , TError > , 'isPlaceholderData' > {
35
+ ) : UseSuspenseInfiniteQueryResult < TData , TError > {
34
36
return useBaseQuery (
35
37
{
36
38
...options ,
@@ -41,5 +43,5 @@ export function useSuspenseInfiniteQuery<
41
43
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
42
44
InfiniteQueryObserver as typeof QueryObserver ,
43
45
queryClient ,
44
- ) as DefinedUseInfiniteQueryResult < TData , TError >
46
+ ) as InfiniteQueryObserverSuccessResult < TData , TError >
45
47
}
0 commit comments