@@ -30,34 +30,31 @@ export type RefetchConfigOptions = {
30
30
refetchOnFocus : boolean
31
31
}
32
32
33
- export type GetNextPageParamFunction < TPageParam , TQueryFnData > = (
34
- lastPage : TQueryFnData ,
35
- allPages : Array < TQueryFnData > ,
36
- lastPageParam : TPageParam ,
37
- allPageParams : Array < TPageParam > ,
38
- ) => TPageParam | undefined | null
33
+ export type PageParamFunction < DataType , PageParam > = (
34
+ firstPage : DataType ,
35
+ allPages : Array < DataType > ,
36
+ firstPageParam : PageParam ,
37
+ allPageParams : Array < PageParam > ,
38
+ ) => PageParam | undefined | null
39
39
40
- export type GetPreviousPageParamFunction < TPageParam , TQueryFnData > = (
41
- firstPage : TQueryFnData ,
42
- allPages : Array < TQueryFnData > ,
43
- firstPageParam : TPageParam ,
44
- allPageParams : Array < TPageParam > ,
45
- ) => TPageParam | undefined | null
46
-
47
- export type InfiniteQueryConfigOptions < TQueryFnData , TPageParam > = {
48
- initialPageParam : TPageParam
40
+ export type InfiniteQueryConfigOptions < DataType , PageParam > = {
41
+ initialPageParam : PageParam
49
42
maxPages ?: number
50
43
/**
51
44
* This function can be set to automatically get the previous cursor for infinite queries.
52
45
* The result will also be used to determine the value of `hasPreviousPage`.
53
46
*/
54
- getPreviousPageParam ?: GetPreviousPageParamFunction < TPageParam , TQueryFnData >
55
- getNextPageParam : GetNextPageParamFunction < TPageParam , TQueryFnData >
47
+ getPreviousPageParam ?: PageParamFunction < DataType , PageParam >
48
+ /**
49
+ * This function is required to automatically get the next cursor for infinite queries.
50
+ * The result will also be used to determine the value of `hasNextPage`.
51
+ */
52
+ getNextPageParam : PageParamFunction < DataType , PageParam >
56
53
}
57
54
58
- export interface InfiniteData < TData , TPageParam > {
59
- pages : Array < TData >
60
- pageParams : Array < TPageParam >
55
+ export interface InfiniteData < DataType , PageParam > {
56
+ pages : Array < DataType >
57
+ pageParams : Array < PageParam >
61
58
}
62
59
63
60
/**
0 commit comments