mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-19 05:03:32 +08:00
Merge pull request #10050 from horiuchi/update-node-fetch
[node-fetch] support `import from` syntax of ES2015
This commit is contained in:
@@ -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();
|
||||
|
||||
9
node-fetch/node-fetch.d.ts
vendored
9
node-fetch/node-fetch.d.ts
vendored
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user