import type { Readable } from 'stream'; export interface RemoteInfo { url: string; encryptionKey?: string; immutable?: boolean; useVhdDirectory?: boolean; compressionType?: string; [key: string]: unknown; } /** A file descriptor as returned by openFile() */ export interface FileArg { fd: unknown; path: string; } /** A file argument: either a path string or an open FileDescriptor */ export type FileDescriptor = number | string | FileArg; export interface RemoteHandlerOptions { highWaterMark?: number; timeout?: number; maxParallelOperations?: number; withLimit?: string[]; withTimeout?: string[]; withRetry?: Record; } export interface RetryOptions { updateArguments?: (error: Error, args: unknown[]) => unknown[]; } export interface RemoteInfoResult { size?: number; used?: number; available?: number; [key: string]: unknown; } export interface ListOptions { filter?: (entry: string) => boolean; ignoreMissing?: boolean; prependDir?: boolean; } export interface ReadStreamOptions { checksum?: boolean; ignoreMissingChecksum?: boolean; start?: number; end?: number; highWaterMark?: number; flags?: string; [key: string]: unknown; } export interface OutputStreamOptions { checksum?: boolean; dirMode?: number; maxStreamLength?: number; streamLength?: number; validator?: (this: RemoteHandlerAbstract, path: string) => Promise; } export interface OutputFileOptions { dirMode?: number; flags?: string; } export interface ReadFileOptions { flags?: string; } export interface WriteFileOptions { flags?: string; dirMode?: number; } export interface MkdirOptions { mode?: number; } export interface RenameOptions { checksum?: boolean; } export interface CopyOptions { checksum?: boolean; } export interface UnlinkOptions { checksum?: boolean; } export interface ReadResult { buffer: Buffer; bytesRead: number; } export interface TestResult { success: boolean; writeRate?: number; readRate?: number; step?: string; file?: string; error?: Error; } export interface LockDisposer { dispose: () => Promise; } export declare abstract class RemoteHandlerAbstract { constructor(_remote: RemoteInfo, _options?: RemoteHandlerOptions); abstract get type(): string; abstract get isEncrypted(): boolean; abstract get encryptionAlgorithm(): string; abstract sync(): Promise; abstract forget(): Promise; abstract list(dir: string, options?: ListOptions): Promise; abstract mkdir(dir: string, options?: MkdirOptions): Promise; abstract mktree(dir: string, options?: MkdirOptions): Promise; abstract rmdir(dir: string): Promise; abstract rmtree(dir: string): Promise; abstract createReadStream(file: FileArg, options?: ReadStreamOptions): Promise; abstract readFile(file: string, options?: ReadFileOptions): Promise; abstract read(file: FileDescriptor, buffer: Buffer, position?: number): Promise; abstract outputStream(path: string, input: Readable, options?: OutputStreamOptions): Promise; abstract outputFile(file: string, data: string | Buffer | Buffer[], options?: OutputFileOptions): Promise; abstract writeFile(file: string, data: string | Buffer, options?: WriteFileOptions): Promise; abstract write(file: FileArg, buffer: Buffer, position?: number): Promise; abstract truncate(file: string, len: number): Promise; abstract rename(oldPath: string, newPath: string, options?: RenameOptions): Promise; abstract copy(oldPath: string, newPath: string, options?: CopyOptions): Promise; /** Silently ignores ENOENT. By default also removes the associated checksum file. */ abstract unlink(file: string, options?: UnlinkOptions): Promise; abstract openFile(path: string, flags: string): Promise; abstract closeFile(fd: FileDescriptor): Promise; abstract getInfo(): Promise; abstract getSize(file: FileDescriptor): Promise; abstract getSizeOnDisk(file: FileDescriptor): Promise; abstract lock(path: string): Promise; abstract test(): Promise; abstract isImmutable(): boolean; abstract getConfig(key: 'useVhdDirectory'): boolean | undefined; abstract getConfig(key: 'compressionType'): string | undefined; abstract getConfig(key: string): unknown; abstract addPrefix(prefix: string): RemoteHandlerAbstract; }