File tree Expand file tree Collapse file tree 1 file changed +28
-1
lines changed
Expand file tree Collapse file tree 1 file changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,33 @@ declare namespace unfetch {
1212 export type IsomorphicRequest = Request | NodeRequest
1313}
1414
15- declare const unfetch : typeof fetch ;
15+ type UnfetchResponse = {
16+ ok : boolean ,
17+ statusText : string ,
18+ status : number ,
19+ url : string ,
20+ text : ( ) => Promise < string > ,
21+ json : ( ) => Promise < any > ,
22+ blob : ( ) => Promise < Blob > ,
23+ clone : ( ) => UnfetchResponse ,
24+ headers : {
25+ keys : ( ) => string [ ] ,
26+ entries : ( ) => Array < [ string , string ] > ,
27+ get : ( key : string ) => string | undefined ,
28+ has : ( key : string ) => boolean ,
29+ }
30+ }
31+
32+ type Unfetch = (
33+ url : string ,
34+ options ?: {
35+ method ?: string ,
36+ headers ?: Record < string , string > ,
37+ credentials ?: 'include' | 'omit' ,
38+ body ?: Parameters < XMLHttpRequest [ "send" ] > [ 0 ]
39+ }
40+ ) => Promise < UnfetchResponse >
41+
42+ declare const unfetch : Unfetch ;
1643
1744export default unfetch ;
You can’t perform that action at this time.
0 commit comments