mirror of
https://github.com/denoland/deno.git
synced 2025-01-09 07:39:15 -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;
|
): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO(ry) Re-expose this interface. There is currently some interference
|
|
||||||
* between deno's File and this one.
|
|
||||||
*/
|
|
||||||
export interface DomFile extends Blob {
|
export interface DomFile extends Blob {
|
||||||
readonly lastModified: number;
|
readonly lastModified: number;
|
||||||
readonly name: string;
|
readonly name: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface DomFileConstructor {
|
||||||
|
new (bits: BlobPart[], filename: string, options?: FilePropertyBag): DomFile;
|
||||||
|
prototype: DomFile;
|
||||||
|
}
|
||||||
|
|
||||||
export interface FilePropertyBag extends BlobPropertyBag {
|
export interface FilePropertyBag extends BlobPropertyBag {
|
||||||
lastModified?: number;
|
lastModified?: number;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@ import * as consoleTypes from "./console";
|
||||||
import * as customEvent from "./custom_event";
|
import * as customEvent from "./custom_event";
|
||||||
import * as deno from "./deno";
|
import * as deno from "./deno";
|
||||||
import * as domTypes from "./dom_types";
|
import * as domTypes from "./dom_types";
|
||||||
|
import * as domFile from "./dom_file";
|
||||||
import * as event from "./event";
|
import * as event from "./event";
|
||||||
import * as eventTarget from "./event_target";
|
import * as eventTarget from "./event_target";
|
||||||
import * as formData from "./form_data";
|
import * as formData from "./form_data";
|
||||||
|
@ -74,11 +75,8 @@ window.location = (undefined as unknown) as domTypes.Location;
|
||||||
window.Blob = blob.DenoBlob;
|
window.Blob = blob.DenoBlob;
|
||||||
export type Blob = blob.DenoBlob;
|
export type Blob = blob.DenoBlob;
|
||||||
|
|
||||||
// TODO(ry) Do not export a class implementing the DOM, export the DOM
|
window.File = domFile.DenoFile as domTypes.DomFileConstructor;
|
||||||
// interface. See this comment for implementation hint:
|
export type File = domTypes.DomFile;
|
||||||
// https://github.com/denoland/deno/pull/1396#discussion_r243711502
|
|
||||||
// window.File = file.DenoFile;
|
|
||||||
// export type File = file.DenoFile;
|
|
||||||
|
|
||||||
window.CustomEventInit = customEvent.CustomEventInit;
|
window.CustomEventInit = customEvent.CustomEventInit;
|
||||||
export type CustomEventInit = customEvent.CustomEventInit;
|
export type CustomEventInit = customEvent.CustomEventInit;
|
||||||
|
|
|
@ -16,9 +16,7 @@ import "./dir_test.ts";
|
||||||
import "./event_test.ts";
|
import "./event_test.ts";
|
||||||
import "./event_target_test.ts";
|
import "./event_target_test.ts";
|
||||||
import "./fetch_test.ts";
|
import "./fetch_test.ts";
|
||||||
// TODO The global "File" has been temporarily disabled. See the note in
|
import "./file_test.ts";
|
||||||
// js/globals.ts
|
|
||||||
// import "./file_test.ts";
|
|
||||||
import "./files_test.ts";
|
import "./files_test.ts";
|
||||||
import "./form_data_test.ts";
|
import "./form_data_test.ts";
|
||||||
import "./globals_test.ts";
|
import "./globals_test.ts";
|
||||||
|
|
Loading…
Reference in a new issue