Aligns definitions for cordova and core plugins with latest Cordova updates.

This commit is contained in:
Vladimir Kotikov
2015-01-22 17:55:16 +03:00
parent 20e56f1f30
commit e5dc44b412
3 changed files with 20 additions and 4 deletions
+14
View File
@@ -177,6 +177,20 @@ file.download('http://some.server.com/download.php',
{ headers: null },
true);
file.upload('cdvfile://localhost/persistent/path/to/downloads/',
'http://some.server.com/download.php',
(result: FileUploadResult)=> { console.log('File uploaded. Bytes uploaded: ' + result.bytesSent); },
(err: FileTransferError) => {
console.error('Error ' + err.code);
if (err.exception) {
console.error('Failed with exception ' + err.exception);
}
},
{ headers: null, httpMethod: "PUT" },
true);
file.abort();
file.abort();
-2
View File
@@ -18,8 +18,6 @@ interface Device {
* by the device manufacturer and may be different across versions of the same product.
*/
model: string;
/** device.name is deprecated as of version 2.3.0. Use device.model instead. */
name: string;
/** Get the device's operating system name. */
platform: string;
/** Get the device's Universally Unique Identifier (UUID). */
+6 -2
View File
@@ -84,6 +84,8 @@ interface FileUploadOptions {
fileKey?: string;
/** The file name to use when saving the file on the server. Defaults to image.jpg. */
fileName?: string;
/** The HTTP method to use - either `PUT` or `POST`. Defaults to `POST`. */
httpMethod?: string;
/** The mime type of the data to upload. Defaults to image/jpeg. */
mimeType?: string;
/** A set of optional key/value pairs to pass in the HTTP request. */
@@ -108,6 +110,7 @@ interface FileTransferError {
* FileTransferError.INVALID_URL_ERR
* FileTransferError.CONNECTION_ERR
* FileTransferError.ABORT_ERR
* FileTransferError.NOT_MODIFIED_ERR
*/
code: number;
/** URL to the source. */
@@ -116,8 +119,8 @@ interface FileTransferError {
target: string;
/** HTTP status code. This attribute is only available when a response code is received from the HTTP connection. */
http_status: number;
/* Request body */
body: any;
/* Response body. This attribute is only available when a response is received from the HTTP connection. */
body: string;
/* Exception that is thrown by native code */
exception: any;
}
@@ -129,4 +132,5 @@ declare var FileTransferError: {
INVALID_URL_ERR: number;
CONNECTION_ERR: number;
ABORT_ERR: number;
NOT_MODIFIED_ERR: number;
}