mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
[Node fetch] Allow body to accept FormData (#42565)
* Add FormData import * Add form-data dep * Add FormData to BodyInit type
This commit is contained in:
parent
1c21ecb184
commit
7da30d6637
5
types/node-fetch/index.d.ts
vendored
5
types/node-fetch/index.d.ts
vendored
@ -10,10 +10,12 @@
|
||||
// Steve Faulkner <https://github.com/southpolesteve>
|
||||
// ExE Boss <https://github.com/ExE-Boss>
|
||||
// Alex Savin <https://github.com/alexandrusavin>
|
||||
// Alexis Tyler <https://github.com/OmgImAlexis>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import FormData = require('form-data');
|
||||
import { Agent } from "http";
|
||||
import { URLSearchParams, URL } from "url";
|
||||
import { AbortSignal } from "./externals";
|
||||
@ -204,7 +206,8 @@ export type BodyInit =
|
||||
| ArrayBufferView
|
||||
| NodeJS.ReadableStream
|
||||
| string
|
||||
| URLSearchParams;
|
||||
| URLSearchParams
|
||||
| FormData;
|
||||
export type RequestInfo = string | URLLike | Request;
|
||||
|
||||
declare function fetch(
|
||||
|
||||
6
types/node-fetch/package.json
Normal file
6
types/node-fetch/package.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"form-data": "^3.0.0"
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user