export declare class ImageCache { maxSize: number; private static _instance; private cache; private currentSize; constructor(maxSize?: number); /** * Gets singleton instance of ImageCache */ static get instance(): ImageCache; /** * Gets or creates an image from cache * @param imageData - Binary image data * @returns Promise resolving with { image: HTMLImageElement, url: string } */ getImage(imageData: Uint8Array): Promise<{ image: HTMLImageElement; url: string; }>; getImageFromCache(imageData: Uint8Array | string): { image: HTMLImageElement; url: string; } | null; /** * Creates new cache entry from image data (Uint8Array or Data-URI string) * Automatically handles both binary data and Data-URI formats */ private createCacheEntry; /** * Preloads an image into the internal cache to speed up future usage. * * @param {Uint8Array | string} imageData - The image data to preload. Can be: * - a Uint8Array containing raw image bytes, or * - a string representing a Data-URI or base64-encoded image. * @returns {Promise} Resolves when the image has been cached or immediately * if the image data is empty or already cached. */ preload(imageData: Uint8Array): Promise; /** * Clears the cache and revokes all URLs */ clear(): void; /** * Gets current cache statistics */ get stats(): { size: number; count: number; }; private loadImage; /** * Generates a hash from input data (Uint8Array or string) * Uses DJB2-like hash algorithm with 4-byte processing * Returns a base36-encoded string prefixed with 'img_' */ generateHash(data: Uint8Array | string): string; /** * Detects MIME type from image binary data * Supports PNG, JPEG, and fallback to PNG for unknown types */ private getMimeType; private ensureCacheSpace; }