@@ -116,7 +116,7 @@ export class HttpResponse<
116
116
static xml < BodyType extends string > (
117
117
body ?: BodyType | null ,
118
118
init ?: HttpResponseInit ,
119
- ) : Response {
119
+ ) : HttpResponse < BodyType > {
120
120
const responseInit = normalizeResponseInit ( init )
121
121
122
122
if ( ! responseInit . headers . has ( 'Content-Type' ) ) {
@@ -135,7 +135,7 @@ export class HttpResponse<
135
135
static html < BodyType extends string > (
136
136
body ?: BodyType | null ,
137
137
init ?: HttpResponseInit ,
138
- ) : Response {
138
+ ) : HttpResponse < BodyType > {
139
139
const responseInit = normalizeResponseInit ( init )
140
140
141
141
if ( ! responseInit . headers . has ( 'Content-Type' ) ) {
@@ -157,7 +157,7 @@ export class HttpResponse<
157
157
static arrayBuffer (
158
158
body ?: ArrayBuffer | SharedArrayBuffer ,
159
159
init ?: HttpResponseInit ,
160
- ) : Response {
160
+ ) : HttpResponse < ArrayBuffer | SharedArrayBuffer > {
161
161
const responseInit = normalizeResponseInit ( init )
162
162
163
163
if ( ! responseInit . headers . has ( 'Content-Type' ) ) {
@@ -168,7 +168,7 @@ export class HttpResponse<
168
168
responseInit . headers . set ( 'Content-Length' , body . byteLength . toString ( ) )
169
169
}
170
170
171
- return new HttpResponse ( body as ArrayBuffer , responseInit )
171
+ return new HttpResponse ( body , responseInit )
172
172
}
173
173
174
174
/**
@@ -179,7 +179,10 @@ export class HttpResponse<
179
179
*
180
180
* HttpResponse.formData(data)
181
181
*/
182
- static formData ( body ?: FormData , init ?: HttpResponseInit ) : Response {
182
+ static formData (
183
+ body ?: FormData ,
184
+ init ?: HttpResponseInit ,
185
+ ) : HttpResponse < FormData > {
183
186
return new HttpResponse ( body , normalizeResponseInit ( init ) )
184
187
}
185
188
}
0 commit comments