From 299702161533d731db799f1bb6c7c95fd92c0c11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 21 Oct 2021 08:47:14 +0200 Subject: fix: declare web types as global (#12497) Co-authored-by: Feng Yu --- ext/fetch/lib.deno_fetch.d.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'ext/fetch/lib.deno_fetch.d.ts') diff --git a/ext/fetch/lib.deno_fetch.d.ts b/ext/fetch/lib.deno_fetch.d.ts index 7fe7d9453..e2f693d28 100644 --- a/ext/fetch/lib.deno_fetch.d.ts +++ b/ext/fetch/lib.deno_fetch.d.ts @@ -22,11 +22,7 @@ type FormDataEntryValue = File | string; * form fields and their values, which can then be easily sent using the * XMLHttpRequest.send() method. It uses the same format a form would use if the * encoding type were set to "multipart/form-data". */ -declare class FormData implements DomIterable { - // TODO(ry) FormData constructor is non-standard. - // new(form?: HTMLFormElement): FormData; - constructor(); - +interface FormData { append(name: string, value: string | Blob, fileName?: string): void; delete(name: string): void; get(name: string): FormDataEntryValue | null; @@ -43,6 +39,11 @@ declare class FormData implements DomIterable { ): void; } +declare var FormData: { + prototype: FormData; + new (): FormData; +}; + interface Body { /** A simple getter used to expose a `ReadableStream` of the body contents. */ readonly body: ReadableStream | null; -- cgit v1.2.3