From d2fdfa835ff8e46a77d1c13b32de678c78279596 Mon Sep 17 00:00:00 2001 From: Subhash Sharma Date: Tue, 29 Sep 2015 12:32:22 +0530 Subject: [PATCH] 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" --- whatwg-fetch/whatwg-fetch-tests.ts | 2 +- whatwg-fetch/whatwg-fetch.d.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/whatwg-fetch/whatwg-fetch-tests.ts b/whatwg-fetch/whatwg-fetch-tests.ts index 3f29746ed..b6bae3066 100644 --- a/whatwg-fetch/whatwg-fetch-tests.ts +++ b/whatwg-fetch/whatwg-fetch-tests.ts @@ -41,7 +41,7 @@ function test_fetchUrlWithRequestObject() { function handlePromise(promise: Promise) { promise.then((response) => { - if (response.type === 'basis') { + if (response.type === 'basic') { // for test only } return response.text(); diff --git a/whatwg-fetch/whatwg-fetch.d.ts b/whatwg-fetch/whatwg-fetch.d.ts index 4d47904a2..d9dae4cd4 100644 --- a/whatwg-fetch/whatwg-fetch.d.ts +++ b/whatwg-fetch/whatwg-fetch.d.ts @@ -5,7 +5,7 @@ /// -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;