forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathng-file-upload.d.ts
43 lines (30 loc) · 1.19 KB
/
ng-file-upload.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Type definitions for Angular File Upload 4.2.1
// Project: https://github.com/danialfarid/ng-file-upload
// Definitions by: John Reilly <https://github.com/johnnyreilly>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare module angular.angularFileUpload {
interface IUploadService {
http<T>(config: IRequestConfig): IUploadPromise<T>;
upload<T>(config: IFileUploadConfigFiles|IFileUploadConfigFile): IUploadPromise<T>;
}
interface IUploadPromise<T> extends IHttpPromise<T> {
abort(): IUploadPromise<T>;
progress(callback: IHttpPromiseCallback<T>): IUploadPromise<T>;
xhr(callback: IHttpPromiseCallback<T>): IUploadPromise<T>;
}
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: IFileUploadConfigFile;
}
}