// Type definitions for ssh2-sftp-client 4.1 // Project: https://github.com/theophilusx/ssh2-sftp-client // Definitions by: igrayson // Ascari Andrea // Kartik Malik // Michael Pertl // Orblazer // Taylor Herron // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped import * as ssh2 from 'ssh2'; import * as ssh2Stream from 'ssh2-streams'; export = sftp; declare class sftp { connect(options: ssh2.ConnectConfig): Promise; list(remoteFilePath: string): Promise; exists(remotePath: string): Promise; stat(remotePath: string): Promise; realPath(remotePath: string): Promise; get(path: string, dst?: string | NodeJS.ReadableStream, options?: boolean): Promise; fastGet(remoteFilePath: string, localPath: string, options?: ssh2Stream.TransferOptions): Promise; put(input: string | Buffer | NodeJS.ReadableStream, remoteFilePath: string, options?: ssh2Stream.TransferOptions): Promise; fastPut(localPath: string, remoteFilePath: string, options?: ssh2Stream.TransferOptions): Promise; cwd(): Promise; mkdir(remoteFilePath: string, recursive?: boolean): Promise; rmdir(remoteFilePath: string, recursive?: boolean): Promise; delete(remoteFilePath: string): Promise; rename(remoteSourcePath: string, remoteDestPath: string): Promise; chmod(remotePath: string, mode: number | string): Promise; append(input: Buffer | NodeJS.ReadableStream, remotePath: string, options?: ssh2Stream.TransferOptions): Promise; end(): Promise; on(event: string, callback: (...args: any[]) => void): void; removeListener(event: string, callback: (...args: any[]) => void): void; } declare namespace sftp { interface FileInfo { type: string; name: string; size: number; modifyTime: number; accessTime: number; rights: { user: string; group: string; other: string; }; owner: number; group: number; } interface FileStats { mode: number; uid: number; gid: number; size: number; accessTime: number; modifyTime: number; isDirectory: boolean; isFile: boolean; isBlockDevice: boolean; isCharacterDevice: boolean; isSymbolicLink: boolean; isFIFO: boolean; isSocket: boolean; } }