1
1
export type HTTP_METHODS =
2
- | " GET"
3
- | " DELETE"
4
- | " HEAD"
5
- | " OPTIONS"
6
- | " POST"
7
- | " PUT"
8
- | " PATCH"
9
- | " PURGE"
10
- | " LINK"
11
- | " UNLINK"
2
+ | ' GET'
3
+ | ' DELETE'
4
+ | ' HEAD'
5
+ | ' OPTIONS'
6
+ | ' POST'
7
+ | ' PUT'
8
+ | ' PATCH'
9
+ | ' PURGE'
10
+ | ' LINK'
11
+ | ' UNLINK'
12
12
13
13
export type FetchContextType = {
14
14
clientOnly ?: boolean
@@ -83,15 +83,15 @@ export type FetchContextType = {
83
83
ctx : FetchContextType
84
84
) : void
85
85
maxCacheAge ?: TimeSpan
86
- } & Omit < RequestInit , " body" >
86
+ } & Omit < RequestInit , ' body' >
87
87
88
88
export type CacheStoreType = {
89
89
get ( k ?: any ) : any
90
90
set ( k ?: any , v ?: any ) : any
91
91
remove ?( k ?: any ) : any
92
92
}
93
93
94
- export type CustomResponse < T > = Omit < Response , " json" > & {
94
+ export type CustomResponse < T > = Omit < Response , ' json' > & {
95
95
json ( ) : Promise < T >
96
96
}
97
97
@@ -103,7 +103,7 @@ export type RequestWithBody = <R = any, BodyType = any>(
103
103
/**
104
104
* The request configuration
105
105
*/
106
- reqConfig ?: Omit < RequestInit & FetchConfigType < R , BodyType > , " suspense" > & {
106
+ reqConfig ?: Omit < RequestInit & FetchConfigType < R , BodyType > , ' suspense' > & {
107
107
/**
108
108
* Default value
109
109
*/
@@ -144,7 +144,7 @@ export type RequestWithBody = <R = any, BodyType = any>(
144
144
145
145
export type TimeSpan =
146
146
| number
147
- | `${string } ${"ms" | " sec" | " min" | "h" | "d" | "we" | "mo" | "y" } `
147
+ | `${string } ${'ms' | ' sec' | ' min' | 'h' | 'd' | 'we' | 'mo' | 'y' } `
148
148
149
149
/**
150
150
* An imperative version of the `useFetch` hook
@@ -165,7 +165,7 @@ export type ImperativeFetch = {
165
165
166
166
export type FetchConfigType < FetchDataType = any , BodyType = any > = Omit <
167
167
RequestInit ,
168
- " body" | " headers"
168
+ ' body' | ' headers'
169
169
> & {
170
170
headers ?: any
171
171
/**
@@ -219,7 +219,7 @@ export type FetchConfigType<FetchDataType = any, BodyType = any> = Omit<
219
219
* @default true
220
220
*/
221
221
memory ?: boolean
222
- onSubmit ?: " reset" | ( ( form : HTMLFormElement , data : FormData ) => void )
222
+ onSubmit ?: ' reset' | ( ( form : HTMLFormElement , data : FormData ) => void )
223
223
/**
224
224
* Function to run when request is resolved succesfuly
225
225
*/
@@ -337,11 +337,11 @@ export type FetchConfigType<FetchDataType = any, BodyType = any> = Omit<
337
337
/**
338
338
* Will run when the request is sent
339
339
*/
340
- onFetchStart ?: FetchContextType [ " onFetchStart" ]
340
+ onFetchStart ?: FetchContextType [ ' onFetchStart' ]
341
341
/**
342
342
* Will run when the response is received
343
343
*/
344
- onFetchEnd ?: FetchContextType [ " onFetchEnd" ]
344
+ onFetchEnd ?: FetchContextType [ ' onFetchEnd' ]
345
345
/**
346
346
* If `true`, the last resolved value be returned as `data` if the request fails. If `false`, the default value will be returned instead
347
347
*
@@ -357,7 +357,7 @@ export type FetchConfigType<FetchDataType = any, BodyType = any> = Omit<
357
357
// If first argument is a string
358
358
export type FetchConfigTypeNoUrl < FetchDataType = any , BodyType = any > = Omit <
359
359
FetchConfigType < FetchDataType , BodyType > ,
360
- " url"
360
+ ' url'
361
361
>
362
362
363
363
/**
0 commit comments