text: var __extends = (this && this.__extends) || (function () {
      var extendStatics = Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
          function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
      return function (d, b) {
          extendStatics(d, b);
          function __() { this.constructor = d; }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
  })();
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
      else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
      return c > 3 && r && Object.defineProperty(target, key, r), r;
  };
  var __metadata = (this && this.__metadata) || function (k, v) {
      if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
  };
  import { Injectable } from '@angular/core';
  import { CordovaCheck, CordovaProperty, IonicNativePlugin, Plugin } from '@ionic-native/core';
  /**
   * @name File
   * @description
   * This plugin implements a File API allowing read/write access to files residing on the device.
   *
   * The File class implements static convenience functions to access files and directories.
   *
   * Example:
   * ```
   * import { File } from '@ionic-native/file';
   *
   * constructor(private file: File) { }
   *
   * ...
   *
   * this.file.checkDir(this.file.dataDirectory, 'mydir').then(_ => console.log('Directory exists')).catch(err => console.log('Directory doesn't exist'));
   *
   * ```
   *
   *  This plugin is based on several specs, including : The HTML5 File API http: //www.w3.org/TR/FileAPI/
   *  The (now-defunct) Directories and System extensions Latest: http: //www.w3.org/TR/2012/WD-file-system-api-20120417/
   *  Although most of the plugin code was written when an earlier spec was current: http: //www.w3.org/TR/2011/WD-file-system-api-20110419/
   *  It also implements the FileWriter spec : http: //dev.w3.org/2009/dap/file-system/file-writer.html
   *  @interfaces
   *  IFile
   *  Entry
   *  DirectoryEntry
   *  DirectoryReader
   *  FileSystem
   */
  var File = (function (_super) {
      __extends(File, _super);
      function File() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.cordovaFileError = {
              1: 'NOT_FOUND_ERR',
              2: 'SECURITY_ERR',
              3: 'ABORT_ERR',
              4: 'NOT_READABLE_ERR',
              5: 'ENCODING_ERR',
              6: 'NO_MODIFICATION_ALLOWED_ERR',
              7: 'INVALID_STATE_ERR',
              8: 'SYNTAX_ERR',
              9: 'INVALID_MODIFICATION_ERR',
              10: 'QUOTA_EXCEEDED_ERR',
              11: 'TYPE_MISMATCH_ERR',
              12: 'PATH_EXISTS_ERR',
              13: 'WRONG_ENTRY_TYPE',
              14: 'DIR_READ_ERR'
          };
          return _this;
      }
      /**
       * Get free disk space in Bytes
       * @returns {Promise<number>} Returns a promise that resolves with the remaining free disk space in Bytes
       */
      File.prototype.getFreeDiskSpace = function () {
          return new Promise(function (resolve, reject) {
              cordova.exec(resolve, reject, 'File', 'getFreeDiskSpace', []);
          });
      };
      /**
       * Check if a directory exists in a certain path, directory.
       *
       * @param {string} path Base FileSystem. Please refer to the iOS and Android filesystem above
       * @param {string} dir Name of directory to check
       * @returns {Promise<boolean>} Returns a Promise that resolves to true if the directory exists or rejects with an error.
       */
      File.prototype.checkDir = function (path, dir) {
          if (/^\//.test(dir)) {
              var err = new FileError(5);
              err.message = 'directory cannot start with /';
              return Promise.reject(err);
          }
          var fullPath = path + dir;
          return this.resolveDirectoryUrl(fullPath).then(function () {
              return true;
          });
      };
      /**
       * Creates a new directory in the specific path.
       * The replace boolean value determines whether to replace an existing directory with the same name.
       * If an existing directory exists and the replace value is false, the promise will fail and return an error.
       *
       * @param {string} path  Base FileSystem. Please refer to the iOS and Android filesystem above
       * @param {string} dirName Name of directory to create
       * @param {boolean} replace If true, replaces file with same name. If false returns error
       * @returns {Promise<DirectoryEntry>} Returns a Promise that resolves with a DirectoryEntry or rejects with an error.
       */
      File.prototype.createDir = function (path, dirName, replace) {
          var _this = this;
          if (/^\//.test(dirName)) {
              var err = new FileError(5);
              err.message = 'directory cannot start with /';
              return Promise.reject(err);
          }
          var options = {
              create: true
          };
          if (!replace) {
              options.exclusive = true;
          }
          return this.resolveDirectoryUrl(path).then(function (fse) {
              return _this.getDirectory(fse, dirName, options);
          });
      };
      /**
       * Remove a directory at a given path.
       *
       * @param {string} path The path to the directory
       * @param {string} dirName The directory name
       * @returns {Promise<RemoveResult>} Returns a Promise that resolves to a RemoveResult or rejects with an error.
       */
      File.prototype.removeDir = function (path, dirName) {
          var _this = this;
          if (/^\//.test(dirName)) {
              var err = new FileError(5);
              err.message = 'directory cannot start with /';
              return Promise.reject(err);
          }
          return this.resolveDirectoryUrl(path)
              .then(function (fse) {
              return _this.getDirectory(fse, dirName, { create: false });
          })
              .then(function (de) {
              return _this.remove(de);
          });
      };
      /**
       * Move a directory to a given path.
       *
       * @param {string} path The source path to the directory
       * @param {string} dirName The source directory name
       * @param {string} newPath The destination path to the directory
       * @param {string} newDirName The destination directory name
       * @returns {Promise<DirectoryEntry|Entry>} Returns a Promise that resolves to the new DirectoryEntry object or rejects with an error.
       */
      File.prototype.moveDir = function (path, dirName, newPath, newDirName) {
          var _this = this;
          newDirName = newDirName || dirName;
          if (/^\//.test(newDirName)) {
              var err = new FileError(5);
              err.message = 'directory cannot start with /';
              return Promise.reject(err);
          }
          return this.resolveDirectoryUrl(path)
              .then(function (fse) {
              return _this.getDirectory(fse, dirName, { create: false });
          })
              .then(function (srcde) {
              return _this.resolveDirectoryUrl(newPath).then(function (destenation) {
                  return _this.move(srcde, destenation, newDirName);
              });
          });
      };
      /**
       * Copy a directory in various methods. If destination directory exists, will fail to copy.
       *
       * @param {string} path Base FileSystem. Please refer to the iOS and Android filesystems above
       * @param {string} dirName Name of directory to copy
       * @param {string} newPath Base FileSystem of new location
       * @param {string} newDirName New name of directory to copy to (leave blank to remain the same)
       * @returns {Promise<Entry>} Returns a Promise that resolves to the new Entry object or rejects with an error.
       */
      File.prototype.copyDir = function (path, dirName, newPath, newDirName) {
          var _this = this;
          if (/^\//.test(newDirName)) {
              var err = new FileError(5);
              err.message = 'directory cannot start with /';
              return Promise.reject(err);
          }
          return this.resolveDirectoryUrl(path)
              .then(function (fse) {
              return _this.getDirectory(fse, dirName, { create: false });
          })
              .then(function (srcde) {
              return _this.resolveDirectoryUrl(newPath).then(function (deste) {
                  return _this.copy(srcde, deste, newDirName);
              });
          });
      };
      /**
       * List files and directory from a given path.
       *
       * @param {string} path Base FileSystem. Please refer to the iOS and Android filesystems above
       * @param {string} dirName Name of directory
       * @returns {Promise<Entry[]>} Returns a Promise that resolves to an array of Entry objects or rejects with an error.
       */
      File.prototype.listDir = function (path, dirName) {
          var _this = this;
          if (/^\//.test(dirName)) {
              var err = new FileError(5);
              err.message = 'directory cannot start with /';
              return Promise.reject(err);
          }
          return this.resolveDirectoryUrl(path)
              .then(function (fse) {
              return _this.getDirectory(fse, dirName, {
                  create: false,
                  exclusive: false
              });
          })
              .then(function (de) {
              var reader = de.createReader();
              return _this.readEntries(reader);
          });
      };
      /**
       * Removes all files and the directory from a desired location.
       *
       * @param {string} path Base FileSystem. Please refer to the iOS and Android filesystem above
       * @param {string} dirName Name of directory
       * @returns {Promise<RemoveResult>} Returns a Promise that resolves with a RemoveResult or rejects with an error.
       */
      File.prototype.removeRecursively = function (path, dirName) {
          var _this = this;
          if (/^\//.test(dirName)) {
              var err = new FileError(5);
              err.message = 'directory cannot start with /';
              return Promise.reject(err);
          }
          return this.resolveDirectoryUrl(path)
              .then(function (fse) {
              return _this.getDirectory(fse, dirName, { create: false });
          })
              .then(function (de) {
              return _this.rimraf(de);
          });
      };
      /**
       * Check if a file exists in a certain path, directory.
       *
       * @param {string} path Base FileSystem. Please refer to the iOS and Android filesystem above
       * @param {string} file Name of file to check
       * @returns {Promise<boolean>} Returns a Promise that resolves with a boolean or rejects with an error.
       */
      File.prototype.checkFile = function (path, file) {
          if (/^\//.test(file)) {
              var err = new FileError(5);
              err.message = 'file cannot start with /';
              return Promise.reject(err);
          }
          return this.resolveLocalFilesystemUrl(path + file).then(function (fse) {
              if (fse.isFile) {
                  return true;
              }
              else {
                  var err = new FileError(13);
                  err.message = 'input is not a file';
                  return Promise.reject(err);
              }
          });
      };
      /**
       * Creates a new file in the specific path.
       * The replace boolean value determines whether to replace an existing file with the same name.
       * If an existing file exists and the replace value is false, the promise will fail and return an error.
       *
       * @param {string} path  Base FileSystem. Please refer to the iOS and Android filesystem above
       * @param {string} fileName Name of file to create
       * @param {boolean} replace If true, replaces file with same name. If false returns error
       * @returns {Promise<FileEntry>} Returns a Promise that resolves to a FileEntry or rejects with an error.
       */
      File.prototype.createFile = function (path, fileName, replace) {
          var _this = this;
          if (/^\//.test(fileName)) {
              var err = new FileError(5);
              err.message = 'file-name cannot start with /';
              return Promise.reject(err);
          }
          var options = {
              create: true
          };
          if (!replace) {
              options.exclusive = true;
          }
          return this.resolveDirectoryUrl(path).then(function (fse) {
              return _this.getFile(fse, fileName, options);
          });
      };
      /**
       * Removes a file from a desired location.
       *
       * @param {string} path  Base FileSystem. Please refer to the iOS and Android filesystem above
       * @param {string} fileName Name of file to remove
       * @returns {Promise<RemoveResult>} Returns a Promise that resolves to a RemoveResult or rejects with an error.
       */
      File.prototype.removeFile = function (path, fileName) {
          var _this = this;
          if (/^\//.test(fileName)) {
              var err = new FileError(5);
              err.message = 'file-name cannot start with /';
              return Promise.reject(err);
          }
          return this.resolveDirectoryUrl(path)
              .then(function (fse) {
              return _this.getFile(fse, fileName, { create: false });
          })
              .then(function (fe) {
              return _this.remove(fe);
          });
      };
      /** Write a new file to the desired location.
       *
       * @param {string} path Base FileSystem. Please refer to the iOS and Android filesystem above
       * @param {string} fileName path relative to base path
       * @param {string | Blob | ArrayBuffer} text content, blob or ArrayBuffer to write
       * @param {IWriteOptions} options replace file if set to true. See WriteOptions for more information.
       * @returns {Promise<any>} Returns a Promise that resolves to updated file entry or rejects with an error.
       */
      File.prototype.writeFile = function (path, fileName, text, options) {
          var _this = this;
          if (options === void 0) { options = {}; }
          if (/^\//.test(fileName)) {
              var err = new FileError(5);
              err.message = 'file-name cannot start with /';
              return Promise.reject(err);
          }
          var getFileOpts = {
              create: !options.append,
              exclusive: !options.replace
          };
          return this.resolveDirectoryUrl(path)
              .then(function (directoryEntry) {
              return _this.getFile(directoryEntry, fileName, getFileOpts);
          })
              .then(function (fileEntry) {
              return _this.writeFileEntry(fileEntry, text, options);
          });
      };
      /** Write content to FileEntry.
       *
       * @hidden
       * @param {FileEntry} fe file entry object
       * @param {string | Blob} text content or blob to write
       * @param {IWriteOptions} options replace file if set to true. See WriteOptions for more information.
       * @returns {Promise<FileEntry>} Returns a Promise that resolves to updated file entry or rejects with an error.
       */
      File.prototype.writeFileEntry = function (fe, text, options) {
          var _this = this;
          return this.createWriter(fe)
              .then(function (writer) {
              if (options.append) {
                  writer.seek(writer.length);
              }
              if (options.truncate) {
                  writer.truncate(options.truncate);
              }
              return _this.write(writer, text);
          })
              .then(function () { return fe; });
      };
      /** Write to an existing file.
       *
       * @param {string} path Base FileSystem. Please refer to the iOS and Android filesystem above
       * @param {string} fileName path relative to base path
       * @param {string | Blob} text content or blob to write
       * @returns {Promise<void>} Returns a Promise that resolves or rejects with an error.
       */
      File.prototype.writeExistingFile = function (path, fileName, text) {
          return this.writeFile(path, fileName, text, { replace: true });
      };
      /**
       * Read the contents of a file as text.
       *
       * @param {string} path Base FileSystem. Please refer to the iOS and Android filesystem above
       * @param {string} file Name of file, relative to path.
       * @returns {Promise<string>} Returns a Promise that resolves with the contents of the file as string or rejects with an error.
       */
      File.prototype.readAsText = function (path, file) {
          return this.readFile(path, file, 'Text');
      };
      /**
       * Read file and return data as a base64 encoded data url.
       * A data url is of the form:
       *      data: [<mediatype>][;base64],<data>
    
       * @param {string} path Base FileSystem. Please refer to the iOS and Android filesystem above
       * @param {string} file Name of file, relative to path.
       * @returns {Promise<string>} Returns a Promise that resolves with the contents of the file as data URL or rejects with an error.
       */
      File.prototype.readAsDataURL = function (path, file) {
          return this.readFile(path, file, 'DataURL');
      };
      /**
       * Read file and return data as a binary data.
       * @param {string} path Base FileSystem. Please refer to the iOS and Android filesystem above
       * @param {string} file Name of file, relative to path.
       * @returns {Promise<string>} Returns a Promise that resolves with the contents of the file as string rejects with an error.
       */
      File.prototype.readAsBinaryString = function (path, file) {
          return this.readFile(path, file, 'BinaryString');
      };
      /**
       * Read file and return data as an ArrayBuffer.
       * @param {string} path Base FileSystem. Please refer to the iOS and Android filesystem above
       * @param {string} file Name of file, relative to path.
       * @returns {Promise<ArrayBuffer>} Returns a Promise that resolves with the contents of the file as ArrayBuffer or rejects with an error.
       */
      File.prototype.readAsArrayBuffer = function (path, file) {
          return this.readFile(path, file, 'ArrayBuffer');
      };
      File.prototype.readFile = function (path, file, readAs) {
          var _this = this;
          if (/^\//.test(file)) {
              var err = new FileError(5);
              err.message = 'file-name cannot start with /';
              return Promise.reject(err);
          }
          return this.resolveDirectoryUrl(path)
              .then(function (directoryEntry) {
              return _this.getFile(directoryEntry, file, { create: false });
          })
              .then(function (fileEntry) {
              var reader = new FileReader();
              return new Promise(function (resolve, reject) {
                  reader.onloadend = function () {
                      if (reader.result !== undefined || reader.result !== null) {
                          resolve(reader.result);
                      }
                      else if (reader.error !== undefined || reader.error !== null) {
                          reject(reader.error);
                      }
                      else {
                          reject({ code: null, message: 'READER_ONLOADEND_ERR' });
                      }
                  };
                  fileEntry.file(function (file) {
                      reader["readAs" + readAs].call(reader, file);
                  }, function (error) {
                      reject(error);
                  });
              });
          });
      };
      /**
       * Move a file to a given path.
       *
       * @param {string} path Base FileSystem. Please refer to the iOS and Android filesystem above
       * @param {string} fileName Name of file to move
       * @param {string} newPath Base FileSystem of new location
       * @param {string} newFileName New name of file to move to (leave blank to remain the same)
       * @returns {Promise<Entry>} Returns a Promise that resolves to the new Entry or rejects with an error.
       */
      File.prototype.moveFile = function (path, fileName, newPath, newFileName) {
          var _this = this;
          newFileName = newFileName || fileName;
          if (/^\//.test(newFileName)) {
              var err = new FileError(5);
              err.message = 'file name cannot start with /';
              return Promise.reject(err);
          }
          return this.resolveDirectoryUrl(path)
              .then(function (fse) {
              return _this.getFile(fse, fileName, { create: false });
          })
              .then(function (srcfe) {
              return _this.resolveDirectoryUrl(newPath).then(function (deste) {
                  return _this.move(srcfe, deste, newFileName);
              });
          });
      };
      /**
       * Copy a file in various methods. If file exists, will fail to copy.
       *
       * @param {string} path Base FileSystem. Please refer to the iOS and Android filesystem above
       * @param {string} fileName Name of file to copy
       * @param {string} newPath Base FileSystem of new location
       * @param {string} newFileName New name of file to copy to (leave blank to remain the same)
       * @returns {Promise<Entry>} Returns a Promise that resolves to an Entry or rejects with an error.
       */
      File.prototype.copyFile = function (path, fileName, newPath, newFileName) {
          var _this = this;
          newFileName = newFileName || fileName;
          if (/^\//.test(newFileName)) {
              var err = new FileError(5);
              err.message = 'file name cannot start with /';
              return Promise.reject(err);
          }
          return this.resolveDirectoryUrl(path)
              .then(function (fse) {
              return _this.getFile(fse, fileName, { create: false });
          })
              .then(function (srcfe) {
              return _this.resolveDirectoryUrl(newPath).then(function (deste) {
                  return _this.copy(srcfe, deste, newFileName);
              });
          });
      };
      /**
       * @hidden
       */
      File.prototype.fillErrorMessage = function (err) {
          try {
              err.message = this.cordovaFileError[err.code];
          }
          catch (e) { }
      };
      /**
       * Resolves a local file system URL
       * @param fileUrl {string} file system url
       * @returns {Promise<Entry>}
       */
      File.prototype.resolveLocalFilesystemUrl = function (fileUrl) {
          var _this = this;
          return new Promise(function (resolve, reject) {
              try {
                  window.resolveLocalFileSystemURL(fileUrl, function (entry) {
                      resolve(entry);
                  }, function (err) {
                      _this.fillErrorMessage(err);
                      reject(err);
                  });
              }
              catch (xc) {
                  _this.fillErrorMessage(xc);
                  reject(xc);
              }
          });
      };
      /**
       * Resolves a local directory url
       * @param directoryUrl {string} directory system url
       * @returns {Promise<DirectoryEntry>}
       */
      File.prototype.resolveDirectoryUrl = function (directoryUrl) {
          return this.resolveLocalFilesystemUrl(directoryUrl).then(function (de) {
              if (de.isDirectory) {
                  return de;
              }
              else {
                  var err = new FileError(13);
                  err.message = 'input is not a directory';
                  return Promise.reject(err);
              }
          });
      };
      /**
       * Get a directory
       * @param directoryEntry {DirectoryEntry} Directory entry, obtained by resolveDirectoryUrl method
       * @param directoryName {string} Directory name
       * @param flags {Flags} Options
       * @returns {Promise<DirectoryEntry>}
       */
      File.prototype.getDirectory = function (directoryEntry, directoryName, flags) {
          var _this = this;
          return new Promise(function (resolve, reject) {
              try {
                  directoryEntry.getDirectory(directoryName, flags, function (de) {
                      resolve(de);
                  }, function (err) {
                      _this.fillErrorMessage(err);
                      reject(err);
                  });
              }
              catch (xc) {
                  _this.fillErrorMessage(xc);
                  reject(xc);
              }
          });
      };
      /**
       * Get a file
       * @param directoryEntry {DirectoryEntry} Directory entry, obtained by resolveDirectoryUrl method
       * @param fileName {string} File name
       * @param flags {Flags} Options
       * @returns {Promise<FileEntry>}
       */
      File.prototype.getFile = function (directoryEntry, fileName, flags) {
          var _this = this;
          return new Promise(function (resolve, reject) {
              try {
                  directoryEntry.getFile(fileName, flags, resolve, function (err) {
                      _this.fillErrorMessage(err);
                      reject(err);
                  });
              }
              catch (xc) {
                  _this.fillErrorMessage(xc);
                  reject(xc);
              }
          });
      };
      /**
       * @hidden
       */
      File.prototype.remove = function (fe) {
          var _this = this;
          return new Promise(function (resolve, reject) {
              fe.remove(function () {
                  resolve({ success: true, fileRemoved: fe });
              }, function (err) {
                  _this.fillErrorMessage(err);
                  reject(err);
              });
          });
      };
      /**
       * @hidden
       */
      File.prototype.move = function (srce, destdir, newName) {
          var _this = this;
          return new Promise(function (resolve, reject) {
              srce.moveTo(destdir, newName, function (deste) {
                  resolve(deste);
              }, function (err) {
                  _this.fillErrorMessage(err);
                  reject(err);
              });
          });
      };
      /**
       * @hidden
       */
      File.prototype.copy = function (srce, destdir, newName) {
          var _this = this;
          return new Promise(function (resolve, reject) {
              srce.copyTo(destdir, newName, function (deste) {
                  resolve(deste);
              }, function (err) {
                  _this.fillErrorMessage(err);
                  reject(err);
              });
          });
      };
      /**
       * @hidden
       */
      File.prototype.readEntries = function (dr) {
          var _this = this;
          return new Promise(function (resolve, reject) {
              dr.readEntries(function (entries) {
                  resolve(entries);
              }, function (err) {
                  _this.fillErrorMessage(err);
                  reject(err);
              });
          });
      };
      /**
       * @hidden
       */
      File.prototype.rimraf = function (de) {
          var _this = this;
          return new Promise(function (resolve, reject) {
              de.removeRecursively(function () {
                  resolve({ success: true, fileRemoved: de });
              }, function (err) {
                  _this.fillErrorMessage(err);
                  reject(err);
              });
          });
      };
      /**
       * @hidden
       */
      File.prototype.createWriter = function (fe) {
          var _this = this;
          return new Promise(function (resolve, reject) {
              fe.createWriter(function (writer) {
                  resolve(writer);
              }, function (err) {
                  _this.fillErrorMessage(err);
                  reject(err);
              });
          });
      };
      /**
       * @hidden
       */
      File.prototype.write = function (writer, gu) {
          if (gu instanceof Blob) {
              return this.writeFileInChunks(writer, gu);
          }
          return new Promise(function (resolve, reject) {
              writer.onwriteend = function (evt) {
                  if (writer.error) {
                      reject(writer.error);
                  }
                  else {
                      resolve(evt);
                  }
              };
              writer.write(gu);
          });
      };
      /**
       * @hidden
       */
      File.prototype.writeFileInChunks = function (writer, file) {
          var BLOCK_SIZE = 1024 * 1024;
          var writtenSize = 0;
          function writeNextChunk() {
              var size = Math.min(BLOCK_SIZE, file.size - writtenSize);
              var chunk = file.slice(writtenSize, writtenSize + size);
              writtenSize += size;
              writer.write(chunk);
          }
          return new Promise(function (resolve, reject) {
              writer.onerror = reject;
              writer.onwrite = function () {
                  if (writtenSize < file.size) {
                      writeNextChunk();
                  }
                  else {
                      resolve();
                  }
              };
              writeNextChunk();
          });
      };
      File.decorators = [
          { type: Injectable },
      ];
      /** @nocollapse */
      File.ctorParameters = function () { return []; };
      __decorate([
          CordovaProperty,
          __metadata("design:type", String)
      ], File.prototype, "applicationDirectory", void 0);
      __decorate([
          CordovaProperty,
          __metadata("design:type", String)
      ], File.prototype, "applicationStorageDirectory", void 0);
      __decorate([
          CordovaProperty,
          __metadata("design:type", String)
      ], File.prototype, "dataDirectory", void 0);
      __decorate([
          CordovaProperty,
          __metadata("design:type", String)
      ], File.prototype, "cacheDirectory", void 0);
      __decorate([
          CordovaProperty,
          __metadata("design:type", String)
      ], File.prototype, "externalApplicationStorageDirectory", void 0);
      __decorate([
          CordovaProperty,
          __metadata("design:type", String)
      ], File.prototype, "externalDataDirectory", void 0);
      __decorate([
          CordovaProperty,
          __metadata("design:type", String)
      ], File.prototype, "externalCacheDirectory", void 0);
      __decorate([
          CordovaProperty,
          __metadata("design:type", String)
      ], File.prototype, "externalRootDirectory", void 0);
      __decorate([
          CordovaProperty,
          __metadata("design:type", String)
      ], File.prototype, "tempDirectory", void 0);
      __decorate([
          CordovaProperty,
          __metadata("design:type", String)
      ], File.prototype, "syncedDataDirectory", void 0);
      __decorate([
          CordovaProperty,
          __metadata("design:type", String)
      ], File.prototype, "documentsDirectory", void 0);
      __decorate([
          CordovaProperty,
          __metadata("design:type", String)
      ], File.prototype, "sharedDirectory", void 0);
      __decorate([
          CordovaCheck(),
          __metadata("design:type", Function),
          __metadata("design:paramtypes", []),
          __metadata("design:returntype", Promise)
      ], File.prototype, "getFreeDiskSpace", null);
      __decorate([
          CordovaCheck(),
          __metadata("design:type", Function),
          __metadata("design:paramtypes", [String, String]),
          __metadata("design:returntype", Promise)
      ], File.prototype, "checkDir", null);
      __decorate([
          CordovaCheck(),
          __metadata("design:type", Function),
          __metadata("design:paramtypes", [String, String, Boolean]),
          __metadata("design:returntype", Promise)
      ], File.prototype, "createDir", null);
      __decorate([
          CordovaCheck(),
          __metadata("design:type", Function),
          __metadata("design:paramtypes", [String, String]),
          __metadata("design:returntype", Promise)
      ], File.prototype, "removeDir", null);
      __decorate([
          CordovaCheck(),
          __metadata("design:type", Function),
          __metadata("design:paramtypes", [String, String, String, String]),
          __metadata("design:returntype", Promise)
      ], File.prototype, "moveDir", null);
      __decorate([
          CordovaCheck(),
          __metadata("design:type", Function),
          __metadata("design:paramtypes", [String, String, String, String]),
          __metadata("design:returntype", Promise)
      ], File.prototype, "copyDir", null);
      __decorate([
          CordovaCheck(),
          __metadata("design:type", Function),
          __metadata("design:paramtypes", [String, String]),
          __metadata("design:returntype", Promise)
      ], File.prototype, "listDir", null);
      __decorate([
          CordovaCheck(),
          __metadata("design:type", Function),
          __metadata("design:paramtypes", [String, String]),
          __metadata("design:returntype", Promise)
      ], File.prototype, "removeRecursively", null);
      __decorate([
          CordovaCheck(),
          __metadata("design:type", Function),
          __metadata("design:paramtypes", [String, String]),
          __metadata("design:returntype", Promise)
      ], File.prototype, "checkFile", null);
      __decorate([
          CordovaCheck(),
          __metadata("design:type", Function),
          __metadata("design:paramtypes", [String, String, Boolean]),
          __metadata("design:returntype", Promise)
      ], File.prototype, "createFile", null);
      __decorate([
          CordovaCheck(),
          __metadata("design:type", Function),
          __metadata("design:paramtypes", [String, String]),
          __metadata("design:returntype", Promise)
      ], File.prototype, "removeFile", null);
      __decorate([
          CordovaCheck(),
          __metadata("design:type", Function),
          __metadata("design:paramtypes", [String, String, Object, Object]),
          __metadata("design:returntype", Promise)
      ], File.prototype, "writeFile", null);
      __decorate([
          CordovaCheck(),
          __metadata("design:type", Function),
          __metadata("design:paramtypes", [String, String, Object]),
          __metadata("design:returntype", Promise)
      ], File.prototype, "writeExistingFile", null);
      __decorate([
          CordovaCheck(),
          __metadata("design:type", Function),
          __metadata("design:paramtypes", [String, String]),
          __metadata("design:returntype", Promise)
      ], File.prototype, "readAsText", null);
      __decorate([
          CordovaCheck(),
          __metadata("design:type", Function),
          __metadata("design:paramtypes", [String, String]),
          __metadata("design:returntype", Promise)
      ], File.prototype, "readAsDataURL", null);
      __decorate([
          CordovaCheck(),
          __metadata("design:type", Function),
          __metadata("design:paramtypes", [String, String]),
          __metadata("design:returntype", Promise)
      ], File.prototype, "readAsBinaryString", null);
      __decorate([
          CordovaCheck(),
          __metadata("design:type", Function),
          __metadata("design:paramtypes", [String, String]),
          __metadata("design:returntype", Promise)
      ], File.prototype, "readAsArrayBuffer", null);
      __decorate([
          CordovaCheck(),
          __metadata("design:type", Function),
          __metadata("design:paramtypes", [String, String, String, String]),
          __metadata("design:returntype", Promise)
      ], File.prototype, "moveFile", null);
      __decorate([
          CordovaCheck(),
          __metadata("design:type", Function),
          __metadata("design:paramtypes", [String, String, String, String]),
          __metadata("design:returntype", Promise)
      ], File.prototype, "copyFile", null);
      __decorate([
          CordovaCheck(),
          __metadata("design:type", Function),
          __metadata("design:paramtypes", [String]),
          __metadata("design:returntype", Promise)
      ], File.prototype, "resolveLocalFilesystemUrl", null);
      __decorate([
          CordovaCheck(),
          __metadata("design:type", Function),
          __metadata("design:paramtypes", [String]),
          __metadata("design:returntype", Promise)
      ], File.prototype, "resolveDirectoryUrl", null);
      __decorate([
          CordovaCheck(),
          __metadata("design:type", Function),
          __metadata("design:paramtypes", [Object, String, Object]),
          __metadata("design:returntype", Promise)
      ], File.prototype, "getDirectory", null);
      __decorate([
          CordovaCheck(),
          __metadata("design:type", Function),
          __metadata("design:paramtypes", [Object, String, Object]),
          __metadata("design:returntype", Promise)
      ], File.prototype, "getFile", null);
      File = __decorate([
          Plugin({
              pluginName: 'File',
              plugin: 'cordova-plugin-file',
              pluginRef: 'cordova.file',
              repo: 'https://github.com/apache/cordova-plugin-file',
              platforms: ['Android', 'Browser', 'iOS', 'macOS', 'Windows']
          })
      ], File);
      return File;
  }(IonicNativePlugin));
  export { File };
  //# sourceMappingURL=index.js.map