mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 15:24:46 -05:00
fix: re-expose DomFile (#2100)
This commit is contained in:
parent
ea1b0519f5
commit
e0edcc9c1b
3 changed files with 9 additions and 11 deletions
|
@ -196,14 +196,16 @@ export interface CustomEvent extends Event {
|
|||
): void;
|
||||
}
|
||||
|
||||
/* TODO(ry) Re-expose this interface. There is currently some interference
|
||||
* between deno's File and this one.
|
||||
*/
|
||||
export interface DomFile extends Blob {
|
||||
readonly lastModified: number;
|
||||
readonly name: string;
|
||||
}
|
||||
|
||||
export interface DomFileConstructor {
|
||||
new (bits: BlobPart[], filename: string, options?: FilePropertyBag): DomFile;
|
||||
prototype: DomFile;
|
||||
}
|
||||
|
||||
export interface FilePropertyBag extends BlobPropertyBag {
|
||||
lastModified?: number;
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import * as consoleTypes from "./console";
|
|||
import * as customEvent from "./custom_event";
|
||||
import * as deno from "./deno";
|
||||
import * as domTypes from "./dom_types";
|
||||
import * as domFile from "./dom_file";
|
||||
import * as event from "./event";
|
||||
import * as eventTarget from "./event_target";
|
||||
import * as formData from "./form_data";
|
||||
|
@ -74,11 +75,8 @@ window.location = (undefined as unknown) as domTypes.Location;
|
|||
window.Blob = blob.DenoBlob;
|
||||
export type Blob = blob.DenoBlob;
|
||||
|
||||
// TODO(ry) Do not export a class implementing the DOM, export the DOM
|
||||
// interface. See this comment for implementation hint:
|
||||
// https://github.com/denoland/deno/pull/1396#discussion_r243711502
|
||||
// window.File = file.DenoFile;
|
||||
// export type File = file.DenoFile;
|
||||
window.File = domFile.DenoFile as domTypes.DomFileConstructor;
|
||||
export type File = domTypes.DomFile;
|
||||
|
||||
window.CustomEventInit = customEvent.CustomEventInit;
|
||||
export type CustomEventInit = customEvent.CustomEventInit;
|
||||
|
|
|
@ -16,9 +16,7 @@ import "./dir_test.ts";
|
|||
import "./event_test.ts";
|
||||
import "./event_target_test.ts";
|
||||
import "./fetch_test.ts";
|
||||
// TODO The global "File" has been temporarily disabled. See the note in
|
||||
// js/globals.ts
|
||||
// import "./file_test.ts";
|
||||
import "./file_test.ts";
|
||||
import "./files_test.ts";
|
||||
import "./form_data_test.ts";
|
||||
import "./globals_test.ts";
|
||||
|
|
Loading…
Reference in a new issue