import { BatchDeleteResult, CopyResult, HealthStatus, IStorageProvider, ListResult, MoveResult, PreSignedUploadInfo, S3StorageOptions, 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'; /** * AWS S3 存储提供者 * 使用动态导入,只在实际使用时加载 AWS SDK */ export declare class S3StorageProvider implements IStorageProvider { private readonly options; name: string; private readonly logger; private initialized; private s3Client; private S3Commands; private s3GetSignedUrl; constructor(options: S3StorageOptions); /** * 初始化存储配置 * 动态导入 AWS S3 SDK */ initialize(): Promise; /** * 上传文件 */ upload(file: FileBuffer, options: UploadOptions): Promise; /** * 下载文件 */ download(key: string): Promise; /** * 删除文件 */ delete(key: string): Promise; /** * 批量删除 */ deleteBatch(keys: string[]): Promise; /** * 检查文件是否存在 */ exists(key: string): Promise; /** * 获取文件元数据 */ getMetadata(key: string): Promise; /** * 获取预签名URL(下载) */ getSignedUrl(key: string, expiresIn?: number): Promise; /** * 获取预签名上传URL */ getSignedUploadUrl(key: string, expiresIn?: number, contentType?: string): Promise; /** * 复制文件 */ copy(sourceKey: string, destinationKey: string): Promise; /** * 移动文件(复制后删除) */ move(sourceKey: string, destinationKey: string): Promise; /** * 列出文件 */ list(prefix?: string, limit?: number): Promise; /** * 健康检查 */ healthCheck(): Promise; /** * 生成文件 Key */ private generateKey; /** * 获取文件访问 URL */ private getFileUrl; /** * 将流转换为 Buffer(带超时和大小限制) */ private streamToBuffer; /** * 确保已初始化 */ private ensureInitialized; }