import { ReadStream, WriteStream } from 'node:fs'; /** * Python shutil module for TypeScript * * Provides high-level file operations with async API. * * @see {@link https://docs.python.org/3/library/shutil.html | Python shutil documentation} * @module */ /** * Copy the file src to the file or directory dst. * * @param src - Source file path * @param dst - Destination file or directory path * @returns The path to the newly created file */ declare function copy(src: string, dst: string): Promise; /** * Copy the file src to the file or directory dst, preserving metadata. * * @param src - Source file path * @param dst - Destination file or directory path * @returns The path to the newly created file */ declare function copy2(src: string, dst: string): Promise; /** * Recursively copy an entire directory tree. * * @param src - Source directory path * @param dst - Destination directory path * @param options - Options object * @returns The destination directory path */ declare function copytree(src: string, dst: string, options?: { symlinkss?: boolean; ignore?: (dir: string, names: string[]) => string[]; copyFunction?: (src: string, dst: string) => Promise; dirsExistOk?: boolean; }): Promise; /** * Recursively move a file or directory to another location. * * @param src - Source path * @param dst - Destination path * @returns The destination path */ declare function move(src: string, dst: string): Promise; /** * Recursively delete a directory tree. * * @param path - Directory path to delete * @param options - Options object */ declare function rmtree(path: string, options?: { ignoreErrors?: boolean; }): Promise; /** * Return the path to an executable which would be run if the given cmd was called. * * @param cmd - Command name to find * @param path - Optional PATH string to search (defaults to process.env.PATH) * @returns Path to the executable, or null if not found */ declare function which(cmd: string, path?: string): Promise; /** * Disk usage statistics. */ interface DiskUsage { total: number; used: number; free: number; } /** * Return disk usage statistics for the given path. * * @param path - Path to check * @returns Object with total, used, and free bytes */ declare function diskUsage(path: string): Promise; /** * Return the size of the terminal window. * * @returns Object with columns and lines */ declare function getTerminalSize(): { columns: number; lines: number; }; /** * Copy file mode bits from src to dst. * * @param src - Source path * @param dst - Destination path */ declare function copymode(src: string, dst: string): Promise; /** * Copy all stat info (mode bits, atime, mtime, flags) from src to dst. * * @param src - Source path * @param dst - Destination path */ declare function copystat(src: string, dst: string): Promise; /** * Copy a file's content (but not metadata) to another file. * * @param src - Source file path * @param dst - Destination file path */ declare function copyfile(src: string, dst: string): Promise; /** * Copy data from a file-like object to another file-like object. * * @param fsrc - Source readable stream * @param fdst - Destination writable stream * @param length - Number of bytes to copy (optional, copies all if not specified) */ declare function copyfileobj(fsrc: ReadStream | NodeJS.ReadableStream, fdst: WriteStream | NodeJS.WritableStream, length?: number): void; /** * Create an archive file from a directory. * * Not implemented - requires external tools (tar, zip). * * @param baseName - Name of the archive file (without extension) * @param format - Archive format ('zip', 'tar', 'gztar', 'bztar', 'xztar') * @param rootDir - Directory to archive * @returns Path to the created archive */ declare function makeArchive(_baseName: string, _format: string, _rootDir: string): string; /** * Unpack an archive file. * * Not implemented - requires external tools (tar, unzip). * * @param filename - Path to the archive * @param extractDir - Directory to extract to (optional) */ declare function unpackArchive(_filename: string, _extractDir?: string): void; type shutilModule_DiskUsage = DiskUsage; declare const shutilModule_copy: typeof copy; declare const shutilModule_copy2: typeof copy2; declare const shutilModule_copyfile: typeof copyfile; declare const shutilModule_copyfileobj: typeof copyfileobj; declare const shutilModule_copymode: typeof copymode; declare const shutilModule_copystat: typeof copystat; declare const shutilModule_copytree: typeof copytree; declare const shutilModule_diskUsage: typeof diskUsage; declare const shutilModule_getTerminalSize: typeof getTerminalSize; declare const shutilModule_makeArchive: typeof makeArchive; declare const shutilModule_move: typeof move; declare const shutilModule_rmtree: typeof rmtree; declare const shutilModule_unpackArchive: typeof unpackArchive; declare const shutilModule_which: typeof which; declare namespace shutilModule { export { type shutilModule_DiskUsage as DiskUsage, shutilModule_copy as copy, shutilModule_copy2 as copy2, shutilModule_copyfile as copyfile, shutilModule_copyfileobj as copyfileobj, shutilModule_copymode as copymode, shutilModule_copystat as copystat, shutilModule_copytree as copytree, shutilModule_diskUsage as diskUsage, shutilModule_getTerminalSize as getTerminalSize, shutilModule_makeArchive as makeArchive, shutilModule_move as move, shutilModule_rmtree as rmtree, shutilModule_unpackArchive as unpackArchive, shutilModule_which as which }; } export { type DiskUsage as D, copy2 as a, copyfile as b, copy as c, copyfileobj as d, copymode as e, copystat as f, copytree as g, diskUsage as h, getTerminalSize as i, move as j, makeArchive as m, rmtree as r, shutilModule as s, unpackArchive as u, which as w };