Merge pull request #10050 from horiuchi/update-node-fetch

[node-fetch] support `import from` syntax of ES2015
This commit is contained in:
Horiuchi_H
2016-07-11 19:11:50 +09:00
committed by GitHub
2 changed files with 8 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
/// <reference path="node-fetch.d.ts" />
import fetch = require('node-fetch');
import * as fetch from 'node-fetch';
function test_fetchUrlWithOptions() {
var headers = new _fetch.Headers();

View File

@@ -87,9 +87,14 @@ declare module _fetch {
type BodyInit = ArrayBuffer | ArrayBufferView | Blob | FormData | string;
type RequestInfo = Request | string;
function fetch(url: string | Request, init?: RequestInit): Promise<Response>;
interface FetchStatic {
(url: string | Request, init?: RequestInit): Promise<Response>;
}
}
declare module "node-fetch" {
export = _fetch.fetch;
var fetch: _fetch.FetchStatic;
namespace fetch {}
export = fetch;
}