-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathindex.d.ts
29 lines (25 loc) · 1023 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
declare module "easy-ftp" {
interface FtpConfig {
host?: string, // default lovalhost
port?: number | 21,
username: string,
password: string,
privateKey?: string, // (only sftp)
secure?: boolean, // (only ftp) same as for tls.connect()
secureOptions?: boolean, // (only ftp)
type?: 'ftp' | 'sftp'
}
type PathCallback = (err: Error, path: string) => void
type ErrCallback = (err: Error) => void
export default class EasyFtp {
connect(config: FtpConfig): void
cd(path: string, cb: PathCallback): void
pwd(cb: PathCallback): void
rm(path: string, cb: ErrCallback): void
ls(path: string, cb: (err: Error, lsit: string[]) => void): void
exist(path: string, cb: (exist: boolean) => void): void
mkdir(path: string, cb: ErrCallback): void
mv(pathFrom: string, pathTo: string, cb: PathCallback): void
upload(pathFrom: string, pathTo: string, cb: ErrCallback): void
}
}