1- type inifiniteQueryFunctionContext <'queryKey , 'pageParam > = {
2- queryKey : array < 'queryKey > ,
3- pageParam : option <'pageParam >,
1+ type inifiniteQueryFunctionContext <'queryKey > = {
2+ queryKey : 'queryKey ,
3+ pageParam : option <int >,
44}
55
6- @deriving (abstract )
7- type infiniteQueryOptions <'queryKey , 'queryData , 'queryError , 'pageParam > = {
8- @optional queryKey : 'queryKey ,
9- @optional
10- queryFn : inifiniteQueryFunctionContext <'queryKey , 'pageParam > => Js .Promise .t <'queryData >,
11- @optional enabled : bool ,
12- @optional retry : ReactQuery_Types .retryValue <'queryError >,
13- @optional retryOnMount : bool ,
14- @optional retryDelay : ReactQuery_Types .retryDelayValue <'queryError >,
15- @optional staleTime : ReactQuery_Types .timeValue ,
16- @optional queryKeyHashFn : 'queryKey => string ,
17- @optional refetchInterval : ReactQuery_Types .refetchIntervalValue ,
18- @optional refetchIntervalInBackground : bool ,
19- @optional refetchOnMount : ReactQuery_Types .boolOrAlwaysValue ,
20- @optional refetchOnWindowFocus : ReactQuery_Types .boolOrAlwaysValue ,
21- @optional refetchOnReconnect : ReactQuery_Types .boolOrAlwaysValue ,
22- @optional notifyOnChangeProps : ReactQuery_Types .notifyOnChangePropsValue ,
23- @optional notifyOnChangePropsExclusions : array <string >,
24- @optional onSuccess : 'queryData => unit ,
25- @optional onError : 'queryError => unit ,
26- @optional onSettled : ('queryData , 'queryError ) => unit ,
27- @optional select : 'queryData => 'queryData ,
28- @optional suspense : bool ,
29- @optional keepPreviousData : bool ,
30- @optional structuralSharing : bool ,
31- @optional useErrorBoundary : bool ,
32- @optional initialData : 'queryData => 'queryData ,
33- @optional initialDataUpdatedAt : unit => int ,
34- @optional placeholderData : unit => 'queryData ,
35- @optional getNextPageParam : ('pageParam , array <'pageParam >) => option <'pageParam >,
36- @optional getPreviousPageParam : ('pageParam , array <'pageParam >) => option <'pageParam >,
6+ type infiniteQueryOptions <'queryKey , 'queryData , 'queryError > = {
7+ queryKey ?: 'queryKey ,
8+ queryFn ?: inifiniteQueryFunctionContext <'queryKey > => Js .Promise .t <'queryData >,
9+ enabled ?: bool ,
10+ retry ?: ReactQuery_Types .retryValue <'queryError >,
11+ retryOnMount ?: bool ,
12+ retryDelay ?: ReactQuery_Types .retryDelayValue <'queryError >,
13+ staleTime ?: ReactQuery_Types .timeValue ,
14+ queryKeyHashFn ?: 'queryKey => string ,
15+ refetchInterval ?: ReactQuery_Types .refetchIntervalValue ,
16+ refetchIntervalInBackground ?: bool ,
17+ refetchOnMount ?: ReactQuery_Types .boolOrAlwaysValue ,
18+ refetchOnWindowFocus ?: ReactQuery_Types .boolOrAlwaysValue ,
19+ refetchOnReconnect ?: ReactQuery_Types .boolOrAlwaysValue ,
20+ notifyOnChangeProps ?: ReactQuery_Types .notifyOnChangePropsValue ,
21+ notifyOnChangePropsExclusions ?: array <string >,
22+ onSuccess ?: 'queryData => unit ,
23+ onError ?: 'queryError => unit ,
24+ onSettled ?: ('queryData , 'queryError ) => unit ,
25+ select ?: 'queryData => 'queryData ,
26+ suspense ?: bool ,
27+ keepPreviousData ?: bool ,
28+ structuralSharing ?: bool ,
29+ useErrorBoundary ?: bool ,
30+ initialData ?: 'queryData => 'queryData ,
31+ initialDataUpdatedAt ?: unit => int ,
32+ placeholderData ?: unit => 'queryData ,
33+ getNextPageParam ?: 'queryData => option <int >,
34+ getPreviousPageParam ?: 'queryData => option <int >,
3735}
3836
39- type rec infiniteQueryResult <'queryError , 'queryData , 'pageParam > = {
37+ type rec infiniteQueryResult <'queryError , 'queryData > = {
4038 status : ReactQuery_Types .queryStatus ,
4139 isIdle : bool ,
4240 isError : bool ,
@@ -55,22 +53,21 @@ type rec infiniteQueryResult<'queryError, 'queryData, 'pageParam> = {
5553 errorUpdatedAt : int ,
5654 failureCount : int ,
5755 refetch : ReactQuery_Types .refetchOptions => Js .Promise .t <
58- infiniteQueryResult <'queryError , 'queryData , 'pageParam >,
56+ infiniteQueryResult <'queryError , 'queryData >,
5957 >,
6058 remove : unit => unit ,
61- data : ReactQuery_Types .infiniteData <'queryData , 'pageParam >,
59+ data : option < ReactQuery_Types .infiniteData <'queryData > >,
6260 isFetchingNextPage : bool ,
6361 isFetchingPreviousPage : bool ,
64- // fetchNextPage: (options?: FetchNextPageOptions) => Promise<UseInfiniteQueryResult>
62+ fetchNextPage : unit => unit ,
6563 //fetchPreviousPage: (options?: FetchPreviousPageOptions) => Promise<UseInfiniteQueryResult>
6664 hasNextPage : bool ,
6765 hasPreviousPage : bool ,
6866}
6967
70- @module ("react-query" )
71- external useQuery : infiniteQueryOptions <
68+ @module ("@tanstack/ react-query" )
69+ external useInfiniteQuery : infiniteQueryOptions <
7270 'queryKey ,
7371 'queryData ,
7472 'queryError ,
75- 'pageParam ,
76- > => infiniteQueryResult <'queryError , 'queryData , 'pageParam > = "useInfiniteQuery"
73+ > => infiniteQueryResult <'queryError , 'queryData > = "useInfiniteQuery"
0 commit comments