mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-05 01:30:17 +00:00
refactored tests
added done typings
This commit is contained in:
@@ -13,6 +13,18 @@ var __handleAddingFile = function (event:any, data:any)
|
||||
data.submit();
|
||||
};
|
||||
|
||||
var options: JQueryFileInputOptions = {
|
||||
dataType: 'json',
|
||||
singleFileUploads: true,
|
||||
limitMultiFileUploads: 1,
|
||||
add: __handleAddingFile,
|
||||
done: (e, data) => {
|
||||
data.result;
|
||||
data.jqXHR;
|
||||
data.textStatus;
|
||||
}
|
||||
}
|
||||
|
||||
class TestFileInput {
|
||||
|
||||
// The whole body will be the container for this test
|
||||
@@ -24,20 +36,6 @@ class TestFileInput {
|
||||
constructor() {
|
||||
|
||||
// The file upload object receives a fileInputOptions configuration object
|
||||
this.fileInput = <JQueryFileUpload>this.$el.fileupload({
|
||||
|
||||
dataType: 'json',
|
||||
|
||||
// By default, each file of a selection is uploaded using an individual
|
||||
// request for XHR type uploads. Set to false to upload file
|
||||
// selections in one request each:
|
||||
singleFileUploads: true,
|
||||
// To limit the number of files uploaded with one XHR request,
|
||||
// set the following option to an integer greater than 0:
|
||||
limitMultiFileUploads: 1,
|
||||
|
||||
add: __handleAddingFile
|
||||
|
||||
});
|
||||
this.fileInput = <JQueryFileUpload>this.$el.fileupload(options);
|
||||
}
|
||||
}
|
||||
|
||||
18
jquery.fileupload/jquery.fileupload.d.ts
vendored
18
jquery.fileupload/jquery.fileupload.d.ts
vendored
@@ -212,7 +212,7 @@ interface JQueryFileInputOptions {
|
||||
|
||||
// Other callbacks:
|
||||
submit?: Function;
|
||||
done?: Function;
|
||||
done?: (e: JQueryEventObject, data: JQueryFileUploadDone) => void;
|
||||
fail?: Function;
|
||||
always?: Function;
|
||||
progressall?: (e: JQueryEventObject, data: JQueryFileUploadProgressAllObject) => void;
|
||||
@@ -265,19 +265,25 @@ interface JQueryFileUploadProgressAllObject {
|
||||
bitrate?: number;
|
||||
}
|
||||
|
||||
interface JQueryFileUploadProgressObject extends JQueryFileInputOptions, JQueryFileUploadProgressAllObject {
|
||||
interface JQueryFileUploadWithXhr {
|
||||
jqXHR: JQueryXHR;
|
||||
result: any;
|
||||
textStatus: string;
|
||||
}
|
||||
|
||||
interface JQueryFileUploadFilesObject {
|
||||
files: File[];
|
||||
}
|
||||
|
||||
interface JQueryFileUploadChunkObject extends JQueryFileInputOptions {
|
||||
interface JQueryFileUploadChunkObject extends JQueryFileInputOptions, JQueryFileUploadWithXhr {
|
||||
blob: any;
|
||||
chunkSize: number;
|
||||
contentRange: string;
|
||||
errorThrown: any;
|
||||
jqXHR: JQueryXHR;
|
||||
result: any;
|
||||
textStatus: string;
|
||||
}
|
||||
|
||||
interface JQueryFileUploadProgressObject extends JQueryFileInputOptions, JQueryFileUploadProgressAllObject {
|
||||
}
|
||||
|
||||
interface JQueryFileUploadDone extends JQueryFileInputOptions, JQueryFileUploadWithXhr {
|
||||
}
|
||||
Reference in New Issue
Block a user