fix: declare web types as global (#12497)

Co-authored-by: Feng Yu <F3n67u@outlook.com>
This commit is contained in:
Bartek Iwańczuk 2021-10-21 08:47:14 +02:00 committed by GitHub
parent 8a0e206ede
commit 2997021615
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 58 additions and 19 deletions

View file

@ -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;