mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
changed defn of Request and ResponseInit
Request needs to extends Body class and ResponseInit needs to have statusText and Headers as optional peoperties, corrected typo in test to "basic"
This commit is contained in:
@@ -41,7 +41,7 @@ function test_fetchUrlWithRequestObject() {
|
||||
|
||||
function handlePromise(promise: Promise<Response>) {
|
||||
promise.then((response) => {
|
||||
if (response.type === 'basis') {
|
||||
if (response.type === 'basic') {
|
||||
// for test only
|
||||
}
|
||||
return response.text();
|
||||
|
||||
Vendored
+4
-4
@@ -5,7 +5,7 @@
|
||||
|
||||
/// <reference path="../es6-promise/es6-promise.d.ts" />
|
||||
|
||||
declare class Request {
|
||||
declare class Request extends Body {
|
||||
constructor(input: string|Request, init?:RequestInit);
|
||||
method: string;
|
||||
url: string;
|
||||
@@ -69,10 +69,10 @@ declare class Response extends Body {
|
||||
|
||||
declare enum ResponseType { "basic", "cors", "default", "error", "opaque" }
|
||||
|
||||
declare class ResponseInit {
|
||||
interface ResponseInit {
|
||||
status: number;
|
||||
statusText: string;
|
||||
headers: HeaderInit;
|
||||
statusText?: string;
|
||||
headers?: HeaderInit;
|
||||
}
|
||||
|
||||
declare type HeaderInit = Headers|Array<string>;
|
||||
|
||||
Reference in New Issue
Block a user