1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, '__esModule', { value: true });
|
4 |
|
5 | var tslib = require('tslib');
|
6 | var core = require('@angular/core');
|
7 | var core$1 = require('@ionic-native/core');
|
8 |
|
9 | var FileTransfer = (function (_super) {
|
10 | tslib.__extends(FileTransfer, _super);
|
11 | function FileTransfer() {
|
12 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
13 | |
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 | _this.FileTransferErrorCode = {
|
24 | FILE_NOT_FOUND_ERR: 1,
|
25 | INVALID_URL_ERR: 2,
|
26 | CONNECTION_ERR: 3,
|
27 | ABORT_ERR: 4,
|
28 | NOT_MODIFIED_ERR: 5,
|
29 | };
|
30 | return _this;
|
31 | }
|
32 | |
33 |
|
34 |
|
35 |
|
36 | FileTransfer.prototype.create = function () {
|
37 | return new FileTransferObject();
|
38 | };
|
39 | FileTransfer.pluginName = "FileTransfer";
|
40 | FileTransfer.plugin = "cordova-plugin-file-transfer";
|
41 | FileTransfer.pluginRef = "FileTransfer";
|
42 | FileTransfer.repo = "https://github.com/apache/cordova-plugin-file-transfer";
|
43 | FileTransfer.platforms = ["Amazon Fire OS", "Android", "Browser", "iOS", "Ubuntu", "Windows", "Windows Phone"];
|
44 | FileTransfer.decorators = [
|
45 | { type: core.Injectable }
|
46 | ];
|
47 | return FileTransfer;
|
48 | }(core$1.IonicNativePlugin));
|
49 | var FileTransferObject = (function () {
|
50 | function FileTransferObject() {
|
51 | if (core$1.checkAvailability(FileTransfer.getPluginRef(), null, FileTransfer.getPluginName()) === true) {
|
52 | this._objectInstance = new (FileTransfer.getPlugin())();
|
53 | }
|
54 | }
|
55 | FileTransferObject.prototype.upload = function (fileUrl, url, options, trustAllHosts) { return core$1.cordovaInstance(this, "upload", { "successIndex": 2, "errorIndex": 3 }, arguments); };
|
56 | FileTransferObject.prototype.download = function (source, target, trustAllHosts, options) { return core$1.cordovaInstance(this, "download", { "successIndex": 2, "errorIndex": 3 }, arguments); };
|
57 | FileTransferObject.prototype.onProgress = function (listener) {
|
58 | var _this = this;
|
59 | return (function () {
|
60 | if (core$1.instanceAvailability(_this) === true) {
|
61 | _this._objectInstance.onprogress = listener;
|
62 | }
|
63 | })();
|
64 | };
|
65 | FileTransferObject.prototype.abort = function () { return core$1.cordovaInstance(this, "abort", { "sync": true }, arguments); };
|
66 | FileTransferObject.plugin = "cordova-plugin-file-transfer";
|
67 | FileTransferObject.pluginName = "FileTransfer";
|
68 | return FileTransferObject;
|
69 | }());
|
70 |
|
71 | exports.FileTransfer = FileTransfer;
|
72 | exports.FileTransferObject = FileTransferObject;
|