mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-26 11:12:19 +08:00
Aligns definitions for cordova and core plugins with latest Cordova updates.
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
|
||||
Vendored
-2
@@ -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). */
|
||||
|
||||
Vendored
+6
-2
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user