diff options
author | Kyra <kyradiscord@gmail.com> | 2018-11-04 19:05:02 +0100 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-11-04 10:05:02 -0800 |
commit | e93d686e9d5e797f7e4e02bda56a8b6d535326ca (patch) | |
tree | e89490da61e17ee890ce590fdaa99d0701dc8308 /js/dom_types.ts | |
parent | 1241b8e9babfec3e87c8958e2065966ee5dd1335 (diff) |
Web APIs: `File` and `FormData` (#1056)
Diffstat (limited to 'js/dom_types.ts')
-rw-r--r-- | js/dom_types.ts | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/js/dom_types.ts b/js/dom_types.ts index bd73639ce..19a3d5fe2 100644 --- a/js/dom_types.ts +++ b/js/dom_types.ts @@ -34,7 +34,7 @@ type ReferrerPolicy = | "origin-when-cross-origin" | "unsafe-url"; export type BlobPart = BufferSource | Blob | string; -type FormDataEntryValue = File | string; +export type FormDataEntryValue = File | string; export type EventListenerOrEventListenerObject = | EventListener | EventListenerObject; @@ -173,7 +173,7 @@ interface Event { readonly NONE: number; } -interface File extends Blob { +export interface File extends Blob { readonly lastModified: number; readonly name: string; } @@ -242,22 +242,18 @@ interface ReadableStreamReader { releaseLock(): void; } -export interface FormData { +export interface FormData extends DomIterable<string, FormDataEntryValue> { append(name: string, value: string | Blob, fileName?: string): void; delete(name: string): void; get(name: string): FormDataEntryValue | null; getAll(name: string): FormDataEntryValue[]; has(name: string): boolean; set(name: string, value: string | Blob, fileName?: string): void; - forEach( - callbackfn: ( - value: FormDataEntryValue, - key: string, - parent: FormData - ) => void, - // tslint:disable-next-line:no-any - thisArg?: any - ): void; +} + +export interface FormDataConstructor { + new (): FormData; + prototype: FormData; } /** A blob object represents a file-like object of immutable, raw data. */ |