interface Metadata { url: string; size: number; hash: string; contentType: string; createdAt: number; fileUnique?: string; } export declare class ImageCache { private savePath; static instance: ImageCache | null; private metadata; private metadataFile; constructor(savePath: string); get(key: string): Buffer; set(url: string, buffer: Buffer, contentType: string, hash?: string, fileUnique?: string): void; has(key: string): boolean; delete(key: string): void; clear(): void; keys(): string[]; /** * 清理过期缓存 * @param maxAge 最大缓存时间(毫秒),默认7天 */ cleanExpired(maxAge?: number): number; getMetadata(key: string): Metadata | undefined; } export {};