@@ -4,39 +4,6 @@ export type ArrayType<DataArray> = DataArray extends Array<infer ElementType> ?
44
55export type ExtractData < Type > = Type extends { data : infer Data } ? ArrayType < Data > : Type ;
66
7- // export type UsePagesOrInfiniteSignature = <
8- // Params extends PagesOrInfiniteOptions,
9- // FetcherReturnData extends Record<string, any>,
10- // TCacheKeys extends {
11- // stableKey: string;
12- // trackedKeys: {
13- // [key: string]: unknown;
14- // args?: Record<string, unknown>;
15- // };
16- // untrackedKeys: {
17- // [key: string]: unknown;
18- // args?: Record<string, unknown>;
19- // };
20- // },
21- // CacheKeys extends Record<string, unknown> = Record<string, unknown>,
22- // TConfig extends PagesOrInfiniteConfig = PagesOrInfiniteConfig,
23- // >(
24- // /**
25- // * The parameters will be passed to the fetcher.
26- // */
27- // params: Params,
28- // /**
29- // * A Promise returning function to fetch your data.
30- // */
31- // fetcher: ((p: Params) => FetcherReturnData | Promise<FetcherReturnData>) | undefined,
32- // acacheKeys: TCacheKeys,
33- // /**
34- // * Internal configuration of the hook.
35- // */
36- // config: TConfig,
37- // cacheKeys: CacheKeys,
38- // ) => PaginatedResources<ExtractData<FetcherReturnData>, TConfig['infinite']>;
39-
407type Config = PagesOrInfiniteConfig & PagesOrInfiniteOptions ;
418
429interface Register {
@@ -76,26 +43,9 @@ export type UsePagesOrInfiniteSignature = <
7643 invalidationKey : AnyQueryKey ;
7744 stableKey : string ;
7845 } ,
79- // CacheKeys extends Record<string, unknown> = Record<string, unknown>,
8046 TConfig extends Config = Config ,
81- > (
82- // /**
83- // * The parameters will be passed to the fetcher.
84- // */
85- // params: Params,
86- // /**
87- // * A Promise returning function to fetch your data.
88- // */
89- // fetcher: ((p: Params) => FetcherReturnData | Promise<FetcherReturnData>) | undefined,
90- // acacheKeys: TCacheKeys,
91- // /**
92- // * Internal configuration of the hook.
93- // */
94- // config: TConfig,
95- // cacheKeys: CacheKeys,
96- params : {
97- fetcher : ( ( p : Params ) => FetcherReturnData | Promise < FetcherReturnData > ) | undefined ;
98- config : TConfig ;
99- keys : TCacheKeys ;
100- } ,
101- ) => PaginatedResources < ExtractData < FetcherReturnData > , TConfig [ 'infinite' ] > ;
47+ > ( params : {
48+ fetcher : ( ( p : Params ) => FetcherReturnData | Promise < FetcherReturnData > ) | undefined ;
49+ config : TConfig ;
50+ keys : TCacheKeys ;
51+ } ) => PaginatedResources < ExtractData < FetcherReturnData > , TConfig [ 'infinite' ] > ;
0 commit comments