File tree 5 files changed +37
-3
lines changed
5 files changed +37
-3
lines changed Original file line number Diff line number Diff line change @@ -11,5 +11,16 @@ Index: dom.generated.d.ts
11
11
/// Window APIs
12
12
/////////////////////////////
13
13
14
+ @@ -2800,9 +2801,9 @@
15
+ readonly bodyUsed: boolean;
16
+ arrayBuffer(): Promise<ArrayBuffer>;
17
+ blob(): Promise<Blob>;
18
+ formData(): Promise<FormData>;
19
+ - json(): Promise<any>;
20
+ + json(): Promise<JSONValue>;
21
+ text(): Promise<string>;
22
+ }
23
+
24
+ interface BroadcastChannelEventMap {
14
25
15
26
```
Original file line number Diff line number Diff line change @@ -2802,9 +2802,16 @@ interface Body {
2802
2802
arrayBuffer(): Promise<ArrayBuffer>;
2803
2803
blob(): Promise<Blob>;
2804
2804
formData(): Promise<FormData>;
2805
- json(): Promise<any >;
2805
+ json(): Promise<JSONValue >;
2806
2806
text(): Promise<string>;
2807
2807
}
2808
+ // readonly body: ReadableStream<Uint8Array> | null;
2809
+ // readonly bodyUsed: boolean;
2810
+ // arrayBuffer(): Promise<ArrayBuffer>;
2811
+ // blob(): Promise<Blob>;
2812
+ // formData(): Promise<FormData>;
2813
+ // json(): Promise<any>;
2814
+ // text(): Promise<string>;
2808
2815
2809
2816
interface BroadcastChannelEventMap {
2810
2817
message: MessageEvent;
Original file line number Diff line number Diff line change
1
+ interface Body {
2
+ readonly body : ReadableStream < Uint8Array > | null ;
3
+ readonly bodyUsed : boolean ;
4
+ arrayBuffer ( ) : Promise < ArrayBuffer > ;
5
+ blob ( ) : Promise < Blob > ;
6
+ formData ( ) : Promise < FormData > ;
7
+ json ( ) : Promise < JSONValue > ;
8
+ text ( ) : Promise < string > ;
9
+ }
Original file line number Diff line number Diff line change
1
+ import { expectType } from "tsd" ;
2
+
3
+ const test = async ( url : string ) => {
4
+ const response = await fetch ( url ) ;
5
+ const json = await response . json ( ) ;
6
+ expectType < JSONValue > ( json ) ;
7
+ } ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"compilerOptions" : {
3
3
"target" : " esnext" ,
4
- "lib" : [" esnext" ],
4
+ "lib" : [" esnext" , " dom " ],
5
5
"module" : " esnext" ,
6
6
"moduleResolution" : " node" ,
7
7
"noEmit" : true ,
8
8
"strict" : true ,
9
9
"types" : []
10
10
},
11
11
"include" : [" ./src/*.ts" ]
12
- }
12
+ }
You can’t perform that action at this time.
0 commit comments