This interface prevents a circular dependency of the modules `./Delete` and `./Upload`.
--- /dev/null
+// This helper interface exists to prevent a circular dependency
+// between `./Delete` and `./Upload`
+define(["require", "exports"], function (require, exports) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+});
Listener_1 = tslib_1.__importDefault(Listener_1);
Language = tslib_1.__importStar(Language);
class UiFileDelete {
- // TODO: uploadHandler should not be `any`
constructor(buttonContainerId, targetId, isSingleImagePreview, uploadHandler) {
this.containers = new Map();
this.deleteButton = undefined;
--- /dev/null
+// This helper interface exists to prevent a circular dependency
+// between `./Delete` and `./Upload`
+
+export interface FileUploadHandler {
+ checkMaxFiles(): void;
+}
import * as Core from "../../Core";
import DomChangeListener from "../../Dom/Change/Listener";
import * as Language from "../../Language";
+import { FileUploadHandler } from "./Data";
interface AjaxResponse extends DatabaseObjectActionResponse {
uniqueFileId: string;
private readonly internalId: string;
private readonly isSingleImagePreview: boolean;
private readonly target: HTMLElement;
- // TODO: uploadHandler should not be `any`
- private readonly uploadHandler: any;
-
- // TODO: uploadHandler should not be `any`
- constructor(buttonContainerId: string, targetId: string, isSingleImagePreview: boolean, uploadHandler: any) {
+ private readonly uploadHandler: FileUploadHandler;
+
+ constructor(
+ buttonContainerId: string,
+ targetId: string,
+ isSingleImagePreview: boolean,
+ uploadHandler: FileUploadHandler,
+ ) {
this.isSingleImagePreview = isSingleImagePreview;
this.uploadHandler = uploadHandler;
import DomUtil from "../../Dom/Util";
import * as Language from "../../Language";
import Upload from "../../Upload";
+import { FileUploadHandler } from "./Data";
interface FileUploadOptions extends UploadOptions {
// image preview
files: FileData[];
}
-class FileUpload extends Upload<FileUploadOptions> {
+class FileUpload extends Upload<FileUploadOptions> implements FileUploadHandler {
protected readonly _deleteHandler: DeleteHandler;
constructor(buttonContainerId: string, targetId: string, options: Partial<FileUploadOptions>) {