Merge pull request #26074 from dwaxweiler/dropzone

dropzone: add dictUploadCanceled to DropzoneOptions & make JQuery interface global & add access to Dropzone via HTMLElement
This commit is contained in:
Armando Aguirre
2018-06-06 14:37:16 -07:00
committed by GitHub
2 changed files with 19 additions and 3 deletions
+3
View File
@@ -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');
+16 -3
View File
@@ -1,6 +1,12 @@
// Type definitions for Dropzone 5.0.0
// Project: http://www.dropzonejs.com/
// Definitions by: Natan Vivo <https://github.com/nvivo>, Andy Hawkins <https://github.com/a904guy/,http://a904guy.com/,http://www.bmbsqd.com>, Vasya Aksyonov <https://github.com/outring>, Simon Huber <https://github.com/renuo>, Sebastiaan de Rooij <https://github.com/Hikariii>, Ted Bicknell <https://github.com/tedbcsgpro>
// Definitions by: Natan Vivo <https://github.com/nvivo>
// Andy Hawkins <https://github.com/a904guy/,http://a904guy.com/,http://www.bmbsqd.com>
// Vasya Aksyonov <https://github.com/outring>
// Simon Huber <https://github.com/renuo>
// Sebastiaan de Rooij <https://github.com/Hikariii>
// Ted Bicknell <https://github.com/tedbcsgpro>
// Daniel Waxweiler <https://github.com/dwaxweiler>
// 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;