diff --git a/types/dropzone/dropzone-tests.ts b/types/dropzone/dropzone-tests.ts index 1caed5f4e2..ea7482c9c4 100644 --- a/types/dropzone/dropzone-tests.ts +++ b/types/dropzone/dropzone-tests.ts @@ -63,6 +63,7 @@ const dropzoneWithOptions = new Dropzone(".test", { dictRemoveFileConfirmation: "", dictMaxFilesExceeded: "", dictFileSizeUnits: { tb: "", gb: "", mb: "", kb: "", b: "" }, + dictUploadCanceled: "", accept: (file: Dropzone.DropzoneFile, done: (error?: string | Error) => void) => { if (file.accepted) { @@ -245,6 +246,8 @@ dropzone.resizeImage(firstFile, 120, 120); dropzone.resizeImage(firstFile, 120, 120, 'contain'); dropzone.resizeImage(firstFile, 120, 120, 'contain', function () { }); +document.createElement("div").dropzone; + dropzone .on("drop", () => { console.count('drop'); diff --git a/types/dropzone/index.d.ts b/types/dropzone/index.d.ts index 93f95d2a65..7360999f85 100644 --- a/types/dropzone/index.d.ts +++ b/types/dropzone/index.d.ts @@ -1,6 +1,12 @@ // Type definitions for Dropzone 5.0.0 // Project: http://www.dropzonejs.com/ -// Definitions by: Natan Vivo , Andy Hawkins , Vasya Aksyonov , Simon Huber , Sebastiaan de Rooij , Ted Bicknell +// Definitions by: Natan Vivo +// Andy Hawkins +// Vasya Aksyonov +// Simon Huber +// Sebastiaan de Rooij +// Ted Bicknell +// Daniel Waxweiler // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -87,6 +93,7 @@ declare namespace Dropzone { dictRemoveFileConfirmation?: string; dictMaxFilesExceeded?: string; dictFileSizeUnits?: DropzoneDictFileSizeUnits; + dictUploadCanceled?: string; accept?(file: DropzoneFile, done: (error?: string | Error) => void): void; chunksUploaded?(file: DropzoneFile, done: (error?: string | Error) => void): void; @@ -306,8 +313,14 @@ declare class Dropzone { } -interface JQuery { - dropzone(options: Dropzone.DropzoneOptions): Dropzone; +declare global { + interface JQuery { + dropzone(options: Dropzone.DropzoneOptions): Dropzone; + } + + interface HTMLElement { + dropzone: Dropzone; + } } export = Dropzone;