mirror of
https://github.com/denoland/deno.git
synced 2025-09-27 20:59:10 +00:00
fix(cli/web/fetch): Make Response constructor standard (#5787)
This commit is contained in:
parent
aef9f22462
commit
08f74e1f6a
6 changed files with 194 additions and 420 deletions
21
cli/js/lib.deno.shared_globals.d.ts
vendored
21
cli/js/lib.deno.shared_globals.d.ts
vendored
|
@ -922,6 +922,12 @@ declare const Request: {
|
|||
new (input: RequestInfo, init?: RequestInit): Request;
|
||||
};
|
||||
|
||||
interface ResponseInit {
|
||||
headers?: HeadersInit;
|
||||
status?: number;
|
||||
statusText?: string;
|
||||
}
|
||||
|
||||
type ResponseType =
|
||||
| "basic"
|
||||
| "cors"
|
||||
|
@ -945,20 +951,7 @@ interface Response extends Body {
|
|||
|
||||
declare const Response: {
|
||||
prototype: Response;
|
||||
|
||||
// TODO(#4667) Response constructor is non-standard.
|
||||
// new(body?: BodyInit | null, init?: ResponseInit): Response;
|
||||
new (
|
||||
url: string,
|
||||
status: number,
|
||||
statusText: string,
|
||||
headersList: Array<[string, string]>,
|
||||
rid: number,
|
||||
redirected_: boolean,
|
||||
type_?: null | ResponseType,
|
||||
body_?: null | Body
|
||||
): Response;
|
||||
|
||||
new (body?: BodyInit | null, init?: ResponseInit): Response;
|
||||
error(): Response;
|
||||
redirect(url: string, status?: number): Response;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue