diff --git a/node-fetch/index.d.ts b/node-fetch/index.d.ts index d6b075107e..733e25639e 100644 --- a/node-fetch/index.d.ts +++ b/node-fetch/index.d.ts @@ -3,6 +3,8 @@ // Definitions by: Torsten Werner // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + export class Request extends Body { constructor(input: string | Request, init?: RequestInit); method: string; @@ -53,12 +55,12 @@ export class Headers { export class Body { bodyUsed: boolean; + body: NodeJS.ReadableStream; arrayBuffer(): Promise; - blob(): Promise; - formData(): Promise; json(): Promise; json(): Promise; text(): Promise; + buffer(): Promise; } export class Response extends Body { @@ -83,7 +85,7 @@ interface ResponseInit { } type HeaderInit = Headers | Array; -type BodyInit = ArrayBuffer | ArrayBufferView | Blob | FormData | string; +type BodyInit = ArrayBuffer | ArrayBufferView | string | NodeJS.ReadableStream; type RequestInfo = Request | string; export default function fetch(url: string | Request, init?: RequestInit): Promise; diff --git a/node-fetch/node-fetch-tests.ts b/node-fetch/node-fetch-tests.ts index 52ebce4999..e72b3db8e2 100644 --- a/node-fetch/node-fetch-tests.ts +++ b/node-fetch/node-fetch-tests.ts @@ -1,4 +1,4 @@ -import fetch, { Headers, Request, RequestInit, Response } from 'node-fetch'; +import fetch, { Headers, Request, RequestInit, Response } from 'node-fetch'; function test_fetchUrlWithOptions() { var headers = new Headers(); diff --git a/node-fetch/tsconfig.json b/node-fetch/tsconfig.json index 0095190246..0a48b2f5ca 100644 --- a/node-fetch/tsconfig.json +++ b/node-fetch/tsconfig.json @@ -10,10 +10,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "lib": ["es5", "es6"] }, "files": [ "index.d.ts", "node-fetch-tests.ts" ] -} \ No newline at end of file +}