docs(ftp): fix jsdoc

This commit is contained in:
Daniel 2018-04-08 21:48:34 +02:00
parent 237ea0d90d
commit 5d1c8c225b

View File

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
/** /**
@ -32,18 +32,19 @@ import { Observable } from 'rxjs';
}) })
@Injectable() @Injectable()
export class FTP extends IonicNativePlugin { export class FTP extends IonicNativePlugin {
/** /**
* Connect to one ftp server. * Connect to one ftp server.
* *
* Just need to init the connection once. If success, you can do any ftp actions later. * Just need to init the connection once. If success, you can do any ftp actions later.
* @param hostname {string} The ftp server url. Like ip without protocol prefix, e.g. "192.168.1.1". * @param {string} hostname The ftp server url. Like ip without protocol prefix, e.g. "192.168.1.1".
* @param username {string} The ftp login username. If it and `password` are all blank/undefined, the default username "anonymous" is used. * @param {string} username The ftp login username. If it and `password` are all blank/undefined, the default username "anonymous" is used.
* @param password {string} The ftp login password. If it and `username` are all blank/undefined, the default password "anonymous@" is used. * @param {string} password The ftp login password. If it and `username` are all blank/undefined, the default password "anonymous@" is used.
* @return {Promise<any>} The success callback. Notice: For iOS, if triggered, means `init` success, but NOT means the later action, e.g. `ls`... `download` will success! * @return {Promise<any>} The success callback. Notice: For iOS, if triggered, means `init` success, but NOT means the later action, e.g. `ls`... `download` will success!
*/ */
@Cordova() @Cordova()
connect(hostname: string, username: string, password: string): Promise<any> { return; } connect(hostname: string, username: string, password: string): Promise<any> {
return;
}
/** /**
* List files (with info of `name`, `type`, `link`, `size`, `modifiedDate`) under one directory on the ftp server. * List files (with info of `name`, `type`, `link`, `size`, `modifiedDate`) under one directory on the ftp server.
@ -56,46 +57,54 @@ export class FTP extends IonicNativePlugin {
* - size: file size in bytes. * - size: file size in bytes.
* - modifiedDate: modified date of this file. date format is `yyyy-MM-dd HH:mm:ss zzz`, e.g "2015-12-01 20:45:00 GMT+8". * - modifiedDate: modified date of this file. date format is `yyyy-MM-dd HH:mm:ss zzz`, e.g "2015-12-01 20:45:00 GMT+8".
* *
* @param path {string} The path on the ftp server. e.g. "/adf/123/". * @param {string} path The path on the ftp server. e.g. "/adf/123/".
* @return {Promise<any>} Returns a promise * @return {Promise<any>} Returns a promise
*/ */
@Cordova() @Cordova()
ls(path: string): Promise<any> { return; } ls(path: string): Promise<any> {
return;
}
/** /**
* Create one directory on the ftp server. * Create one directory on the ftp server.
* *
* @param path {string} The path on the ftp server. e.g. "/adf/123/". * @param {string} path The path on the ftp server. e.g. "/adf/123/".
* @return {Promise<any>} Returns a promise * @return {Promise<any>} Returns a promise
*/ */
@Cordova() @Cordova()
mkdir(path: string): Promise<any> { return; } mkdir(path: string): Promise<any> {
return;
}
/** /**
* Delete one directory on the ftp server. * Delete one directory on the ftp server.
* *
* Tip: As many ftp server could not rm dir when it's not empty, so rm all files under the dir at first is recommended. * Tip: As many ftp server could not rm dir when it's not empty, so rm all files under the dir at first is recommended.
* *
* @param path {string} The file (with full path) you want to delete. e.g. "/adf/123/newDir/myFile". * @param {string} path The file (with full path) you want to delete. e.g. "/adf/123/newDir/myFile".
* @return {Promise<any>} Returns a promise * @return {Promise<any>} Returns a promise
*/ */
@Cordova() @Cordova()
rmdir(path: string): Promise<any> { return; } rmdir(path: string): Promise<any> {
return;
}
/** /**
* Delete one file on the ftp server. * Delete one file on the ftp server.
* *
* @param file {string} The file (with full path) you want to delete. e.g. "/adf/123/newDir/myFile". * @param {string} file The file (with full path) you want to delete. e.g. "/adf/123/newDir/myFile".
* @return {Promise<any>} Returns a promise * @return {Promise<any>} Returns a promise
*/ */
@Cordova() @Cordova()
rm(file: string): Promise<any> { return; } rm(file: string): Promise<any> {
return;
}
/** /**
* Upload one local file to the ftp server. * Upload one local file to the ftp server.
* *
* @param localFile {string} The file (with full path) you want to upload. e.g. "/local/path/to/localFile". * @param {string} localFile 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". * @param {string} remoteFile The file (with full path) you want to located on the ftp server. e.g. "/adf/123/newDir/remoteFile".
* @return {Observable<any>} Returns an observable. * @return {Observable<any>} Returns an observable.
* It will be triggered many times according the file's size. * 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. * The arg `0`, `0.1xx`, `0.2xx` ... `1` means the upload percent. When it reach `1`, means success.
@ -103,13 +112,15 @@ export class FTP extends IonicNativePlugin {
@Cordova({ @Cordova({
observable: true observable: true
}) })
upload(localFile: string, remoteFile: string): Observable<any> { return; } upload(localFile: string, remoteFile: string): Observable<any> {
return;
}
/** /**
* Download one remote file on the ftp server to local path. * 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 {string} localFile 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". * @param {string} remoteFile The file (with full path) you want to located on the ftp server. e.g. "/adf/123/newDir/remoteFile".
* @return {Observable<any>} Returns an observable. * @return {Observable<any>} Returns an observable.
* It will be triggered many times according the file's size. * 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. * The arg `0`, `0.1xx`, `0.2xx` ... `1` means the upload percent. When it reach `1`, means success.
@ -117,7 +128,9 @@ export class FTP extends IonicNativePlugin {
@Cordova({ @Cordova({
observable: true observable: true
}) })
download(localFile: string, remoteFile: string): Observable<any> { return; } download(localFile: string, remoteFile: string): Observable<any> {
return;
}
/** /**
* Cancel all requests. Always success. * Cancel all requests. Always success.
@ -125,7 +138,9 @@ export class FTP extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise * @return {Promise<any>} Returns a promise
*/ */
@Cordova() @Cordova()
cancel(): Promise<any> { return; } cancel(): Promise<any> {
return;
}
/** /**
* Disconnect from ftp server. * Disconnect from ftp server.
@ -133,6 +148,7 @@ export class FTP extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise * @return {Promise<any>} Returns a promise
*/ */
@Cordova() @Cordova()
disconnect(): Promise<any> { return; } disconnect(): Promise<any> {
return;
}
} }