123456789101112131415161718192021222324252627282930313233343536373839404142 |
- /// <reference types="node" />
- import { EventEmitter } from 'events';
- import { SFTPWrapper } from 'ssh2';
- import { Stats } from 'ssh2-streams';
- export interface IScpOptions {
- host?: string;
- port?: number;
- username?: string;
- password?: string;
- privateKey?: Buffer | string;
- passphrase?: string;
- forceIPv4?: boolean;
- forceIPv6?: boolean;
- readyTimeout?: number;
- keepaliveInterval?: number;
- keepaliveCountMax?: number;
- remoteOsType?: 'posix' | 'win32';
- }
- export declare class ScpClient extends EventEmitter {
- sftpWrapper: SFTPWrapper | null;
- private sshClient;
- remotePathSep: string;
- endCalled: boolean;
- errorHandled: boolean;
- constructor(options: IScpOptions);
- uploadFile(localPath: string, remotePath: string): Promise<void>;
- downloadFile(remotePath: string, localPath: string): Promise<void>;
- emptyDir(dir: string): Promise<void>;
- uploadDir(src: string, dest: string): Promise<void>;
- downloadDir(remotePath: string, localPath: string): Promise<string>;
- stat(remotePath: string): Promise<Stats>;
- unlink(remotePath: string): Promise<void>;
- _rmdir(remotePath: string): Promise<void>;
- rmdir(remotePath: string): Promise<void>;
- mkdir(remotePath: string): Promise<void>;
- exists(remotePath: string): Promise<string | boolean>;
- close(): void;
- list(remotePath: string, pattern?: RegExp): Promise<any>;
- realPath(remotePath: string): Promise<string>;
- }
- export declare function Client(options: IScpOptions): Promise<ScpClient>;
- export default Client;
|