import { BatchDeleteResult, CopyResult, HealthStatus, IStorageProvider, ListResult, LocalStorageOptions, MoveResult, PreSignedUploadInfo, UploadResult } from '../interfaces/storage-provider.interface'; import { FileBuffer } from '../interfaces/file-buffer.interface'; import { UploadOptions } from '../interfaces/upload-options.interface'; import { FileMetadata } from '../interfaces/file-metadata.interface'; /** * 本地文件存储提供者 */ export declare class LocalStorageProvider implements IStorageProvider { private readonly options; name: string; private readonly logger; private initialized; constructor(options: LocalStorageOptions); /** * 初始化存储配置 */ initialize(): Promise; /** * 上传文件 */ upload(file: FileBuffer, options: UploadOptions): Promise; /** * 下载文件 */ download(filePath: string): Promise; /** * 删除文件 */ delete(filePath: string): Promise; /** * 批量删除 */ deleteBatch(paths: string[]): Promise; /** * 检查文件是否存在 */ exists(filePath: string): Promise; /** * 获取文件元数据 */ getMetadata(filePath: string): Promise; /** * 获取预签名URL(本地存储不支持,返回直接URL) */ getSignedUrl(filePath: string, expiresIn?: number): Promise; /** * 获取预签名上传URL(本地存储不支持) */ getSignedUploadUrl(filePath: string, expiresIn?: number, contentType?: string): Promise; /** * 复制文件 */ copy(sourcePath: string, destinationPath: string): Promise; /** * 移动文件 */ move(sourcePath: string, destinationPath: string): Promise; /** * 列出文件 */ list(prefix?: string, limit?: number): Promise; /** * 健康检查 */ healthCheck(): Promise; /** * 生成文件路径 */ private generateFilePath; /** * 获取文件URL */ private getFileUrl; /** * 计算文件哈希 */ private calculateFileHash; /** * 递归读取目录 */ private readDirRecursive; /** * 验证路径安全性,防止路径遍历攻击 */ private validatePath; /** * 验证文件是否在上传目录内 */ private ensurePathWithinUpload; /** * 根据扩展名获取 MIME 类型 */ private getMimeTypeFromExtension; /** * 确保已初始化 */ private ensureInitialized; }