From d56826f12d2d8b994d7cc05af9d46c47ee874525 Mon Sep 17 00:00:00 2001 From: Ibby Hadeed Date: Mon, 9 Apr 2018 14:49:08 -0400 Subject: [PATCH] Fix decorators + remove duplicate implementations --- src/@ionic-native/plugins/file/index.ts | 271 ++++++++++-------------- 1 file changed, 113 insertions(+), 158 deletions(-) diff --git a/src/@ionic-native/plugins/file/index.ts b/src/@ionic-native/plugins/file/index.ts index 79241dc9..a87bd52f 100644 --- a/src/@ionic-native/plugins/file/index.ts +++ b/src/@ionic-native/plugins/file/index.ts @@ -1,10 +1,5 @@ import { Injectable } from '@angular/core'; -import { - CordovaCheck, - CordovaProperty, - IonicNativePlugin, - Plugin -} from '@ionic-native/core'; +import { CordovaCheck, CordovaProperty, getPromise, IonicNativePlugin, Plugin } from '@ionic-native/core'; export interface IFile extends Blob { /** @@ -54,10 +49,12 @@ export interface LocalFileSystem { /** * Requests a filesystem in which to store application data. - * @param type Whether the filesystem requested should be persistent, as defined above. Use one of TEMPORARY or PERSISTENT. + * @param type Whether the filesystem requested should be persistent, as defined above. Use one of TEMPORARY or + * PERSISTENT. * @param size This is an indicator of how much storage space, in bytes, the application expects to need. * @param successCallback The callback that is called when the user agent provides a filesystem. - * @param errorCallback A callback that is called when errors happen, or when the request to obtain the filesystem is denied. + * @param errorCallback A callback that is called when errors happen, or when the request to obtain the filesystem is + * denied. */ requestFileSystem( type: number, @@ -70,7 +67,8 @@ export interface LocalFileSystem { * Allows the user to look up the Entry for a file or directory referred to by a local URL. * @param url A URL referring to a local file in a filesystem accessable via this API. * @param successCallback A callback that is called to report the Entry to which the supplied URL refers. - * @param errorCallback A callback that is called when errors happen, or when the request to obtain the Entry is denied. + * @param errorCallback A callback that is called when errors happen, or when the request to obtain the Entry is + * denied. */ resolveLocalFileSystemURL( url: string, @@ -110,7 +108,8 @@ export interface Flags { create?: boolean; /** - * By itself, exclusive must have no effect. Used with create, it must cause getFile and getDirectory to fail if the target path already exists. + * By itself, exclusive must have no effect. Used with create, it must cause getFile and getDirectory to fail if the + * target path already exists. */ exclusive?: boolean; } @@ -120,7 +119,8 @@ export interface Flags { */ export interface FileSystem { /** - * This is the name of the file system. The specifics of naming filesystems is unspecified, but a name must be unique across the list of exposed file systems. + * This is the name of the file system. The specifics of naming filesystems is unspecified, but a name must be unique + * across the list of exposed file systems. * @readonly */ name: string; @@ -146,6 +146,7 @@ export interface Entry { * Entry is a directory. */ isDirectory: boolean; + /** * Look up metadata about this entry. * @param successCallback A callback that is called with the time of the last modification. @@ -238,7 +239,8 @@ export interface Entry { *
  • copy a directory to a path occupied by a file;
  • *
  • copy any element to a path occupied by a directory which is not empty.
  • *
  • A copy of a file on top of an existing file must attempt to delete and replace that file.
  • - *
  • A copy of a directory on top of an existing empty directory must attempt to delete and replace that directory.
  • + *
  • A copy of a directory on top of an existing empty directory must attempt to delete and replace that + * directory.
  • * * * Directory copies are always recursive--that is, they copy all contents of the directory. @@ -251,7 +253,8 @@ export interface Entry { ): void; /** - * Returns a URL that can be used to identify this entry. Unlike the URN defined in [FILE-API-ED], it has no specific expiration; as it describes a location on disk, it should be valid at least as long as that location exists. + * Returns a URL that can be used to identify this entry. Unlike the URN defined in [FILE-API-ED], it has no specific + * expiration; as it describes a location on disk, it should be valid at least as long as that location exists. */ toURL(): string; @@ -262,14 +265,16 @@ export interface Entry { toInternalURL(): string; /** - * Deletes a file or directory. It is an error to attempt to delete a directory that is not empty. It is an error to attempt to delete the root directory of a filesystem. + * Deletes a file or directory. It is an error to attempt to delete a directory that is not empty. It is an error to + * attempt to delete the root directory of a filesystem. * @param successCallback A callback that is called on success. * @param errorCallback A callback that is called when errors happen. */ remove(successCallback: VoidCallback, errorCallback?: ErrorCallback): void; /** - * Look up the parent DirectoryEntry containing this Entry. If this Entry is the root of its filesystem, its parent is itself. + * Look up the parent DirectoryEntry containing this Entry. If this Entry is the root of its filesystem, its parent + * is itself. * @param successCallback A callback that is called to return the parent Entry. * @param errorCallback A callback that is called when errors happen. */ @@ -290,11 +295,13 @@ export interface DirectoryEntry extends Entry { /** * Creates or looks up a file. - * @param path Either an absolute path or a relative path from this DirectoryEntry to the file to be looked up or created. It is an error to attempt to create a file whose immediate parent does not yet exist. + * @param path Either an absolute path or a relative path from this DirectoryEntry to the file to be looked up or + * created. It is an error to attempt to create a file whose immediate parent does not yet exist. * @param options *