Fix get() dst param. Should be writable stream (#42135)

This commit is contained in:
Sam Galizia 2020-02-06 09:33:21 -08:00 committed by GitHub
parent 53089a8608
commit 09bee8f86e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,6 +8,7 @@
// Taylor Herron <https://github.com/gbhmt>
// Lane Goldberg <https://github.com/builtbylane>
// Lorenzo Adinolfi <https://github.com/loru88>
// Sam Galizia <https://github.com/sgalizia>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import * as ssh2 from 'ssh2';
@ -18,19 +19,27 @@ export = sftp;
declare class sftp {
connect(options: ssh2.ConnectConfig): Promise<ssh2.SFTPWrapper>;
list(remoteFilePath: string, pattern?: string|RegExp): Promise<sftp.FileInfo[]>;
list(remoteFilePath: string, pattern?: string | RegExp): Promise<sftp.FileInfo[]>;
exists(remotePath: string): Promise<false | "d" | "-" | "l">;
exists(remotePath: string): Promise<false | 'd' | '-' | 'l'>;
stat(remotePath: string): Promise<sftp.FileStats>;
realPath(remotePath: string): Promise<string>;
get(path: string, dst?: string | NodeJS.ReadableStream, options?: ssh2Stream.TransferOptions): Promise<string | NodeJS.ReadableStream | Buffer>;
get(
path: string,
dst?: string | NodeJS.WritableStream,
options?: ssh2Stream.TransferOptions,
): Promise<string | NodeJS.WritableStream | Buffer>;
fastGet(remoteFilePath: string, localPath: string, options?: ssh2Stream.TransferOptions): Promise<string>;
put(input: string | Buffer | NodeJS.ReadableStream, remoteFilePath: string, options?: ssh2Stream.TransferOptions): Promise<string>;
put(
input: string | Buffer | NodeJS.ReadableStream,
remoteFilePath: string,
options?: ssh2Stream.TransferOptions,
): Promise<string>;
fastPut(localPath: string, remoteFilePath: string, options?: ssh2Stream.TransferOptions): Promise<string>;
@ -46,7 +55,11 @@ declare class sftp {
chmod(remotePath: string, mode: number | string): Promise<string>;
append(input: Buffer | NodeJS.ReadableStream, remotePath: string, options?: ssh2Stream.TransferOptions): Promise<string>;
append(
input: Buffer | NodeJS.ReadableStream,
remotePath: string,
options?: ssh2Stream.TransferOptions,
): Promise<string>;
end(): Promise<void>;