@stacksjs/stx
Version:
A performant UI Framework. Powered by Bun.
32 lines • 1.26 kB
TypeScript
import { } from '../../shared/cache';
import type { EnhancedImgProps, ProcessedImageResult, TsImagesConfig, } from '../../types';
/**
* Get cached image processing result
*/
export declare function getCachedImageResult(src: string, options: Partial<EnhancedImgProps>, config?: TsImagesConfig): Promise<ProcessedImageResult | null>;
/**
* Set cached image processing result
*/
export declare function setCachedImageResult(src: string, options: Partial<EnhancedImgProps>, result: ProcessedImageResult, config?: TsImagesConfig): Promise<void>;
/**
* Clear image processing cache
*/
export declare function clearImageCache(): Promise<void>;
/**
* Image processor cache configuration
*/
export declare interface ImageCacheConfig extends CacheConfig {
cacheVariants?: boolean
cachePlaceholders?: boolean
}
/**
* Image processor cache class
*/
export declare class ImageProcessorCache {
private config: ImageCacheConfig;
constructor(config?: Partial<ImageCacheConfig>);
get(src: string, options: Partial<EnhancedImgProps>): Promise<ProcessedImageResult | null>;
set(src: string, options: Partial<EnhancedImgProps>, result: ProcessedImageResult): Promise<void>;
clear(): Promise<void>;
updateConfig(config: Partial<ImageCacheConfig>): void;
}