rsbuild-plugin-sharp-image-optimizer
Version:
A Rsbuild plugin for image optimization using Sharp
19 lines (18 loc) • 513 B
TypeScript
export interface CacheOptions {
enabled: boolean;
dir: string;
maxSize: string;
ttl: number;
}
export declare class CacheManager {
private options;
private cacheDir;
constructor(options: CacheOptions);
private ensureCacheDir;
private getCacheKey;
private getCacheFilePath;
private parseSize;
private cleanupCache;
get(inputBuffer: Buffer, options: any): Promise<Buffer | null>;
set(inputBuffer: Buffer, options: any, outputBuffer: Buffer): Promise<void>;
}