import { SFTPFile, SFTPPanelComponent } from 'tabby-ssh'; /** The live SFTP transport, borrowed from the one member that publicly exposes its type. */ type SftpSession = SFTPPanelComponent['sftp']; /** Fetches one remote file into one local path. Supplied by the caller, which owns how a transfer is reported. */ export type FileFetcher = (remotePath: string, localPath: string, item: SFTPFile) => Promise; /** * Copies a remote directory into a local one, depth first. * * A symlink to a *directory* is skipped, not followed: following it invites a * cycle (a link back to any ancestor would recurse forever), and there is no * realpath in `SFTPSession` to detect one with. A symlink to a file is * downloaded normally — the server resolves it, so the copy is the target's * content. * * Skipping is not cosmetic. Downloading a link-to-directory as a file makes the * server answer `Failure` (EISDIR), which would throw and fail the whole * directory: one link would make a perfectly ordinary tree undraggable. And the * entry's own flags cannot tell the two apart — `isDirectory` is false for any * symlink, and its `mode` describes the link. Only reading the *target* * answers, and only through its mode (piège #45) — read from the parent's * listing, never through `stat()`, see `targetIsDirectory()`. */ export declare function downloadRemoteTree(sftp: SftpSession, remotePath: string, localPath: string, fetch: FileFetcher): Promise; export {};