import GifAnimationManager from './GifAnimationManager';
/**
 * Image Manager - 管理图片加载和缓存
 */
declare class ImageManager {
    private static instance;
    private imageCache;
    private loadingImages;
    private failedImages;
    private gifImages;
    private gifAnimationManager;
    private redrawCallbacks;
    private imageLoadedCallbacks;
    private _imageLoadedFlushScheduled;
    private editIcon;
    private editIconCanvas;
    private editIconColor;
    private expandIcon;
    private collapseIcon;
    private sortIcon;
    private sortIconCanvas;
    private filterIcon;
    private filterIconCanvas;
    private settingsIcon;
    private settingsIconCanvas;
    private infoIcon;
    private infoIconCanvas;
    private tapdIcon;
    private iomcIcon;
    private warningIcon;
    private warningIconCanvas;
    private linkIcon;
    private linkIconCanvas;
    private linkIconHeaderCanvas;
    private upArrowIconCanvas;
    private downArrowIconCanvas;
    private defaultAvatarImage;
    private constructor();
    /**
     * Load edit icon
     */
    private loadEditIcon;
    /**
     * Get edit icon (returns colored canvas version if available, otherwise raw SVG)
     * @returns HTMLCanvasElement or HTMLImageElement or null if not loaded
     */
    getEditIcon(): HTMLCanvasElement | HTMLImageElement | null;
    /**
     * Update edit icon color (called on theme switch)
     * @param color The target color for the edit icon, or null to use raw SVG
     */
    updateEditIconColor(color: string | null): void;
    /**
     * Load expand icon (double arrow right SVG, rotated 90 degrees to point down)
     * Returns a canvas with the icon colored in the specified color
     */
    private loadExpandIcon;
    /**
     * Load collapse icon (double arrow right SVG, rotated -90 degrees to point up)
     */
    private loadCollapseIcon;
    /**
     * Get expand icon canvas (rotated 90deg)
     * @returns HTMLCanvasElement or null if not loaded
     */
    getExpandIcon(): HTMLCanvasElement | null;
    /**
     * Get a colored version of expand icon
     * @param color The target color for the icon
     * @param size The display size
     * @returns HTMLCanvasElement with colored icon
     */
    getColoredExpandIcon(color: string, size?: number): HTMLCanvasElement | null;
    /**
     * Get a colored version of collapse icon (arrow pointing up)
     * @param color The target color for the icon
     * @param size The display size
     * @returns HTMLCanvasElement with colored icon
     */
    getColoredCollapseIcon(color: string, size?: number): HTMLCanvasElement | null;
    /**
     * Recolor an SVG image to the specified color using an offscreen canvas.
     * This is needed because the SVG icons have hardcoded fill colors (e.g., #efefef)
     * that are nearly invisible on white table headers.
     * @param img The loaded image element
     * @param color The target fill color
     * @param size The canvas size (square)
     * @returns A colored HTMLCanvasElement or null
     */
    private recolorIcon;
    /** Default color for header hover icons (sort/filter/settings) */
    private static HEADER_ICON_COLOR;
    /**
     * Load sort icon
     */
    private loadSortIcon;
    /**
     * Get sort icon (recolored canvas version for visible rendering)
     * @returns HTMLCanvasElement or HTMLImageElement or null if not loaded
     */
    getSortIcon(): HTMLCanvasElement | HTMLImageElement | null;
    /**
     * Load filter icon
     */
    private loadFilterIcon;
    /**
     * Get filter icon (recolored canvas version for visible rendering)
     * @returns HTMLCanvasElement or HTMLImageElement or null if not loaded
     */
    getFilterIcon(): HTMLCanvasElement | HTMLImageElement | null;
    /**
     * Get a colored version of filter icon (on-demand recolor, no cache).
     * Used for "filter active" state where icon must show a themed highlight color.
     * @param color Target fill color
     * @param size Display size (square)
     * @returns HTMLCanvasElement with colored icon, or null if source icon not yet loaded
     */
    getColoredFilterIcon(color: string, size?: number): HTMLCanvasElement | null;
    /**
     * Load settings icon (for nested column parent headers)
     */
    private loadSettingsIcon;
    /**
     * Get settings icon (recolored canvas version for visible rendering)
     * @returns HTMLCanvasElement or HTMLImageElement or null if not loaded
     */
    getSettingsIcon(): HTMLCanvasElement | HTMLImageElement | null;
    /** fieldHint info icon color */
    private static INFO_ICON_COLOR;
    /**
     * Load fieldHint info icon and recolor to #767E89 (14px for header business icon slot)
     */
    private loadInfoIcon;
    /**
     * Get fieldHint info icon (recolored 14px canvas version)
     * @returns HTMLCanvasElement or HTMLImageElement or null if not loaded
     */
    getInfoIcon(): HTMLCanvasElement | HTMLImageElement | null;
    /**
     * Load TAPD sync icon (display only)
     */
    private loadTapdIcon;
    /**
     * Get TAPD icon
     * @returns HTMLImageElement or null if not loaded
     */
    getTapdIcon(): HTMLImageElement | null;
    /**
     * Load IOMC icon (display only)
     */
    private loadIomcIcon;
    /**
     * Get IOMC icon
     * @returns HTMLImageElement or null if not loaded
     */
    getIomcIcon(): HTMLImageElement | null;
    /** Warning icon color */
    private static WARNING_ICON_COLOR;
    /**
     * Load warning icon and recolor to #f86332
     */
    private loadWarningIcon;
    /**
     * Get warning icon (recolored canvas version for visible rendering)
     * @returns HTMLCanvasElement or HTMLImageElement or null if not loaded
     */
    getWarningIcon(): HTMLCanvasElement | HTMLImageElement | null;
    /** Link icon 颜色 */
    private static LINK_ICON_COLOR;
    /**
     * Load link icon (引用字段附件图标) and create recolored versions
     * 表头版本 16px，表体版本 14px
     */
    private loadLinkIcon;
    /**
     * Get link icon for cell body (14px recolored version)
     * @returns HTMLCanvasElement or null if not loaded
     */
    getLinkIcon(): HTMLCanvasElement | null;
    /**
     * Get link icon for header (16px recolored version)
     * @returns HTMLCanvasElement or null if not loaded
     */
    getLinkIconForHeader(): HTMLCanvasElement | null;
    /** Sort arrow icon color (#3f9eff blue, matching DOM version) */
    private static SORT_ARROW_COLOR;
    /**
     * Load sort arrow icons (up/down) and recolor to blue (#3f9eff)
     */
    private loadSortArrowIcons;
    /**
     * Get sort up arrow icon (recolored to #3f9eff)
     * @returns HTMLCanvasElement or null if not loaded
     */
    getSortUpArrowIcon(): HTMLCanvasElement | null;
    /**
     * Get sort down arrow icon (recolored to #3f9eff)
     * @returns HTMLCanvasElement or null if not loaded
     */
    getSortDownArrowIcon(): HTMLCanvasElement | null;
    /**
     * Load default avatar (base64 PNG, used as fallback when person avatar fails to load)
     */
    private loadDefaultAvatar;
    /**
     * Get default avatar image (for person avatar fallback)
     * @returns HTMLImageElement or null if not loaded
     */
    getDefaultAvatar(): HTMLImageElement | null;
    /**
     * Check if an image URL has previously failed to load
     * @param src Image source URL
     * @returns true if the image has failed to load before
     */
    isImageFailed(src: string): boolean;
    static getInstance(): ImageManager;
    /**
     * Load image with caching
     * @param src Image source URL
     * @returns Promise that resolves to HTMLImageElement
     */
    loadImage(src: string): Promise<HTMLImageElement>;
    /**
     * Get cached image synchronously
     * @param src Image source URL
     * @returns HTMLImageElement or null if not cached
     */
    getCachedImage(src: string): HTMLImageElement | null;
    /**
     * Check if image is cached
     * @param src Image source URL
     * @returns true if image is cached
     */
    isCached(src: string): boolean;
    /**
     * 提取 URL 的基础部分（去掉查询参数和 hash），用于模糊匹配
     * 例如 "https://cdn.example.com/img.jpg?sign=abc&t=123" → "https://cdn.example.com/img.jpg"
     */
    private getBaseUrl;
    /**
     * Clear all cached images
     */
    clearCache(): void;
    /**
     * Clear all failed image records, allowing retry on next load attempt.
     * Called when image URLs are refreshed (e.g. expired signed URLs replaced).
     */
    clearFailedImages(): void;
    /**
     * Remove a specific URL from the failed set, allowing retry.
     * @param src Image source URL to remove from failed set
     */
    removeFromFailed(src: string): void;
    /**
     * Remove specific image from cache
     * @param src Image source URL
     */
    removeFromCache(src: string): void;
    /**
     * Check if image is GIF format
     * @param src Image source URL
     * @returns true if image is GIF
     */
    private isGif;
    /**
     * Get GIF canvas for drawing
     * @param src Image source URL
     * @returns Canvas element with current GIF frame or null
     */
    getGifCanvas(src: string): HTMLCanvasElement | null;
    /**
     * Check if image is animated GIF
     * @param src Image source URL
     * @returns true if image is GIF
     */
    isAnimatedImage(src: string): boolean;
    /**
     * Check if there are any GIF images loaded
     * @returns true if there are GIF images
     */
    hasGifImages(): boolean;
    /**
     * Register a callback to be called when GIF frames update
     * @param callback Function to call on animation frame
     */
    onAnimationFrame(callback: () => void): void;
    /**
     * Unregister animation frame callback
     * @param callback Function to remove
     */
    offAnimationFrame(callback: () => void): void;
    /**
     * Trigger redraw callbacks
     */
    private triggerRedraw;
    /**
     * [PERF] 注册图片加载完成（成功 + 失败）后的重绘回调。
     * 由 DataGrid 在构造时注册一次（推荐回调内仅做 markDirty，rAF 循环统一合并实际 draw）。
     * 与 onAnimationFrame（GIF 动画帧）相互独立。
     */
    onImageLoaded(callback: () => void): void;
    /**
     * [PERF] 注销 onImageLoaded 注册的回调。
     */
    offImageLoaded(callback: () => void): void;
    /**
     * [PERF] 帧级合并触发图片加载完成后的重绘。
     * 即便首屏一秒内 N 张图陆续 onload，本方法也只在下一帧触发 1 次回调，
     * 让上层 DataGrid 仅 markDirty 1 次、rAF 循环只 draw 1 帧，
     * 杜绝"事件: load → 同步 grid.draw() 串行 N 次"的长任务。
     */
    private scheduleImageLoadedRedraw;
    /**
     * Get GIF animation manager instance
     * @returns GifAnimationManager instance
     */
    getGifManager(): GifAnimationManager;
}
export default ImageManager;
