diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2021-10-21 08:47:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-21 08:47:14 +0200 |
commit | 299702161533d731db799f1bb6c7c95fd92c0c11 (patch) | |
tree | b390c1b114a852eea04bc53dc252885f0bd6fb35 /ext/fetch/lib.deno_fetch.d.ts | |
parent | 8a0e206ede0f5cc7c21312688e86a1157edb4bcf (diff) |
fix: declare web types as global (#12497)
Co-authored-by: Feng Yu <F3n67u@outlook.com>
Diffstat (limited to 'ext/fetch/lib.deno_fetch.d.ts')
-rw-r--r-- | ext/fetch/lib.deno_fetch.d.ts | 11 |
1 files changed, 6 insertions, 5 deletions
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<string, FormDataEntryValue> { - // 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<string, FormDataEntryValue> { ): 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<Uint8Array> | null; |