@@ -41,9 +41,9 @@ export function useFetchConfig(id?: unknown) {
4141 return thisConfig as FetchInit & FetchContextType
4242}
4343
44- export function useFetchSuspense < FetchDataType = any , BodyType = any > (
45- init : FetchConfigType < FetchDataType , BodyType > | string ,
46- options ?: FetchConfigTypeNoUrl < FetchDataType , BodyType >
44+ export function useFetchSuspense < FetchDataType = any > (
45+ init : FetchConfigType < FetchDataType > | string ,
46+ options ?: FetchConfigTypeNoUrl < FetchDataType >
4747) {
4848 let o =
4949 typeof init === 'string'
@@ -224,13 +224,13 @@ export function useSuccess(id: any) {
224224 * @deprecated - Use the useFetch hook instead
225225 * Get everything from a `useFetch` call using its id
226226 */
227- export function useFetchId < ResponseType = any , BodyType = any > ( id : any ) {
227+ export function useFetchId < ResponseType = any > ( id : any ) {
228228 const defaultsKey = serialize ( {
229229 idString : serialize ( id )
230230 } )
231231 const def = fetcherDefaults . get ( defaultsKey )
232232
233- return useFetch < ResponseType , BodyType > ( {
233+ return useFetch < ResponseType > ( {
234234 id,
235235 default : def
236236 } )
@@ -289,9 +289,9 @@ export function useResolve<ResponseType = any, VT = any>(
289289/**
290290 * User a `GET` request
291291 */
292- export function useGET < FetchDataType = any , BodyType = any > (
293- init : FetchConfigType < FetchDataType , BodyType > | string ,
294- options ?: FetchConfigTypeNoUrl < FetchDataType , BodyType >
292+ export function useGET < FetchDataType = any > (
293+ init : FetchConfigType < FetchDataType > | string ,
294+ options ?: FetchConfigTypeNoUrl < FetchDataType >
295295) {
296296 return useFetch ( init , {
297297 ...options ,
@@ -302,9 +302,9 @@ export function useGET<FetchDataType = any, BodyType = any>(
302302/**
303303 * Use a `DELETE` request
304304 */
305- export function useDELETE < FetchDataType = any , BodyType = any > (
306- init : FetchConfigType < FetchDataType , BodyType > | string ,
307- options ?: FetchConfigTypeNoUrl < FetchDataType , BodyType >
305+ export function useDELETE < FetchDataType = any > (
306+ init : FetchConfigType < FetchDataType > | string ,
307+ options ?: FetchConfigTypeNoUrl < FetchDataType >
308308) {
309309 return useFetch ( init , {
310310 ...options ,
@@ -315,9 +315,9 @@ export function useDELETE<FetchDataType = any, BodyType = any>(
315315/**
316316 * Use a `HEAD` request
317317 */
318- export function useHEAD < FetchDataType = any , BodyType = any > (
319- init : FetchConfigType < FetchDataType , BodyType > | string ,
320- options ?: FetchConfigTypeNoUrl < FetchDataType , BodyType >
318+ export function useHEAD < FetchDataType = any > (
319+ init : FetchConfigType < FetchDataType > | string ,
320+ options ?: FetchConfigTypeNoUrl < FetchDataType >
321321) {
322322 return useFetch ( init , {
323323 ...options ,
@@ -328,9 +328,9 @@ export function useHEAD<FetchDataType = any, BodyType = any>(
328328/**
329329 * Use an `OPTIONS` request
330330 */
331- export function useOPTIONS < FetchDataType = any , BodyType = any > (
332- init : FetchConfigType < FetchDataType , BodyType > | string ,
333- options ?: FetchConfigTypeNoUrl < FetchDataType , BodyType >
331+ export function useOPTIONS < FetchDataType = any > (
332+ init : FetchConfigType < FetchDataType > | string ,
333+ options ?: FetchConfigTypeNoUrl < FetchDataType >
334334) {
335335 return useFetch ( init , {
336336 ...options ,
@@ -342,9 +342,9 @@ export function useOPTIONS<FetchDataType = any, BodyType = any>(
342342/**
343343 * Use a `POST` request
344344 */
345- export function usePOST < FetchDataType = any , BodyType = any > (
346- init : FetchConfigType < FetchDataType , BodyType > | string ,
347- options ?: FetchConfigTypeNoUrl < FetchDataType , BodyType >
345+ export function usePOST < FetchDataType = any > (
346+ init : FetchConfigType < FetchDataType > | string ,
347+ options ?: FetchConfigTypeNoUrl < FetchDataType >
348348) {
349349 return useFetch ( init , {
350350 ...options ,
@@ -355,9 +355,9 @@ export function usePOST<FetchDataType = any, BodyType = any>(
355355/**
356356 * Use a `PUT` request
357357 */
358- export function usePUT < FetchDataType = any , BodyType = any > (
359- init : FetchConfigType < FetchDataType , BodyType > | string ,
360- options ?: FetchConfigTypeNoUrl < FetchDataType , BodyType >
358+ export function usePUT < FetchDataType = any > (
359+ init : FetchConfigType < FetchDataType > | string ,
360+ options ?: FetchConfigTypeNoUrl < FetchDataType >
361361) {
362362 return useFetch ( init , {
363363 ...options ,
@@ -368,9 +368,9 @@ export function usePUT<FetchDataType = any, BodyType = any>(
368368/**
369369 * Use a `PATCH` request
370370 */
371- export function usePATCH < FetchDataType = any , BodyType = any > (
372- init : FetchConfigType < FetchDataType , BodyType > | string ,
373- options ?: FetchConfigTypeNoUrl < FetchDataType , BodyType >
371+ export function usePATCH < FetchDataType = any > (
372+ init : FetchConfigType < FetchDataType > | string ,
373+ options ?: FetchConfigTypeNoUrl < FetchDataType >
374374) {
375375 return useFetch ( init , {
376376 ...options ,
@@ -381,9 +381,9 @@ export function usePATCH<FetchDataType = any, BodyType = any>(
381381/**
382382 * Use a `PURGE` request
383383 */
384- export function usePURGE < FetchDataType = any , BodyType = any > (
385- init : FetchConfigType < FetchDataType , BodyType > | string ,
386- options ?: FetchConfigTypeNoUrl < FetchDataType , BodyType >
384+ export function usePURGE < FetchDataType = any > (
385+ init : FetchConfigType < FetchDataType > | string ,
386+ options ?: FetchConfigTypeNoUrl < FetchDataType >
387387) {
388388 return useFetch ( init , {
389389 ...options ,
@@ -394,9 +394,9 @@ export function usePURGE<FetchDataType = any, BodyType = any>(
394394/**
395395 * Use a `LINK` request
396396 */
397- export function useLINK < FetchDataType = any , BodyType = any > (
398- init : FetchConfigType < FetchDataType , BodyType > | string ,
399- options ?: FetchConfigTypeNoUrl < FetchDataType , BodyType >
397+ export function useLINK < FetchDataType = any > (
398+ init : FetchConfigType < FetchDataType > | string ,
399+ options ?: FetchConfigTypeNoUrl < FetchDataType >
400400) {
401401 return useFetch ( init , {
402402 ...options ,
@@ -407,9 +407,9 @@ export function useLINK<FetchDataType = any, BodyType = any>(
407407/**
408408 * Use an `UNLINK` request
409409 */
410- export function useUNLINK < FetchDataType = any , BodyType = any > (
411- init : FetchConfigType < FetchDataType , BodyType > | string ,
412- options ?: FetchConfigTypeNoUrl < FetchDataType , BodyType >
410+ export function useUNLINK < FetchDataType = any > (
411+ init : FetchConfigType < FetchDataType > | string ,
412+ options ?: FetchConfigTypeNoUrl < FetchDataType >
413413) {
414414 return useFetch ( init , {
415415 ...options ,
@@ -420,9 +420,9 @@ export function useUNLINK<FetchDataType = any, BodyType = any>(
420420/**
421421 * Use a request without making it automatically
422422 */
423- export function useManualFetch < FetchDataType = any , BodyType = any > (
424- init : FetchConfigType < FetchDataType , BodyType > | string ,
425- options ?: FetchConfigTypeNoUrl < FetchDataType , BodyType >
423+ export function useManualFetch < FetchDataType = any > (
424+ init : FetchConfigType < FetchDataType > | string ,
425+ options ?: FetchConfigTypeNoUrl < FetchDataType >
426426) {
427427 return useFetch ( init , {
428428 ...options ,
@@ -433,15 +433,13 @@ export function useManualFetch<FetchDataType = any, BodyType = any>(
433433/**
434434 * Get a blob of the response. You can pass an `objectURL` property that will convet that blob into a string using `URL.createObjectURL`
435435 */
436- export function useFetchBlob < FetchDataType = string , BodyType = any > (
437- init :
438- | ( FetchConfigType < FetchDataType , BodyType > & { objectURL ?: boolean } )
439- | string ,
440- options ?: FetchConfigTypeNoUrl < FetchDataType , BodyType > & {
436+ export function useFetchBlob < FetchDataType = string > (
437+ init : ( FetchConfigType < FetchDataType > & { objectURL ?: boolean } ) | string ,
438+ options ?: FetchConfigTypeNoUrl < FetchDataType > & {
441439 objectURL ?: boolean
442440 }
443441) {
444- return useFetch < FetchDataType , BodyType > ( init , {
442+ return useFetch < FetchDataType > ( init , {
445443 ...options ,
446444 async resolver ( res ) {
447445 const blob = await res . blob ( )
@@ -463,11 +461,11 @@ export function useFetchBlob<FetchDataType = string, BodyType = any>(
463461/**
464462 * Get a text of the response
465463 */
466- export function useFetchText < FetchDataType = string , BodyType = any > (
467- init : FetchConfigType < string , BodyType > | string ,
468- options ?: FetchConfigTypeNoUrl < string , BodyType >
464+ export function useFetchText < FetchDataType = string > (
465+ init : FetchConfigType < string > | string ,
466+ options ?: FetchConfigTypeNoUrl < string >
469467) {
470- return useFetch < string , BodyType > ( init , {
468+ return useFetch < string > ( init , {
471469 ...options ,
472470 async resolver ( res ) {
473471 const text = await res . text ( )
@@ -503,21 +501,21 @@ export function useRequestEnd(id: any) {
503501/**
504502 * Debounce a fetch by the time given
505503 */
506- export function useDebounceFetch < FetchDataType = any , BodyType = any > (
504+ export function useDebounceFetch < FetchDataType = any > (
507505 init :
508- | ( Omit < FetchConfigType < FetchDataType , BodyType > , 'debounce' > & {
506+ | ( Omit < FetchConfigType < FetchDataType > , 'debounce' > & {
509507 debounce ?: TimeSpan
510508 } )
511509 | string
512510 | Request ,
513- options ?: Omit < FetchConfigTypeNoUrl < FetchDataType , BodyType > , 'debounce' > & {
511+ options ?: Omit < FetchConfigTypeNoUrl < FetchDataType > , 'debounce' > & {
514512 debounce ?: TimeSpan
515513 }
516514) {
517515 // @ts -ignore - auto can be present in the first arg
518516 const canDebounce = init ?. auto ?? options ?. auto ?? true
519517
520- const res = useFetch < FetchDataType , BodyType > ( init , {
518+ const res = useFetch < FetchDataType > ( init , {
521519 ...options ,
522520 auto : false
523521 } )
@@ -550,7 +548,7 @@ export function useGql<T = any, VT = { [k: string]: any }>(
550548 value : T
551549 variables : VT
552550 } ,
553- cfg : FetchConfigTypeNoUrl < T , any > & {
551+ cfg : FetchConfigTypeNoUrl < T > & {
554552 /**
555553 * GraphQL variables
556554 */
0 commit comments