mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 15:00:26 +00:00
[node-fetch] Make ResponseInit url optional (#35414)
This commit is contained in:
committed by
Nathan Shively-Sanders
parent
be73d79797
commit
df31e13c58
Vendored
+3
-2
@@ -6,6 +6,7 @@
|
||||
// Antonio Román <https://github.com/kyranet>
|
||||
// Andrew Leedham <https://github.com/AndrewLeedham>
|
||||
// Jason Li <https://github.com/JasonLi914>
|
||||
// Brandon Wilson <https://github.com/wilsonianb>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
@@ -179,7 +180,7 @@ export interface ResponseInit {
|
||||
status?: number;
|
||||
statusText?: string;
|
||||
timeout?: number;
|
||||
url: string;
|
||||
url?: string;
|
||||
}
|
||||
|
||||
export type HeadersInit = Headers | string[][] | { [key: string]: string };
|
||||
@@ -194,7 +195,7 @@ export type BodyInit =
|
||||
export type RequestInfo = string | Request;
|
||||
|
||||
declare function fetch(
|
||||
url: string | Request,
|
||||
url: RequestInfo,
|
||||
init?: RequestInit
|
||||
): Promise<Response>;
|
||||
|
||||
|
||||
@@ -117,9 +117,7 @@ function test_Blob() {
|
||||
|
||||
function test_ResponseInit() {
|
||||
fetch("http://test.com", {}).then(response => {
|
||||
new Response(response.body, {
|
||||
url: response.url,
|
||||
});
|
||||
new Response(response.body);
|
||||
new Response(response.body, {
|
||||
url: response.url,
|
||||
size: response.size,
|
||||
|
||||
Reference in New Issue
Block a user