mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-01 02:53:03 +08:00
fix(ftp): return observable (not promise) for upload and download method (#2174)
* style(network-interface): remove trailing whitespace * fix(ftp): return an observable instead of a promise for upload and download method
This commit is contained in:
parent
d06fa48866
commit
5159367db8
@ -1,5 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
/**
|
||||
* @name FTP
|
||||
@ -95,24 +96,28 @@ export class FTP extends IonicNativePlugin {
|
||||
*
|
||||
* @param localFile {string} The file (with full path) you want to upload. e.g. "/local/path/to/localFile".
|
||||
* @param remoteFile {string} The file (with full path) you want to located on the ftp server. e.g. "/adf/123/newDir/remoteFile".
|
||||
* @return {Promise<any>} Returns a promise.
|
||||
* @return {Observable<any>} Returns an observable.
|
||||
* It will be triggered many times according the file's size.
|
||||
* The arg `0`, `0.1xx`, `0.2xx` ... `1` means the upload percent. When it reach `1`, means success.
|
||||
*/
|
||||
@Cordova()
|
||||
upload(localFile: string, remoteFile: string): Promise<any> { return; }
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
upload(localFile: string, remoteFile: string): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Download one remote file on the ftp server to local path.
|
||||
*
|
||||
* @param localFile {string} The file (with full path) you want to upload. e.g. "/local/path/to/localFile".
|
||||
* @param remoteFile {string} The file (with full path) you want to located on the ftp server. e.g. "/adf/123/newDir/remoteFile".
|
||||
* @return {Promise<any>} Returns a promise.
|
||||
* @return {Observable<any>} Returns an observable.
|
||||
* It will be triggered many times according the file's size.
|
||||
* The arg `0`, `0.1xx`, `0.2xx` ... `1` means the upload percent. When it reach `1`, means success.
|
||||
*/
|
||||
@Cordova()
|
||||
download(localFile: string, remoteFile: string): Promise<any> { return; }
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
download(localFile: string, remoteFile: string): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Cancel all requests. Always success.
|
||||
|
Loading…
Reference in New Issue
Block a user