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CC=97=CC=96=CC=A4=CC=99=CC=9C=CD=8De=CC=BF=CC=AB=CD=8E=CC=9F?= =?UTF-8?q?=CC=BC=CC=BA=CC=ABr=CC=8A=CC=91=CC=BF=CC=85=CD=AF=CD=99=CD=85?= =?UTF-8?q?=CC=B0=29=CD=86=CC=87=CD=A7=CC=9A=CD=91=CC=AA=CC=96=CD=87=CC=9D?= =?UTF-8?q?=CC=AE=CC=AA=CD=96=CC=A6?= Date: Tue, 4 Aug 2015 05:55:47 -0400 Subject: [PATCH] Update dropzone.d.ts to v4.0.1 support. --- dropzone/dropzone.d.ts | 175 ++++++++++++++++++++++++----------------- 1 file changed, 102 insertions(+), 73 deletions(-) diff --git a/dropzone/dropzone.d.ts b/dropzone/dropzone.d.ts index 475925469..137604772 100644 --- a/dropzone/dropzone.d.ts +++ b/dropzone/dropzone.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Dropzone 3.7.1 +// Type definitions for Dropzone 4.0.1 // Project: http://www.dropzonejs.com/ // Definitions by: Natan Vivo , Andy Hawkins // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -6,94 +6,123 @@ /// interface DropzoneFile extends File { - previewElement: HTMLElement; - previewTemplate: HTMLElement; - previewsContainer: HTMLElement; - status: string; - accepted: boolean; + previewElement: HTMLElement; + previewTemplate: HTMLElement; + previewsContainer: HTMLElement; + status: string; + accepted: boolean; } interface DropzoneOptions { - url?: string; - method?: string; - withCredentials?: boolean; - parallelUploads?: number; - maxFilesize?: number; - paramName?: string; - uploadMultiple?: boolean; - headers?: any; - addRemoveLinks?: boolean; - previewsContainer?: string; - clickable?: any; - createImageThumbnails?: boolean; - maxThumbnailFilesize?: number; - thumbnailWidth?: number; - thumbnailHeight?: number; - maxFiles?: number; - resize?: (file?: any) => any; - init?: () => void; - acceptedFiles?: string; - accept?: (file: DropzoneFile, doneCallback: (...args) => void) => void; - autoProcessQueue?: boolean; - previewTemplate?: string; - forceFallback?: boolean; - fallback?: () => void; + url?: string; + method?: string; + withCredentials?: boolean; + parallelUploads?: number; + maxFilesize?: number; + paramName?: string; + uploadMultiple?: boolean; + headers?: any; + addRemoveLinks?: boolean; + previewsContainer?: string; + clickable?: any; + createImageThumbnails?: boolean; + maxThumbnailFilesize?: number; + thumbnailWidth?: number; + thumbnailHeight?: number; + maxFiles?: number; + resize?: ( file?: any ) => any; + init?: () => void; + acceptedFiles?: string; + accept?: ( file: DropzoneFile, doneCallback: ( ...args ) => void ) => void; + autoProcessQueue?: boolean; + previewTemplate?: string; + forceFallback?: boolean; + fallback?: () => void; - // dictionary options - dictDefaultMessage?: string; - dictFallbackMessage?: string; - dictFallbackText?: string; - dictInvalidFileType?: string; - dictFileTooBig?: string; - dictResponseError?: string; - dictCancelUpload?: string; - dictCancelUploadConfirmation?: string; - dictRemoveFile?: string; - dictRemoveFileConfirmation?: string; - dictMaxFilesExceeded?: string; + // dictionary options + dictDefaultMessage?: string; + dictFallbackMessage?: string; + dictFallbackText?: string; + dictInvalidFileType?: string; + dictFileTooBig?: string; + dictResponseError?: string; + dictCancelUpload?: string; + dictCancelUploadConfirmation?: string; + dictRemoveFile?: string; + dictRemoveFileConfirmation?: string; + dictMaxFilesExceeded?: string; } declare class Dropzone { - constructor(container: string, options?: DropzoneOptions); - constructor(container: HTMLElement, options?: DropzoneOptions); - static autoDiscover: boolean; - static options: any; - static confirm: (question: string, accepted: () => void, rejected?: () => void) => void; + constructor( container: string, options?: DropzoneOptions ); + constructor( container: HTMLElement, options?: DropzoneOptions ); - files: DropzoneFile[]; + static autoDiscover: boolean; + static options: any; + static confirm: ( question: string, accepted: () => void, rejected?: () => void ) => void; - on(eventName, callback: (...args) => any); - off(eventName): void; + files: DropzoneFile[]; - removeFile(file: DropzoneFile): void; - removeAllFiles(cancelIfNecessary?: boolean): void; - processQueue(): void; - getAcceptedFiles(): DropzoneFile[]; - getRejectedFiles(): DropzoneFile[]; - getQueuedFiles(): DropzoneFile[]; - getUploadingFiles(): DropzoneFile[]; + enable(): void; + disable(): void; + destroy(): Dropzone; - emit(eventName: string, file: DropzoneFile, str?: string); - emit(eventName: "thumbnail", file: DropzoneFile, path: string); - emit(eventName: "addedfile", file: DropzoneFile); - emit(eventName: "removedfile", file: DropzoneFile); - emit(eventName: "processing", file: DropzoneFile); - emit(eventName: "canceled", file: DropzoneFile); - emit(eventName: "complete", file: DropzoneFile); + on( eventName, callback: ( ...args ) => any ); - emit(eventName: string, e: Event); - emit(eventName: "drop", e: Event); - emit(eventName: "dragstart", e: Event); - emit(eventName: "dragend", e: Event); - emit(eventName: "dragenter", e: Event); - emit(eventName: "dragover", e: Event); - emit(eventName: "dragleave", e: Event); + off( eventName ): void; + + addFile( file: DropzoneFile ): void; + + removeFile( file: DropzoneFile ): void; + + removeAllFiles( cancelIfNecessary?: boolean ): void; + + processQueue(): void; + + cancelUpload( file: DropzoneFile ): void; + + processFiles ( files: DropzoneFile[] ): void; + processFile( file: DropzoneFile ): void; + + uploadFile( file: DropzoneFile ): void; + + getAcceptedFiles(): DropzoneFile[]; + + getRejectedFiles(): DropzoneFile[]; + + getQueuedFiles(): DropzoneFile[]; + + getUploadingFiles(): DropzoneFile[]; + + accept( file: DropzoneFile, done: ( error?: string ) => {} ):void; + getActiveFiles(): DropzoneFile[]; + getFilesWithStatus( status: string ): DropzoneFile[]; + enqueueFile( file: DropzoneFile ): void; + enqueueFiles( file: DropzoneFile[] ): void; + createThumbnail( file: DropzoneFile, callback?: (...any) => {}): any; + createThumbnailFromUrl( file: DropzoneFile, url: string, callback?: ( ...any ) => any ): any; + + emit( eventName: string, file: DropzoneFile, str?: string ); + emit( eventName: "thumbnail", file: DropzoneFile, path: string ); + emit( eventName: "addedfile", file: DropzoneFile ); + emit( eventName: "removedfile", file: DropzoneFile ); + emit( eventName: "processing", file: DropzoneFile ); + emit( eventName: "canceled", file: DropzoneFile ); + emit( eventName: "complete", file: DropzoneFile ); + + emit( eventName: string, e: Event ); + emit( eventName: "drop", e: Event ); + emit( eventName: "dragstart", e: Event ); + emit( eventName: "dragend", e: Event ); + emit( eventName: "dragenter", e: Event ); + emit( eventName: "dragover", e: Event ); + emit( eventName: "dragleave", e: Event ); } interface JQuery { - dropzone(options: DropzoneOptions): Dropzone; + dropzone( options: DropzoneOptions ): Dropzone; } declare module "Dropzone" { - export = Dropzone; + export = Dropzone; }