@@ -20,23 +20,23 @@ export type Fetcher<
2020> = SWRKey extends ( ) => infer Arg | null | undefined | false
2121 ? ( arg : Arg ) => FetcherResponse < Data >
2222 : SWRKey extends null | undefined | false
23- ? never
24- : SWRKey extends infer Arg
25- ? ( arg : Arg ) => FetcherResponse < Data >
26- : never
23+ ? never
24+ : SWRKey extends infer Arg
25+ ? ( arg : Arg ) => FetcherResponse < Data >
26+ : never
2727
2828export type BlockingData <
2929 Data = any ,
3030 Options = SWROptions < Data >
3131> = SWRGlobalConfig extends { suspense : true }
3232 ? true
3333 : Options extends undefined
34- ? false
35- : Options extends { suspense : true }
36- ? true
37- : Options extends { fallbackData : Data | Promise < Data > }
38- ? true
39- : false
34+ ? false
35+ : Options extends { suspense : true }
36+ ? true
37+ : Options extends { fallbackData : Data | Promise < Data > }
38+ ? true
39+ : false
4040
4141// Configuration types that are only used internally, not exposed to the user.
4242export interface InternalConfiguration {
@@ -237,95 +237,95 @@ export interface SWRHook {
237237 Data = any ,
238238 Error = any ,
239239 SWRKey extends Key = StrictKey ,
240- SWROptions extends
240+ SWRHookOptions extends
241241 | SWRConfiguration < Data , Error , Fetcher < Data , SWRKey > >
242242 | undefined =
243243 | SWRConfiguration < Data , Error , Fetcher < Data , SWRKey > >
244244 | undefined
245245 > (
246246 key : SWRKey
247- ) : SWRResponse < Data , Error , SWROptions >
247+ ) : SWRResponse < Data , Error , SWRHookOptions >
248248 <
249249 Data = any ,
250250 Error = any ,
251251 SWRKey extends Key = StrictKey ,
252- SWROptions extends
252+ SWRHookOptions extends
253253 | SWRConfiguration < Data , Error , Fetcher < Data , SWRKey > >
254254 | undefined =
255255 | SWRConfiguration < Data , Error , Fetcher < Data , SWRKey > >
256256 | undefined
257257 > (
258258 key : SWRKey ,
259259 fetcher : Fetcher < Data , SWRKey > | null
260- ) : SWRResponse < Data , Error , SWROptions >
260+ ) : SWRResponse < Data , Error , SWRHookOptions >
261261 <
262262 Data = any ,
263263 Error = any ,
264264 SWRKey extends Key = StrictKey ,
265- SWROptions extends
265+ SWRHookOptions extends
266266 | SWRConfiguration < Data , Error , Fetcher < Data , SWRKey > >
267267 | undefined =
268268 | SWRConfiguration < Data , Error , Fetcher < Data , SWRKey > >
269269 | undefined
270270 > (
271271 key : SWRKey ,
272- config : SWRConfigurationWithOptionalFallback < SWROptions >
273- ) : SWRResponse < Data , Error , SWROptions >
272+ config : SWRConfigurationWithOptionalFallback < SWRHookOptions >
273+ ) : SWRResponse < Data , Error , SWRHookOptions >
274274 <
275275 Data = any ,
276276 Error = any ,
277277 SWRKey extends Key = StrictKey ,
278- SWROptions extends
278+ SWRHookOptions extends
279279 | SWRConfiguration < Data , Error , Fetcher < Data , SWRKey > >
280280 | undefined =
281281 | SWRConfiguration < Data , Error , Fetcher < Data , SWRKey > >
282282 | undefined
283283 > (
284284 key : SWRKey ,
285285 fetcher : Fetcher < Data , SWRKey > | null ,
286- config : SWRConfigurationWithOptionalFallback < SWROptions >
287- ) : SWRResponse < Data , Error , SWROptions >
286+ config : SWRConfigurationWithOptionalFallback < SWRHookOptions >
287+ ) : SWRResponse < Data , Error , SWRHookOptions >
288288 < Data = any , Error = any > ( key : Key ) : SWRResponse < Data , Error >
289289 <
290290 Data = any ,
291291 Error = any ,
292- SWROptions extends
292+ SWRHookOptions extends
293293 | SWRConfiguration < Data , Error , BareFetcher < Data > >
294294 | undefined = SWRConfiguration < Data , Error , BareFetcher < Data > > | undefined
295295 > (
296296 key : Key
297- ) : SWRResponse < Data , Error , SWROptions >
297+ ) : SWRResponse < Data , Error , SWRHookOptions >
298298 <
299299 Data = any ,
300300 Error = any ,
301- SWROptions extends
301+ SWRHookOptions extends
302302 | SWRConfiguration < Data , Error , BareFetcher < Data > >
303303 | undefined = SWRConfiguration < Data , Error , BareFetcher < Data > > | undefined
304304 > (
305305 key : Key ,
306306 fetcher : BareFetcher < Data > | null
307- ) : SWRResponse < Data , Error , SWROptions >
307+ ) : SWRResponse < Data , Error , SWRHookOptions >
308308 <
309309 Data = any ,
310310 Error = any ,
311- SWROptions extends
311+ SWRHookOptions extends
312312 | SWRConfiguration < Data , Error , BareFetcher < Data > >
313313 | undefined = SWRConfiguration < Data , Error , BareFetcher < Data > > | undefined
314314 > (
315315 key : Key ,
316- config : SWRConfigurationWithOptionalFallback < SWROptions >
317- ) : SWRResponse < Data , Error , SWROptions >
316+ config : SWRConfigurationWithOptionalFallback < SWRHookOptions >
317+ ) : SWRResponse < Data , Error , SWRHookOptions >
318318 <
319319 Data = any ,
320320 Error = any ,
321- SWROptions extends
321+ SWRHookOptions extends
322322 | SWRConfiguration < Data , Error , BareFetcher < Data > >
323323 | undefined = SWRConfiguration < Data , Error , BareFetcher < Data > > | undefined
324324 > (
325325 key : Key ,
326326 fetcher : BareFetcher < Data > | null ,
327- config : SWRConfigurationWithOptionalFallback < SWROptions >
328- ) : SWRResponse < Data , Error , SWROptions >
327+ config : SWRConfigurationWithOptionalFallback < SWRHookOptions >
328+ ) : SWRResponse < Data , Error , SWRHookOptions >
329329}
330330
331331// Middleware guarantees that a SWRHook receives a key, fetcher, and config as the argument
@@ -403,10 +403,10 @@ export type MutatorWrapper<Fn> = Fn extends (
403403 ? Parameters [ 3 ] extends boolean
404404 ? Result
405405 : Parameters [ 3 ] extends Required < Pick < MutatorOptions , 'populateCache' > >
406- ? Parameters [ 3 ] [ 'populateCache' ] extends false
407- ? never
406+ ? Parameters [ 3 ] [ 'populateCache' ] extends false
407+ ? never
408+ : Result
408409 : Result
409- : Result
410410 : never
411411
412412export type Mutator < Data = any > = MutatorWrapper < MutatorFn < Data > >
0 commit comments