mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-01 12:42:58 +08:00
fix(ng-file-upload): allow File[] in upload config
File[] is allowed to be used in IFileUploadConfig.
This commit is contained in:
@@ -40,7 +40,7 @@ module controllers {
|
||||
.error((data: any, status: number, response: any, headers: any) => {
|
||||
console.error(data, status, response, headers);
|
||||
})
|
||||
.success((data: any, status: number, headers: any, config: angular.angularFileUpload.IFileUploadConfig) => {
|
||||
.success((data: any, status: number, headers: any, config: angular.angularFileUpload.IFileUploadConfigFile) => {
|
||||
// file is uploaded successfully
|
||||
console.log("Success!", data, status, headers, config);
|
||||
});
|
||||
|
||||
19
ng-file-upload/ng-file-upload.d.ts
vendored
19
ng-file-upload/ng-file-upload.d.ts
vendored
@@ -10,7 +10,7 @@ declare module angular.angularFileUpload {
|
||||
interface IUploadService {
|
||||
|
||||
http<T>(config: IRequestConfig): IUploadPromise<T>;
|
||||
upload<T>(config: IFileUploadConfig): IUploadPromise<T>;
|
||||
upload<T>(config: IFileUploadConfigFiles|IFileUploadConfigFile): IUploadPromise<T>;
|
||||
}
|
||||
|
||||
interface IUploadPromise<T> extends IHttpPromise<T> {
|
||||
@@ -19,14 +19,25 @@ declare module angular.angularFileUpload {
|
||||
xhr(callback: IHttpPromiseCallback<T>): IUploadPromise<T>;
|
||||
}
|
||||
|
||||
interface IFileUploadConfig extends IRequestConfig {
|
||||
interface IFileUploadConfigFile extends IRequestConfig {
|
||||
|
||||
file: File;
|
||||
fileName?: string;
|
||||
}
|
||||
|
||||
interface IFileUploadConfigFiles extends IRequestConfig {
|
||||
|
||||
file: File[];
|
||||
fileName?: string;
|
||||
}
|
||||
|
||||
interface IFilesProgressEvent extends ProgressEvent {
|
||||
|
||||
config: IFileUploadConfigFiles;
|
||||
}
|
||||
|
||||
interface IFileProgressEvent extends ProgressEvent {
|
||||
|
||||
config: IFileUploadConfig;
|
||||
config: IFileUploadConfigFile;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user