diff --git a/types/ssh2-sftp-client/index.d.ts b/types/ssh2-sftp-client/index.d.ts index a0133961d8..0e1555abaf 100644 --- a/types/ssh2-sftp-client/index.d.ts +++ b/types/ssh2-sftp-client/index.d.ts @@ -1,17 +1,19 @@ -// Type definitions for ssh2-sftp-client 2.0 +// Type definitions for ssh2-sftp-client 2.3 // Project: https://www.npmjs.com/package/ssh2-sftp-client -// Definitions by: igrayson , Ascari Andrea +// Definitions by: igrayson , Ascari Andrea , Kartik Malik // 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; get(remoteFilePath: string, useCompression?: boolean, encoding?: string | null): Promise; + fastGet(remoteFilePath: string, localPath: string, options?: ssh2Stream.TransferOptions): Promise; put(input: string | Buffer | NodeJS.ReadableStream, remoteFilePath: string, useCompression?: boolean, encoding?: string): Promise; + fastPut(localPath: string, emoteFilePath: string, options?: ssh2Stream.TransferOptions): Promise; mkdir(remoteFilePath: string, recursive?: boolean): Promise; rmdir(remoteFilePath: string, recursive?: boolean): Promise; delete(remoteFilePath: string): Promise; diff --git a/types/ssh2-sftp-client/ssh2-sftp-client-tests.ts b/types/ssh2-sftp-client/ssh2-sftp-client-tests.ts index 67d2d35826..0b9c1a940c 100644 --- a/types/ssh2-sftp-client/ssh2-sftp-client-tests.ts +++ b/types/ssh2-sftp-client/ssh2-sftp-client-tests.ts @@ -15,10 +15,14 @@ client.get('/remote/path').then(stream => stream.read(0)); client.get('/remote/path', true, 'utf8').then(stream => stream.read(0)); client.get('/remote/path', true, null).then(stream => stream.read(0)); +client.fastGet('/remote/path', 'local/path').then(() => null); + client.put('/local/path', '/remote/path').then(() => null); client.put(new Buffer('content'), '/remote/path').then(() => null); client.put(fs.createReadStream('Hello World'), '/remote/path').then(() => null); +client.fastPut('/remote/path', 'local/path').then(() => null); + client.mkdir('/remote/path/dir', true).then(() => null); client.rmdir('/remote/path/dir', true).then(() => null);