mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 14:20:12 +00:00
Merge pull request #30892 from lucasmotta/ssh2-read-file
[ssh2|ssh2-streams] - Include missing type for the method readFile
This commit is contained in:
23
types/ssh2-streams/index.d.ts
vendored
23
types/ssh2-streams/index.d.ts
vendored
@@ -1044,6 +1044,24 @@ export class SFTPStream extends stream.Transform {
|
||||
*/
|
||||
fastPut(localPath: string, remotePath: string, callback: (err: any) => void): void;
|
||||
|
||||
/**
|
||||
* (Client-only)
|
||||
* Reads a file in memory and returns its contents
|
||||
*/
|
||||
readFile(remotePath: string, options: ReadFileOptions, callback: (err: any, handle: Buffer) => void): void;
|
||||
|
||||
/**
|
||||
* (Client-only)
|
||||
* Reads a file in memory and returns its contents
|
||||
*/
|
||||
readFile(remotePath: string, encoding: string, callback: (err: any, handle: Buffer) => void): void;
|
||||
|
||||
/**
|
||||
* (Client-only)
|
||||
* Reads a file in memory and returns its contents
|
||||
*/
|
||||
readFile(remotePath: string, callback: (err: any, handle: Buffer) => void): void;
|
||||
|
||||
/**
|
||||
* (Client-only)
|
||||
* Returns a new readable stream for `path`.
|
||||
@@ -1680,4 +1698,9 @@ export interface ParsedKey {
|
||||
publicOrig: Buffer;
|
||||
ppk?: boolean;
|
||||
privateMAC?: string;
|
||||
}
|
||||
|
||||
export interface ReadFileOptions {
|
||||
encoding?: string;
|
||||
flag?: string;
|
||||
}
|
||||
20
types/ssh2/index.d.ts
vendored
20
types/ssh2/index.d.ts
vendored
@@ -3,6 +3,7 @@
|
||||
// Definitions by: Qubo <https://github.com/tkQubo>
|
||||
// Ron Buckton <https://github.com/rbuckton>
|
||||
// Will Boyce <https://github.com/wrboyce>
|
||||
// Lucas Motta <https://github.com/lucasmotta>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
@@ -21,6 +22,7 @@ import {
|
||||
Attributes,
|
||||
Stats,
|
||||
TransferOptions,
|
||||
ReadFileOptions,
|
||||
ReadStreamOptions,
|
||||
WriteStreamOptions,
|
||||
FileEntry
|
||||
@@ -1273,6 +1275,24 @@ export interface SFTPWrapper extends events.EventEmitter {
|
||||
*/
|
||||
fastPut(localPath: string, remotePath: string, callback: (err: any) => void): void;
|
||||
|
||||
/**
|
||||
* (Client-only)
|
||||
* Reads a file in memory and returns its contents
|
||||
*/
|
||||
readFile(remotePath: string, options: ReadFileOptions, callback: (err: any, handle: Buffer) => void): void;
|
||||
|
||||
/**
|
||||
* (Client-only)
|
||||
* Reads a file in memory and returns its contents
|
||||
*/
|
||||
readFile(remotePath: string, encoding: string, callback: (err: any, handle: Buffer) => void): void;
|
||||
|
||||
/**
|
||||
* (Client-only)
|
||||
* Reads a file in memory and returns its contents
|
||||
*/
|
||||
readFile(remotePath: string, callback: (err: any, handle: Buffer) => void): void;
|
||||
|
||||
/**
|
||||
* (Client-only)
|
||||
* Returns a new readable stream for `path`.
|
||||
|
||||
Reference in New Issue
Block a user