mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
$upload.http() is used to send the file binary or any data to the server through the 'data' field in the config object, not the 'file' field. Hence, its config type should be just ng.IRequestConfig, and not ng.IFileUploadConfig
27 lines
759 B
TypeScript
27 lines
759 B
TypeScript
// Type definitions for Angular File Upload 1.6.7
|
|
// Project: https://github.com/danialfarid/angular-file-upload
|
|
// Definitions by: John Reilly <https://github.com/johnnyreilly>
|
|
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
|
|
|
/// <reference path="../angularjs/angular.d.ts" />
|
|
|
|
declare module ng.angularFileUpload {
|
|
|
|
interface IUploadService {
|
|
|
|
http<T>(config: ng.IRequestConfig): IUploadPromise<T>;
|
|
upload<T>(config: IFileUploadConfig): IUploadPromise<T>;
|
|
}
|
|
|
|
interface IUploadPromise<T> extends IHttpPromise<T> {
|
|
|
|
progress(callback: IHttpPromiseCallback<T>): IUploadPromise<T>;
|
|
}
|
|
|
|
interface IFileUploadConfig extends ng.IRequestConfig {
|
|
|
|
file: File;
|
|
fileName?: string;
|
|
}
|
|
}
|