/// import { EventEmitter } from 'events'; import { Writable, Readable } from 'stream'; import { IFile, ITransferOptions, ITransferProgressListener, ITransferInfo } from '../interfaces'; export declare interface Strategy { on(event: 'connect', listener: () => void): this; on(event: 'disconnect', listener: () => void): this; on(event: 'progress', listener: ITransferProgressListener): this; once(event: 'connect', listener: () => void): this; once(event: 'disconnect', listener: () => void): this; } /** * An abstract class, which allows to create a custom protocol. */ export declare abstract class Strategy extends EventEmitter { protected readonly config: any; protected readonly options?: any; abstract readonly connected: boolean; private transfer; abstract connect: () => Promise; abstract disconnect: () => Promise; abort(): Promise; abstract download: (dest: Writable, info: ITransferInfo, options?: ITransferOptions) => Promise; abstract upload: (source: Readable, info: ITransferInfo, options?: ITransferOptions) => Promise; abstract list: (path?: string) => Promise; abstract size: (path: string) => Promise; abstract exists: (path: string) => Promise; abstract move: (source: string, dest: string) => Promise; abstract removeFile: (path: string) => Promise; abstract removeEmptyFolder: (path: string) => Promise; abstract removeFolder: (path: string) => Promise; abstract createFolder: (path: string) => Promise; abstract createEmptyFile: (path: string) => Promise; abstract pwd: () => Promise; abstract send: (command: string) => Promise; constructor(config: any, options?: any); protected prepareTransfer(info: ITransferInfo, options?: ITransferOptions): (bytes: number) => void; protected finishTransfer(): void; protected handleNetwork(cb: any, clean?: any): Promise; }